Docs
The Gateway is OpenAI-compatible. If your code already talks to an OpenAI-style endpoint, changing the base URL and the key is the whole migration.
Quickstart
Base URL: https://api.aireadify.ai/v1. Get a key from the console, then:
from openai import OpenAI
client = OpenAI(
base_url="https://api.aireadify.ai/v1", # the only line that changes
api_key=AIREADIFY_API_KEY,
)
r = client.chat.completions.create(
model="groq/llama-3.3-70b",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.aireadify.ai/v1", // the only line that changes
apiKey: process.env.AIREADIFY_API_KEY,
});
const r = await client.chat.completions.create({
model: "mistral/mistral-small",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);curl https://api.aireadify.ai/v1/chat/completions \ -H "Authorization: Bearer $AIREADIFY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek/deepseek-chat", "messages": [{"role": "user", "content": "Hello"}] }'
Model ids follow provider/model. The full list with prices is on the Gateway page and from GET /v1/models.
Authentication
Send your key as a bearer token: Authorization: Bearer ak_live_…. Keys are shown once at creation and stored hashed. Test keys start with ak_test_ and are billed the same but are easy to tell apart in logs.
Chat completions
POST /v1/chat/completions accepts the OpenAI request schema: model, messages, temperature, max_tokens, stream, tools where the upstream supports them. max_tokens is capped at 8192 per request.
The response is the OpenAI response schema. model in the response is the id you requested, not the upstream name.
Streaming
Set "stream": true to receive server-sent events. The final chunk carries a usage block; the Gateway sets stream_options.include_usage for you, and billing is settled from that block. If a stream ends without a usage block, the request is held as unsettled with its reservation and reconciled against provider logs rather than billed as zero.
Models
GET /v1/models returns every enabled model with context_window, data_region and zero_retention so you can pick by policy, not only by price.
| Model | Provider | Context | Data region | Zero retention | Input / 1M | Output / 1M |
|---|---|---|---|---|---|---|
| deepseek/deepseek-chat | DeepSeek | 128k | CN | No | $0.34 | $1.38 |
| deepseek/deepseek-reasoner | DeepSeek | 128k | CN | No | $0.69 | $2.74 |
| groq/llama-3.3-70b | Groq | 128k | US | Yes | $0.74 | $0.99 |
| groq/llama-3.1-8b | Groq | 128k | US | Yes | $0.06 | $0.10 |
| mistral/mistral-large | Mistral | 128k | EU | On request | $2.50 | $7.50 |
| mistral/mistral-small | Mistral | 128k | EU | On request | $0.25 | $0.75 |
| xai/grok-4 | xAI | 256k | US | Yes | $3.75 | $18.75 |
Prices are upstream list price + 25%, in USD per million tokens, billed per token with no per-request minimum. Balances are kept in credits (1 credit = $0.001); fractions of a credit carry over to your next request, never rounded away. Confirmed at launch; DeepSeek requests are processed in China and are not eligible for zero-retention.
Errors
Errors use the OpenAI error envelope: {"error": {"message", "type", "code"}}.
| Status | code | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing, malformed or revoked key. |
| 402 | insufficient_quota | Account balance is zero. Top up in the console. |
| 402 | key_budget_exceeded | This key reached its monthly budget. |
| 404 | model_not_found | Unknown or disabled model id. |
| 429 | rate_limit_exceeded | Per-key requests per minute exceeded. See retry-after. |
| 502 / 503 | upstream_error, provider_unavailable | Upstream failed after failover. Not billed. |
Upstream 4xx errors (for example a content-policy rejection) are passed through with the provider's status and body, and are not billed.
Rate limits
Each key has a requests-per-minute limit, 60 by default and adjustable in the console. Every response carries an RFC 9331 RateLimit header: limit, remaining, reset (seconds).
Billing
- Price per token is upstream list price × 1.25, settled exactly from the
usageblock. No per-request minimum: fractions of a credit carry over to the next request. - Before each request the gateway reserves credits up to the request ceiling (estimated input tokens plus
max_tokens, timesn). A 402 withinsufficient_quotameans the reservation could not be covered; nothing was sent upstream. - Upstream errors are not billed. Streams are billed from the final chunk.
- Balance and per-key spend are visible in the console and via the account API.
- Credits do not expire. See the refund policy.
Response headers
| Header | Meaning |
|---|---|
x-request-id | Id to quote in support requests and to find the call in logs. |
x-aireadify-model | The model id that served the request. |
x-aireadify-provider | The upstream provider that served it, useful after failover. |
ratelimit | Per-key limit, remaining and reset. |
Scan API
The agent-readiness scanner is public and free: GET https://aireadify.ai/api/scan?url=example.com. No key needed; 10 scans per 10 minutes per IP. The response includes the 0–100 score, category scores, 20 checks with fix prompts, and a markdown summary. OpenAPI: /openapi.json.