Request IDs
Record the request identifiers from APIONE responses. Different interfaces or routes may returnX-Request-ID, X-Maxx-Trace-Id, or X-Maxx-Request-ID; retain the actual field names and values received. When reporting issues, provide request time and timezone, model ID, complete endpoint, status code, error code, and request identifier.
Do not submit complete API Keys, sensitive prompts, or unsanitized files.

Console request details can be filtered by time, source, API Key, and request ID, and checked for status, latency, tokens, and cost.
When to retry
Timeout recommendations
- Set separate connection timeout and read timeout for text requests.
- For streaming requests, use the first event and continuous read as boundaries; do not apply a short ordinary-request timeout.
- Video generation is an asynchronous task. After successful creation, poll the task status; do not let one HTTP connection wait until generation finishes.
Smart routing boundaries
APIONE selects or switches among available routes for the same model. If the model, permission, balance, or request parameters themselves are incorrect, switching routes cannot solve the problem. If all routes are unavailable, the request may still fail.Recommended backoff strategy
Wait a short time after the first failure, then increase wait time exponentially, and add random jitter to avoid multiple requests retrying simultaneously. Total attempts should be limited, and the business side should also set a total time budget.maxAttempts includes the first request; the last HTTP failure retains the original response for reading status code and error body. Retry-After supports both seconds and HTTP dates; use backoff delay when missing or invalid.
The caller should check the final response’s ok status and set timeouts according to business needs. The request body should use replayable string or byte data; if the SDK already retries automatically, coordinate the total attempt count.
Combine the two JavaScript blocks below in order, save as example.mjs. First set APIONE_API_KEY as described in the quickstart, then run node example.mjs in the same terminal. Use Node.js 18 or higher; built-in fetch requires no extra dependencies.
Reading request identifiers
Prevent duplicate creation
Text queries can usually be safely retried, but image, video, or other creation requests may have already been received by the server. A connection interruption does not mean the task was not created. Applications should save the following information:
When status is unknown, query records or tasks first; do not immediately recreate.
Timeout layers
Production checklist
- Use different API Keys for testing and production to facilitate limits, revocation, and auditing.
- Record status code, latency, model, and request ID; do not record the full key.
- Limit maximum concurrency and total retries to avoid amplifying traffic during failures.
- Handle halfway errors, client cancellation, and incomplete JSON for streaming output.
- Distinguish “creation successful”, “generation successful”, and “result downloaded” for media tasks.
- Monitor success rate, time to first byte, total latency, and 429 and 5xx ratios.

