ApiLux

Errors

Every error uses the same shape, with a stable code you can branch on.

Error shape

json
{
  "error": {
    "code": "pricing_not_configured",
    "message": "Pricing has not been configured for this model."
  }
}

Branch on code, not on message — messages may be reworded for clarity, codes stay stable.

Error codes

HTTPCodeMeaning
401auth_missing_or_malformedHeader missing or not in Bearer apl_... form.
401auth_invalidUnknown key.
401auth_revokedKey was revoked.
401auth_expiredKey has expired.
400invalid_requestWrong types, missing fields, or out-of-range values.
400unknown_modelThe model does not exist.
400capability_not_supportedThe model cannot be used on this endpoint.
402insufficient_balanceNot enough balance.
404not_foundNot found, or the resource is not yours.
429upstream_rate_limitedRate limited. Retry later.
502upstream_errorThe provider failed. You are not charged.
503pricing_not_configuredThe model is implemented but not priced yet. Our side, not yours.
503model_disabledThe model is disabled.
503model_temporarily_unavailableThe upstream provider is not serving this model right now. Temporary; can clear on its own.
504upstream_timeoutThe provider did not respond in time. You are not charged.

Retrying

Retry only on 429, 502 and 504. Back off 1s, 3s, 8s with jitter, at most 2–3 attempts. Do not retry the other 4xx codes — they will fail identically.

For video: once you have a job ID, do not retry the create request. Poll that job ID instead.