aiml docs

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/completions speaks OpenAI; POST /v1/messages speaks 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/models lists 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). Send x-aiml-debug: 1 and x-aiml-route-trace explains 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-micro and in the response's aiml.cost object. Nothing is rounded twice.
  • A request id on everything. x-aiml-request-id (also the id of the response) works for GET /v1/generation/{id}, the console and support.

Base URL and keys

Base URLhttps://api.ai.ml
AuthAuthorization: Bearer aiml-live-… (or aiml-test-… for the sandbox)
Versionaiml-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

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.

On this page