Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Errors

Every Lazu error follows the OpenAI error envelope:

{
  "error": {
    "message": "Human-readable description",
    "type": "invalid_request_error",
    "code": "missing_required_parameter",
    "param": "purpose",
    "request_id": "req_lazu_01ABCDEF..."
  }
}

code is the stable machine-readable identifier — match on this, not on message. request_id is also returned as the X-Lazu-Request-Id HTTP header; include it when contacting support.

HTTP status codes at a glance

StatusCategoryWhat to do
200Success-
201Created (file upload)Same as 200; some clients reject 201 — patch them
400Bad requestFix the request body / params; safe to retry after fix
401Auth failedWrong / missing API key; do not retry without fixing key
403ForbiddenKey disabled, IP not allow-listed, or quota exhausted
404Not foundWrong path, missing model, deleted file_id
413Payload too largeSingle file exceeds purpose's max size
422Validation failedBody matched schema but values invalid (e.g. temperature OOB)
429Rate limitSleep Retry-After seconds, then retry
500Lazu internal errorRetry with backoff; if persistent, open a ticket
502Upstream bad gatewayRetry; Lazu will try another channel automatically once
503Upstream unavailableRetry with backoff; usually transient
504Upstream timeoutRetry with backoff; check if your request is too slow

Common error codes

Auth

CodeWhen
invalid_api_keyHeader missing, malformed, or key deleted
insufficient_quotaBalance hit zero — top up to continue
ip_not_allowedKey has IP allowlist, your request came from outside it
token_disabledKey was manually disabled in console
token_expiredKey passed its expired_time

Request shape

CodeWhen
bad_request_bodyJSON didn't parse, or upstream rejected the request as malformed
missing_required_parameterRequired field absent (param shows which one)
invalid_requestGeneric catch-all for malformed inputs
model_not_foundThe model name doesn't exist or isn't accessible to this key
convert_request_failedInternal: couldn't translate the request for the chosen vendor
tokenization_errorCouldn't count input tokens (rare; usually huge / malformed prompt)

Files API specific

CodeWhen
purpose_not_supportedUsed batch / fine-tune / assistants (not supported yet)
file_not_foundfile_id doesn't exist or wasn't uploaded by this key
file_expiredFile aged past its 30-day retention
file_too_largeSingle file over purpose's max size, or Responses dereference
total exceeds 64 MB
file_dereference_failedCouldn't pull the file from storage (very rare)

Pricing & quota

CodeWhen
pricing_not_configuredModel exists but no sell-price set in the requested lane
pre_consume_token_quota_failedToken quota tracking conflict (retry once)

Rate limits

CodeWhen
request_rate_limit_exceededHit your tier's RPM cap. Retry-After header shows seconds

Upstream / routing

CodeWhen
upstream_errorUpstream returned non-2xx. details.status_code has the original
upstream_timeoutUpstream didn't respond in time
upstream_network_errorNetwork failure connecting to upstream
channel_response_time_exceededChannel exceeded the per-channel timeout budget
no_available_channelNo channel is configured to serve the requested model+lane combo

Retry strategy

Roughly: retry idempotent error categories with exponential backoff:

Status / codeRetry?
429 request_rate_limit_exceededYes — honor Retry-After
500 / 502 / 503 / 504Yes — exp backoff, max 3 tries
400 / 404 / 422No — fix the request
401 / 403No — fix auth / quota first
upstream_error with 4xx underneathNo
upstream_error with 5xx underneathYes — exp backoff

Most popular OpenAI / Anthropic SDKs do this automatically. Don't disable their retry logic unless you have a strong reason.

Including a request_id in support tickets

Every Lazu response (success or error) includes:

X-Lazu-Request-Id: req_lazu_01KSBV4MC6THZ9TCZEM38KPYRX

Paste this into any support ticket. We can trace the full request path through routing, upstream call, and billing — far faster than re-creating the issue from a fuzzy description.

See also