Overview
One API key for every model. OpenAI and Anthropic wire formats, transparent routing, prepaid billing in integers.
aiml is an LLM gateway. You send requests in the wire format you already use (OpenAI Chat Completions or Anthropic Messages), name a model as vendor/model, and the gateway picks a provider endpoint, streams the reply back, meters it and bills your prepaid balance.
What you get
- Two dialects, one key.
POST /v1/chat/completionsspeaks OpenAI;POST /v1/messagesspeaks Anthropic. The official SDKs work unchanged; only the base URL and the key differ. - Every model behind one catalog. Model ids are
vendor/model(openai/gpt-5-mini,anthropic/claude-sonnet-4.6).GET /v1/modelslists them with prices and capabilities. - Routing you can see. The response tells you which provider served it (
x-aiml-provider,x-aiml-region) and how many attempts it took (x-aiml-attempts). Sendx-aiml-debug: 1andx-aiml-route-traceexplains the choice. - Prepaid, integer billing. Costs are micro-USD integers, reserved before the call and settled after it; the settled cost travels in
x-aiml-cost-microand in the response'saiml.costobject. Nothing is rounded twice. - A request id on everything.
x-aiml-request-id(also theidof the response) works forGET /v1/generation/{id}, the console and support.
Base URL and keys
| Base URL | https://api.ai.ml |
| Auth | Authorization: Bearer aiml-live-… (or aiml-test-… for the sandbox) |
| Version | aiml-version: 2026-09-01 header; defaults to the version pinned on the key |
Keys carry scopes: inference for calls, read:usage, read:credits, manage:credits, manage:keys, manage:policies for management routes. Create them in the console or with POST /v1/keys.
Where next
Quick start: OpenAI SDK
Quick start: Anthropic SDK
Quick start: curl
Migrate from OpenAI, Anthropic or OpenRouter
Errors
API reference
Every snippet in these docs is an include from the cookbook, which runs against a staging cell every night. If a snippet stops working, the build of this site fails before you see it.