Loading the documentation…
The DataMind Platform API lets your own applications call the pay-as-you-go models in the OpenAI request format, so existing OpenAI code works with a new base URL and one extra header. Kartlos Premium and Kartlos Standard work inside DataMind OS and cannot be called with an API key (Kartlos models).
You need the company API key. An Administrator creates and manages it on the API key card in
Settings, as described in Manage the API key. The
examples below read it from the DATAMIND_API_KEY environment variable.
| Setting | Value |
|---|---|
| Base URL | https:/ |
| Authentication | x-api-key: <api_key> header. An Authorization: Bearer header alone is not accepted. |
| Request body | JSON, with Content-Type: application/ |
Your company holds one active key, for your own applications. DataMind OS installs run on License Keys instead, one for each install (API keys and License Keys). A key that is rotated or revoked stops working at once, and a company that is no longer active stops serving requests (API authentication).
List the models your key can use:
curl https://platform.datamind.ai/llm/models \ -H "x-api-key: $DATAMIND_API_KEY"
Pick an entry whose billing is payg and use its id as model in the next step. Each entry
tells you what the model can do and what it costs; the fields are listed on
Models API, and the Models page shows the same
list.
A company set to EU sees only the models served in the EU, and a request for any other model is refused like an unknown one.
Send model and messages, as in the OpenAI Chat Completions API:
curl https://platform.datamind.ai/llm/chat/completions \
-H "x-api-key: $DATAMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<model_id>",
"messages": [
{ "role": "system", "content": "You answer in one short paragraph." },
{ "role": "user", "content": "What is a data lakehouse?" }
],
"user": "customer-4821"
}'The answer is in choices[0]., and usage holds the token counts. The response
names the model you asked for. user is optional: send your end user's identifier there, and you
can filter requests by it on Usage in the External ID column.
The full request and response reference is on Chat completions.
Any HTTP client works: send a POST with the x-api-key header and a JSON body.
import os
import requests
response = requests.post(
"https://platform.datamind.ai/llm/chat/completions",
headers={"x-api-key": os.environ["DATAMIND_API_KEY"]},
json={
"model": "<model_id>",
"messages": [{"role": "user", "content": "Summarise the benefits of a lakehouse in two lines."}],
},
timeout=60,
)
response.raise_for_status()
print(response.json()["choices"][0]["message"]["content"])const response = await fetch("https://platform.datamind.ai/llm/chat/completions", {
method: "POST",
headers: {
"x-api-key": process.env.DATAMIND_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "<model_id>",
messages: [{ role: "user", content: "Name three uses of embeddings." }],
}),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
console.log(data.choices[0].message.content);Instead of curl, you can use an OpenAI SDK. OpenAI SDKs send their key as Authorization: Bearer,
so pass the DataMind key in the x-api-key header as well:
import os
from openai import OpenAI
api_key = os.environ["DATAMIND_API_KEY"]
client = OpenAI(
base_url="https://platform.datamind.ai/llm",
api_key=api_key,
default_headers={"x-api-key": api_key},
)
completion = client.chat.completions.create(
model="<model_id>",
messages=[{"role": "user", "content": "Summarise the benefits of a lakehouse in two lines."}],
)
print(completion.choices[0].message.content)import OpenAI from "openai";
const apiKey = process.env.DATAMIND_API_KEY;
const client = new OpenAI({
baseURL: "https://platform.datamind.ai/llm",
apiKey,
defaultHeaders: { "x-api-key": apiKey },
});
const completion = await client.chat.completions.create({
model: "<model_id>",
messages: [{ role: "user", content: "Name three uses of embeddings." }],
});
console.log(completion.choices[0].message.content);Add "stream": true (stream=True in the SDK). The answer arrives as server-sent events, each
carrying an OpenAI-style chunk with the new text in choices[0].; the last chunk
carries usage. If the stream breaks after it starts, the last event is event: error with the
code stream_interrupted: send the request again. Closing the connection stops the request; you pay
for the tokens generated before it stopped. No stream_options is needed: usage is always included.
The stream details are on Chat completions.
For a model with supports_thinking, send a reasoning object:
"reasoning": { "effort": "high" } sets the effort. Use a value from the model's
supported_efforts."reasoning": { "enabled": false } turns thinking off, when the model's thinking is not
mandatory.In the Python SDK, pass reasoning and provider through extra_body={.. In the JavaScript
SDK, add them to the request object.
Every model's thinking options, including its default effort, are on Models API; the full rules are on Chat completions.
Send "provider": { "sort": "price" } to override the company's Provider sort for one request.
The values are throughput, latency, price and balanced; an unknown value is refused. The
company default is set on Settings.
POST / turns text into embedding vectors, with the same key and the OpenAI
embeddings format. The one model is qwen/, and the vectors come back in data.
See Embeddings.
GET / searches the web for q; POST / returns the content of the page
at url. Each successful call uses Premium tokens, and a failed call costs nothing. See
Web search and web read.
Errors use the OpenAI shape {"error": {"message": ".. Act on
code; every status and code, and what to retry, is on
Errors and retries.
Every request that reaches a model provider runs with zero data retention: your prompts and the answers are not stored and are not used for model training. The platform enforces this for every forwarded request, and no request setting can change it.
Yes. The chat and embeddings endpoints speak the OpenAI formats, so an OpenAI client works once you
point it at https:/ and pass the key in the x-api-key header, as in
Use an OpenAI SDK.
Yes. Send a POST to https:/ with the x-api-key header and a JSON body, as in Call the API without an SDK.
The SDK sends the key only as Authorization: Bearer, and that header alone does not authenticate a
request. Add the x-api-key header, as in Use an OpenAI SDK. Without a usable
key, the request is refused with status 401, code invalid_api_key and the message
Invalid or missing API key (API authentication).
Chat completions, embeddings, web search and web read, and the models list. Each has its own page: Chat completions, Embeddings, Web search and web read and Models API.
Any entry from GET / whose billing is payg; send its id as model. A company set
to EU sees only the models served in the EU, and a request for any other model is refused like
an unknown one (Models API).
Yes. Add "stream": true and the answer arrives as server-sent events, each carrying a chunk with
the new text; the last chunk carries usage. See Stream the answer.
The Usage page lists every request with its tokens and cost, and the Dashboard shows the totals, including the Premium tokens your web searches and web reads used.
No. Every request that reaches a model provider runs with zero data retention, and the platform enforces it for every forwarded request (Zero data retention).
Kartlos names keep the model behind them private, so a request served under your plan shows the region that served it, EU Provider or Global Provider, in place of a provider name; the same labels appear on the Usage log. A pay-as-you-go request names the provider that served it.