Back to Models

GLM 5.1 APIActive

glm-5.1

No description available

By:GLMInput Type:Output Type:Publish time:-

AI Code With channel availability

The same model is billed by channel discount. Copy a channel code to set your preference.

ChannelCache Hit RateContext
GLM官方渠道25% off
92.0%¥4.5/ M tokens¥18/ M tokensRead:¥1.575/ M tokensWrite:¥0/ M tokens200K0.0s

Related Models

More models from GLM

GLM 5.1 API: price, model ID, and how to call it

Call GLM 5.1 through AI Code With. Use model ID glm-5.1 with 200K context. list price about ¥6.00 / ¥24.00 per 1M tokens before channel discounts. Artificial Analysis lists official prices around $1.28 / $4.07 per 1M tokens; our cheapest channel is about ¥4.50 / ¥18.00 per 1M tokens. About ¥0.6300 for 100,000 input / 10,000 output tokens at the cheapest live channel.

Model IDglm-5.1
ProtocolsOpenAI Chat Completions
Context200K
Max output128K

Next: Get API key · See integration guides · All model prices · All model prices

Official vs our price

Official list prices from Artificial Analysis, next to our cheapest live channel (per 1M tokens).

Official input$1.28
Official output$4.07
Our input¥4.50
Our output¥18.00

Artificial Analysis

Cost calculator

Estimate at the cheapest live channel: ¥4.50 / ¥18.00 per 1M tokens, cache read ¥1.57, cache write ¥0.0000. Billed usage follows your prepaid balance.

Estimated cost¥0.6300

cURL example

Set model to glm-5.1. The page slug is only the URL, not the API parameter.

curl https://api.aicodewith.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AICODEWITH_API_KEY" \
  -d '{
    "model": "glm-5.1",
    "messages": [
      { "role": "user", "content": "What is the meaning of life?" }
    ]
  }'

FAQ

What is the GLM 5.1 model ID?

Send model "glm-5.1" in the API request. The page path /glm-5.1 is only the URL, not the model parameter.

How do I call the GLM 5.1 API?

Use one AI Code With API key against https://api.aicodewith.ai/v1/chat/completions, and set model to glm-5.1. Supported protocols: OpenAI Chat Completions. See See integration guides.

How is GLM 5.1 priced?

GLM 5.1 is list price about ¥6.00 / ¥24.00 per 1M tokens before channel discounts. The public page shows available channel discounts; billed usage follows your prepaid balance and the live channel. Artificial Analysis lists official prices around $1.28 / $4.07 per 1M tokens; our cheapest channel is about ¥4.50 / ¥18.00 per 1M tokens. About ¥0.6300 for 100,000 input / 10,000 output tokens at the cheapest live channel.

How long is the GLM 5.1 context window?

GLM 5.1 has about 200K input context and up to 128K output tokens. Treat that as capacity, not a reason to fill every request.