One OpenAI-compatible endpoint.
Every GPT model. A fraction of the price.

CaptainRouter gives you an API key that works with the OpenAI SDKs, Codex and any tool that speaks the OpenAI API. Change the base URL, keep your code.

$5 free on sign-up. No card required to start.

Drop-in compatible

Chat Completions, Responses, streaming, tools, structured outputs and image generation. Point the official SDK at https://captainrouter.net/v1 and it just works.

Pay as you go

Prepaid balance in USD, charged per token. No subscription, no minimum monthly spend. Top up by card whenever you need.

Full visibility

Every request in the dashboard: model, tokens, cached input, latency and exact cost. Per-key spend limits and expiry dates.

Two lines to switch

Use the OpenAI SDK you already have. Only the API key and the base URL change.

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_CAPTAINROUTER_KEY",
    base_url="https://captainrouter.net/v1",
)

response = client.chat.completions.create(
    model="gpt-6-luna",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CAPTAINROUTER_API_KEY,
  baseURL: "https://captainrouter.net/v1",
});

const response = await client.responses.create({
  model: "gpt-6-sol",
  input: "Write a haiku about routers.",
});
console.log(response.output_text);
curl https://captainrouter.net/v1/chat/completions \
  -H "Authorization: Bearer $CAPTAINROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "Hello!"}]}'

Models

All reasoning models of the GPT-6 and GPT-5.6 families plus image generation. The live list is always at GET /v1/models, prices per 1M tokens are on the pricing page in the dashboard.

gpt-6.2-astraflagship
gpt-6-astraflagship
gpt-6.2-solbalanced
gpt-6.1-solbalanced
gpt-6-solbalanced
gpt-6.1-terrafast
gpt-6-lunacheapest
gpt-5.6-solbalanced
gpt-5.6-terrafast
gpt-5.6-lunacheapest
gpt-image-2.5images

Works with Codex

Run Codex CLI or the Codex app on your CaptainRouter balance. Add a provider to ~/.codex/config.toml, restart Codex and start a new chat.

The same works for any agent or IDE plugin with an OpenAI-compatible provider setting: Cline, Continue, Aider, LangChain, LlamaIndex and others.

model_provider = "captainrouter"

[model_providers.captainrouter]
name = "CaptainRouter"
base_url = "https://captainrouter.net/v1"
env_key = "CAPTAINROUTER_API_KEY"
wire_api = "responses"

Good to know

Send a thread-id

Pass a thread-id header, one unique value per conversation. It keeps parallel chats apart and makes cached input work.

Zero data retention

Conversations are not stored. Send the full history with every request; previous_response_id is not supported.

Cached input is cheap

Repeated prompt prefixes are billed at a fraction of the input price, and cache writes are free.

Start with $5 on us

Create an account, confirm your email and get a key with $5 of free credit.

Open the dashboard