Skip to content
Albastar Corp.

Errors

Error shapes, status codes, key errors and retry rules.

Every JSON error body carries a code and a message. Branch on the HTTP status and code; the message text may change.

OpenAI shape

POST /v1/chat/completions, GET /v1/models, POST /v1/audio/speech and POST /v1/audio/transcriptions return errors in the OpenAI shape. The OpenAI SDKs raise AuthenticationError, PermissionDeniedError, NotFoundError, RateLimitError and APIStatusError for these errors.

Shell
curl -s https://api.albastov.com/v1/models -H "Authorization: Bearer abk_not_a_key"
Response
{"error": {"message": "The API key is unknown or revoked", "type": "invalid_request_error", "code": "invalid_api_key"}}
FieldValue
codeError code
typeOpenAI error type
messageHuman-readable text
paramAudio routes: the parameter at fault, or null
Other fieldsPer code: model, state and retry_after_s on model_loading; job_id on queued

Albastov shape

Every other route, the docs routes included, returns errors in the Albastov shape.

Shell
curl -s https://api.albastov.com/v1/media/voices -H "Authorization: Bearer abk_not_a_key"
Response
{"ok": false, "error": "invalid-key", "code": "invalid_key", "message": "unknown or revoked api key"}
FieldValue
okfalse
codeError code
messageHuman-readable text
errorcode with hyphens for underscores (legacy; use code)
paramThe parameter at fault, when one is
Other fieldsPer code, e.g. resets_at on budget-exhausted

Codes appear exactly as each route returns them; some use hyphens (bad-param, too-large). Codes per route: API reference.

Status codes

StatusMeaning
400Invalid request: a missing, unknown or malformed parameter
401Missing, unknown or revoked key
403Key without the scope the route needs, or account without access to the product
404Unknown route, model, voice or job
413Request body or file over its limit
429Call, token, open-request or daily limit reached
500Internal error
502No reply from the model
503Model loading, request queued, or service unavailable for now
524Non-streamed request with no response within about 100 s

Key errors

FailureLanguage model routesOther routes
No Authorization header401 missing_api_key401 unauthorized
Unknown or revoked key401 invalid_api_key401 invalid_key
Key without the route's scope403 insufficient_scope403 scope_missing
Account without access to the productnone403 account_cannot
Key over its calls per minute or per day429 rate_limited429 rate_limited

A 401 on the language model routes carries WWW-Authenticate: Bearer. Language model routes are GET /v1/models and POST /v1/chat/completions.

Plain-text errors

Two errors arrive as plain text, not JSON. Check Content-Type before parsing an error body as JSON.

StatusBodyCause
403error code: 1010Default Python-urllib User-Agent; send a User-Agent header
524error code: 524Non-streamed request with no response within about 100 s; send it with "stream": true

Retries

Status and codeRetry
400, 401, 403, 404, 413No; fix the request or the key
429 daily_limit, daily_tokens, budget-exhaustedAfter 00:00 UTC
429 rate_limitedWithin 60 s for the per-minute limit; the per-day limit frees calls over a rolling 24 hours
429, other codesAfter Retry-After, or after an open request or job ends
500Once; then report the X-Request-Id
502After 5 to 10 s
503After Retry-After
524No; stream the request

Every limit and its code: Rate limits.