Overview
Errors from Lectr come in two flavours:- Proxy errors — Lectr itself rejected the request before it reached your provider
- Provider errors — your provider returned an error, which Lectr forwards in OpenAI format
Proxy errors
These come from Lectr before your provider is ever contacted.401 — Authentication errors
400 — Bad request errors
429 — Rate limit errors
Rate limiting is per org key and per instance. If you’re hitting limits
unexpectedly, check the dashboard for unusual traffic spikes — the anomaly
detector will surface them.
413 — Payload errors
503 — Proxy errors
Provider errors
When your provider returns an error, Lectr normalises it to OpenAI format and forwards it with the original HTTP status code. Theerror.type and error.code
reflect the provider’s original error.
Common provider errors you’ll see:
Identifying error source
The dashboard attributes errors to their source — proxy or provider — so you can tell at a glance whether the issue is with Lectr or with your provider. TheRecent Failures table shows:
proxy_error means Lectr rejected it. Everything else means the provider did.
Error handling in code
Provider errors pass through in OpenAI SDK format — your existing error handling works unchanged.Retrying errors
Not all errors are worth retrying. A quick guide:
For
429 errors, start with a 1 second delay and double on each retry up to
a maximum of 60 seconds.