Errors, rate limits and safe retries
Interpret CHUA ONE API failures, preserve request receipts and retry only when the outcome is known.
Read the complete failure
Record the HTTP status and any returned error.code and error.message. The example shows a local rate-limit response from Chat Completions. Preserve X-CHUA-Request-ID when present so you can locate the request before sending it again.
HTTP/1.1 429 Too Many Requests
Retry-After: 60
Content-Type: application/json
{
"error": {
"code": "RATE_LIMIT",
"message": "Key request rate limit reached.",
"retryable": true,
"retryAfterSeconds": 60
}
}Open request records. Search by the CHUA request id, model or upstream request id. Workspace members need access to that workspace; billing details follow workspace roles.
Responses and Messages
For /v1/responses, read error.code and error.message where present. For /v1/messages, read error.type and error.message, such as rate_limit_error for HTTP 429. With either endpoint, check for an explicit retry signal in the body or a Retry-After header from the CHUA ONE request limit before resending.
What each response means
400- A validation rejection means the request shape, model limits or a parameter is invalid and the request was not accepted. Correct it, then send the corrected body as a new request with a new idempotency key.
401/403- Check the project key, its expiry, workspace scope, model allowlist and your account access. Do not retry until the permission problem is fixed.
404- The request or task is not visible in the selected project, or the published resource does not exist. Verify the id and project scope.
409 REQUEST_ALREADY_ACCEPTED- The project already recorded this idempotency key with the same request. Read the existing request record. Sending a new key can create another billable request.
409 IDEMPOTENCY_CONFLICT- The same idempotency key was reused with different content. Keep one immutable request per key and investigate the earlier request before creating a new one.
429 RATE_LIMIT- This is the retryable rolling-minute limit. Wait for Retry-After or retryAfterSeconds, then resend the identical request with the same idempotency key.
429 BUDGET_LIMIT- The project or key cannot cover the reservation or settlement difference. This response is not retryable. Review the project and key budgets first.
5xx- Service, route, provider result, usage or price evidence is unavailable or uncertain. CHUA ONE reports these errors as non-retryable. Check service status and request records before taking action.
Disconnects and uncertain outcomes
- For a non-streaming text or image request, a timeout or disconnect can occur after the request was accepted. If you received X-CHUA-Request-ID, look it up. If you did not, keep the original project and idempotency key and check the workspace records before deciding whether to retry.
- After streaming begins, a failure can arrive as an error event within an HTTP 200 response. Treat the partial output as incomplete and check the existing request record before another attempt.
- An attempted image request with an unconfirmed result enters review. Check its request record before another generation.
- Video creation is asynchronous. Once accepted, the task continues even if the client disconnects. Keep the returned id and poll the existing task; do not submit another creation request to replace it.
Poll an accepted video task
curl 'https://chuaone.si/v1/videos/YOUR_REQUEST_ID' \
-H "Authorization: Bearer $CHUA_API_KEY"Continue while status is queued or running. Stop on succeeded, failed or review. A review status means the outcome or charge still requires reconciliation; creating another task can duplicate work and reservations.
Retry checklist
- Save the HTTP status, error.code and X-CHUA-Request-ID.
- Check the request record and service status. Service status.
- Automatically retry a confirmed CHUA ONE request limit after the indicated delay. Preserve the original body, project and idempotency key.
- For every other failure, resolve the indicated problem or confirm the recorded outcome before sending another billable request.
Related guides
API keys and permissions · Usage, charges and reconciliation