GLM 5.1 is the earlier entry in the GLM 5 line, positioned for long-horizon coding tasks that run without step-by-step supervision. It has a smaller context window than the 5.2 and 5.3 entries.

Input · Account credit
$1.40

per 1M tokens

Cash equivalent $0.14

Output · Account credit
$4.40

per 1M tokens

Cash equivalent $0.44

Context window
204,800

tokens · OpenRouter

Input → Output
Text→ Text
Model specifications
Sources reviewed: Y-API catalog snapshot:

Choosing this model

Selection advice by Y-API. The checks below are suggested evaluations, not published test results.

Where to start

Consider it for batch code work where the model is expected to keep working through a task on its own — refactors, test backfills, or dependency upgrades with a clear definition of done.

What to watch for

At 204,800 tokens the window is roughly a fifth of the newer GLM entries while the input price is the same, so long documents belong on 5.2 or 5.3. Being the oldest entry, it is also the most likely to be superseded.

Model specifications

These are OpenRouter model-level specifications, not a Y-API compatibility test. A particular route may accept fewer input formats, parameters or tokens. Verify the features you need with a small request; a successful text response does not validate vision or tool calling.

Context window
204,800 tokens
Input
Text
Output
Text
Listed on OpenRouter
Parameters listed by OpenRouter
frequency_penaltyinclude_reasoninglogit_biaslogprobsmax_tokensmin_ppresence_penaltyreasoningrepetition_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_ktop_logprobstop_p
OpenRouter model page & specifications

API pricing & cost estimate

Estimated credit consumed
$3.60
Estimated cash equivalent
$0.36

Illustrative token budget, not measured usage or a quote. Includes input and output; excludes separate media charges, cache discounts and retries. Include billed reasoning tokens in your output budget where applicable. Actual billing follows usage returned by the service.

$1 paid adds $10 of credit. Cash equivalent = credit consumed ÷ 10; this is not the model publisher’s list price.

Same token budget, different models
ModelEstimated credit consumedEstimated cash equivalent
GLM 5.1$3.60$0.36
GLM 5.2$3.60$0.36
DeepSeek V4 Flash 0731$0.30$0.03
View LLM API pricing & billing

API integration examples

These minimal, text-only requests use the exact Y-API model ID. They do not demonstrate image, audio, video, file or tool support. The output limit also needs room for reasoning; an empty answer with finish_reason=length can mean the budget was exhausted.

A task to try

Add tests for the untested branches in this module without changing its public behavior. Report which branches you could not reach and why.

Set the TOKEN environment variable to a key from your console. Run this on your server or locally; never expose a key in browser code or a public repository.

cURL · GLM 5.1
curl --fail-with-body --silent --show-error --max-time 120 \
  'https://api.y-api.bestvirtualgoods.com/v1/chat/completions' \
  -H "Authorization: Bearer ${TOKEN:?Set TOKEN first}" \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "model": "z-ai/glm-5.1",
  "messages": [
    {
      "role": "user",
      "content": "Add tests for the untested branches in this module without changing its public behavior. Report which branches you could not reach and why."
    }
  ],
  "max_tokens": 4096
}
JSON

How to evaluate the result

Confirm the public API is unchanged by diffing the exported surface, then check that each new test fails when the corresponding branch is deliberately broken.

Before you choose

Why pick GLM 5.1 over 5.2 or 5.3 at the same price?

Usually you would not. Pick it when a shorter window is acceptable and you specifically want the older behavior; otherwise the newer entries cost the same per input token and give you more room.

Sources & scope

Technical facts come from the cited model page and, where available, its linked publisher card. A card describes that checkpoint; it is not proof of the weights a gateway serves. Prices come only from the Y-API catalog. We do not claim measured latency, uptime or benchmark scores for this endpoint.