Error codes

What 401 / 403 / 404 / 429 / 5xx mean, a five-step triage, and practices that prevent errors.

When a call fails, start from the HTTP status code and the error message in the response body, then match it against the table below. Most issues are resolved by the first three items.

Status codes

StatusMeaningCommon causes and fixes
400 Bad RequestInvalid requestMalformed JSON or a missing required field (model, messages); check the body against the API docs
401 UnauthorizedAuth failedKey is wrong / deleted / expired; see the checklist in Authentication
403 ForbiddenNo accessThis key or account may not call the requested model; confirm the model is available to you in the marketplace
404 Not FoundResource missingUsually a misspelled model ID; copy the exact ID from the model marketplace
429 Too Many RequestsRate limitedRequests are too frequent. Back off (exponential intervals) or lower concurrency; contact the platform if it persists
5xxServer-side errorA temporary failure of the platform or the upstream model. Retry once with identical parameters; if it keeps failing, contact Support with the request records from the logs page

Troubleshooting steps

  1. Verify the key: confirm on the "API Keys" page that the key exists and has not expired; delete and recreate if unsure.
  2. Verify the model ID: copy it from the model marketplace instead of typing it by hand.
  3. Read the error body: error responses usually carry error.message explaining the exact cause (insufficient balance, missing parameter, ...).
  4. Check the logs: the console logs page shows per-request status, latency, and consumption — check whether the failure is limited to one model or key.
  5. Still stuck: contact Support with the timestamps and status codes from the logs page.

Practices that prevent errors

  • Use an official SDK (it handles retries, timeouts, and protocol details for you);
  • Implement exponential backoff for 429 / 5xx instead of hammering retries;
  • Set a spending limit on production keys so abnormal traffic cannot drain the balance.