Errors
Every non-200 response has x-laya-error-code. Validation errors use FastAPI-style detail[] entries with loc; other errors use {"detail":"message"}. Never log request state or API keys when diagnosing an error.
unknown_model
Use one of the accepted aliases listed in migrating.
model_retired
Switch to laya-latest.
invalid_api_key
Check the Bearer key or create a new key.
overloaded
The worker refused admission (529). Honor Retry-After; no usage is charged.
deadline
The queue deadline expired (529). Retry a smaller call after Retry-After.
not_ready
The worker is loading (529). Retry after the indicated delay.
body_too_large
The JSON body exceeds 1 MiB (413).
metering_failed
The usage write failed (503); no charge was recorded. Retry.
metering_uncertain
The usage commit outcome is uncertain (503). Check usage before retrying.
not_found
The resource does not exist (404).
internal_error
An unexpected server error occurred (500). Record the request id for support.