中文

Your first call

Three values and one request. If you already use the OpenAI SDK, you only change two of them.

base_url
https://router.xiaojins.com/v1
api_key
Your key, sent as Authorization: Bearer <key>
model
deepseek-flash, deepseek-flash-three-pass (Sansi)
curl https://router.xiaojins.com/v1/chat/completions \
  -H "Authorization: Bearer $THRICEGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Get a key

Sign in, top up, then create a key in the console. The full key is shown once; the console can run your first call right there.

Open the console

Sansi

Set model to deepseek-flash-three-pass. reasoning_effort accepts low, medium, high or max (default high); max_tokens defaults to 65,536. A hard request can take minutes, so give your client a long timeout or stream.

curl https://router.xiaojins.com/v1/chat/completions \
  -H "Authorization: Bearer $THRICEGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash-three-pass",
    "reasoning_effort": "high",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Translate

POST /v1/workflows/translate with text and target_language (20 codes: en fr tr ja ko es de pt it ru ar vi th id ms hi nl pl zh-hans zh-hant). One model runs three passes: a literal draft, a revision, a final text. Billed at 2x the model's token price on all three passes.

curl https://router.xiaojins.com/v1/workflows/translate \
  -H "Authorization: Bearer $THRICEGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "答之前先想三遍。", "target_language": "en"}'

Guard

POST /v1/workflows/guard with {"input": "..."}. The answer is four booleans; if the judge cannot finish, allowed is false and the call is free.

curl https://router.xiaojins.com/v1/workflows/guard \
  -H "Authorization: Bearer $THRICEGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "text to check"}'

Contract, limits and billing →

In your tools

ToolHow
Any OpenAI-compatible clientSet the base URL to the value above, paste your key, type the model id.
OpenAI SDKs (Python, Node)Pass base_url / baseURL and api_key / apiKey when you create the client, as in the examples.
Environment variablesOPENAI_BASE_URL and OPENAI_API_KEY are read by most tools built on the OpenAI SDK.

Errors

StatusMeaningWhat to do
400Bad request, or the model id is not one we serveCheck the model id against /models
401Missing or unknown keySend Authorization: Bearer <key>; a new key works within seconds
402Balance too low for this request (code insufficient_credits). A call first holds its largest possible cost, its max_tokens reply included, then is charged what it actually usedTop up, or send a smaller max_tokens
403The key lacks the scope for this endpointWrite to us with the key's last four characters
429Rate limit for this keyBack off and retry
5xxThe upstream model failed or timed outRetry; for real-time work use deepseek-flash

Billing

Prepaid: you top up a USD balance and each call is deducted from it, rounded up to the next $0.00001. Prices are on the pricing page and are final.

Listed prices are final: tax included, no top-up fee, no platform fee.

Pricing →