DOCUMENTATION

Integrate the Atria API

Use standard Chat Completions, Messages, and Responses APIs with existing applications and agent tools.

Authentication: create an API key

Atria API identifies callers with an API key created in the console. It only takes a few steps.

  1. 1
    Sign in to the consoleSign in with Google, then open the API keys page.
  2. 2
    Name the keyChoose a name that identifies its environment or application, such as production-agent.
  3. 3
    Create and copy it nowSelect Create key and copy the complete value. It is shown once and cannot be viewed again after closing the notice.
  4. 4
    Store it safelyKeep the key in a server-side environment variable or password manager, never in frontend code.
If a key is lost, revoke it and create a replacement. The complete hidden value cannot be recovered.Open API key console →

Authentication and environment

Every request uses a Bearer API key. The full key is shown only once, so store it in a password manager or a server-side environment variable.

macOS / Linux

export ATRIA_API_KEY=atr_xxx

Windows PowerShell

$env:ATRIA_API_KEY="atr_xxx"

Request headers

Authorization: Bearer <ATRIA_API_KEY>
Content-Type: application/json

Non-streaming request

Use this when you want the complete answer at once. Copy the command, replace the API key, and run it.

curl -X POST https://api.atria-asi.ai/v1/chat/completions \
  -H "Authorization: Bearer $ATRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Atria-Dawn-Preview",
    "messages": [{"role": "user", "content": "hi"}]
  }'

Streaming request

Use this for chat interfaces. Tokens arrive continuously and curl prints each event as it arrives.

curl -N -X POST https://api.atria-asi.ai/v1/chat/completions \
  -H "Authorization: Bearer $ATRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Atria-Dawn-Preview",
    "messages": [{"role": "user", "content": "hi"}],
    "stream": true
  }'

Messages API

Anthropic Messages-compatible, authenticated with x-api-key. Use it with existing Anthropic SDKs and tools.

curl -X POST https://api.atria-asi.ai/v1/messages \
  -H "x-api-key: $ATRIA_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Atria-Dawn-Preview",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "hi"}]
  }'

Responses API

OpenAI Responses-compatible. Send text or structured content through the input field.

curl -X POST https://api.atria-asi.ai/v1/responses \
  -H "Authorization: Bearer $ATRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Atria-Dawn-Preview",
    "input": "hi"
  }'

Read the response

Each API has a different response shape. The table below shows the common text, finish-reason, and token-usage paths so clients do not need to traverse the entire payload.

Chat CompletionsAnswer text: choices[0].message.contentFinish reason: choices[0].finish_reasonToken usage: usage.prompt_tokens / completion_tokensStreaming delta: choices[0].delta.content
MessagesAnswer text: content[0].textFinish reason: stop_reasonToken usage: usage.input_tokens / output_tokensStreaming delta: content_block_delta.delta.text
ResponsesAnswer text: output[0].content[0].textFinish reason: statusToken usage: usage.input_tokens / output_tokensStreaming delta: response.output_text.delta

Streaming delta

Streaming responses use SSE. Read each data: event and append its text delta; stop at [DONE] or the corresponding completed/stop event. Individual events are not complete answers.

data: {"choices":[{"delta":{"content":"Hello"}}]}

data: {"choices":[{"delta":{"content":" world!"}}]}

data: [DONE]

Token usage

usage powers console reporting and operational monitoring. Input and output tokens are reconciled when the stream ends, so an in-flight stream may not appear immediately.

Model overview and API selection

Atria Dawn Preview supports research analysis, coding, and multi-turn Agent tasks. Atria-Dawn-Preview is the single available model. Choose the API that matches your SDK or request format.

Available model

Set the model field to Atria-Dawn-Preview, preserving its capitalization. Select the ID below to see the full request example.

Model IDContext window
Atria-Dawn-Preview →256K tokens

Atria-Dawn-Preview supports all three APIs below, with streaming and non-streaming requests. Use the same model ID across APIs.

Prepare input for your task

  1. 01
    Research and document analysisSupply the research question, relevant excerpts, and scope. Specify the output you need, such as an evidence comparison, research hypothesis, or experiment plan. Include source details when asking for citations.
  2. 02
    Coding and engineeringSupply relevant code, error messages, the runtime environment, and acceptance criteria. Ask for an implementation or change for the specific problem, then use test results to guide the next iteration.
  3. 03
    Multi-turn Agent workflowsSupply the goal, available tools, and current state. Your application or Agent executes tool calls and sends the results back to the model as input for the next step.

Choose an API

For existing projects, keep the API used by your SDK. For a direct HTTP integration, start with the Chat Completions example. Switching APIs also requires changing the input fields and response parsing.

API and pathInput fieldOutput limit parameter
Chat Completions/v1/chat/completionsmessagesmax_completion_tokensor max_tokens
Messages/v1/messagesmessagesmax_tokens
Responses/v1/responsesinputmax_output_tokens

Understand the 256K context window and output length

The 256K context window covers the input and generated content in a request. System instructions, conversation history, document excerpts, and tool results all use input space. Leave room for the response when preparing long inputs.

Context size is not the length of a single answer. The output limit parameters above accept integer token limits from 1 to 65,536 and cap generation for a request. Actual output also depends on stopping conditions and available context. The limit is not a word count or a target the model must reach.

For long documents and multi-turn tasks, keep relevant material and necessary history, specify the output format, and set an output limit appropriate to the task. The three inference APIs no longer impose an application-level request body size cap. Model context, available quota, and infrastructure limits still apply.

Make a request and verify the result

Copy the example below and make a short request with an API key created in the console. For Messages or Responses, keep the model field set to Atria-Dawn-Preview and use the corresponding request path, authentication headers, and input fields.

Before using the model for your workload, check correctness, instruction following, latency, and token usage on representative inputs. Repeat these tasks after changing prompts, tool configuration, or APIs.

Atria-Dawn-Preview

This is a minimal Chat Completions request for this model. Set the ATRIA_API_KEY environment variable, then copy and run the command. Replace hi with your question to begin.

curl -X POST https://api.atria-asi.ai/v1/chat/completions \
  -H "Authorization: Bearer $ATRIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Atria-Dawn-Preview",
    "messages": [{"role": "user", "content": "hi"}]
  }'

For Messages or Responses, keep this model ID and use the request body shown in the corresponding example.

Connect Agent tools

Any Agent that accepts a custom OpenAI- or Anthropic-compatible model can connect with the Atria API URL, API key, and model ID. The examples below show the minimum setup for common tools.

Before you connect

Create an API key in the console and store it in the ATRIA_API_KEY environment variable. All examples use the model ID Atria-Dawn-Preview. Keep its capitalization exactly as shown.

export ATRIA_API_KEY=atr_xxx

Claude Code

Claude Code connects through the Messages API. Do not append /v1 to the host; Claude Code requests /v1/messages automatically.

export ANTHROPIC_BASE_URL=https://api.atria-asi.ai
export ANTHROPIC_AUTH_TOKEN=$ATRIA_API_KEY
claude --model Atria-Dawn-Preview

Block image and PDF reads

Atria-Dawn-Preview accepts text input. A PreToolUse hook can deny image and PDF reads by Claude Code’s Read tool. Extract the relevant text before sending it to the model. These steps require Python 3.

1. Save the hook script

Save the complete script below as block_pdf_image_read.py and note its absolute path, for example /absolute/path/block_pdf_image_read.py. Replace this placeholder with the real path on your machine.

#!/usr/bin/env python3
"""
PreToolUse hook: block the Read tool from reading PDF and image files.
"""
import json
import sys


IMAGE_EXTENSIONS = (
    ".apng",
    ".avif",
    ".bmp",
    ".gif",
    ".heic",
    ".heif",
    ".ico",
    ".jfif",
    ".jpeg",
    ".jpg",
    ".jxl",
    ".png",
    ".svg",
    ".tif",
    ".tiff",
    ".webp",
)


def main():
    hook_input = json.loads(sys.stdin.read())
    file_path = hook_input.get("tool_input", {}).get("file_path", "")

    if file_path.lower().endswith(".pdf"):
        reason = "Reading PDF files with the Read tool is not allowed."
    elif file_path.lower().endswith(IMAGE_EXTENSIONS):
        reason = "Reading image files with the Read tool is not allowed."
    else:
        sys.exit(0)

    output = {
        "hookSpecificOutput": {
            "hookEventName": "PreToolUse",
            "permissionDecision": "deny",
            "permissionDecisionReason": reason,
        }
    }
    print(json.dumps(output, ensure_ascii=False))

    sys.exit(0)


if __name__ == "__main__":
    main()

2. Merge the hook settings

Merge the hooks configuration below into ~/.claude/settings.json. Append the rule to any existing PreToolUse array; do not overwrite other settings or hooks. If you use CLAUDE_CONFIG_DIR, edit settings.json in that directory. Put the script’s absolute path in command and keep the quotes around it.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Read",
        "hooks": [
          {
            "type": "command",
            "command": "python3 \"/absolute/path/block_pdf_image_read.py\"",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

3. Verify the hook’s scope

In a new Claude Code session, ask the Read tool to read a .txt, .pdf, and .png file. Text should remain readable; PDF and image reads should be denied with a reason. If they are not blocked, check Python 3, the script path, and hook execution errors.

This is not a global attachment filter. It checks file extensions for Read only, not pasted or uploaded images, @file references, Bash, or MCP input. Script failures or timeouts do not guarantee a blocked read. Paste extracted text instead of sending image or PDF files.

Claude Code hook reference ↗

Codex

Add a custom provider to ~/.codex/config.toml. Codex uses the Responses API.

Configure a text-only model

Atria-Dawn-Preview accepts text only. If the client treats it as multimodal and attaches an image through -i/--image or a pasted screenshot, the request may fail with 400 Atria-Dawn-Preview is not a multimodal model. Declare input_modalities in a custom catalog so compatible Codex versions treat it as text-only.

This model catalog example targets Codex CLI 0.154.0 and later. Check codex --version first; catalog fields and tool settings can vary between versions. Set ATRIA_API_KEY in your terminal before starting Codex.

1. Create a model catalog file

Save this JSON as ~/.codex/atria-catalog.json. Keep the complete set of fields. If startup reports missing field <name>, check for omitted fields and confirm compatibility with your client version.

{
  "models": [
    {
      "slug": "Atria-Dawn-Preview",
      "display_name": "Atria-Dawn-Preview",
      "base_instructions": "You are a coding agent running in the Codex CLI. You collaborate with the user in a shared workspace to accomplish their software engineering goals.\n\nYou can only receive text input. Images, screenshots, PDFs, and other binary attachments are not available to you. If the user refers to an attachment you cannot see, say so plainly and ask them to paste the relevant text instead.",
      "supported_reasoning_levels": [
        {
          "effort": "low",
          "description": "Fast responses with lighter reasoning"
        },
        {
          "effort": "medium",
          "description": "Balances speed and reasoning depth"
        },
        {
          "effort": "high",
          "description": "Greater reasoning depth for complex problems"
        }
      ],
      "shell_type": "unified_exec",
      "visibility": "list",
      "supported_in_api": true,
      "priority": 1,
      "support_verbosity": false,
      "truncation_policy": {
        "mode": "tokens",
        "limit": 10000
      },
      "experimental_supported_tools": [],
      "context_window": 256000,
      "max_context_window": 256000,
      "input_modalities": [
        "text"
      ]
    }
  ]
}

input_modalities: ["text"] declares text input. context_window and max_context_window are set to 256000 for context budgeting and automatic compaction; do not inflate them beyond the model’s actual limit. base_instructions also tells the model to disclose unavailable attachments and request the relevant text.

2. Load the catalog in your user config

Merge this into ~/.codex/config.toml. Place model, model_provider, and model_catalog_json at the top level, before tables such as [model_providers.atria]. Update existing entries instead of duplicating fields or tables.

model = "Atria-Dawn-Preview"
model_provider = "atria"
model_catalog_json = "~/.codex/atria-catalog.json"

[model_providers.atria]
name = "Atria"
base_url = "https://api.atria-asi.ai/v1"
env_key = "ATRIA_API_KEY"
wire_api = "responses"
model_catalog_json replaces the catalog rather than merging it. If you switch models with -m or by editing model, add that model to this file too. Missing metadata may produce Model metadata for <slug> not found and fall back to default capabilities; the current model’s text-only declaration does not apply to other models.

3. Optional: disable the image-viewing tool

The current official setting is tools.view_image. Add the following to the [tools] table in the same config.toml to disable the local image-viewing tool. Earlier examples use [features] view_image = false; check your installed version’s reference rather than treating both forms as universal. Disabling the tool does not convert images to text.

[tools]
view_image = false

Official Codex configuration reference ↗

4. Restart and verify

Restart Codex and send a text-only task with Atria-Dawn-Preview. Check that no catalog parsing errors or missing-metadata warnings appear. For images, screenshots, or PDFs, run OCR or text extraction outside the client and paste the text instead of relying on binary attachments.

codex --model Atria-Dawn-Preview

WorkBuddy

Open model settings, choose a custom model, and enter:

Provider: Custom / OpenAI CompatibleBase URL: https://api.atria-asi.ai/v1API Key: atr_xxxModel: Atria-Dawn-PreviewAPI: Chat Completions

Save, select Atria-Dawn-Preview, and send a short task to verify the connection.

Qoder

Open model settings, choose a custom model, and enter:

Provider: Custom → OpenAI CompatibleAPI: Responses APIBase URL: https://api.atria-asi.ai/v1API Key: atr_xxxModel ID: Atria-Dawn-Preview

Save, select Atria-Dawn-Preview, and send a short task to verify the connection.

OpenClaw

Register a custom provider in the OpenClaw config and set the default model to atria/Atria-Dawn-Preview.

{
  agents: { defaults: { model: { primary: "atria/Atria-Dawn-Preview" } } },
  models: { providers: { atria: {
    baseUrl: "https://api.atria-asi.ai/v1",
    apiKey: "${ATRIA_API_KEY}",
    api: "openai-responses",
    models: [{ id: "Atria-Dawn-Preview", name: "Atria Dawn Preview" }]
  } } }
}

Hermes

Run hermes model, choose Custom endpoint, and enter:

Base URL: https://api.atria-asi.ai/v1API Key: atr_xxxModel: Atria-Dawn-PreviewFormat: OpenAI

Save, select Atria-Dawn-Preview, and send a short task to verify the connection.

Rate limits

Each account has a total limit on requests per minute, shared by every API key under the account and by all three APIs: Chat Completions, Messages, and Responses. Exceeding it returns 429 with these headers:

Retry-After: 42        # seconds to waitx-rpm-limit: 60        # per-minute capx-rpm-remaining: 0     # remaining this minute

Retry-After is the suggested wait in seconds, x-rpm-limit is the per-minute cap, and x-rpm-remaining is how many requests are left this minute. Successful responses carry the same pair, so clients can back off adaptively. The limit resets on a fixed minute boundary, and a request that fails returns its count to the window.

Common status codes

401The API key is invalid or revoked
429Rate limit exceeded or quota exhausted
5xxService temporarily unavailable; try again later