AIRouter documentation

One API key. Every major LLM. Fully documented.

AIRouter exposes a single OpenAI, Anthropic, or Gemini-shaped API surface and routes each request to any combination of 37 active providers using 17 routing strategies and 5 combo types. These pages document every endpoint, every strategy, every combo, and the full production deployment path on Cloudflare Pages free tier.

Browse the documentation

What you can build

Chat completions

OpenAI-shaped POST /api/v1/chat/completions with streaming and non-streaming responses, translated to Anthropic, Gemini, or any custom upstream.

Embeddings, rerank, search

Speciality endpoints for embeddings, document reranking, content moderation, and web search through Tavily, Exa, SerpAPI, Jina, and others.

Media generation

Image generation, edits, variations, upscaling, audio TTS, transcriptions, video, and music generation through any compatible provider in the catalog.

Architecture at a glance

+-----------------------------------------------------+
|             Cloudflare Pages (Free Tier)             |
|                                                      |
|  Static assets (CDN)        Pages Functions (SSR)    |
|  - Landing, docs             - /api/v1/*  (router)   |
|  - Dashboard shell           - /api/auth/* (proxy)  |
|  - Islands hydrate            - /api/admin/*         |
|                              - /api/internal/*      |
|                                      |              |
|  In-memory credential cache (per-isolate, TTL)      |
|  - apiKeyCache: 5min                                 |
|  - credentialsCache: 5min                            |
|  - routingRulesCache: 60s                             |
|  - orgCache: 30s                                      |
+--------------------------------------+---------------+
                                       |
                                       v
                       Lightbase (airouter-beta)
                       14 collections, 40 providers seeded
                                       |
                                       v
                       Upstream LLM providers (30+)
                       OpenAI, Anthropic, Gemini, Groq, OpenRouter, ...
+-----------------------------------------------------+