Provider setup

Set up AiApiy reverse-proxy

One key for OpenAI / Anthropic / Gemini — stable from China.

What is AiApiy

AiApiy is a routing aggregator: it unifies a dozen upstream model APIs (OpenAI, Anthropic, Google Gemini, xAI, etc.) behind a single OpenAI-Responses-compatible endpoint. One key, one baseURL, and Kition can hit every major model.

Two main use cases: a stable low-latency entry point for regions where official APIs are flaky (China especially), and developers who want one invoice and one key. Kition has no commercial tie to AiApiy — it is just the OpenAI-compatible router we test against most.

Get a key and baseURL

  • Log in to the AiApiy console → API Keys → New Key
  • baseURL is typically https://api.aiapiy.com/v1 (region subdomains exist for .cn or eu)
  • Top up or attach Stripe — AiApiy is prepaid
  • Check the Models page for available aliases (e.g. gpt-5.1, claude-opus-4-7, gemini-2.5-pro)

Add it in Kition

Use the custom provider template. Pick wire responses — AiApiy exposes the OpenAI Responses shape even when forwarding to Anthropic upstream.

{
  "name": "aiapiy",
  "baseURL": "https://api.aiapiy.com/v1",
  "apiKey": "ak-...",
  "wire": "responses",
  "defaultModel": "claude-sonnet-4-6"
}

Auth header

AiApiy reuses OpenAI-style Authorization: Bearer <key> — no extra header. If your deployment uses a private baseURL, paste it verbatim — Kition performs no path rewriting.

curl https://api.aiapiy.com/v1/responses \
  -H "Authorization: Bearer $AIAPIY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","input":"ping"}'

Model alias table

AiApiy uses aliases to flatten upstreams into the OpenAI shape. Below are common mappings — the live list lives in the console Models page.

  • gpt-5.1 / gpt-5 — forward to OpenAI
  • claude-opus-4-7 / claude-sonnet-4-6 — forward to Anthropic
  • gemini-2.5-pro / gemini-2.5-flash — forward to Google
  • grok-4 — forward to xAI
  • Some upstreams expose a -thinking suffix that enables reasoning — see the console

Common errors

  • 401 Unauthorized — key typo / suspended / balance drained
  • 402 Payment Required — zero balance; top up
  • 404 model not found — alias typo or upstream removed
  • 429 too many requests — AiApiy or upstream rate limit; auto-retried
  • 502 Bad Gateway — transient upstream failure, usually back within 30s
  • Streaming stalls — check local proxy / DNS; AiApiy endpoint itself is SSE

When to use it

Good fit: based in mainland China, behind a corporate firewall blocking direct API access, or comparing many models on a single invoice.

Skip it if: you already have direct OpenAI or Anthropic accounts with stable connectivity — direct is always lower-latency and cheaper than going through any middle layer.

Related articles

Ready when you are.

Kition is a local-first AI workspace. Markdown documents, structured tables, and an AI agent — running on your own machine, against the model provider you choose.