One endpoint, your existing OpenAI code. If something doesn't work, jump to troubleshooting.
Go to api.novatoken.dev/register and sign up.
In the dashboard sidebar, open Tokens (令牌) → click Add Token (添加令牌).
my-appsk-auto pick for youNot sure which model to use? Set "model": "auto" and we route each request to the cheapest model that can handle it well — short chat goes to Qwen, everyday answers to GLM, hard reasoning to DeepSeek. You pay that model's normal per-token rate, exactly as if you had picked it yourself. No routing fee, no markup.
| Model name | USD per 1M in / out | Use it for |
|---|---|---|
autoSTART HERE |
Same as the model it picks $0.10 – $0.30 in / $0.30 – $1.20 out |
Default choice. Difficulty-based routing at the chosen model's own rate — you are charged for Qwen when Qwen answers, DeepSeek when DeepSeek answers. Your usage log shows the real model name. |
Qwen/Qwen2.5-7B-Instruct |
$0.10 / $0.30 | Fastest replies (~2s), 32K context. Translation, rewriting, classification, simple Q&A. |
zai-org/GLM-5.3-Flash |
$0.15 / $0.50 | 1M context, strong Chinese + English, light reasoning and summaries. |
deepseek-ai/DeepSeek-V4-Flash |
$0.30 / $1.20 cache hit $0.006 |
1M context, deep reasoning, math, long documents. Cache-hit input is 50x cheaper than list. |
moonshotai/Kimi-K2.7-Code |
$1.20 / $5.00 | 262K context. Coding agents, repo-scale edits, tool-heavy workflows. |
All five support streaming, tool / function calling and JSON mode. Use the exact name including the vendor/ prefix — a typo returns model not found.
auto. Heavy coding → moonshotai/Kimi-K2.7-Code. You can switch per request, no new key needed.Base URL: https://api.novatoken.dev/v1 — it behaves exactly like the OpenAI API.
# curl — the whole thing in one line curl https://api.novatoken.dev/v1/chat/completions \ -H "Authorization: Bearer sk-YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}'
# python (pip install openai) from openai import OpenAI client = OpenAI(api_key="sk-YOUR_KEY", base_url="https://api.novatoken.dev/v1") r = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": "Explain JWT in three bullets."}]) print(r.choices[0].message.content)
# python — streaming (recommended for chat UIs) stream = client.chat.completions.create( model="auto", stream=True, messages=[{"role": "user", "content": "Write a haiku about rain."}]) for chunk in stream: print(chunk.choices[0].delta.content or "", end="")
// node (npm i openai) import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.NOVATOKEN_KEY, baseURL: "https://api.novatoken.dev/v1" }); const r = await client.chat.completions.create({ model: "auto", messages: [{ role: "user", content: "hi" }], }); console.log(r.choices[0].message.content);
base_url → https://api.novatoken.dev/v1 and api_key → your sk- key. Everything else (SDK, request shape, streaming, tool calls) stays the same.Any app that accepts a custom OpenAI-compatible endpoint works. Fill in two fields — endpoint and key:
| App | Where | What to enter |
|---|---|---|
| Cherry Studio | Settings → Model Provider → Add → OpenAI | API Host: https://api.novatoken.dev · API Key: sk-... |
| Chatbox | Settings → Model → Add custom provider | API Host: https://api.novatoken.dev/v1 |
| LobeChat / NextChat | Settings → Language Model → OpenAI | Base URL: https://api.novatoken.dev/v1 |
| Cursor | Settings → Models → OpenAI API Key + Override Base URL | Base URL: https://api.novatoken.dev/v1 · model: moonshotai/Kimi-K2.7-Code |
| Cline / Roo Code (VS Code) | Provider: OpenAI Compatible | Base URL: https://api.novatoken.dev/v1 |
| Continue | config.json → models → provider: openai | apiBase: https://api.novatoken.dev/v1 |
| Dify / n8n | Model provider → OpenAI-API-compatible | Base URL: https://api.novatoken.dev/v1 |
Some clients let you type any model name — use the full names from the table in step 3. Others only show a fixed list; pick the closest and override the model string if the app allows it.
| You see | Meaning | Fix |
|---|---|---|
401 invalid token | Key wrong, deleted, or has a stray space/newline | Create a fresh token, paste it again, make sure there's no trailing space |
403 insufficient quota | Account balance is $0 | Credits not applied yet → refresh the console; if still missing, email support with your receipt |
404 model not found | Model name typo | Copy the exact name from step 3, including the vendor/ prefix and case |
400 context length exceeded | Input longer than the model's window | Qwen 32K · Kimi 262K · GLM and DeepSeek 1M. Trim history or switch model |
429 | Rate limited | Slow down, or use stream: true and retry with exponential backoff |
| First words take 5–15s | Reasoning models think before answering | Expected. Use stream: true, or pick Qwen2.5-7B / auto for instant replies |
connection reset / timeout on long output | Client timeout shorter than generation time | Raise the client timeout (e.g. 300s) and enable streaming |
| Question | Answer |
|---|---|
| Can I use this key with the official OpenAI API? | This key is a NovaToken credential — it authenticates against our endpoint and draws down your NovaToken balance, so it is not an OpenAI account key. That is the point: your code keeps using the same OpenAI SDK, but you are billed per token by card for Chinese open-weight models, with no OpenAI account, subscription or card on file. If you also need OpenAI's own models, keep a separate OpenAI key for those calls. |
| Can I use it in my own app / backend / bot? | Yes. It's a normal HTTP API — any language, server-side or client-side. Keep it out of public front-end code and rotate it if leaked. |
Does auto cost extra? | No. You pay the normal per-token price of whichever model answers the request — Qwen when Qwen answers, DeepSeek when DeepSeek answers. There is no routing fee and no markup on top of the model price. |
| Which model does auto actually use? | Short chat → Qwen2.5-7B, everyday answers → GLM-5.3, hard reasoning and code → DeepSeek-V4. Your usage log records the real model that served each request, so the bill is always auditable. |
| Do credits expire? | No. They sit on your balance until used. |
| Is my data used for training? | No. We proxy to upstream inference providers and don't retain prompt or completion content beyond short-lived request logs used for billing. |