Overview
airpx is a multi-provider AI gateway that exposes 330+ models from 30 providers through a single, unified API. It is fully compatible with both the OpenAI and Anthropic APIs, so you can use it as a drop-in replacement in any tool or SDK that supports those formats.
Key features: smart routing across multiple provider keys, automatic failover, per-model pricing with token-level billing, streaming with SSE, tool/function calling, thinking/reasoning support, and a growing catalog of free models.
Base URL (OpenAI-compatible): https://airpx.cc/v1 — Base URL (Anthropic-compatible): https://airpx.cc
Quick Start
Get up and running in three steps.
1. Sign up at https://airpx.cc and create an API key in the dashboard. 2. Set your base URL to https://airpx.cc/v1 (OpenAI) or https://airpx.cc (Anthropic). 3. Send your first request:
curl https://airpx.cc/v1/chat/completions \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4-reason",
"messages": [{"role": "user", "content": "Hello!"}]
}'That's it! Many models including grok-4-reason are free — you can start immediately after signing up.
Authentication
All /v1/* proxy endpoints accept your API key via one of two headers.
Pass your proxy key (starts with sk-proxy-*) in either header: • x-api-key: YOUR_KEY • Authorization: Bearer YOUR_KEY Both headers are interchangeable. Use whichever your tool or SDK supports.
Important: proxy keys (sk-proxy-*) are used for /v1/* endpoints only. They are NOT the same as dashboard login tokens.
curl https://airpx.cc/v1/chat/completions \
-H "x-api-key: sk-proxy-abc123" \
-H "Content-Type: application/json" \
-d '{"model": "grok-4-reason", "messages": [{"role": "user", "content": "Hi"}]}'API Reference
Public proxy endpoints. All require a valid API key.
/v1/chat/completionsChat completion (OpenAI format). Streaming supported./v1/messagesAnthropic Messages API (native format). Streaming supported./v1/responsesOpenAI Responses API (Codex CLI). Streaming supported./v1/modelsModel catalog with pricing and capabilities./v1/embeddingsText embedding generation (OpenAI format)./v1/audio/transcriptionsAudio transcription (Whisper-compatible).All endpoints accept JSON request bodies and return JSON responses. For streaming, set "stream": true and receive Server-Sent Events (SSE).
Integrations
airpx works as a drop-in backend for popular coding assistants and AI tools.
🔧Claude Code
- Add environment variables to ~/.bashrc or ~/.zshrc
- Run claude as usual
export ANTHROPIC_BASE_URL=https://airpx.cc
export ANTHROPIC_API_KEY=YOUR_KEY
# Then just run:
claude🔧Pi Coding Agent
- Set Anthropic environment variables
- Run pi as usual — uses /v1/messages with streaming SSE
export ANTHROPIC_BASE_URL=https://airpx.cc
export ANTHROPIC_API_KEY=YOUR_KEY
# Or in .env / config:
ANTHROPIC_BASE_URL=https://airpx.cc
ANTHROPIC_API_KEY=YOUR_KEY🔧Cursor
- Open Settings → Models → OpenAI API Key + Base URL
- Enter your airpx key and base URL
API Key: YOUR_KEY
Base URL: https://airpx.cc/v1🔧Cline (VS Code)
- Open extension settings → API Provider → OpenAI Compatible
- Enter your airpx key and base URL
Base URL: https://airpx.cc/v1
API Key: YOUR_KEY
Model: claude-opus-4🔧Aider
- Set OPENAI_BASE_URL environment variable
- Run aider with any supported model
export OPENAI_BASE_URL=https://airpx.cc/v1
export OPENAI_API_KEY=YOUR_KEY
aider --model claude-opus-4🔧OpenCode
- Set OPENAI_BASE_URL environment variable
- Run opencode
export OPENAI_BASE_URL=https://airpx.cc/v1
export OPENAI_API_KEY=YOUR_KEY
opencode🔧Codex CLI
- Set openai_base_url in ~/.codex/config.toml
- Export OPENAI_API_KEY and run codex
openai_base_url = "https://airpx.cc/v1"SDKs
Use standard OpenAI and Anthropic SDKs — just point them at airpx.
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://airpx.cc/v1",
api_key="YOUR_KEY"
)
r = client.chat.completions.create(
model="grok-4-reason", # free
messages=[{"role": "user", "content": "Hello!"}]
)
print(r.choices[0].message.content)Models
airpx exposes 330+ models across 30 providers. Browse the full catalog at /v1/models.
The model catalog is available at GET /v1/models and returns all active models with their pricing, capabilities, and provider information.
Models are split into free and paid tiers. Many models are available for free — check GET /v1/models for the current list (free models show $0 pricing). Paid models are billed per 1M tokens with separate rates for input, output, cache read, and cache write tokens. Example pricing: grok-4-fast $0.20/$0.50, gpt-5.5 $5/$30, claude-opus-4 $5/$25 per 1M tokens (input/output).
curl https://airpx.cc/v1/models \
-H "x-api-key: YOUR_KEY"Billing
Prepaid balance with token-level billing.
airpx uses a prepaid balance model. You top up your balance in the dashboard, and each request deducts the cost based on actual token usage and the model's pricing.
Billing is calculated per request based on: • Input tokens × model input price (per 1M tokens) • Output tokens × model output price (per 1M tokens) • Cache read tokens × cache read price • Cache write tokens × cache write price Your balance is checked before each request. If insufficient, the request returns HTTP 402 (Payment Required).
Free models do not deduct from your balance and can be used without topping up. Check the Models page or GET /v1/models for the current free model list.
Streaming
Both OpenAI and Anthropic formats support real-time streaming via Server-Sent Events (SSE).
Set "stream": true in your request body to receive incremental responses. The proxy streams directly from the upstream provider, preserving the original SSE format for both OpenAI and Anthropic protocols.
{
"model": "grok-4-reason",
"stream": true,
"messages": [{"role": "user", "content": "Hello!"}]
}Thinking / reasoning is also supported. Use reasoning_effort (OpenAI style) or thinking: {type: "enabled", budget_tokens: N} (Anthropic style). Responses include reasoning_content or thinking blocks accordingly.
{
"model": "claude-opus-4",
"reasoning_effort": "high",
"stream": true,
"messages": [{"role": "user", "content": "Solve this step by step..."}]
}Bring Your Own Key
Use your own provider API keys for direct access and custom billing.
If you have your own API key from a provider (e.g., OpenAI, Anthropic, Google), you can configure it in the dashboard. Requests routed through your own key are billed directly by the provider — airpx acts as a transparent proxy.
BYOK is useful when you need higher rate limits, specific model access, or prefer to use your existing provider agreement. Your own keys are never shared with other users.
Limits & Errors
HTTP status codes and common error scenarios.
The proxy returns standard HTTP status codes: • 401 Unauthorized — invalid or missing API key • 402 Payment Required — insufficient balance for the requested model • 403 Forbidden — model not allowed for your key or account tier • 429 Too Many Requests — rate limit exceeded, retry after backoff • 500 Internal Server Error — unexpected proxy error • 502 Bad Gateway — upstream provider error or timeout
Rate limits depend on your account tier and key configuration. If you hit a 429, wait a few seconds and retry. Balance errors (402) require topping up in the dashboard.