Appearance
Errors
Pixapi uses HTTP status codes plus machine-readable error types.
Error shape
json
{
"error": {
"code": 400,
"message": "xxx",
"type": "invalid_request_error"
}
}Common errors
| HTTP status | Type | Meaning |
|---|---|---|
400 | invalid_request_error | Missing or invalid request field. |
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_credits | The account does not have enough credits. |
404 | model_not_found | The model id is unknown or unavailable. |
422 | prompt_rejected | The prompt or input violates model policy. |
429 | rate_limited | Too many requests in a short period. |
500 | internal_error | Unexpected server error. |
503 | model_unavailable | Provider is temporarily unavailable. |
Retry guidance
Retry only transient errors:
429 rate_limited500 internal_error503 model_unavailable
Use exponential backoff and avoid retrying 400, 401, 402, or 422 responses without changing the request, key, or account state.
