Back
A
Atlara/API Docs
v1

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.ai
Authentication: send your key as either an Authorization: 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).

POSThttps://api.atlara.ai/v1/chat/completions

Request Parameters

All parameters are sent as JSON in the request body.

ParameterTypeRequiredDescription
atlara_asyncbooleanoptionalRun plain text flex chat in the background and return a job id immediately. Requires service_tier: "flex".
atlara_webhook_urlstringoptionalOptional public HTTPS completion webhook for async flex. The signing secret is returned once on submission.
messagesarrayrequiredChat messages, same shape as OpenAI's chat completions API (role + content).
modelstringoptionalA 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_tokensintegeroptionalMaximum number of tokens to generate.
temperaturefloatoptionalSampling temperature. Range: 0.0–2.0. Higher = more creative output.
streambooleanoptionalWhether to stream the response via server-sent events. Default: false.
toolsarrayoptionalOpenAI-shaped function tool definitions, for tool/function calling.
service_tierstringoptional"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.
modelsstring[]optionalOrdered 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_strategystringoptionalOverrides your workspace's default cost / balanced / performance ranking for "auto" requests.
response_formatobjectoptionalOpenAI-shaped JSON mode ({"type":"json_object"} or {"type":"json_schema",...}), forwarded to providers that support it.
tool_choicestring | objectoptionalOpenAI-shaped tool selection, sent together with tools. parallel_tool_calls is also accepted.
reasoning_effortstringoptionalReasoning depth for models that support it. Ignored or clamped for models that do not declare support.
stream_optionsobjectoptionalSet {"include_usage": true} to receive a final usage chunk on streamed responses.

Examples

Auto-select model

Let Atlara choose the best available model.

bash
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.

bash
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.

bash
{
  "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:

bash
{
  "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:

javascript
// 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.

bash
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"}]
  }'
json
{
  "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

recommendedThe 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.
candidatesUp 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_fitHow 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).
adequatetrue 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.
routesnetwork (served by the Atlara machine network) and/or hosted (a cloud provider on Atlara's key).
estimated_costnetwork_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_typeHow the request was classified: coding, math or chat_qa. task_type_source is embedding or regex_fallback.
complexityThe request's estimated difficulty, from 0 to 1.
requirementsWhat a model needs to take this request: capabilities (e.g. tool_use, vision, json_mode, reasoning) and min_context_tokens.
requestedOnly 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_foundNo model with this name is in the catalogue.
model_not_enabledThe model is switched off for your workspace (Inference → Models).
model_not_allowed_for_keyThe API key is limited to specific models and this is not one of them.
missing_capabilityThe model lacks something the request needs, e.g. tools or images.
context_too_smallThe request does not fit in the model's context window.
no_route_availableNo 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.

json
{
  "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.

HeaderDescription
X-Atlara-Served-ModelThe model id that actually served the request — the resolved id when you passed "auto" or a fallback list.
X-Atlara-Served-ProviderWhere 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-ReasonOnly present when a request was automatically downgraded to the best-effort-free tier — currently always "credits-exhausted".

Other Endpoints

POST/v1/embeddingsText embeddings (OpenAI-compatible) or image embeddings via Gemini — pass an image_url content part in input.
POST/v1/images/generationsImage generation.
POST/v1/audio/transcriptionsSpeech-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/translationsSpeech translated to English text. Same request shape as transcriptions.
POST/v1/model-adviceRecommends 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-catalogueThe 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.

python
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.

ts
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.

ts
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.

python
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).

python
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.

python
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.

python
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.

bash
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).

json
{
  "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.

text
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.

yaml
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\
json
{
  "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.

bash
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 StatusError CodeDescription
400invalid_requestMissing or malformed request parameters.
400invalid_jsonThe request body is not valid JSON.
400model_not_foundThe requested model id isn't an enabled model in the catalogue.
400content_flaggedContent moderation blocked the prompt (only when moderation is set to block for your workspace).
401unauthorizedInvalid or missing API key.
402insufficient_creditsWorkspace is out of credits. A request with model "auto" may still be served from a best-effort free pool when one is configured.
402credit_cap_reachedPostpaid workspace has hit its spending cap.
402org_budget_reachedWorkspace has reached the monthly spend budget an owner or admin set on the Billing page. Resets on the 1st (UTC).
403model_not_enabledThis model is disabled for your workspace — enable it under Models.
403model_not_allowed_for_keyThis API key is limited to specific models and the request named another one. With model "auto", only the key's models are used.
413request_too_large_for_free_creditsPrompt is over about 128k tokens and the workspace has never bought credits.
429rate_limitedToo many requests.
429best_effort_rate_limitedThe best-effort free pool is rate limited. Retry shortly or add credits.
502audio_transcription_failedNo provider could serve the audio request.
503no_agentNo agent or provider could currently serve the request.
503no_eligible_modelNo enabled model matches the request.
500internal_errorAn unexpected server error occurred.

Need help? Ask the in-app help assistant, or email [email protected]