Loading the documentation…
The DataMind Platform API authenticates machine callers with your company's API key, sent in the x-api-key header. This page covers the header, what happens when a key is rejected, and the company settings that apply to every request you send.
Send the company key in the x-api-key header, for example x-api-key: <api_key>, on every request to the API.
A request that carries no key, an empty key or a key that DataMind does not recognise is refused before it reaches a model. It fails with status 401, code invalid_api_key and the message Invalid or missing API key. A key that was rotated or revoked is refused the same way. An Authorization: Bearer header does not authenticate a request on its own: a request that sends the key only that way is refused like one without a key.
For full request and SDK examples, see Use the API.
The platform knows two kinds of key, and both go in the same x-api-key header:
| Key | What it is for |
|---|---|
| API key | Your applications' direct requests to the API. Your company holds one active API key. |
| License Key | One DataMind OS install: its AI features, its maps, its software downloads and its license check-ins. Each install has its own, and it starts with dm-lic-. |
Use the API key for your own applications. A License Key belongs to the install it was created for: the first install that checks in with it keeps it, and another install that presents the same key is refused.
A DataMind OS server installed with the API key keeps working on it until it moves to a License Key of its own: DataMind prepares the License Key, and the DataMind Installer on that server takes it over at its next update.
An Administrator creates, rotates and revokes the API key in Settings. The full secret is shown once, when it is created or rotated, so copy it then. A rotated or revoked secret stops working at once: requests that still send the old secret are refused. Paste the new secret wherever the old one was used.
The company's license state can refuse a request even with a valid key. Three 402 codes carry it:
license_suspended: an invoice is past its AI cut-off date, so AI is paused for every key of the
company, API keys and License Keys alike. This applies only once DataMind enforces license
payments for your company.payg_not_available: the company is in its trial, and pay-as-you-go models are not served.trial_ended: the company's trial has ended and none of its instances is billed yet, so AI is not
served.All three are listed with their messages on Errors and retries.
A refused key is never answered 401 for a license reason: 401 always means the key itself is
missing, unknown, rotated or revoked.
Two company settings shape the requests your key authenticates. An Administrator changes both in Settings.
| Setting | What it does to your requests |
|---|---|
| Region | Decides where requests are processed. With EU, requests are processed in the EU, and your company uses the models served there. Embeddings are the one exception: they always run on the global route (Embeddings). |
| Provider sort | Sets which provider DataMind tries first for pay-as-you-go requests. The default is Throughput; a single request can override it with provider.. |
The x-api-key header, on every request. Use the API shows full examples for your first request.
The request is refused before it reaches a model, with status 401, code invalid_api_key and the message Invalid or missing API key. Check that the request sends the current company key, then send it again.
No. Use your company's API key for your own applications. A License Key belongs to one DataMind OS install, and another install that presents it is refused.
A rotated or revoked secret stops working at once, so a request that still sends the old secret is refused with the 401 error above. Ask an Administrator to rotate the key or create a new one in Settings, then paste the new secret wherever the old one was used.
Yes. With Region set to EU, requests are processed in the EU, and your company uses the models served there. Embeddings are the one exception: they always run on the global route (Embeddings). An Administrator changes the setting in Settings.
Your company's Provider sort setting, which defaults to Throughput. One request can override it with provider.; see Use the API.
AI requests only. Last used does not count software downloads; you can see it on the key card in Settings.
When a request carries a version, DataMind records it for your company, so support can check which version you run. A request without a version leaves the recorded value unchanged.