XPlor3
REST API

Limits and errors

The error format, the codes you will meet most, per-minute request limits, and how to handle them.

Error format

Every error is answered with the right HTTP status and a body of always the same shape:

{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "Not enough credits for this model"
  }
}

Branch on code, which never changes. message is written for people and follows the Accept-Language header, so it can be shown to your users as it is.

The codes you will meet most

StatusCodeMeaningWhat to do
400BAD_REQUESTThe body or parameters do not match the schemaCheck the field named in message
400JOB_ALREADY_SENTThe job was already sent to the model and cannot be cancelledWait for the result; no credits are returned
400JOB_NOT_CANCELABLEThe job has already finishedNothing
400WEBHOOK_URL_INVALIDwebhookUrl is not a public HTTPS address on port 443Use an HTTPS address reachable from the internet. See Webhooks
401UNAUTHORIZEDThe key is missing, wrong, revoked or expiredCheck the Authorization header or make a new key
402INSUFFICIENT_CREDITSNot enough balance for this requestTop up credits in the studio
403EMAIL_UNVERIFIEDThe account's email is not verifiedVerify the email in the studio
403ACCOUNT_SUSPENDEDThe account is suspendedContact the team on Telegram
404NOT_FOUNDThe job, file or project does not exist or is not this account'sCheck the id
429TOO_MANY_ACTIVE_JOBS5 jobs are already runningWait for one to finish, then try again
429RATE_LIMITEDToo many requests within a minuteWait as message says, then try again

When the input breaks a model's rules, for example an option that does not exist, a reference file that is too large, or an unsupported combination of settings, the answer is 400 with a code that names the rule. No credits are taken for a refused request.

Limits

LimitValue
Jobs running at the same time (QUEUED, SUBMITTED, RUNNING)5 per account
Variations per request1 to 5
Requests that start a generation or upload30 per minute per key
Other requests120 per minute per key
Ids per download-link request100
Items per list page50

Per-minute limits are counted per API key, so several keys do not use up each other's allowance.

Handling tips

  • Retry with a delay for 429 and for 5xx errors. A growing delay (2, 4, 8 seconds) is enough.
  • Do not blindly retry POST /jobs after a dropped connection. Check GET /jobs?sort=newest&limit=5 first to be sure the job was not created, so credits are not taken twice.
  • A FAILED job is already refunded. Nothing needs doing to get the refund.

On this page