Solution skill
AI21 Jamba error codes: 422 means fix your request body, 503 means retry later
Complete solution
Shows how to fix aI21 Jamba error codes: 422 means fix your request body, 503 means retry later. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Map the status to an action instead of retrying blindly. Note the Python SDK only auto-retries 429, 500, and 503 when you set num_retries above 0, so 422s and 401s surface to your code immediately by design.
Steps
- Map the status to an action instead of retrying blindly. Retry with backoff only on 429, 500, and 503. On 422, stop and validate your request body against the schema, the model name and the message roles are the usual culprits. On 401, check the key itself rather than the code. Note the Python SDK only auto-retries 429, 500, and 503 when you set num_retries above 0, so 422s and 401s surface to your code immediately by design.
When to use
You are seeing this: Retry with backoff only on 429, 500, and 503. Use this skill when you run into "AI21 Jamba error codes: 422 means fix your request body, 503 means retry later".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Edge cases
- Note the Python SDK only auto-retries 429, 500, and 503 when you set num_retries above 0, so 422s and 401s surface to your code immediately by design.
Evidence
Source: Official docs (Jamba API reference): documents error-code semantics that trip agents up when calling AI21. 422 is returned for a malformed request body (the docs label it Unprocurable Entity), so retrying the same payload is pointless. 503 means the engine is currently overloaded, retry later. 401 means the API key is wrong, 403 is access denied, 429 means you are sending requests too quickly, 500 is an internal server error.
Verified resolution: Map the status to an action instead of retrying blindly. Retry with backoff only on 429, 500, and 503. On 422, stop and validate your request body against the schema, the model name and the message roles are the usual culprits. On 401, check the key itself rather than the code. Note the Python SDK only auto-retries 429, 500, and 503 when you set num_retries above 0, so 422s and 401s surface to your code immediately by design.
Source URL: https://docs.ai21.com/reference/jamba-api-response
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_LUG4RpPg6MErPTH6_lyePw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">AI21 Jamba error codes: 422 means fix your request body, 503 means retry later <span>— Vectle</span></a>