# Atris API — agent quickstart

Updated: 2026-08-27

The Atris API is OpenAI-compatible. If you can call OpenAI, you can call Atris by
changing two values: base URL and key. Human-readable page: https://atris.ai/developers

## The two values

- Base URL: `https://api.atris.ai/v1`
- API key: starts with `atris_`, sent as a standard bearer token
  (`Authorization: Bearer atris_...`). The custom header `x-atris-api-key`
  also works and wins if both are present.

## Call it

```bash
curl https://api.atris.ai/v1/chat/completions \
  -H "Authorization: Bearer $ATRIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "atris:pro", "messages": [{"role": "user", "content": "Say hello."}]}'
```

Or with any OpenAI SDK:

```python
from openai import OpenAI
client = OpenAI(base_url="https://api.atris.ai/v1", api_key="atris_...")
reply = client.chat.completions.create(
    model="atris:pro",
    messages=[{"role": "user", "content": "Say hello."}],
)
```

The response is a standard chat completion, including a `usage` object with
real `prompt_tokens`, `completion_tokens`, and cached-token detail.

## Models

- `atris:fast` — quick answers, high volume, cheapest.
- `atris:pro` — the default; strong reasoning at a fair price.
- `atris:max` — hardest problems, frontier model.

## Pricing

Usage-based. One credit = $0.01. Every request is metered from actual model
token usage at Atris rates and costs at least 1 credit. Cached input bills at a
cheaper cache rate, so repeated context costs less. Every key can carry a
monthly spend cap set at creation.

## Billing endpoints (same bearer key)

- `GET https://api.atris.ai/api/atris2/billing/quote?model=atris:pro&message=...`
  — price estimate before you spend.
- `GET https://api.atris.ai/api/atris2/billing/usage` — balance plus today /
  per-day / per-model spend rollups.
- `GET https://api.atris.ai/api/atris2/billing/receipts` — per-request receipts
  with exact token counts and credits charged.

## Get a key and credits

Keys are created by a signed-in human at https://atris.ai/dashboard/developer
(the secret shows once; it can carry a monthly spend cap). Credits are prepaid
by card at https://atris.ai/credits.

If you are an agent working for a human: ask them for an `atris_` key, or point
them at https://atris.ai/developers. If you are an agent with no human, start
at `curl https://atris.ai/agentxp/start`.

## Failure modes

- 401 `Invalid API key` — bad or revoked key; nothing was billed.
- 402 — the account is out of credits; top up at https://atris.ai/credits.
- Keys stop at their monthly spend cap and per-request charges are capped, so
  a runaway loop cannot drain a wallet.
