API REFERENCE
Atlara API Docs
An OpenAI-compatible API for inference across any model. Point your existing OpenAI SDK at Atlara and it works.
Base URL
https://api.atlara.aiAuthorization: Bearer YOUR_API_KEY header or an X-API-Key: YOUR_API_KEY header — both work. Create keys from the "API Keys" section in the dashboard sidebar.POST /v1/chat/completions
The main inference endpoint — same request/response shape as OpenAI's chat completions API. Atlara routes your request to the best available model and provider (or exactly the one you name).
https://api.atlara.ai/v1/chat/completionsRequest Parameters
All parameters are sent as JSON in the request body.
| Parameter | Type | Required | Description |
|---|---|---|---|
atlara_async | boolean | optional | Run plain text flex chat in the background and return a job id immediately. Requires service_tier: "flex". |
atlara_webhook_url | string | optional | Optional public HTTPS completion webhook for async flex. The signing secret is returned once on submission. |
messages | array | required | Chat messages, same shape as OpenAI's chat completions API (role + content). |
model | string | optional | A specific model id from the Models page (e.g. "llama4:scout"), or "auto" to let Atlara pick the best available model. "atlara" is an alias for "auto" (handy in clients like Cursor that reserve "auto" for their own picker). Default: "auto". |
max_tokens | integer | optional | Maximum number of tokens to generate. |
temperature | float | optional | Sampling temperature. Range: 0.0–2.0. Higher = more creative output. |
stream | boolean | optional | Whether to stream the response via server-sent events. Default: false. |
tools | array | optional | OpenAI-shaped function tool definitions, for tool/function calling. |
service_tier | string | optional | "realtime" (default) for standard interactive priority, or "flex" for lower priority / best-effort latency at a discount — synchronous by default; set atlara_async to run plain text flex chat in the background. |
models | string[] | optional | Ordered fallback list: Atlara tries each model in turn until one is served. Any entry may be "auto". Takes precedence over model when non-empty. |
routing_strategy | string | optional | Overrides your workspace's default cost / balanced / performance ranking for "auto" requests. |
response_format | object | optional | OpenAI-shaped JSON mode ({"type":"json_object"} or {"type":"json_schema",...}), forwarded to providers that support it. |
tool_choice | string | object | optional | OpenAI-shaped tool selection, sent together with tools. parallel_tool_calls is also accepted. |
reasoning_effort | string | optional | Reasoning depth for models that support it. Ignored or clamped for models that do not declare support. |
stream_options | object | optional | Set {"include_usage": true} to receive a final usage chunk on streamed responses. |
Examples
Auto-select model
Let Atlara choose the best available model.
curl -X POST https://api.atlara.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "auto",
"messages": [
{"role": "user", "content": "Explain the concept of gradient descent"}
]
}'Specific model, streaming
Request a named model with a streamed response.
curl -X POST https://api.atlara.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama4:scout",
"messages": [
{"role": "user", "content": "Summarize this article in 3 bullet points:"}
],
"stream": true
}'Async flex
For work that can outlast an HTTP connection, POST to /v1/chat/completions with atlara_async: true and service_tier: "flex". Use model: "auto" or a named model. Async flex accepts plain text chat up to 1 MB; tools, vision, reasoning, streaming, JSON output and model fallback lists require a synchronous call.
{
"model": "auto",
"messages": [{"role": "user", "content": "Explain gradient descent"}],
"service_tier": "flex",
"atlara_async": true,
"atlara_webhook_url": "https://your-app.example/webhooks/atlara"
}The router returns HTTP 202 immediately:
{
"id": "aflex_example",
"object": "async_job",
"status": "queued",
"model": "auto",
"created_at": 1793741400,
"expires_at": 1793742600,
"poll_url": "/v1/async-jobs/aflex_example",
"webhook_secret": "SAVE_THIS_SECRET"
}Save webhook_secret securely: it appears only when a webhook is configured, only in the submission response. Poll poll_url on the same API host using your Bearer API key. States are queued, running, completed, failed and expired. Completed jobs include served_model, usage and response (the full chat completion); failed or expired jobs include error.code and error.message. Jobs have a 20-minute execution window. Results and errors remain available for three hours after completion, then polling returns 404. Live jobs are capped per workspace: 5 for individual accounts, 20 for SMB and 50 for enterprise; exceeding the cap returns 429 async_job_limit. Polling does not incur inference charges.
The optional webhook must use a public HTTPS endpoint without redirects. It receives a small JSON pointer such as {"id":"aflex_example","status":"completed"}, signed in X-Atlara-Signature with a hex HMAC-SHA256 over the exact raw body. Return 2xx to acknowledge. Delivery retries are bounded; keep polling as a fallback and deduplicate notifications by job id. Verify before parsing or acting on the body:
// Node.js: rawBody must be the unmodified request Buffer.
import { createHmac, timingSafeEqual } from "node:crypto";
function verifyAtlara(rawBody, signature, secret) {
if (typeof signature !== "string" || !/^[a-f0-9]{64}$/i.test(signature)) return false;
const expected = createHmac("sha256", secret).update(rawBody).digest();
return timingSafeEqual(expected, Buffer.from(signature, "hex"));
}Model advice
POST /v1/model-advice takes the same body you would send to /v1/chat/completions and returns the models Atlara would choose for it, in the order it would try them, without running anything. It is free, does not use credits and creates no job. Use it to show a recommendation, or to check a model you named, before you send the real request with the model you pick. The ranking is the same one model: "auto" uses.
Which models it considers
Only models enabled for the workspace your API key belongs to (dashboard: Inference → Models). A model you have switched off is never a candidate or the recommendation, and naming it returns usable: false with reason model_not_enabled. Your routing rules narrow the candidates the same way they narrow auto. Of those, only models that can take this request are listed: they must have the capabilities it needs (tools, images, JSON output, reasoning) and a context window large enough for it. When nothing qualifies, recommended is omitted and candidates is empty.
curl https://api.atlara.ai/v1/model-advice \
-H "Authorization: Bearer $ATLARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5",
"max_tokens": 800,
"messages": [{"role": "user", "content": "Write a Python function that dedupes a list"}]
}'{
"object": "model_advice",
"recommended": "qwen3-coder",
"task_type": "coding",
"task_type_source": "embedding",
"complexity": 0.41,
"adequacy_threshold": 0.31,
"estimated_input_tokens": 14,
"assumed_output_tokens": 800,
"requirements": {"capabilities": [], "min_context_tokens": 817},
"candidates": [
{
"rank": 1,
"model": "qwen3-coder",
"task_fit": 0.82,
"task_fit_source": "global",
"adequate": true,
"context_window": 262144,
"routes": ["network", "hosted"],
"estimated_cost": {"network_usd": 0.000161, "hosted_usd": 0.000322}
}
],
"requested": {
"model": "gpt-5",
"usable": true,
"task_fit": 0.9,
"task_fit_source": "global",
"adequate": true,
"estimated_cost": {"hosted_usd": 0.008017}
},
"note": "Advice only: nothing was run or billed. Send the request to /v1/chat/completions with the model you choose."
}Response fields
| recommended | The model auto would try first: the cheapest model whose fit for this task clears the bar (adequate). It is not necessarily the highest-rated one; a better-rated model further down costs more. Omitted when no enabled model can take it. |
| candidates | Up to 10 models, in the order auto would try them: adequate models first, cheapest first, then the rest (still used if every adequate one fails). Each has rank, model, task_fit, task_fit_source, adequate, context_window, routes and estimated_cost. |
| task_fit | How well the model does on this kind of task, from 0 to 1. task_fit_source says where the number comes from: org (your workspace's own ratings), global (Atlara's evaluations), quality_rank_fallback (catalogue rating, no evaluations yet) or neutral_default (no rating at all). |
| adequate | true when task_fit reaches the bar auto applies to this request. The bar is in adequacy_threshold; it rises with the request's complexity and your workspace's routing setting. |
| routes | network (served by the Atlara machine network) and/or hosted (a cloud provider on Atlara's key). |
| estimated_cost | network_usd and/or hosted_usd for each route the model has. Input tokens are counted from your messages (estimated_input_tokens); output is assumed to be max_tokens, or 1,024 when you do not set it (assumed_output_tokens). |
| task_type | How the request was classified: coding, math or chat_qa. task_type_source is embedding or regex_fallback. |
| complexity | The request's estimated difficulty, from 0 to 1. |
| requirements | What a model needs to take this request: capabilities (e.g. tool_use, vision, json_mode, reasoning) and min_context_tokens. |
| requested | Only when the body names a model: model, usable, reason (when not usable), adequate and, for an enabled model, task_fit, task_fit_source and estimated_cost. |
Why a named model is not usable
| model_not_found | No model with this name is in the catalogue. |
| model_not_enabled | The model is switched off for your workspace (Inference → Models). |
| model_not_allowed_for_key | The API key is limited to specific models and this is not one of them. |
| missing_capability | The model lacks something the request needs, e.g. tools or images. |
| context_too_small | The request does not fit in the model's context window. |
| no_route_available | No machine or provider can serve the model right now. |
The advice assumes every route is healthy and your balance can pay for the request, so the real request may still move on to the next candidate. Requests are limited to 120 a minute per API key (429 rate_limit_exceeded). Other errors: 401 for a missing or invalid key, 403 ip_not_allowed when the key has an IP allow-list, 403 advisor_disabled when model advice is turned off for the workspace, 400 invalid_json or invalid_request (messages missing), 413 request_too_large over 16 MB.
Turning it on or off
Model advice is on for every workspace by default. An owner or admin can turn it off in the dashboard under Routing → Model advice; every API key in the workspace then gets 403 advisor_disabled. Routing of your normal requests is the same either way. The setting is also the model_advisor field ("off" or "on_request") of the dashboard's /enterprise/routing-strategy settings.
Response Schema
Successful responses return HTTP 200 OK with the following JSON structure.
{
"id": "chatcmpl_01j9xk2m4b3vw8qhpnr5t6",
"object": "chat.completion",
"created": 1735689600,
"model": "llama4:scout",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Gradient descent is an optimization algorithm..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 198,
"total_tokens": 210
}
}Response Headers
Every response from /v1/chat/completions, /v1/completions, and /v1/responses carries these headers reporting what actually served the request — useful when you passed "model": "auto" or a fallback list and want to know which one won without parsing the body. Not yet sent on streamed ( "stream": true) responses.
| Header | Description |
|---|---|
X-Atlara-Served-Model | The model id that actually served the request — the resolved id when you passed "auto" or a fallback list. |
X-Atlara-Served-Provider | Where the request was served from — a cloud provider name, "agent" for a network node, or "own-device" for your own linked device. |
X-Atlara-Service-Tier | "realtime", "flex", or "best-effort-free" — the tier the request actually ran at. |
X-Atlara-Fallback-Reason | Only present when a request was automatically downgraded to the best-effort-free tier — currently always "credits-exhausted". |
Other Endpoints
| POST | /v1/embeddings | Text embeddings (OpenAI-compatible) or image embeddings via Gemini — pass an image_url content part in input. |
| POST | /v1/images/generations | Image generation. |
| POST | /v1/audio/transcriptions | Speech-to-text. multipart/form-data with a file and a model field (a catalogue id, or "auto"); other fields such as language are passed to the provider unchanged. Billed per audio minute. |
| POST | /v1/audio/translations | Speech translated to English text. Same request shape as transcriptions. |
| POST | /v1/model-advice | Recommends a model for a chat request without running it: the ranked models auto would choose, their fit for the task and an estimated cost. Free. See Model advice. |
| GET | /v1/model-catalogue | The public model catalogue: every enabled model with its capabilities, context window and prices. No API key needed. It is not filtered by your workspace's Models toggles, so a listed model can still return model_not_enabled. Models that need a newer desktop Ollama are listed only with ?ollama=<version> or ?ollama=any. |
Models and prices
Every model is billed per token. An API key pays the dollar price. The Atlara app, the dashboard chat and cloud tasks pay in credits (100 credits = $1), which includes a small app markup.
The $ to $$$$$ level is what a typical task costs on that model: a 2,000-token request plus the model’s usual answer length, allowing for retries. A model with cheap tokens that writes long answers can cost more per task than its token price suggests. auto has no fixed price: each request is billed by the model that answered it, at or below that model’s price. Image and speech models are priced per image or per minute; see GET /v1/model-catalogue.
Loading prices…
Use Atlara with other tools
Anything that speaks the OpenAI API works with base URL https://api.atlara.ai/v1 and your API key. Use auto to let Atlara pick the model, or any model_id from /v1/model-catalogue.
OpenAI SDK (Python)
Point the official OpenAI client at Atlara's base URL.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.atlara.ai/v1",
api_key=os.environ["ATLARA_API_KEY"],
)
reply = client.chat.completions.create(
model="auto",
messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.choices[0].message.content)OpenAI SDK (Node.js)
The same with the JavaScript client.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.atlara.ai/v1",
apiKey: process.env.ATLARA_API_KEY,
});
const reply = await client.chat.completions.create({
model: "auto",
messages: [{ role: "user", content: "Say hello in five words." }],
});
console.log(reply.choices[0].message.content);Vercel AI SDK
Use the @ai-sdk/openai-compatible provider with generateText or streamText.
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";
const atlara = createOpenAICompatible({
name: "atlara",
baseURL: "https://api.atlara.ai/v1",
apiKey: process.env.ATLARA_API_KEY,
});
const { text } = await generateText({
model: atlara("DeepSeek-V4.1-Flash"),
prompt: "Explain what a vector database is in two sentences.",
});
console.log(text);LangChain
ChatOpenAI accepts a base URL, so tools and structured output work as usual.
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="DeepSeek-V4.1-Flash",
base_url="https://api.atlara.ai/v1",
api_key=os.environ["ATLARA_API_KEY"],
)
print(llm.invoke("Summarise the theory of relativity in one line.").content)LlamaIndex
Use OpenAILike (pip install llama-index-llms-openai-like).
import os
from llama_index.llms.openai_like import OpenAILike
llm = OpenAILike(
model="DeepSeek-V4.1-Flash",
api_base="https://api.atlara.ai/v1",
api_key=os.environ["ATLARA_API_KEY"],
is_chat_model=True,
is_function_calling_model=True,
context_window=1000000,
)
print(llm.complete("Name three uses of graph databases."))Pydantic AI
Use OpenAICompatibleProvider with Atlara's base URL and an OpenAI chat model.
import os
from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai_compatible import OpenAICompatibleProvider
model = OpenAIChatModel(
"DeepSeek-V4.1-Flash",
provider=OpenAICompatibleProvider(
"atlara",
base_url="https://api.atlara.ai/v1",
api_key=os.environ["ATLARA_API_KEY"],
),
)
agent = Agent(model)
print(agent.run_sync("What is the capital of Japan?").output)LiteLLM
Use the openai/ prefix with Atlara's base URL. Works in the SDK and in a proxy config.yaml.
import os
import litellm
reply = litellm.completion(
model="openai/DeepSeek-V4.1-Flash",
api_base="https://api.atlara.ai/v1",
api_key=os.environ["ATLARA_API_KEY"],
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)Aider
Aider talks to any OpenAI-compatible API through its openai/ model prefix.
export OPENAI_API_BASE=https://api.atlara.ai/v1 export OPENAI_API_KEY=YOUR_ATLARA_API_KEY aider --model openai/DeepSeek-V4.1-Flash
Zed
Add Atlara as an OpenAI-compatible provider in settings.json, then set ATLARA_API_KEY (or paste the key in Agent Settings).
{
"language_models": {
"openai_compatible": {
"atlara": {
"api_url": "https://api.atlara.ai/v1",
"available_models": [
{ "name": "DeepSeek-V4.1-Flash", "display_name": "DeepSeek V4.1 Flash (Atlara)", "max_tokens": 1000000 },
{ "name": "NVIDIA-Nemotron-3-Ultra-550B-A55B", "display_name": "Nemotron 3 Ultra (Atlara)", "max_tokens": 256000 }
]
}
}
}
}Open WebUI
In Admin Settings → Connections, add an OpenAI connection. Leave Model IDs empty to list your workspace's models.
URL: https://api.atlara.ai/v1 API Key: YOUR_ATLARA_API_KEY
LibreChat
Add a custom endpoint to librechat.yaml and put ATLARA_API_KEY in .env.
endpoints:
custom:
- name: "Atlara"
apiKey: "${ATLARA_API_KEY}"
baseURL: "https://api.atlara.ai/v1"
models:
default: ["auto", "DeepSeek-V4.1-Flash", "NVIDIA-Nemotron-3-Ultra-550B-A55B", "GLM-5.3", "moonshotai/kimi-k3.1-pro"]
fetch: false
titleConvo: true
titleModel: "DeepSeek-V4.1-Flash"
modelDisplayLabel: "Atlara"Use Atlara in goose
goose reads extra providers from JSON files in its custom_providers folder. Save the file below as atlara.json in that folder:
- macOS and Linux:
~/.config/goose/custom_providers/ - Windows:
%APPDATA%\Block\goose\config\custom_providers\
{
"name": "atlara",
"engine": "openai",
"display_name": "Atlara",
"description": "Open and frontier models on one OpenAI-compatible API",
"api_key_env": "ATLARA_API_KEY",
"base_url": "https://api.atlara.ai/v1",
"models": [
{ "name": "DeepSeek-V4.1-Flash", "context_limit": 1000000 },
{ "name": "GLM-5.3", "context_limit": 1000000 },
{ "name": "deepseek/deepseek-v4-pro", "context_limit": 1048576 },
{ "name": "moonshotai/kimi-k3.1-pro", "context_limit": 1048576 },
{ "name": "NVIDIA-Nemotron-3-Ultra-550B-A55B", "context_limit": 256000 },
{ "name": "qwen3.5:122b", "context_limit": 262144 },
{ "name": "gemma4:26b", "context_limit": 262144 },
{ "name": "meta-llama/llama-4-maverick", "context_limit": 1048576 }
],
"supports_streaming": true,
"requires_auth": true
}Then set your key and start a session. In goose Desktop, pick Atlara under Settings → Models → Configure providers and paste the key there instead.
export ATLARA_API_KEY="YOUR_API_KEY" goose session start --provider atlara
The list holds open models that support tool calling. Add any other model from /v1/model-catalogue by its model_id. Any other OpenAI-compatible tool works the same way: base URL https://api.atlara.ai/v1 and your API key.
Error Codes
All errors return JSON with an error field describing the issue.
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or malformed request parameters. |
| 400 | invalid_json | The request body is not valid JSON. |
| 400 | model_not_found | The requested model id isn't an enabled model in the catalogue. |
| 400 | content_flagged | Content moderation blocked the prompt (only when moderation is set to block for your workspace). |
| 401 | unauthorized | Invalid or missing API key. |
| 402 | insufficient_credits | Workspace is out of credits. A request with model "auto" may still be served from a best-effort free pool when one is configured. |
| 402 | credit_cap_reached | Postpaid workspace has hit its spending cap. |
| 402 | org_budget_reached | Workspace has reached the monthly spend budget an owner or admin set on the Billing page. Resets on the 1st (UTC). |
| 403 | model_not_enabled | This model is disabled for your workspace — enable it under Models. |
| 403 | model_not_allowed_for_key | This API key is limited to specific models and the request named another one. With model "auto", only the key's models are used. |
| 413 | request_too_large_for_free_credits | Prompt is over about 128k tokens and the workspace has never bought credits. |
| 429 | rate_limited | Too many requests. |
| 429 | best_effort_rate_limited | The best-effort free pool is rate limited. Retry shortly or add credits. |
| 502 | audio_transcription_failed | No provider could serve the audio request. |
| 503 | no_agent | No agent or provider could currently serve the request. |
| 503 | no_eligible_model | No enabled model matches the request. |
| 500 | internal_error | An unexpected server error occurred. |
Need help? Ask the in-app help assistant, or email [email protected]