Read the HTTP status before consuming answers or usage.
| Status | When it occurs | Next step |
|---|---|---|
| 400 | Malformed JSON, invalid model or request fields. | Validate the envelope and asset references. |
| 401 | Missing, inactive or invalid key. | Check the key and workspace in the console. |
| 402 | Insufficient available credits. | Review the balance before retrying. |
| 403 | Workspace permissions or console origin check. | Verify the operation and active workspace. |
| 413 | Multipart image exceeds the file limit or the proxy rejects the body. | Resize the image or send a smaller batch. |
| 422 | The model could not process the question. | Check primitive, criteria and input types. |
| 502 / 503 | The gateway could not obtain a usable model result. | Inspect the response; use bounded retries for transient failures. |
Request size and retries
The public gateway accepts request bodies up to 16 MiB. Each uploaded multipart image is limited to 8 MiB. Base64 increases the size of JSON bodies. A client-side timeout can occur after processing begins; repeated POSTs may be billed separately.