201 models · OpenAI-compatible · text, image & video

One gateway forevery major AI model

One-stop access to the world's top AI models, with transparent pay-as-you-go pricing.

  • Great pricing
  • Reliable service
  • Easy integration
201
models
OpenAI
SDK-compatible
1 line
to migrate
WanAPIs Console
Unified AI gateway
Live
Models
201
available
Failover
auto
on 503/timeout
Billing
per-token
usage-based
Smart routing
gpt-5.6-sol · primary route
Primary
GPT · Claude · Gemini
Fallback
auto on error
Off-peak
cost optimization

Integrated model providers

OpenAIAnthropicGoogleDeepSeekMoonshotAlibabaxAIMistralStabilityMidjourneyOpenAIAnthropicGoogleDeepSeekMoonshotAlibabaxAIMistralStabilityMidjourney
llms.txt Ready

Let AI coding tools understand your API integration in one read

Standardized context for Claude Code, Codex, Cursor, ChatGPT, Windsurf and your own agents. Paste the prompt and models generate code against WanAPIs endpoints, model names and task APIs — also works with ccswitch / cc-switch one-click switching.

wanapis-context.md
# WanAPIs API conventions

Base URL:
https://api.wanapis.com/v1

OpenAI-SDK compatible:
- chat.completions.create
- responses.create
- embeddings.create

Recommended models:
- Code / Agent: gpt-5.6-sol, claude-opus-5
- Reasoning: deepseek-v4-pro, kimi-k3
- Fast & cheap: gemini-3.7-flash

Rules:
1. Never hardcode the API key
2. Use the async task API for long-running jobs
3. Log the request id for troubleshooting
Quick integration

Migrate your app to WanAPIs in three steps

Keep the OpenAI SDK and request format you already use — hand model selection, routing and cost control to the gateway.

Step 1

Create an API key

Sign up, open the console and generate a key. Set group, quota and allowed models per project.

Step 2

Swap base_url

Keep your existing OpenAI SDK — just point baseURL to https://api.wanapis.com/v1.

Step 3

Ship & observe

See tokens, cost, channel, latency and failure reasons in the logs, and tune routing anytime.

Node.js
OpenAI Compatible
01import OpenAI from 'openai';0203const client = new OpenAI({04  apiKey: process.env.WANAPIS_API_KEY,05  baseURL: 'https://api.wanapis.com/v1',06});0708const response = await client.chat.completions.create({09  model: 'deepseek-v4-pro',10  messages: [{ role: 'user', content: 'Explain the core flow of RAG' }],11});
Why WanAPIs

Not just a relay — a production-grade AI API gateway

From local debugging to production monitoring, the trickiest parts of multi-model integration are consolidated into one console.

One endpoint for every model

A single endpoint covering text, reasoning, code, image, video and audio models — no more juggling multiple auth schemes and SDKs.

Production-grade failover

Multi-channel health checks, auto-demotion, group routing and retry policies keep upstream hiccups away from your business.

Transparent billing & quotas

Logged per model, group, input, output and cache hit — easy to reconcile, control cost and distribute quota.

Global low-latency routing

Cloudflare Tunnel plus backend routing reduce unreachable, timeout and cross-border failures.

OpenAI-compatible

Supports OpenAI Chat Completions, Responses and common clients — migrate existing projects by changing base_url.

Async task hosting

Long jobs like video, image and Midjourney are handled by the WanAPIs facade, avoiding the 100s edge timeout.

FAQ

Frequently asked questions

The most common questions before integrating. For detailed model params, task APIs and error codes, see the docs.

Is it compatible with the OpenAI SDK?

Yes — compatible with common OpenAI Chat Completions, Responses and Embeddings calls. Most projects only need to swap base_url and the API key.

Does the model list get updated?

Yes. We continuously add GPT, Claude, Gemini, DeepSeek, Kimi, Qwen, image and video models based on upstream stability, cost and demand.

How do you handle unstable upstreams?

WanAPIs can configure multiple channels for the same model and fail over via priority, groups and automatic retries.

Is billing transparent?

The console logs prompt tokens, completion tokens, cache hits, model ratio, group ratio and the final charge for every request.

Can I use it with Claude Code, Codex, Cursor or my own agent?

Yes. Any tool that supports an OpenAI-compatible endpoint works with WanAPIs: Claude Code, Codex, Cursor, Windsurf, Cline, and switchers like ccswitch / cc-switch can all point base_url to WanAPIs. We recommend separate quotas for long-context and reasoning models.

Are wanapi.ai and wanapis.com the same service?

Yes — one service, one operator, one account system. wanapi.ai is the international (English) site and wanapis.com is the Chinese site. The console and API for both live at api.wanapis.com, and the same API key and balance work everywhere.

Do you train models on my request data?

No. WanAPIs only relays traffic and does not retain your prompts or completions for training. For synchronous calls the request body is released from memory once forwarded; usage logs record metadata only (model, token counts, latency, cost), not conversation content. The exception is async image/video generation: because those jobs are tracked across polls, the request (including the prompt) is stored temporarily while running, cleared when the job finishes, and kept 7 days at most. Note that upstream providers are mostly located outside mainland China, so prompts are processed on overseas servers. See our Privacy Policy and Data & Security page for the full statement.

Which payment methods do you support? Can I get an invoice?

Alipay (CNY) and credit card (via Creem, billed in USD). Every top-up is listed in the billing page of your console. For invoices or bank transfers, email [email protected] with your requirements.

Are there rate limits? How is reliability handled?

We do not impose a fixed RPM / TPM cap on API calls; effective throughput is bounded by upstream channel capacity. For reliability, each model is backed by several channels from different upstreams, and a 503, timeout or unresponsive upstream triggers an automatic switch. Streaming requests additionally have a response-header timeout so a silent upstream cannot hang the request. Console logs show which channel served each request and whether a failover happened.

Is my API key safe? What if it leaks?

Any key can be reset or deleted from the console and stops working immediately. More usefully, you can shrink the blast radius up front: each key can carry its own quota cap, allowed-model list, IP allowlist and expiry. Create one key per project so a leak stays boxed in by that key’s quota and allowlists.

Start building today

Start now — one API key for every major model

New projects use the WanAPIs endpoint directly; existing projects migrate gradually by swapping base_url.