airpx — Multi-provider AI Gateway

330+ models · 30 providers · OpenAI & Anthropic compatible

A single API endpoint that routes your requests to the best available provider. Drop-in replacement for OpenAI and Anthropic SDKs — works with Claude Code, Cursor, Aider, Codex CLI, Pi Coding Agent, and more.

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
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.

POST/v1/chat/completionsChat completion (OpenAI format). Streaming supported.
POST/v1/messagesAnthropic Messages API (native format). Streaming supported.
POST/v1/responsesOpenAI Responses API (Codex CLI). Streaming supported.
GET/v1/modelsModel catalog with pricing and capabilities.
POST/v1/embeddingsText embedding generation (OpenAI format).
POST/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

  1. Add environment variables to ~/.bashrc or ~/.zshrc
  2. Run claude as usual
bash
export ANTHROPIC_BASE_URL=https://airpx.cc
export ANTHROPIC_API_KEY=YOUR_KEY

# Then just run:
claude

🔧Pi Coding Agent

  1. Set Anthropic environment variables
  2. Run pi as usual — uses /v1/messages with streaming SSE
bash
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

  1. Open Settings → Models → OpenAI API Key + Base URL
  2. Enter your airpx key and base URL
text
API Key: YOUR_KEY
Base URL: https://airpx.cc/v1

🔧Cline (VS Code)

  1. Open extension settings → API Provider → OpenAI Compatible
  2. Enter your airpx key and base URL
text
Base URL: https://airpx.cc/v1
API Key: YOUR_KEY
Model: claude-opus-4

🔧Aider

  1. Set OPENAI_BASE_URL environment variable
  2. Run aider with any supported model
bash
export OPENAI_BASE_URL=https://airpx.cc/v1
export OPENAI_API_KEY=YOUR_KEY

aider --model claude-opus-4

🔧OpenCode

  1. Set OPENAI_BASE_URL environment variable
  2. Run opencode
bash
export OPENAI_BASE_URL=https://airpx.cc/v1
export OPENAI_API_KEY=YOUR_KEY

opencode

🔧Codex CLI

  1. Set openai_base_url in ~/.codex/config.toml
  2. 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).

List models
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.

FAQ

Is airpx OpenAI-compatible?
Yes. airpx is a drop-in replacement for the OpenAI API. Point any OpenAI SDK or tool at https://airpx.cc/v1 and it will work out of the box.
Is the Anthropic Messages API supported?
Yes. airpx natively supports the Anthropic Messages format at POST /v1/messages. Set your Anthropic base URL to https://airpx.cc and use your airpx key.
Which auth header should I use?
You can use either x-api-key: YOUR_KEY or Authorization: Bearer YOUR_KEY. Both work identically for all /v1/* endpoints.
Where do I get an API key?
Sign up at https://airpx.cc, then create a proxy key in the dashboard. Keys start with sk-proxy-*.
Which models are free?
Many models are available for free. The list changes as providers update their offerings — check GET /v1/models for the current catalog. Free models show $0 pricing.
Does streaming work?
Yes. Set "stream": true in your request body. Both OpenAI and Anthropic formats stream via Server-Sent Events (SSE).
Does tools / function calling work?
Yes. Tools and function calling are fully supported for both OpenAI and Anthropic formats. Pass your tool definitions as usual.
Can I use my own provider key (BYOK)?
Yes. You can add your own OpenAI, Anthropic, or other provider keys in the dashboard. Requests routed through your key are billed by the provider directly.
Is there a Swagger / OpenAPI spec?
Yes. Visit /v1/docs for the interactive Swagger UI with the full OpenAPI specification.
How do I contact support?
Open an issue on our repository or reach out via the dashboard contact form.