AI Gateway
Add access to AI models through OpenRouter.
npx extraorbital add aiYou receive a gateway key, not a direct provider account. All team keys share a budget.
- 01 / Run the commandGet the service
- 02 / Read your .envUse its credentials
- 03 / Connect your appCall the SDK or API
Limits
| Limit | Free · Prototype | Paid |
|---|---|---|
| Models | Small models | Every model |
| Spend | $5.00, once per account | Shared team credit or budget |
Free allowances are shared across the account. Provider limits still apply on paid plans.
Use it
OpenAI-compatible example:
import OpenAI from "openai";
// Reads OPENROUTER_API_KEY and OPENROUTER_BASE_URL from the environment.
const client = new OpenAI({
apiKey: process.env.OPENROUTER_API_KEY,
baseURL: process.env.OPENROUTER_BASE_URL,
});
const response = await client.chat.completions.create({
model: "anthropic/claude-opus-5",
messages: [{ role: "user", content: "Draft a status report from these logs." }],
});The gateway also supports Anthropic Messages. See SDK recipes for compatible clients.
Environment variables
The CLI writes these to .env or an existing .env.local.
| Variable | Purpose |
|---|---|
OPENROUTER_BASE_URL | OpenRouter API endpoint |
OPENROUTER_API_KEY | Private gateway key |
Specifics
Options
npx extraorbital add ai [--slug <name>]| Flag | Default | Description |
|---|---|---|
--slug | default | A second key, for a second agent |
Model ids
Every model is named author/slug:
anthropic/claude-opus-5
openai/gpt-5.2
google/gemini-3-proAppend :free for a free variant where one exists, and ~author/…-latest for
an alias that follows the newest release. The model
list has all of them with current prices.
Budget
All team keys share one budget. --max-budget is accepted for compatibility but does not set a per-key limit.
Top-ups increase available credit. Imported usage from other services reduces it. Enable a hard cap in the dashboard to block gateway requests at your limit; raising the cap restores access with the same keys.
If you asked for a provider key
extraorbital add openai creates an OpenRouter key and writes an OpenAI-compatible base URL. It exits 8 to report the substitution. Other requested resources are processed first. Review model IDs and SDK compatibility before using the key.
Providers and keys lists every variable name this applies to and what gets written for each.
Pricing
| Usage | Paid rate |
|---|---|
| Models | Every model |
| Spend | Model list price |
See pricing for team subscription fees, allowances, and billing terms. Plans and billing ↗