# APIVAI > APIVAI (https://apivai.com) is a pay-as-you-go API gateway for Claude and GPT models. One API key works with the Anthropic Messages API format and the OpenAI Chat Completions / Responses formats, so Claude Code, Cursor, Codex CLI, the Anthropic SDK and the OpenAI SDK work by changing only the base URL. Prices are per million tokens, below official list prices for most models. No subscription. ## Key facts - API base URL (Anthropic format, Claude Code, Anthropic SDK): https://api.apivai.com - API base URL (OpenAI format, OpenAI SDK, Cursor, most tools): https://api.apivai.com/v1 - Authentication: `x-api-key: ` or `Authorization: Bearer ` - Endpoints: POST /v1/messages, POST /v1/messages/count_tokens, POST /v1/chat/completions, POST /v1/responses, GET /v1/models - Streaming (server-sent events) is supported on all generation endpoints - Default rate limit: 60 requests per minute per key - Billing: prepaid account balance in USD; each request is charged by input, output and cache tokens - Payment: credit and debit cards, Alipay, WeChat Pay (charged in CNY and converted to USD), cryptocurrency (USDT and more); minimum top-up $10 by card or crypto, or ¥20 via Alipay / WeChat Pay - Top-up bonus: a single top-up of $50 or more, by any payment method (Alipay / WeChat Pay by the dollars the yuan convert to), gets 30% extra credit - Invoices: Chinese VAT invoices (electronic general invoice 普票 or special invoice 专票) for paid top-ups, requested in the dashboard's Invoices tab, no extra charge, issued within 3 working days; payment by company bank transfer and purchase contracts are not available - Refunds: credits are non-refundable once consumed; unused credits may be refunded at our discretion within 30 days of purchase - Live model list with prices: https://apivai.com/llms-full.txt and https://apivai.com/pricing - Contact: support@apivai.com, Telegram @e3655 ## Quick start Claude Code (macOS / Linux): ``` ANTHROPIC_AUTH_TOKEN="your-key" ANTHROPIC_BASE_URL="https://api.apivai.com" claude ``` OpenAI Python SDK: ``` from openai import OpenAI client = OpenAI(api_key="your-key", base_url="https://api.apivai.com/v1") r = client.chat.completions.create(model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello"}]) ``` ## Pages - [Pricing](https://apivai.com/pricing): per-token prices for every model, with official prices side by side - [Models](https://apivai.com/models): every model with its ID, price, saving and context window, linking to one page per model - [API cost calculator](https://apivai.com/claude-api-cost-calculator): cost per request, per day and per month for a given number of input and output tokens, for every model, at APIVAI and official prices - [API documentation](https://apivai.com/docs): endpoints, parameters and code examples - [OpenAI-compatible API guide](https://apivai.com/openai-compatible-api): using Claude and GPT through the OpenAI format - [Claude API proxy guide](https://apivai.com/claude-api-proxy): Claude Code and Anthropic SDK setup, common errors - [Blog](https://apivai.com/blog): tutorials for Claude Code, Cursor, Codex CLI, Cline, Roo Code, Aider, Continue, Open WebUI, LobeChat, Cherry Studio, Chatbox, n8n, Dify, Zed, OpenCode, Kilo Code and Goose; API error codes; model cost comparisons - [Comparisons](https://apivai.com/alternatives): APIVAI compared with OpenRouter and the official Anthropic and OpenAI APIs - [Terms of service](https://apivai.com/terms) - [Privacy policy](https://apivai.com/privacy) ## Blog - [Claude Code and GPT API Costs: How to Pay Less](https://apivai.com/blog/claude-code-gpt-api-cheaper): prices against official list prices, cost per message and per month, setup for Claude Code, Cursor and the SDKs - [Claude API Options in 2026: Anthropic, OpenRouter, Bedrock, Vertex](https://apivai.com/blog/best-claude-api-alternative-2026): APIVAI, OpenRouter, AWS Bedrock, Google Vertex AI and prompt caching compared - [Claude Code Custom API Setup: Base URL and API Key Guide](https://apivai.com/blog/claude-code-setup-guide): environment variables on Mac, Linux and Windows, Codex CLI config, model choice, fixes for 401 / 404 / 429 - [Cursor Custom API Setup: Your Own Key for Claude and GPT](https://apivai.com/blog/cursor-ai-cheap-api-setup): Override OpenAI Base URL, model IDs, troubleshooting - [Claude API Pricing 2026: Official Rates and Cache Prices](https://apivai.com/blog/claude-api-pricing-comparison-2026): every Claude model's official and APIVAI price, with a worked monthly cost - [OpenRouter Alternative: Move Claude and GPT Calls to APIVAI](https://apivai.com/blog/openrouter-alternative-cheaper): model ID mapping, SDK and tool changes, testing and running both side by side - [Claude Code vs Cursor vs Codex CLI: Real Cost Comparison](https://apivai.com/blog/claude-code-vs-cursor-cost-comparison): subscriptions against pay-per-token, daily and monthly cost - [Claude API Error Codes](https://apivai.com/blog/claude-api-error-codes): 400, 401, 402, 403, 404, 413, 429, 500 and 529, what each means and how to fix or retry it - [Claude Code Without a Subscription](https://apivai.com/blog/claude-code-without-subscription): running Claude Code with an API key and paying per token, compared with Pro and Max - [Claude Sonnet vs Opus vs Haiku vs GPT: API Cost Compared](https://apivai.com/blog/claude-sonnet-vs-opus-vs-gpt-api-cost): which model to pick for which task, with worked costs - [Claude & GPT API with a Chinese VAT Invoice (Fapiao)](https://apivai.com/blog/claude-gpt-api-invoice-fapiao): electronic VAT general invoices and VAT special invoices for top-ups, requested in the dashboard, no extra charge, issued within 3 working days; no company bank transfer or contracts. - [Claude API Without a Credit Card](https://apivai.com/blog/pay-claude-api-without-credit-card): paying by Alipay, WeChat Pay or USDT and other crypto, minimums, fees, arrival times, invoices and refunds - [What Is an OpenAI-Compatible API?](https://apivai.com/blog/what-is-openai-compatible-api): which endpoints and fields it copies, where services differ, who offers one (Ollama, vLLM, LM Studio, Anthropic, Gemini) and how to switch the base URL - [Is Your Claude API Relay Serving the Real Model?](https://apivai.com/blog/verify-claude-api-relay-genuine-model): the extended-thinking signature test, a monitoring script with alerts, how to read changes and what no outside test can prove Setup tutorials for one tool each: - [Cline](https://apivai.com/blog/cline-claude-gpt-api-setup): OpenAI Compatible or Anthropic provider, base URL, model choice - [Roo Code](https://apivai.com/blog/roo-code-claude-gpt-api-setup): API configuration profiles, per-mode models, prompt caching - [Aider](https://apivai.com/blog/aider-claude-gpt-api-setup): OPENAI_API_BASE, the openai/ model prefix, edit formats - [Continue](https://apivai.com/blog/continue-dev-claude-gpt-api-setup): config.yaml for the openai and anthropic providers - [Open WebUI](https://apivai.com/blog/open-webui-claude-gpt-api-setup): OpenAI API connection, Docker variables, task model - [LobeChat (LobeHub)](https://apivai.com/blog/lobechat-claude-gpt-api-setup): custom provider, self-hosted environment variables - [Cherry Studio](https://apivai.com/blog/cherry-studio-claude-gpt-api-setup): adding APIVAI as a provider - [Chatbox](https://apivai.com/blog/chatbox-claude-gpt-api-setup): adding APIVAI as a custom model provider - [n8n](https://apivai.com/blog/n8n-claude-gpt-api-setup): OpenAI and Anthropic credentials with a custom base URL, AI Agent nodes - [Dify](https://apivai.com/blog/dify-claude-gpt-api-setup): OpenAI-API-compatible and Anthropic model providers - [Zed](https://apivai.com/blog/zed-claude-gpt-api-setup): openai_compatible and anthropic_compatible providers in settings.json - [OpenCode](https://apivai.com/blog/opencode-claude-gpt-api-setup): custom provider in opencode.json, /connect - [Kilo Code](https://apivai.com/blog/kilo-code-claude-gpt-api-setup): custom provider with OpenAI Compatible or Anthropic Messages - [Goose](https://apivai.com/blog/goose-claude-gpt-api-setup): goose configure, OPENAI_HOST and ANTHROPIC_HOST - [Open Interpreter](https://apivai.com/blog/open-interpreter-claude-gpt-api-setup): custom provider in config.toml (base_url, wire_api), classic Python --api_base flags The older posts are in English, Russian (/ru/blog/...) and Chinese (/zh/blog/...); the setup tutorials are also in Spanish (/es/blog/...) and Portuguese (/pt/blog/...). ## Models Each model has its own page with its price against the official list price, cost per request, code examples and a FAQ: https://apivai.com/models/, with dots in the ID written as hyphens (for example https://apivai.com/models/claude-sonnet-4-6 and https://apivai.com/models/gpt-6-1-sol). All models are listed with links to their pages on https://apivai.com/models, and with cache prices on https://apivai.com/pricing. Model pages as of 2026-11-13 (the live list is on https://apivai.com/models): - [Claude Fable 5.1 API](https://apivai.com/models/claude-fable-5-1): Anthropic, model ID `claude-fable-5-1` - [Claude Fable 5 API](https://apivai.com/models/claude-fable-5): Anthropic, model ID `claude-fable-5` - [Claude Opus 5.5 API](https://apivai.com/models/claude-opus-5-5): Anthropic, model ID `claude-opus-5-5` - [Claude Opus 5 API](https://apivai.com/models/claude-opus-5): Anthropic, model ID `claude-opus-5` - [Claude Opus 4.8 API](https://apivai.com/models/claude-opus-4-8): Anthropic, model ID `claude-opus-4-8` - [Claude Opus 4.7 API](https://apivai.com/models/claude-opus-4-7): Anthropic, model ID `claude-opus-4-7` - [Claude Opus 4.6 API](https://apivai.com/models/claude-opus-4-6): Anthropic, model ID `claude-opus-4-6` - [Claude Sonnet 5.5 API](https://apivai.com/models/claude-sonnet-5-5): Anthropic, model ID `claude-sonnet-5-5` - [Claude Sonnet 5 API](https://apivai.com/models/claude-sonnet-5): Anthropic, model ID `claude-sonnet-5` - [Claude Sonnet 4.6 API](https://apivai.com/models/claude-sonnet-4-6): Anthropic, model ID `claude-sonnet-4-6` - [Claude Haiku 5.5 API](https://apivai.com/models/claude-haiku-5-5): Anthropic, model ID `claude-haiku-5-5` - [Claude Haiku 4.5 API](https://apivai.com/models/claude-haiku-4-5): Anthropic, model ID `claude-haiku-4-5` - [Claude Fable 5.2 API](https://apivai.com/models/claude-fable-5-2): Anthropic, model ID `claude-fable-5-2` - [GPT-6.1 Sol API](https://apivai.com/models/gpt-6-1-sol): OpenAI, model ID `gpt-6.1-sol` - [GPT-6.1 Terra API](https://apivai.com/models/gpt-6-1-terra): OpenAI, model ID `gpt-6.1-terra` - [GPT-6 Astra API](https://apivai.com/models/gpt-6-astra): OpenAI, model ID `gpt-6-astra` - [GPT-6 Sol API](https://apivai.com/models/gpt-6-sol): OpenAI, model ID `gpt-6-sol` - [GPT-6 Luna API](https://apivai.com/models/gpt-6-luna): OpenAI, model ID `gpt-6-luna` - [GPT-5.6 Sol API](https://apivai.com/models/gpt-5-6-sol): OpenAI, model ID `gpt-5.6-sol` - [GPT-5.6 Terra API](https://apivai.com/models/gpt-5-6-terra): OpenAI, model ID `gpt-5.6-terra` - [GPT-5.6 Luna API](https://apivai.com/models/gpt-5-6-luna): OpenAI, model ID `gpt-5.6-luna` ## Comparisons - [APIVAI alternatives](https://apivai.com/alternatives): all comparison pages - [APIVAI vs OpenRouter](https://apivai.com/alternatives/openrouter) - [APIVAI vs the official Anthropic API](https://apivai.com/alternatives/anthropic-api) - [APIVAI vs the official OpenAI API](https://apivai.com/alternatives/openai-api) ## Languages The site is available in English (https://apivai.com), Russian (https://apivai.com/ru), Chinese (https://apivai.com/zh), Spanish (https://apivai.com/es) and Portuguese (https://apivai.com/pt).