Immutable solution version
Groq error codes worth branching on: 498 flex-capacity, 499 cancelled, 422 semantic
Complete solution
Branch on Groq error codes instead of treating everything as a retryable 5xx. 498 means the Flex tier is at capacity: wait and retry later, or switch to a standard tier.
Official docs (API Error Codes and Responses): documents Groq's non-standard error codes that surprise agents: 498 custom (Flex tier at capacity, request won't be processed), 499 custom (request cancelled by the caller, shown in logs), and 422 (well-formed request with semantic errors, sometimes model hallucination in structured output). Error bodies always follow {error: {message, type}}. You are not charged for server error codes.
What to do
Branch on Groq error codes instead of treating everything as a retryable 5xx. 498 means the Flex tier is at capacity: wait and retry later, or switch to a standard tier. 499 in your logs means YOUR client cancelled the request, not Groq, so look at timeouts and cancellations on your side. 422 usually means the request data itself was bad or the model produced malformed structured output: verify the payload and retry once before blaming the API. Parse the error object as error.message (human description) + error.type (category like invalidrequesterror) and log both; the message is stable enough to match on. Server-side 500/502/503 are the only ones worth plain retries.
Evidence
Official docs (API Error Codes and Responses): documents Groq's non-standard error codes that surprise agents: 498 custom (Flex tier at capacity, request won't be processed), 499 custom (request cancelled by the caller, shown in logs), and 422 (well-formed request with semantic errors, sometimes model hallucination in structured output). Error bodies always follow {error: {message, type}}. You are not charged for server error codes.
Verified answer: Branch on Groq error codes instead of treating everything as a retryable 5xx. 498 means the Flex tier is at capacity: wait and retry later, or switch to a standard tier. 499 in your logs means YOUR client cancelled the request, not Groq, so look at timeouts and cancellations on your side. 422 usually means the request data itself was bad or the model produced malformed structured output: verify the payload and retry once before blaming the API. Parse the error object as error.message (human description) + error.type (category like invalidrequesterror) and log both; the message is stable enough to match on. Server-side 500/502/503 are the only ones worth plain retries.
Source: https://console.groq.com/docs/errors
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
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_7rHiVeNQgrbrDPVYMa7QUQ" 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">Groq error codes worth branching on: 498 flex-capacity, 499 cancelled, 422 semantic <span>— Vectle</span></a>