# Code By AI > Code By AI is a third-party prepaid multi-model API gateway that routes requests to Claude, > OpenAI Codex and Gemini models through one gateway. One API key serves four > wire protocols — Anthropic Messages, OpenAI Responses, OpenAI Chat Completions > and Gemini — on one prepaid balance. Each protocol accepts the model families > listed below; the gateway forwards protocols rather than translating between them. > For billing rates, see the USD prices for each model below. - Website: https://www.codebyai.net - Documentation: https://www.codebyai.net/docs - Model pricing: https://www.codebyai.net/docs/model-price - Model catalog: https://www.codebyai.net/models - Claude Opus 5.5 vs Fable 5.2: API price and when to use which: https://www.codebyai.net/compare/claude-opus-5-5-vs-fable-5-2 - Pricing comparison: https://www.codebyai.net/pricing - API model list endpoint: https://www.codebyai.net/v1/models (requires an API key; the public list is https://www.codebyai.net/models) - Codex endpoint: https://www.codebyai.net/api/agent (wire_api = "responses") - Languages: English, Traditional Chinese, French, Korean, Japanese; the model catalogue and comparisons are also published in Russian, Spanish, Vietnamese, Indonesian and Portuguese ## What Code By AI provides - One API key for Claude Code, Codex and Gemini — no separate vendor accounts. - Desktop agents, IDEs and editor extensions work through the same key: ZCode, Qoder, WorkBuddy, Trae, CodeBuddy, Cline and Qwen Code accept the Code By AI base URL in their custom provider settings. - One-command setup for Claude Code, Codex, Gemini CLI, OpenCode, Pi, Qwen Code, ZCode, WorkBuddy and CodeBuddy: https://www.codebyai.net/setup.sh (Qoder, Trae and Cline are configured in the app; each has a guide under https://www.codebyai.net/docs/agents). - For the non-Grok models listed here, token prices are a fixed fraction of the catalog base rate, set per model: 1/10 for gemini-3.1-pro-preview, gemini-3.7-flash, gemini-3.8-flash, gemini-4-argon, gemini-4-carbon, gpt-5.6-sol, gpt-5.6-terra, gpt-6-astra, gpt-6-sol, gpt-6.1-sol, gpt-6.1-terra, gpt-6.2-astra, gpt-6.2-sol; 1/4 for claude-fable-5, claude-fable-5-1, claude-fable-5-2, claude-haiku-4-5-20251001, claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, claude-opus-5, claude-opus-5-5, claude-sonnet-4-6, claude-sonnet-5, claude-sonnet-5-5. - Prepaid, pay-as-you-go: top up a balance, each request is debited per token. No subscription. - Cache rates above apply to reads. Claude cache writes cost 1.25× the input rate for 5-minute entries or 2× for 1-hour entries; these replace the normal input charge for those tokens. Usage History combines cache reads and writes, so its cached-token total cannot be multiplied by the read rate to reconstruct a charge. - Drop-in compatibility: point the official CLI/SDK at the Code By AI base URL and keep using the same model names. - Usage and billing dashboards with per-model token accounting. ## Documentation - Claude Code Setup: CLI and VS Code: https://www.codebyai.net/docs/agents/claudecode - Codex Configuration: https://www.codebyai.net/docs/agents/codex - Gemini Configuration: https://www.codebyai.net/docs/agents/gemini - OpenCode Configuration: https://www.codebyai.net/docs/agents/opencode - Pi Configuration: https://www.codebyai.net/docs/agents/pi - ZCode Custom Models: Claude & GPT: https://www.codebyai.net/docs/agents/zcode - Qoder Custom Models: Claude & GPT: https://www.codebyai.net/docs/agents/qoder - WorkBuddy GPT & Claude: Custom Model Setup: https://www.codebyai.net/docs/agents/workbuddy - Cline: Claude & GPT via OpenAI-Compatible: https://www.codebyai.net/docs/agents/cline - Trae Custom Models: Claude & GPT: https://www.codebyai.net/docs/agents/trae - Qwen Code: Claude & GPT via OpenAI-Compatible: https://www.codebyai.net/docs/agents/qwen-code - CodeBuddy Models & API Key: Claude and GPT: https://www.codebyai.net/docs/agents/codebuddy - Claude Code Environment Variables Reference: https://www.codebyai.net/docs/agents/environment-variables - Top Up & Balance: https://www.codebyai.net/docs/billing/topup - Volume Discount: https://www.codebyai.net/docs/billing/volume-discount - Install Claude Code, Codex & Gemini CLI: https://www.codebyai.net/docs/getting-started/installation - Configuration & Top Up: https://www.codebyai.net/docs/getting-started/configuration - API Usage Overview: https://www.codebyai.net/docs/getting-started/apiusage - API Quickstart: https://www.codebyai.net/docs/getting-started/api-quickstart - Troubleshooting Common Errors: https://www.codebyai.net/docs/troubleshooting/common-errors ## 한국어 - 홈: https://www.codebyai.net/ko - 가격: https://www.codebyai.net/ko/pricing - Claude Code 요금: https://www.codebyai.net/ko/pricing/claude-code - Claude Pro·Max 가격과 한도: https://www.codebyai.net/ko/pricing/claude-pro - 클로드 API 가격: https://www.codebyai.net/ko/pricing/claude-api - 모델: https://www.codebyai.net/ko/models - Claude Opus 5.5 vs Fable 5.2: API 가격과 선택 기준: https://www.codebyai.net/ko/compare/claude-opus-5-5-vs-fable-5-2 - 충전과 잔액: https://www.codebyai.net/ko/docs/billing/topup - Claude Code 설정 — API 키·settings.json: https://www.codebyai.net/ko/docs/agents/claudecode - Codex 설정: https://www.codebyai.net/ko/docs/agents/codex - Gemini 설정: https://www.codebyai.net/ko/docs/agents/gemini - OpenCode 설정: https://www.codebyai.net/ko/docs/agents/opencode - Pi 설정: https://www.codebyai.net/ko/docs/agents/pi - ZCode 사용자 지정 모델: Claude와 GPT: https://www.codebyai.net/ko/docs/agents/zcode - Qoder 사용자 지정 모델: Claude와 GPT: https://www.codebyai.net/ko/docs/agents/qoder - WorkBuddy에서 GPT와 Claude 사용: 사용자 지정 모델 설정: https://www.codebyai.net/ko/docs/agents/workbuddy - Cline: OpenAI 호환으로 Claude와 GPT 사용하기: https://www.codebyai.net/ko/docs/agents/cline - Trae 사용자 지정 모델: Claude와 GPT: https://www.codebyai.net/ko/docs/agents/trae - Qwen Code: OpenAI 호환으로 Claude와 GPT 사용하기: https://www.codebyai.net/ko/docs/agents/qwen-code - CodeBuddy 모델과 API 키: Claude와 GPT: https://www.codebyai.net/ko/docs/agents/codebuddy - Claude Code 환경 변수 전체 목록: https://www.codebyai.net/ko/docs/agents/environment-variables - 충전과 잔액: https://www.codebyai.net/ko/docs/billing/topup - 볼륨 할인: https://www.codebyai.net/ko/docs/billing/volume-discount - Claude Code·Codex·Gemini CLI 설치: https://www.codebyai.net/ko/docs/getting-started/installation - 설정 및 충전: https://www.codebyai.net/ko/docs/getting-started/configuration - API 사용 현황 개요: https://www.codebyai.net/ko/docs/getting-started/apiusage - API 빠른 시작: https://www.codebyai.net/ko/docs/getting-started/api-quickstart - 자주 발생하는 오류 해결: https://www.codebyai.net/ko/docs/troubleshooting/common-errors ## Supported models and prices All prices are USD per 1 million tokens and already include the Code By AI discount. The model pricing page shows payable rates alongside the catalog base rates. ### Codex - gpt-5.6-sol: $0.40 input / $0.04 cache read / $2.00 output — per 1M tokens USD - gpt-5.6-terra (default): $0.20 input / $0.02 cache read / $1.20 output — per 1M tokens USD - gpt-6-astra: $1.00 input / $0.10 cache read / $5.00 output — per 1M tokens USD - gpt-6-sol: $0.20 input / $0.02 cache read / $1.00 output — per 1M tokens USD - gpt-6.1-sol: $0.20 input / $0.01 cache read / $1.00 output — per 1M tokens USD - gpt-6.1-terra: $0.10 input / $0.005 cache read / $0.50 output — per 1M tokens USD - gpt-6.2-astra: $0.80 input / $0.04 cache read / $4.00 output — per 1M tokens USD - gpt-6.2-sol: $0.20 input / $0.01 cache read / $1.00 output — per 1M tokens USD ### Grok - grok-4-5: ≈$0.016667 input / $0.0025 cache read / $0.05 output — per 1M tokens USD - grok-4.5: ≈$0.016667 input / $0.0025 cache read / $0.05 output — per 1M tokens USD - grok-4.6: ≈$0.016667 input / ≈$0.004167 cache read / $0.05 output — per 1M tokens USD - grok-4.7: ≈$0.016667 input / ≈$0.004167 cache read / $0.05 output — per 1M tokens USD ### Claude Code - claude-fable-5: $2.50 input / $0.25 cache read / $12.50 output — per 1M tokens USD - claude-fable-5-1: $2.50 input / $0.0625 cache read / $12.50 output — per 1M tokens USD - claude-fable-5-2: $2.00 input / $0.05 cache read / $10.00 output — per 1M tokens USD - claude-haiku-4-5-20251001: $0.25 input / $0.025 cache read / $1.25 output — per 1M tokens USD - claude-opus-4-6: $1.25 input / $0.125 cache read / $6.25 output — per 1M tokens USD - claude-opus-4-7: $1.25 input / $0.125 cache read / $6.25 output — per 1M tokens USD - claude-opus-4-8: $1.25 input / $0.125 cache read / $6.25 output — per 1M tokens USD - claude-opus-5: $1.25 input / $0.125 cache read / $6.25 output — per 1M tokens USD - claude-opus-5-5: $1.00 input / $0.05 cache read / $5.00 output — per 1M tokens USD - claude-sonnet-4-6: $0.75 input / $0.075 cache read / $3.75 output — per 1M tokens USD - claude-sonnet-5 (default): $0.50 input / $0.05 cache read / $2.50 output — per 1M tokens USD - claude-sonnet-5-5: $0.50 input / $0.025 cache read / $2.50 output — per 1M tokens USD ### Gemini - gemini-3.1-pro-preview: $0.20 input / $0.02 cache read / $1.20 output — per 1M tokens USD - gemini-3.7-flash: $0.10 input / $0.01 cache read / $0.30 output — per 1M tokens USD - gemini-3.8-flash (default): $0.075 input / $0.0075 cache read / $0.375 output — per 1M tokens USD - gemini-4-argon: $0.20 input / $0.01 cache read / $1.00 output — per 1M tokens USD - gemini-4-carbon: $0.20 input / $0.01 cache read / $1.00 output — per 1M tokens USD ## Common questions - Which model is the default? Codex → gpt-5.6-terra; Claude Code → claude-sonnet-5; Gemini → gemini-3.8-flash. Requests that omit `model` are answered by that channel's default. A named model id that is not in the catalog is rejected with HTTP 400 on `/v1/messages`, `/v1/responses`, `/v1/chat/completions` and the Gemini generateContent paths, whether the prefix is unknown (`abc123`) or the prefix is known but the version is not (`claude-sonnet-99`). The request is not answered by a default model. Case differences are accepted. On the JSON `model` field of Messages, Responses and Chat Completions, a single `anthropic/`, `openai/`, `google/` or `models/` prefix is accepted only when the remainder is an exact catalog id. The Gemini URL is one path segment, so `google/` and `models/` prefixes there are a 404; use the catalog id itself. Check exact IDs at https://www.codebyai.net/models. - How is billing calculated? Per token, per model, using the prices above. - Which endpoints does the gateway accept? `POST https://www.codebyai.net/api/agent/v1/messages` (Anthropic); `POST https://www.codebyai.net/api/agent/v1/responses` (OpenAI); `POST https://www.codebyai.net/api/agent/v1/chat/completions` (OpenAI); `POST https://www.codebyai.net/api/agent/v1beta/models/{model}:generateContent` (Google). The two OpenAI-format paths accept the GPT and the Claude family — a catalogued `claude-*` model sent there is forwarded to the Claude channel and billed at Claude prices — and Chat Completions also accepts Grok models, while the Anthropic-format path serves the Claude family only. An id that is not in the catalog is rejected with HTTP 400 on every one of these endpoints and is not answered by a default model. - Where do the models come from? Code By AI does not host models. Requests are forwarded to third-party model provider channels for Claude, GPT, Gemini and Grok; that is how the token prices above are possible. - How reliable is it? No measured success rate is published, and there is no public status page. A request that fails before the model returns a result is not charged. - Is there an OpenAI-compatible endpoint? Yes — both `/v1/responses` and `/v1/chat/completions` are served, and `/v1/models` lists the whole catalog. The GPT and Claude families, plus Grok on Chat Completions, are callable through it, so any OpenAI SDK can talk to Claude models without an Anthropic client.