Loading the documentation…

Errors and retries

A refusal from the DataMind Platform API tells you what went wrong and whether sending the request again can succeed. This page lists the statuses and codes you can meet and the retry behaviour for each one; for your first request from scratch, see Use the API.

What an error looks like

Every error the platform itself produces uses the OpenAI error shape:

json
{
  "error": {
    "message": "Rate limit exceeded - retry in 42s",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded"
  }
}

Most errors the platform itself decides carry a named code. An error relayed from a model provider, and some internal failures, keep the HTTP status number as code instead; a plain unexpected failure reads internal_error. Match on the status and the code together.

Errors by status

These are the statuses the API can answer with; the code column is what your retry logic reads.

StatuscodeWhat it meansWhat to do
400invalid_requestThe body is not a valid JSON object, or a field is missing or not accepted. This covers a model outside your key's menu, a thinking effort the model does not support and an unknown provider.sort value.Correct the request and send it again. The field-level refusals are on Chat completions.
401invalid_api_keyThe x-api-key header is missing or empty, or the key was rotated or revoked. The message reads Invalid or missing API key.Send your company's current key. An Administrator manages keys in Settings.
402budget_exceededExtra spend reached the monthly spend cap.An Administrator raises the cap in Settings, or wait for the next billing window. Retrying as-is cannot succeed.
402no_active_subscriptionThe company has no active plan; the message asks you to contact your DataMind integrator.An Administrator selects a plan on Pricing.
402standard_quota_exceededThe plan's Standard allowance is used up, and the plan prices no Standard overage.Send the request to a pay-as-you-go model, or contact DataMind about a plan that prices Standard overage.
402license_suspendedAn invoice of your company is past its AI cut-off date, by default 45 days after its due date, so AI is paused for every key of the company. The message reads AI is paused because this installation's license payment is overdue. An administrator can see details in Admin > License.Pay the oldest unpaid invoice on Billing. AI returns within minutes of the payment being recorded. Retrying as-is cannot succeed.
402payg_not_availableYour company is in its trial, and pay-as-you-go models are not served during a trial: Pay-as-you-go models are not available during the trial. Choose Kartlos Premium or Kartlos Standard.Send the request to kartlos-premium or kartlos-standard.
402trial_endedYour company's trial has ended and none of its instances is billed yet, so AI is not served: The trial has ended, so AI is not available. It returns once DataMind starts billing an instance.Contact DataMind to start billing an instance or to extend the trial. AI returns within minutes. Retrying as-is cannot succeed.
413PAYLOAD_TOO_LARGEThe request body is larger than the platform allows; the refusal names the size limit.Send a smaller request: fewer or smaller files, or a shorter conversation.
429rate_limit_exceededYour company sent more requests this minute than its rate allows. The message reads Rate limit exceeded - retry in <seconds>s.Wait the seconds in the retry-after header, then send the request again.
429concurrency_limit_exceededYour company is running more requests at once than its limit allows: Too many concurrent requests - wait for an in-flight request to finish.Wait for one of your running requests to finish (retry-after is 1), then send it again.
500internal_errorAn unexpected failure on the DataMind side.Retry with a short back-off; contact DataMind support if it repeats.
502upstream_unavailableThe model provider could not be reached.Retry with a short back-off, or choose another model.
503overloadedThe platform is at capacity and refused the request before sending anything to a model: The DataMind AI platform is busy. Retry shortly. Nothing is billed.Wait the seconds in the retry-after header (3), then send the request again. When many requests are refused together, add a random delay so they do not all return at the same moment.
503service_unavailablePart of the platform is briefly unavailable; the message says which part, in the four cases below.Retry shortly.
504upstream_timeoutThe model provider did not answer in time.Retry with a short back-off, or make the request smaller.

The 503 code covers four situations, and the message tells you which one you met:

Errors from the license state

Three 402 codes come from your company's license state rather than from its plan or spend cap:

None of these refusals reaches a model, so none is billed.

Errors from the web tool endpoints

The web search and web read endpoints refuse a request in the same shape as a chat request:

The endpoints and their parameters are described on Web search and web read.

Retrying a request

Tip

Retry 429, 500, 502, 503 and 504 with a short back-off. A 402 is a billing state: retrying does not help until the plan or the spend cap changes.

The limits that gate requests, and what happens when you reach them, are on Limits and the spend cap.

Questions, answered

Why do money limits return 402 and not 429?

A 402 cannot be fixed by retrying: it stays until the plan or the spend cap changes. That is why it is a separate status from 429, so automatic retry logic leaves it alone.

Which errors should I retry?

Retry 429, 500, 502, 503 and 504 with a short back-off, and wait for retry-after on a 429 and on a 503 overloaded. Do not retry 400, 401, 402 or 413 as they are: correct the request, the key, the plan or the size first.

How long should I wait after a 429?

Wait the seconds the retry-after header gives. For a rate refusal that is the time left in the current minute; for a concurrency refusal it is 1, and the refusal clears as soon as one of your running requests finishes.

The error says overloaded. Was I charged?

No. The platform refused the request before it reached a model, so nothing was used or billed. Wait the seconds in retry-after, add a small random delay, and send the request again.

Why do my requests answer license_suspended?

An unpaid invoice of your company has passed its AI cut-off date, by default 45 days after its due date, so AI is paused for every key of the company. Pay the oldest unpaid invoice on Billing; AI returns within minutes of the payment being recorded.

Why does code sometimes hold a number instead of a name?

An error relayed from a model provider, and some internal failures, keep the HTTP status number as code. Branch on the named codes on this page; when code is a number, treat it as the status.

The error says service_unavailable. What actually broke?

The message names the part that is briefly unavailable: the model list, a model's pricing, the web tool service or your company's limits. In each case, retry shortly.

Should I match on code or on type?

On code. type groups the error family, such as rate_limit_error or billing_error; it helps you route logging but does not identify the exact problem.

Is a timed-out request safe to retry?

Yes. A 504 means the model provider did not answer in time; send the request again with a short back-off. Long answers time out first, so make the request smaller if it repeats.

What does a plain 500 mean?

An unexpected failure on the DataMind side; the request was not served. Retry with a short back-off, and contact DataMind support if it repeats.