request_id is end-to-end traceable. If you report a bug, include it — we can find your request in the logs.
Error catalog
| HTTP | code | What to do |
|---|---|---|
400 | invalid_request_error | Review the body (Zod tells you the exact field in message) |
401 | missing_api_key | Send Authorization: Bearer ghub_sk_... header |
401 | invalid_api_key | Verify the key is correct and not revoked |
401 | key_revoked | Generate a new one at /dashboard/keys |
402 | insufficient_balance | Top up at /dashboard/billing/recharge |
404 | model_not_found | Call GET /v1/models to see the valid catalog |
429 | rate_limit_exceeded | Retry with exponential backoff (coming soon) |
500 | internal_error | Retry. If it persists, open a ticket with request_id |
502 | provider_unavailable | The provider (Anthropic/OpenAI/etc) is down or your prompt isn’t acceptable. Retry or switch model |
Provider-specific errors
Ifcode is provider_unavailable, the message comes from the original provider as-is. Common examples:
Recommended retry
Streaming errors
If you requeststream: true and something fails after the stream starts, you receive a final SSE message with the error shape:
error in addition to [DONE].