Errors
Every non-200 response has x-jein-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.
validation_error
The request does not match the schema (422): a missing or mistyped field, or an invalid question definition such as an unknown type, missing instructions, or malformed criteria. Each detail[] entry names the problem and its loc. A body that is not readable JSON answers 400 with the same code. Rejected requests count toward the rate limit.
unknown_model
Use a name that GET /v1/models lists; see models.
model_retired
Switch to laya-latest.
invalid_api_key
Check the Bearer key or create a new key.
overloaded
The worker refused admission (529), for example a short refusal during a burst of calls. Honor Retry-After; no usage is charged.
deadline
The request did not complete within the end-to-end deadline (529): it expired in the worker's queue, or the worker call timed out. No usage is charged. Retry after Retry-After, or send fewer questions per call. The API text is "Request did not complete within the deadline and was not charged. Retry, or send fewer questions per call.", followed by a link to these docs.
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). Before retrying, look up the response's X-Request-Id in the request log: if it is listed, the request was recorded; only recorded requests count against your allowance.
not_found
The resource does not exist (404).
internal_error
An unexpected server error occurred (500). Email the request id (x-typesafe-request-id) to [email protected].