API Documentation
CheapAI gives you OpenAI-compatible access to Claude, GPT-5, Gemini, and DeepSeek at up to 65% off official list prices. Same endpoints, real models, lower cost.
⚡ Connect Any App in 3 Steps
Works with any app that supports OpenAI or OpenAI Compatible connection. Just 3 simple changes:
Change Base URL
Set your base URL to:
https://cheapai-netifly-app.up.railway.app
Add Your API Key
Use the API key and base URL from your completed delivery flow:
Pricing and activation flow →Choose a Model
Pick from our available models:
Browse Models →Popular: openai/gpt-5.4, anthropic/claude-sonnet-4-6-20260217, google/gemini-3-pro-preview
✅ That's it! You're ready to go.
If the app has an "OpenAI" or "OpenAI Compatible" option, just switch the base URL and use your API key. No other changes needed.
Example: Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
base_url="https://cheapai-netifly-app.up.railway.app", # ← Change this
api_key="your-api-key-here" # ← Your API key
)
response = client.chat.completions.create(
model="openai/gpt-5.4", # ← Any model from /models
messages=[{"role": "user", "content": "Hello!"}]
)
Example: cURL
curl https://cheapai-netifly-app.up.railway.app/chat/completions \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-5.4", "messages": [{"role": "user", "content": "Hello!"}]}'
🔧 Advanced Configuration
Detailed API reference and tool-specific integration guides below.
🚀 Quick Start
Our API is 100% OpenAI-compatible. Just change the base URL and you're ready.
Three Things You Need
| Base URL | https://cheapai-netifly-app.up.railway.app |
| API Key | Get yours at Pricing |
| Models | Browse available models |
30-Second Setup
# Install: pip install openai
from openai import OpenAI
client = OpenAI(
api_key="your-api-key-here",
base_url="https://cheapai-netifly-app.up.railway.app"
)
response = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
🔑 Authentication
Get Your API Key
- Visit Pricing
- Complete the purchase flow and wait for payment confirmation
- Use the API key and base URL delivered by email. If your product includes a separate dashboard activation step, follow the instructions in that delivery message.
Using Your API Key
Include your API key in the Authorization header as a Bearer token:
curl https://cheapai-netifly-app.up.railway.app/chat/completions \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-5.4", "messages": [{"role": "user", "content": "Hello!"}]}'
🌐 Base URL
All API requests should be made to:
https://cheapai-netifly-app.up.railway.app
Endpoints
/chat/completions
Create chat completions
/models
List available models
/embeddings
Create embeddings
📋 Available Models
Browse all models at CheapAI Models directory — Claude, GPT-5, Gemini, and DeepSeek available via one OpenAI-compatible endpoint.
Model Catalog
| Model ID | Provider | Context | Input | Output | Savings |
|---|---|---|---|---|---|
openai/gpt-5.4 | OpenAI | See docs | $2.50/1M | $15.00/1M | 50%-65% |
openai/gpt-5.3-codex | OpenAI | See docs | $1.75/1M | $14.00/1M | 50%-65% |
openai/gpt-5.2-codex | OpenAI | See docs | $1.75/1M | $14.00/1M | 50%-65% |
openai/gpt-5.2 | OpenAI | See docs | $1.75/1M | $14.00/1M | 50%-65% |
anthropic/claude-sonnet-4-6-20260217 | Anthropic | See docs | $3.00/1M | $15.00/1M | 50%-65% |
anthropic/claude-opus-4-6-20260205 | Anthropic | See docs | $5.00/1M | $25.00/1M | 50%-65% |
anthropic/claude-opus-4-5-20251101 | Anthropic | See docs | $5.00/1M | $25.00/1M | 50%-65% |
anthropic/claude-haiku-4-5-20251001 | Anthropic | See docs | $1.00/1M | $5.00/1M | 50%-65% |
deepseek/deepseek-v3.2 | DeepSeek | See docs | $0.28/1M | $0.42/1M | 50%-65% |
google/gemini-3-pro-preview | See docs | $2.00/1M | $12.00/1M | 50%-65% | |
google/gemini-3-flash-preview | See docs | $0.50/1M | $3.00/1M | 50%-65% |
Model Aliases
Use short names for convenience:
| Model | Full Model ID |
|---|---|
openai/gpt-5.4 | openai/gpt-5.4 |
openai/gpt-5.3-codex | openai/gpt-5.3-codex |
openai/gpt-5.2-codex | openai/gpt-5.2-codex |
openai/gpt-5.2 | openai/gpt-5.2 |
anthropic/claude-sonnet-4-6-20260217 | anthropic/claude-sonnet-4-6-20260217 |
anthropic/claude-opus-4-6-20260205 | anthropic/claude-opus-4-6-20260205 |
anthropic/claude-opus-4-5-20251101 | anthropic/claude-opus-4-5-20251101 |
anthropic/claude-haiku-4-5-20251001 | anthropic/claude-haiku-4-5-20251001 |
deepseek/deepseek-v3.2 | deepseek/deepseek-v3.2 |
google/gemini-3-pro-preview | google/gemini-3-pro-preview |
google/gemini-3-flash-preview | google/gemini-3-flash-preview |
List Models via API
curl https://cheapai-netifly-app.up.railway.app/models \
-H "Authorization: Bearer your-api-key-here"
📖 Chat Completions
/v1/chat/completions
Request Body
{
"model": "openai/gpt-5.4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"max_tokens": 4096,
"stream": false
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Model ID to use |
messages |
array | Yes | Conversation messages |
temperature |
number | No | Sampling temperature (0-2) |
max_tokens |
integer | No | Maximum tokens to generate |
stream |
boolean | No | Enable streaming responses |
top_p |
number | No | Nucleus sampling parameter |
stop |
array | No | Stop sequences |
Response
{
"id": "chatcmpl-xxx",
"object": "chat.completion",
"created": 1234567890,
"model": "openai/gpt-5.4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 20,
"total_tokens": 30
}
}
⚡ Streaming Responses
Enable streaming by setting stream: true:
response = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Write a poem"}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
🔌 Integrations
Our API works with any tool that supports OpenAI-compatible endpoints.
💻 Claude Code
Anthropic's official CLI tool. Use claude-code-router to connect it to CheapAI for access to Claude at up to 65% off Anthropic's official API pricing. See the Claude Code setup guide for the full walkthrough.
Powered by: This integration uses claude-code-router by musistudio. If you encounter any issues, check their Issues section.
Step 1: Install Claude Code & Router
npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-router
Step 2: Create Config File
Create the config file at:
- Windows:
C:\Users\YOUR_NAME\.claude-code-router\config.json - Mac/Linux:
~/.claude-code-router/config.json
{
"Providers": [{
"name": "CheapAI",
"api_base_url": "https://cheapai-netifly-app.up.railway.app/chat/completions",
"api_key": "YOUR_API_KEY",
"models": ["openai/gpt-5.4", "openai/gpt-5.3-codex", "anthropic/claude-sonnet-4-6-20260217", "google/gemini-3-pro-preview", "deepseek/deepseek-v3.2"]
}],
"Router": {
"default": "CheapAI,openai/gpt-5.4",
"background": "CheapAI,deepseek/deepseek-v3.2",
"think": "CheapAI,anthropic/claude-opus-4-6-20260205",
"longContext": "CheapAI,google/gemini-3-pro-preview",
"longContextThreshold": 60000
}
}
Step 3: Start Coding
ccr code
Useful Commands
ccr code |
Start Claude Code with router |
ccr start |
Start router server in background |
ccr stop |
Stop router server |
ccr model |
Switch model interactively |
ccr ui |
Open web UI for config management |
ccr restart |
Restart router (after config changes) |
Model Switching
Switch models on-the-fly in Claude Code:
/model CheapAI,anthropic/claude-opus-4-6-20260205
Router Config Options
default |
Default model for general tasks |
background |
Model for background tasks (cost-saving) |
think |
Model for reasoning-heavy tasks (Plan Mode) |
longContext |
Model for long contexts (>60K tokens) |
webSearch |
Model for web search tasks |
Tip: After modifying the config file, run ccr restart for changes to take effect.
🤖 Codex CLI
OpenAI's Codex CLI supports custom providers through environment variables.
Installation
npm install -g @openai/codex
Configuration
Mac/Linux:
export CheapAI_API_KEY="your-api-key-here"
export CheapAI_BASE_URL="https://cheapai-netifly-app.up.railway.app"
Windows (PowerShell):
$env:CheapAI_API_KEY="your-api-key-here"
$env:CheapAI_BASE_URL="https://cheapai-netifly-app.up.railway.app"
Run
codex --provider CheapAI "your prompt here"
🦘 Roo Code
VSCode extension for AI-assisted coding.
Installation
- Open VSCode
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Roo Code"
- Click Install
Configuration
- Open Roo Code in VSCode
- Click Configure Provider
- Add an OpenAI Compatible provider
- Enter settings:
| OpenAI Base URL | https://cheapai-netifly-app.up.railway.app |
| API Key | Your API key |
| Model | openai/gpt-5.4 or any model |
⚡ Kilo Code
Powerful VSCode extension for AI coding.
Installation
- Open VSCode
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Kilo Code"
- Click Install
Configuration
Same as Roo Code - add an OpenAI Compatible provider with:
| OpenAI Base URL | https://cheapai-netifly-app.up.railway.app |
| API Key | Your API key |
| Model | openai/gpt-5.4 |
🤖 Droid CLI
Terminal-based AI coding assistant from Factory AI.
Installation
macOS/Linux:
curl -fsSL https://app.factory.ai/cli | sh
Windows:
irm https://app.factory.ai/cli | iex
Configuration
Edit ~/.factory/config.json:
{
"custom_models": [
{
"model_display_name": "CheapAI-gpt5",
"model": "openai/gpt-5.4",
"base_url": "https://cheapai-netifly-app.up.railway.app",
"api_key": "YOUR_API_KEY",
"provider": "generic-chat-completion-api",
"max_tokens": 128000
}
]
}
🦞 OpenClaw
AI agent framework supporting Telegram, Discord, and more.
Download
Configuration
Config file location:
- Windows:
C:\Users\YOUR_NAME\.openclaw\openclaw.json - Mac/Linux:
~/.openclaw/openclaw.json
{
"models": {
"providers": {
"custom": {
"baseUrl": "https://cheapai-netifly-app.up.railway.app",
"apiKey": "YOUR_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "openai/gpt-5.4",
"name": "GPT-5",
"contextWindow": 400000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "custom/openai/gpt-5.4" }
}
}
}
🔄 n8n
Workflow automation tool that supports OpenAI nodes.
Setup
- Open n8n workflow editor
- Add an OpenAI or AI Agent node
- Configure credentials:
| Base URL | https://cheapai-netifly-app.up.railway.app |
| API Key | Your API key |
💻 Code Examples
Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="your-api-key-here",
base_url="https://cheapai-netifly-app.up.railway.app"
)
# Basic completion
response = client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
# Streaming
for chunk in client.chat.completions.create(
model="openai/gpt-5.4",
messages=[{"role": "user", "content": "Write a story"}],
stream=True
):
print(chunk.choices[0].delta.content or "", end="")
JavaScript/TypeScript
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'your-api-key-here',
baseURL: 'https://cheapai-netifly-app.up.railway.app',
});
const response = await client.chat.completions.create({
model: 'openai/gpt-5.4',
messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
cURL
curl https://cheapai-netifly-app.up.railway.app/chat/completions \
-H "Authorization: Bearer your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4",
"messages": [{"role": "user", "content": "Hello!"}]
}'
LangChain (Python)
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="openai/gpt-5.4",
openai_api_key="your-api-key-here",
openai_api_base="https://cheapai-netifly-app.up.railway.app"
)
response = llm.invoke("Hello!")
print(response.content)
💰 Pricing
Pay as you go - no monthly fees, no minimum spend.
Compare and Save
| Model | Official Input | Our Input | Official Output | Our Output | Savings |
|---|---|---|---|---|---|
| GPT 5.4 (openai/gpt-5.4) | $2.50/1M | $1.25/1M | $15.00/1M | $7.50/1M | 50% |
| GPT 5.3 Codex (openai/gpt-5.3-codex) | $1.75/1M | $0.88/1M | $14.00/1M | $7.00/1M | 50% |
| GPT 5.2 Codex (openai/gpt-5.2-codex) | $1.75/1M | $0.88/1M | $14.00/1M | $7.00/1M | 50% |
| GPT 5.2 (openai/gpt-5.2) | $1.75/1M | $0.88/1M | $14.00/1M | $7.00/1M | 50% |
| Claude Sonnet 4.6 (anthropic/claude-sonnet-4-6-20260217) | $3.00/1M | $1.50/1M | $15.00/1M | $7.50/1M | 50% |
| Claude Opus 4.6 (anthropic/claude-opus-4-6-20260205) | $5.00/1M | $2.50/1M | $25.00/1M | $12.50/1M | 50% |
| Claude Opus 4.5 (anthropic/claude-opus-4-5-20251101) | $5.00/1M | $2.50/1M | $25.00/1M | $12.50/1M | 50% |
| Claude Haiku 4.5 (anthropic/claude-haiku-4-5-20251001) | $1.00/1M | $0.50/1M | $5.00/1M | $2.50/1M | 50% |
| DeepSeek V3.2 (deepseek/deepseek-v3.2) | $0.28/1M | $0.14/1M | $0.42/1M | $0.21/1M | 50% |
| Gemini 3 Pro (google/gemini-3-pro-preview) | $2.00/1M | $1.00/1M | $12.00/1M | $6.00/1M | 50% |
| Gemini 3 Flash (google/gemini-3-flash-preview) | $0.50/1M | $0.25/1M | $3.00/1M | $1.50/1M | 50% |
Need pricing details first? Start from Pricing and choose the product that matches your workflow.
❓ FAQ
General Questions
Q: Is this API really OpenAI-compatible?
Yes! Our API uses the exact same request/response format as OpenAI. Any code or tool that works with OpenAI will work with CheapAI.
Q: How does CheapAI offer up to 65% off official AI API prices?
CheapAI aggregates usage across many developers and teams, purchasing API access at volume. The savings from bulk purchasing are passed directly to customers. You access the same real models through our OpenAI-compatible proxy — no code changes needed beyond the base URL.
Q: Is there a rate limit?
The service is designed for real developer workloads, but infrastructure protections and fair-use controls may still apply when needed for stability or abuse prevention.
Q: Do you store my data?
We aim to minimize retained data. Temporary technical processing or short-lived optimization layers may be used where needed for delivery, stability, or abuse prevention, and you should avoid placing real API keys in committed project files.
Which tool should I use?
- Claude Code - Best for terminal-based coding
- Roo Code / Kilo Code - Best for VSCode users
- Codex CLI - Best for OpenAI ecosystem
- Droid CLI - Best for Factory AI users
- OpenClaw - Best for multi-channel AI agents
- n8n - Best for workflow automation
Which model should I use?
- openai/gpt-5.4 - Best general-purpose OpenAI default
- anthropic/claude-opus-4-6-20260205 - Highest-end Claude reasoning
- anthropic/claude-sonnet-4-6-20260217 - Fast daily Claude default
- google/gemini-3-pro-preview - Long-context premium option
- deepseek/deepseek-v3.2 - Code generation
🆘 Support
| Website | CheapAI.com |
| Pricing & delivery | Pricing |
| Models | cheap AI Models |
| Contact | Telegram Support |
🚀 Start Here
- Choose the matching plan at Pricing
- Set your base URL to
https://cheapai-netifly-app.up.railway.app - Start making requests!