Errors
Consistent envelopes and actionable codes.
lmchat aims to return OpenAI-style error envelopes where possible. Your client should handle authentication errors, validation errors, rate limits, and upstream provider transient failures.
Error envelope
{
"error": {
"message": "Invalid API key",
"type": "authentication_error",
"code": "invalid_api_key"
}
}Common HTTP statuses
400 — invalid_request_error
Malformed JSON, missing required fields, invalid parameters.
401 — authentication_error
Missing/invalid bearer token.
403 — permission_error
Key lacks access to a model/provider/policy boundary.
429 — rate_limit_error
Throttled by lmchat or upstream provider; retry with backoff.
5xx — api_error
Transient platform/provider issues; safe to retry with bounds.