altrouter.ai
DOCUMENTATION

API overview

altrouter is an OpenAI-compatible gateway. Point any OpenAI SDK at our base URL with your ar-… key — nothing else to change. One key, one balance, every model.

Base URLhttps://api.altrouter.ai/v1

Quickstart

Three steps: create a key, set the base URL to ours, and call any model from the catalog. The standard OpenAI SDK works unchanged.

PythonJavaScriptcURL
from openai import OpenAI

client = OpenAI(
    base_url="https://api.altrouter.ai/v1",
    api_key="ar-...",            # your altrouter key
)

resp = client.chat.completions.create(
    model="gpt-5.4",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Endpoints

POST/chat/completionsChat & text, with SSE streaming and tool calling.
POST/images/generationsImage generation & editing, results re-hosted to our CDN.
GET/modelsModel catalog: prices and available params.
GET/creditsYour account’s credit balance.

The full machine-readable spec — openapi.json. A per-endpoint breakdown is in the API reference.

NextAuthentication