Error response format
Every public API error includes a stable code, a human-readable message, actionable guidance, and a request ID:error.code rather than matching the complete message. Store the request_id in logs and include it when contacting AtlasFlux support.
Retry policy
- Do not retry 400, 401, 403, or 409 errors until the request, key, permission, or idempotency key is fixed.
- Do not automatically retry 402 errors; add credits or adjust the spending limit first.
- For 429, wait for
retry_after_secondsor theRetry-Afterresponse header. - Retry 502, 503, and 504 with exponential backoff and a maximum retry count.
- Retry a 500 response only when
error.retryableistrue.
JavaScript example
Context-limit errors
Context errors include measured token counts when AtlasFlux can calculate them. Reduce the conversation history, remove unnecessary content, or lowermax_output_tokens; increasing the output limit does not fix a context overflow.
Billing on failed requests
Requests recorded with statusfailed are not charged. AtlasFlux releases the complete temporary reservation and records the request cost as RM0.000000, including when search or content extraction was attempted before the failure. Use the error request_id to locate the matching zero-cost entry in Logs.
Streaming errors
Streaming requests can fail after the HTTP connection has already returned200. Always handle the stream error event and stop processing further output. See Streaming responses for event examples.