DeepSeek API guide: models, prices, and Claude Code setup
DeepSeek's API in November 2026: two models, a 1M-token context, peak and off-peak prices, automatic caching, and the documented Claude Code settings.
At a glanceZ.ai sells GLM models two ways: a pay-per-token API and a coding subscription from $18 a month. Prices, credit limits, key types and the Claude Code settings.
Not testedAn overview of Z.ai's documentation. No account was created and nothing was subscribed to.
Z.ai makes the GLM family of models. It sells them in two ways that are easy to confuse: an API billed per token, and a subscription called the GLM Coding Plan for use inside coding tools. They have different prices, different keys and different rules. This guide sets out what the documentation says about each, and how the plan connects to Claude Code.
The standard API is pay-as-you-go. You top up a balance and each call is charged per token. The Coding Plan is a monthly subscription with a usage allowance, and it only works in supported coding tools.
Since October 16, 2026 the keys for the two are managed separately, and the type of key decides how a call is billed. The documentation gives the case that catches people out: a Standard API key used in a coding tool does not draw on your Coding Plan allowance, even if you have a subscription. It is charged to your balance. Create the key from the section that matches what you are paying for.
The current flagship is GLM-5.3. The documentation describes it as text-only, with a 1M-token context window and a maximum output of 128K tokens. Reasoning is always on, with three effort levels: low, high and max.
| Per 1M tokens | Input | Cached input | Output |
|---|---|---|---|
| GLM-5.3 | $1.40 | $0.26 | $4.40 |
| GLM-5.3-FlashX | $0.37 | $0.075 | $1.25 |
| GLM-5.3-Flash | $0.15 | $0.03 | $0.50 |
Storing cached input is listed as free for a limited time. The built-in web search tool costs $0.01 per use. Two older models, GLM-4.7-Flash and GLM-4.5-Flash, are listed as free.
The API follows the OpenAI format. With the OpenAI SDK, set the base URL to https://api.z.ai/api/paas/v4/ and use a Standard API key.
The plan starts at $18 a month and has three tiers: Lite, Pro and Max. The documentation does not list the Pro and Max prices on the pages read for this guide; they are on the subscription page.
All tiers include GLM-5.3 and GLM-5.3-Flash. Requests for GLM-5.2 or GLM-5.1 are routed to GLM-5.3, and requests for GLM-4.7 go to GLM-5.3-Flash. Every tier also includes image understanding and three MCP servers: web search, web reader and Zread.
Usage is counted in credits, with a limit per five hours and a limit per week:
| Tier | Credits per 5 hours | Credits per week | Suggested use |
|---|---|---|---|
| Lite | 2,000 | 10,000 | One project at a time |
| Pro | 12,000 | 60,000 | One or two projects at once |
| Max | 28,000 | 140,000 | Two or more projects at once |
The five-hour allowance refills five hours after it is used. The weekly allowance resets every seven days from the day you subscribe. Credits are calculated from tokens: input, cached input and output tokens are each multiplied by a rate for the model, added together and divided by 10,000. Tool calls through the MCP servers use credits too. The billing page in the console shows the tokens and tool calls counted against you.
Whether a tier is enough depends on how the multipliers apply to your work, which this guide could not measure. Start on the lowest tier and watch the usage page for a week before moving up.
The plan offers an endpoint in Anthropic's format, which is what Claude Code speaks. After installing Claude Code, the documentation's setup adds three values to ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"API_TIMEOUT_MS": "3000000"
}
}
Use a Coding Plan key here, not a Standard one. Open a new terminal window for the change to take effect, then run claude in your project.
By default the plan maps Claude Code's three model slots to GLM-5.3-Flash. To use GLM-5.3 for the larger slots, the documentation's manual configuration sets them explicitly in the same env block:
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]"
Z.ai also offers two shortcuts: a helper started with npx @z_ai/coding-helper, and a shell script that edits the settings file for you. Both change files on your machine. Editing settings.json by hand takes a minute and lets you see exactly what was added.
Other tools use other endpoints on the same plan:
| Protocol | Base URL |
|---|---|
| Anthropic Messages | https://api.z.ai/api/anthropic |
| OpenAI Chat Completions | https://api.z.ai/api/coding/paas/v4 |
| OpenAI Responses | https://api.z.ai/api/v1 |
How Claude Code's own project files work is covered in Claude Code project setup. They apply the same way whichever model is answering.
The usage policy is short and worth reading before subscribing:
If you want to call the models from your own scripts or a product, that is what the standard API and its separate key are for.
This guide did not review Z.ai's privacy terms or test the models. Read the terms before sending confidential code, and try your own tasks before committing to a tier. A similar setup with a different provider is described in the DeepSeek API guide.
This article reflects public information available when it was written. Versions, defaults and prices can change; check the linked official documentation.
This is an overview of Z.ai's documentation as read on November 12, 2026, not a hands-on review. No account was created, nothing was subscribed to, and no requests were sent. Prices, credits and rules are Z.ai's published figures. Written for this site with AI assistance, from the sources above. For errors or additional information, please request a correction. Editorial policy
Found this useful? Share it, or follow for new guides.