Quickstart

The Atraly API speaks an OpenAI-compatible format. By changing the base URL and key, you can use the OpenAI SDK — or any OpenAI-compatible software — to access Atraly.

ParamValue
base_urlhttps://api.atraly.com/v1
api_keyCreate one in the API console
modelaorila-1

Your first API call

Once you have a key, send your first chat request. Set stream to true for a streaming response.

curl https://api.atraly.com/v1/chat \
  -H "Authorization: Bearer $ATRALY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aorila-1",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ],
    "stream": false
  }'
from openai import OpenAI

client = OpenAI(
    api_key="$ATRALY_API_KEY",
    base_url="https://api.atraly.com/v1",
)

resp = client.chat.completions.create(
    model="aorila-1",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.ATRALY_API_KEY,
  baseURL: "https://api.atraly.com/v1",
});

const resp = await client.chat.completions.create({
  model: "aorila-1",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);
Note
Everything on this page works against the live API today. Create a key in the API console at api.atraly.com and the examples below run as-is.

Authentication

The API uses Bearer tokens. Pass your key in the Authorization header on every request:

Authorization: Bearer $ATRALY_API_KEY

Create and rotate keys from the API console. Never embed keys in client-side code.

Chat API

POST /v1/chat takes a messages array and returns the reply as OpenAI-style JSON:

{
  "choices": [{ "message": { "content": "..." } }],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 48,
    "total_tokens": 60
  },
  "billing": { "credits_charged": 0.0012 }
}

The last 20 messages are used, each capped at 8000 characters. Unknown models and requests with no user message return 400. GET /v1/models lists the models you can call.

Models

ModelDescription
aorila-1Atraly 1 — flagship. The latest Atraly intelligence.
aorila-1.2Atraly 1.2 — balanced.
aorila-1.1Atraly 1.1 — fast, efficient.

atraly-1 and atraly-deep are accepted as aliases for aorila-1.

Pricing

One flat rate for every model — no tiers, no subscription. Top up credits in the API console and pay only for the tokens you use. 1 credit = $1.

ModelInput · per 1M tokensOutput · per 1M tokens
aorila-1 — Atraly 1 (flagship)$3.00$10.00
aorila-1.2 — Atraly 1.2 (balanced)$3.00$10.00
aorila-1.1 — Atraly 1.1 (fast, efficient)$3.00$10.00

Every call is metered per API key into your usage ledger. If a request would exceed your balance, it returns 402 before the model is called.

Minimum top-up is $10. Credits never expire. All top-ups are final and non-refundable.

Volume discounts

Discounts apply automatically each calendar month on all tokens used:

Monthly usageDiscountInput · per 1M tokensOutput · per 1M tokens
Up to 100M tokensList price$3.00$10.00
100M–500M10% off$2.70$9.00
500M–2B20% off$2.40$8.00
2B–10B30% off$2.10$7.00
10B+40% off$1.80$6.00

Need committed-use pricing against a 12-month monthly floor? Talk to us: api@atraly.com.

Rate limits

Limits are enforced per API key:

LimitValue
Requests per minute60
Concurrent requests10

When a limit is hit the API returns 429 with a Retry-After header telling you how many seconds to wait before retrying.

Files

In the app, attach text files and photos straight from the composer — they sit beside the prompt in the same thread.

Errors

Errors come back as JSON with an error field.

CodeMeaning
401The key is bad or revoked.
400Bad request — unknown model or no user message.
429Rate limit hit — wait the Retry-After seconds, then retry.