Loading the documentation…
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.
Every error the platform itself produces uses the OpenAI error shape:
{
"error": {
"message": "Rate limit exceeded - retry in 42s",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}message says what happened, in one sentence.type groups the error family: authentication_error, invalid_request_error, rate_limit_error,
billing_error or api_error.code is the value your retry logic acts on.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.
These are the statuses the API can answer with; the code column is what your retry logic reads.
| Status | code | What it means | What to do |
|---|---|---|---|
| 400 | invalid_request | The 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. value. | Correct the request and send it again. The field-level refusals are on Chat completions. |
| 401 | invalid_api_key | The 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. |
| 402 | budget_exceeded | Extra 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. |
| 402 | no_active_subscription | The company has no active plan; the message asks you to contact your DataMind integrator. | An Administrator selects a plan on Pricing. |
| 402 | standard_quota_exceeded | The 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. |
| 402 | license_suspended | An 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. | Pay the oldest unpaid invoice on Billing. AI returns within minutes of the payment being recorded. Retrying as-is cannot succeed. |
| 402 | payg_not_available | Your 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. | Send the request to kartlos-premium or kartlos-standard. |
| 402 | trial_ended | Your 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. | Contact DataMind to start billing an instance or to extend the trial. AI returns within minutes. Retrying as-is cannot succeed. |
| 413 | PAYLOAD_TOO_LARGE | The 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. |
| 429 | rate_limit_exceeded | Your 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. |
| 429 | concurrency_limit_exceeded | Your 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. |
| 500 | internal_error | An unexpected failure on the DataMind side. | Retry with a short back-off; contact DataMind support if it repeats. |
| 502 | upstream_unavailable | The model provider could not be reached. | Retry with a short back-off, or choose another model. |
| 503 | overloaded | The platform is at capacity and refused the request before sending anything to a model: The DataMind AI platform is busy. 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. |
| 503 | service_unavailable | Part of the platform is briefly unavailable; the message says which part, in the four cases below. | Retry shortly. |
| 504 | upstream_timeout | The 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:
Model catalog is unavailable: the model list cannot be read right now. Retry shortly.Pricing for model "<model>" is temporarily unavailable - retry later or pick another model from GET / models: the model cannot be priced, so it is not served. Retry later, or pick another model.The <provider> service is temporarily unavailable - retry shortly: the web search or web read service cannot serve the call. Retry shortly.Account limits are unavailable - retry shortly: your company's limits cannot be checked, and a request that cannot be checked is not forwarded. Retry shortly.Three 402 codes come from your company's license state rather than from its plan or spend cap:
license_suspended is answered on chat completions, embeddings, web search and web read once an
unpaid invoice passes its AI cut-off date, by default 45 days after its due date. Model list
requests are still served. The refusal applies to every key of the company, API
keys and License Keys alike, and it ends within minutes of the invoice being marked paid. It is
answered only once DataMind enforces license payments for your company.payg_not_available is answered on chat completions that name a pay-as-you-go model while your
company is in its trial. The Kartlos models are unaffected.trial_ended is answered on chat completions, embeddings, web search and web read once your
company's trial has ended and none of its instances is billed yet, Kartlos included. Model list
requests are still served, and AI returns within minutes of an instance being
billed or the trial being extended.None of these refusals reaches a model, so none is billed.
The web search and web read endpoints refuse a request in the same shape as a chat request:
Search query is required (use 'q' or 'query' parameter).'url' is required.503 service_unavailable.The endpoints and their parameters are described on Web search and web read.
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.
429, 503 or 529 (on a streamed
request also 408, 500, 502 or 504), the platform already sends the request again, up to twice
within about 10 seconds, before it answers you. If you still receive one of these, the provider is
busy for longer: back off before you retry.retry-after asks for more than
5 seconds, or when the waits already add up to its budget. It then passes the provider's answer on
as it is. If a retry cannot reach the provider at all, you receive the provider's earlier refusal,
not a 502 or 504 of the platform's own.upstream_stream_error:<code> when the answer was streamed, and as
upstream_body_error:<code> when it was not. The answer you receive is unchanged; see the
Request log.429, wait the seconds in the retry-after header before sending the request again. For a
rate refusal that is the time left in the current minute; for a concurrency refusal it is 1.503 with the code overloaded, the platform is busy and asks you to wait the seconds in
retry-after. Add a random part to the delay (for example, up to one second), so that many
clients refused at the same moment do not all come back at the same moment.overloaded body with a
retry-after of 1 and connection: close. That answer is not the platform being busy: close the
connection, send the request again and it reaches a healthy instance.x-datamind-priority: batch.
When the platform is busy, batch requests are refused first, so people's requests keep room. A
request without the header is treated as interactive.402 instead of 429, so SDK retry logic, which retries 429, leaves them
alone: they stay until the plan or the spend cap changes.429 or 402 limit refusal still counts toward your requests-per-minute rate, so back off
rather than retrying in a tight loop. A 503 overloaded refusal does not count: it comes before
the rate is checked.event: error with the code
stream_interrupted. Send the request again.The limits that gate requests, and what happens when you reach them, are on Limits and the spend cap.
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.
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.
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.
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.
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.
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 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.
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.
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.
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.