Minimal, copy-paste examples for calling frontier AI models through WanAPI — one OpenAI-compatible endpoint for GPT, Claude, Gemini, DeepSeek, image and video models.
- Base URL:
https://api.wanapis.com/v1 - Auth:
Authorization: Bearer $WANAPI_KEY(get a key at https://wanapi.ai) - Compatible with the OpenAI SDKs — you only change
base_url. - Live status: https://uptime.wanapis.com/status/wanapis
export WANAPI_KEY=sk-... # your key from the console| Lang | Setup | Run |
|---|---|---|
| Python | pip install -r python/requirements.txt |
python python/chat.py |
| Node | cd node && npm install |
node node/chat.mjs |
| Go | cd go |
go run main.go |
| cURL | — | bash curl/chat.sh |
Expected output: one short sentence, e.g. Hello! How can I help you today?
Billing is pay-as-you-go per token — you are charged only for what you send/receive. A "hello" round-trip like the examples costs a fraction of a cent. See live per-model pricing at https://wanapi.ai/pricing and the model catalog at https://wanapi.ai/model.
- Never hard-code your key — read it from an environment variable (as shown).
- Swap
"model": "gpt-5.5"for any model id from https://wanapi.ai/model (e.g.claude-sonnet-4.7,gemini-3.5-flash,deepseek-v4-pro). - For long-running image/video jobs, use the async task API (see the docs at https://wanapi.ai/docs) instead of a single blocking call.
- Issues / questions: open a GitHub issue or email support@wanapis.com — the founder replies within 24 hours.
MIT — do whatever you like with these snippets.