Get started
Quickstart
Send your first request in 4 steps — sign up and create an API key, point base_url at https://open.tutujin.com/v1, call a model with cURL, Python or Node.js, then check the charge in the console.
Tutujin API is compatible with the OpenAI API. Code that already uses an OpenAI SDK needs two changes: set base_url to https://open.tutujin.com/v1 and replace api_key with a key from your console. The whole thing takes about five minutes.
Step 1: Sign up and add credit
- Create an account on the sign-up page and open the console.
- Add credit in the console. Balances are in CNY and you pay for what you use — no monthly fee, no minimum spend.
- For company purchasing or an overseas invoice, contact support on WeChat at
JsnonoChat.
Step 2: Create an API key
Create a key on the API Keys page of the console. Each key has its own settings:
| Setting | What it does |
|---|---|
| Name | Tells projects and environments apart, e.g. "support-bot-prod" |
| Group | Which line the key uses and which price tier it is billed at — see Choosing a group |
| Spending limit | The most this key can spend; it stops working once the limit is reached |
| Expiry | The key stops working after this date — handy for temporary or contractor projects |
| Model allowlist | Only the listed models can be called |
| IP allowlist | Only the listed server IPs can call |
Keys start with sk-. Use one key per project and per environment, so you can disable one without touching anything else.
Never put a key in web, app or mini-program front-end code — anyone with developer tools can read it. Keep keys on your own servers and load them from environment variables. More in API key security best practices.
Step 3: Set the key and base URL
Put the key in an environment variable; every example below reads it from there:
export TUTUJIN_API_KEY="sk-your-key"The base URL depends on the API format you use:
| SDK or API you use | Base URL |
|---|---|
| OpenAI-compatible APIs (Chat Completions, Responses, Embeddings, images, audio…) | https://open.tutujin.com/v1 |
| Anthropic SDK (native Claude Messages) | https://open.tutujin.com |
| Google Gen AI SDK (native Gemini generateContent) | https://open.tutujin.com |
The Anthropic and Google SDKs append /v1/messages and /v1beta/models/... themselves, so give them the site root only.
Step 4: Send your first request
Set model to a model name from the model hub. The examples use gpt-5.4-mini:
curl https://open.tutujin.com/v1/chat/completions \
-H "Authorization: Bearer $TUTUJIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4-mini",
"messages": [
{"role": "user", "content": "Introduce yourself in one sentence"}
]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://open.tutujin.com/v1",
api_key=os.environ["TUTUJIN_API_KEY"],
)
resp = client.chat.completions.create(
model="gpt-5.4-mini",
messages=[{"role": "user", "content": "Introduce yourself in one sentence"}],
)
print(resp.choices[0].message.content)import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://open.tutujin.com/v1',
apiKey: process.env.TUTUJIN_API_KEY,
})
const resp = await client.chat.completions.create({
model: 'gpt-5.4-mini',
messages: [{ role: 'user', content: 'Introduce yourself in one sentence' }],
})
console.log(resp.choices[0].message.content)The response has the same shape as OpenAI's. The answer is in choices[0].message.content and this call's usage is in usage:
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "gpt-5.4-mini",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "..." },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 14, "completion_tokens": 32, "total_tokens": 46 }
}A 401 means the key is wrong or no longer valid; a 403 usually means the balance ran out or the key's allowlists block the call. See Errors and retries for the full list.
Step 5: Check usage and charges
Every call leaves a record under Usage in the console with the model, group, input and output tokens and the cost. For token-billed models, cost = input tokens × input price + output tokens × output price. The example model's cheapest group currently costs:
| Model | Vendor | Cheapest group | Input ¥/1M | Output ¥/1M | Per request ¥ |
|---|---|---|---|---|---|
| gpt-5.4-mini | OpenAI | Standard | ¥1.5 | ¥9 | — |
Prices in CNY, cheapest group for each model; updated Nov 12, 2026, 8:17 PM.
Billing details are in Billing and usage.
Next steps
- Authentication and base URL: the three header styles and how to configure each native SDK.
- Choosing a group: the same model costs different amounts and runs on different lines in different groups.
- API reference: parameters and examples for every endpoint.
- OpenAI SDK guide: full Python and Node.js setup, including streaming, timeouts and retries.
Still stuck? Add our WeChat support JsnonoChat and send the request id from the error message, and we will look into it.