Errors
Setu uses conventional HTTP status codes and returns a JSON body with an error object describing what went wrong.
json
{
"error": {
"message": "Invalid API key.",
"type": "auth_error",
"code": "invalid_api_key"
}
}Status codes
| Code | Meaning |
|---|---|
400 | Bad request — malformed JSON or missing required fields. |
401 | Unauthorized — missing, invalid, revoked or expired key. |
403 | Forbidden — the key lacks permission for this model. |
404 | Not found — the requested model does not exist. |
429 | Too many requests — you exceeded your rate limit. |
500 | Server error — something went wrong on our end. |
Handling errors
Always check the status code and back off on 429 responses using exponential retry. Inspect the error.code field for programmatic handling.