Errors
FUNCD returns JSON error objects. Log the HTTP status, code, and request ID together.
json
{
"error": {
"message": "Insufficient balance",
"type": "insufficient_quota",
"code": "INSUFFICIENT_CREDITS",
"param": null
}
}Common statuses
| HTTP | Code | Meaning | Action |
|---|---|---|---|
400 | invalid_request_error | Invalid parameters or JSON | Check the model ID, messages, and body |
401 | invalid_api_key | Invalid, revoked, or expired key | Use a valid key |
402 | INSUFFICIENT_CREDITS | Balance or key limit is insufficient | Add funds or raise the key limit |
403 | model_not_allowed | The key cannot use this model | Edit the key's model access |
404 | not_found | Endpoint or model not found | Query /v1/models |
429 | rate_limit_error | Request or token rate exceeded | Retry with exponential backoff |
5xx | server_error | Platform or upstream unavailable | Keep the request ID and retry |
Retry guidance
- Automatically retry only
429, connection timeouts, and selected5xxerrors. - Use exponential backoff with jitter.
- Add an application idempotency identifier where duplicate business effects matter.
- Do not retry
400,401,402, or403indefinitely.