# glm-5.1 — API, Pricing & Context Window | Vivgrid

> Source: https://vivgrid.com/docs/models/glm-5.1

glm-5.1 on Vivgrid: Zhipu AI's capable coding model with a 200K context window, function calling, and competitive pricing.

`glm-5.1` is Zhipu AI's capable coding and reasoning model, offering a **200K-token context window** and reliable function calling at a competitive price. It's a strong open-weight-style option for agentic coding workloads.

On Vivgrid, `glm-5.1` is reachable through the unified, OpenAI-compatible endpoint, so it integrates cleanly alongside models from OpenAI, Anthropic, Google, and DeepSeek under one API key.

## Specifications

| Field | Value |
| --- | --- |
| Provider | Zhipu AI |
| Model ID | `glm-5.1` |
| Best for | Coding |
| Available on | Vibe coding |
| Context window | 200,000 tokens |
| Max output | 128,000 tokens |
| Modalities | Text |
| Tool / function calling | Yes |
| Knowledge cutoff | 2026-03 |
| Acceleration | Global (centralized) |

## Pricing

Pricing in USD per 1M tokens.

| Input | Cached input | Output |
| --- | --- | --- |
| $1.40 | $0.30 | $4.40 |

### What one request costs

The rates above applied to a 20K-token prompt with a 2K-token reply — a typical single agent turn, small enough that every request is billed at the base rate.

| Request | Cost |
| --- | --- |
| Cold prompt, nothing cached | $0.0368 |
| Warm prompt, 90% of the input served from cache | $0.0170 |


## API surfaces

The Vivgrid Console catalogs `glm-5.1` on one surface, all behind the same API key. The endpoint shown is the one the Console previews for that surface.

| Surface | Primary endpoint | Use it for |
| --- | --- | --- |
| Vibe coding | `/chat/completions` | Coding CLIs and IDE agents that drive the model themselves — point the tool at Vivgrid and keep your own loop. |

## Quick start

Get an API key from the Vivgrid Console (https://console.vivgrid.com), then call `glm-5.1` directly.

```bash
curl https://api.vivgrid.com/v1/chat/completions \
  -H "Authorization: Bearer $VIVGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.1",
    "messages": [
      { "role": "user", "content": "Say hello in English, Chinese and Spanish." }
    ],
    "stream": true
  }'
```


## Ideal use cases

- Cost-effective coding agents and CLIs
- Tool-calling workflows on Chat Completions
- General reasoning within a 200K-token context
- Teams diversifying beyond US-based providers

## Related models

- [gpt-6-astra](/docs/models/gpt-6-astra) — OpenAI's frontier gpt-6 coding model
- [glm-5.2](/docs/models/glm-5.2) — newer GLM with a 1M-token context window
- [deepseek-v4-pro](/docs/models/deepseek-v4-pro) — flagship low-cost coding model
