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.
400content_filterYour company blocks personal data transmission and the request contained some. The message reads PII detected in request: <TYPE> (<count>), ... This company's policy prohibits PII transmission to upstream providers; the request was not forwarded. It names the kinds of data and counts, never the values.Remove the personal data and send the request again.
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.
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.
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 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. 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.

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.