/TEXT/glm-5.1
Chat
Z.ai

GLM-5.1 API

GLM model for text generation, reasoning, and code.

Starting at

$0.63

input price per 1M tokens

4 token price options

GLM-5.1 API pricing

The base rates apply when total input is at most 32000 tokens, including cache reads and writes. Above this threshold, the long-context rates apply to the whole request, including output, not just the excess tokens.

If a cache rate is absent, reads and writes use the input rate. An absent 1h write rate uses the ordinary cache-write rate, or input if that is also absent.

Prices per 1M tokens
Token typeBase: input ≤ 32000Long context: input > 32000
Input$0.63$0.84
Output$1.98$2.31
Cache read$0.117$0.18
Cache write$0.63$0.84
1curl -X POST https://api.api-stock.com/api/v1/chat/completions \
2 -H "Authorization: Bearer $API_STOCK_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "glm-5.1",
6 "messages": [
7 {
8 "role": "user",
9 "content": "A cinematic shot of a city at dusk"
10 }
11 ]
12 }'

Frequently asked questions

How much does GLM-5.1 cost?

GLM-5.1 starts at $0.63 per 1M input tokens on API Stock. The final charge depends on the selected settings.

How do I get an API key for GLM-5.1?

Create an account and API key on API Stock, then fund your balance. The same key works with GLM-5.1 and other catalog models.

How is long context priced for GLM-5.1?

The base rates apply when total input is at most 32000 tokens, including cache reads and writes. Above this threshold, the long-context rates apply to the whole request, including output, not just the excess tokens. Above-threshold rates per 1M tokens: Input: $0.84; Output: $2.31; Cache read: $0.18; Cache write: $0.84. If a cache rate is absent, reads and writes use the input rate. An absent 1h write rate uses the ordinary cache-write rate, or input if that is also absent.

How do I call the GLM-5.1 API?

Send a POST request to https://api.api-stock.com/api/v1/chat/completions with your API key and the model "glm-5.1", using the openai-compatible request format shown in the quick start above.

What happens if a GLM-5.1 request fails?

API Stock automatically retries the request on a reserve provider. If every provider fails, the charge is refunded to your balance.

Can I use GLM-5.1 with the same API key as other models?

Yes. Use your API Stock API key and balance for GLM-5.1 and other catalog models.