Introduction

One OpenAI-compatible API for China's top AI models — DeepSeek, GLM, MiniMax and Kimi.

What is TokenFly?

TokenFly is an AI API gateway. One key and one OpenAI-compatible endpoint give you access to China's leading models — DeepSeek, GLM, MiniMax and Kimi — at the lowest prices, pay-as-you-go, with no subscription.

If you've used the OpenAI SDK before, you already know how to use TokenFly. Change one line — the base URL — and you're done.

Quickstart

1. Get your API key

Sign in to the console, top up a balance, and create an API key (it looks like sk-...). Copy it — you'll use it in the next step.

2. Set the base URL

Point your client at TokenFly's OpenAI-compatible endpoint:

https://tokenfly666.com/v1

3. Make your first request

curl https://tokenfly666.com/v1/chat/completions \
  -H "Authorization: Bearer $TOKENFLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_TOKENFLY_API_KEY",
    base_url="https://tokenfly666.com/v1",
)

resp = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.TOKENFLY_API_KEY,
  baseURL: "https://tokenfly666.com/v1",
});

const resp = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(resp.choices[0].message.content);

That's it. To use a different model, change the model string — for example GLM-5, glm-5.1, deepseek-v4-pro, or kimi-k2.6. See Models for the full list and live pricing.

Next steps