Docs

Quickstart

AI Gate speaks the OpenAI API. If your code already calls OpenAI, you are one line away. There is no SDK to install and nothing to instrument.

1. Point at the gateway

Set the base URL and use your AI Gate key. Everything else — messages, streaming, tool calls, error shapes — stays exactly as it was.

curl
curl https://api.aigate.dev/v1/chat/completions \
  -H "Authorization: Bearer $AIGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "messages": [{ "role": "user", "content": "Hello" }],
    "stream": true
  }'

Python

main.py
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.aigate.dev/v1",
    api_key=os.environ["AIGATE_API_KEY"],
)

stream = client.chat.completions.create(
    model="anthropic/claude-opus-5",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Model strings are always provider/model. Browse the11 models in the catalog for the exact identifiers, prices and context limits.

2. Label your traffic (optional)

Add a metadata object and it rides along with the request. Those fields become the axes you slice cost and traces by later: trace_id groups an agent’s steps into one thread, session_id groups threads into a session, and tags are free form.

request bodyignored by the model, kept by us
{
  "model": "anthropic/claude-haiku-4-5",
  "messages": [ ... ],
  "metadata": {
    "trace_id": "checkout-agent-7f2a",
    "session_id": "sess_9182",
    "user_id": "u_1024",
    "tags": ["checkout", "v3-prompt"]
  }
}

Running with privacy mode on? Metadata is still recorded; the prompt and response bodies are not stored at all.

3. API reference

Two endpoints today. Both are OpenAI-shaped, so existing clients discover them without help.

  • POST/chat/completionsStreaming and non-streaming completions.
  • GET/modelsThe live catalog, served as OpenAI’s model list shape.
curl
curl https://api.aigate.dev/v1/models \
  -H "Authorization: Bearer $AIGATE_API_KEY"

Not there yet

These docs describe the private beta. Fallback chains, image inputs and batch are on the list, not in the gateway.Request access and tell us which one you need first.