How to use the OpenAI GPT API in China: Alipay top-ups, the official SDK
Updated 2026-11-27简体中文繁體中文日本語한국어DeutschFrançaisEspañolPortuguês (Brasil)ItalianoРусский
OpenAI does not offer its API in mainland China and takes payment by foreign card only. On APIKing you sign up with an email address and top up with Alipay, then call GPT-6.2, GPT-6, GPT-5.6 and the rest with the official OpenAI SDK. Change only base_url and api_key; Chat Completions and Responses both work, and so does the Codex CLI.
How it differs from the official API
- No foreign phone number or card, and no identity or company verification.
- Pay with Alipay in CNY, or with Visa or Mastercard in USD.
- Pay as you go, no subscription, the balance never expires, and failed calls are free.
- The same key calls Claude, Gemini and DeepSeek, and the image and video models.
- The API servers are in Hong Kong.
GPT prices
| Model | Price | Official price (per 1M tokens) |
|---|---|---|
| GPT-6.2 Astra | $0.40 in · $2.00 out / 1M | $8.00 in · $40.00 out / 1M |
| GPT-6.2 Sol | $0.10 in · $0.50 out / 1M | $2.00 in · $10.00 out / 1M |
| GPT-6 Luna | $0.0784 in · $0.392 out / 1M | $0.10 in · $0.50 out / 1M |
| GPT-6.1 Terra | $0.05 in · $0.25 out / 1M | $1.00 in · $5.00 out / 1M |
| GPT-5.6 Sol | $0.25 in · $1.50 out / 1M | $5.00 in · $30.00 out / 1M |
Call GPT with Chat Completions
from openai import OpenAI
client = OpenAI(base_url="https://apiking.ai/v1", api_key="sk-YOUR_KEY")
reply = client.chat.completions.create(
model="gpt-6-luna",
messages=[{"role": "user", "content": "Translate into Chinese: the meeting moved to 3 pm"}],
)
print(reply.choices[0].message.content)Call GPT with the Responses API
GPT models also take /v1/responses, which is what the Codex CLI uses. See the Codex setup guide.
from openai import OpenAI
client = OpenAI(base_url="https://apiking.ai/v1", api_key="sk-YOUR_KEY")
response = client.responses.create(model="gpt-6.2-astra", input="List three ways to handle concurrency in Python")
print(response.output_text)Get started
- Sign up with an email address, or sign in with Google.
- Top up in the wallet with Alipay or a card.
- Create an API key and call it as above.
Questions
Can I use the OpenAI API in China?
OpenAI does not offer its API in mainland China. An APIKing key calls every GPT model; top up with Alipay and change only base_url and api_key.
Is the Responses API supported?
Yes. GPT models take /v1/responses, and the Codex CLI works.
Can one key call other makers’ models?
Yes. The same key calls Claude, Gemini and DeepSeek, and image, video and music models.
How do I pay?
Alipay in CNY, Visa or Mastercard in USD, or a redeem code.