# GLM-5.1

> GLM-5.1 is Z-AI's flagship foundation model for long-horizon autonomous tasks. With a 200K context and 128K output window, it scores 58.4 on SWE-Bench Pro and supports thinking mode, function calling, and MCP integration. Overall capability aligns with Claude Opus 4.6 across reasoning, coding, and agentic benchmarks.

**ID**: `z-ai/glm-5.1`  
**Creator**: Zhipu AI  
**Category**: text  
**Context**: 128K tokens  
**Pricing**: $0.97 / $3.04 per 1M · billed by your provider (BYOK)  
**Released**: 2026-06-01  
**Web page**: https://anyrouter.dev/model/z-ai/glm-5.1

**Input modalities**: text  
**Output modalities**: text  

**Tokenizer**: GLM

**Capabilities**: chat, reasoning, streaming, function-calling, thinking

## Usage

**Endpoint**: `POST https://anyrouter.dev/api/v1/chat/completions`

```bash
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "z-ai/glm-5.1",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in 3 words."
    }
  ]
}'
```

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| aihubmix-byok | $1.40/M (list) | $4.40/M (list) |
| z-ai-byok | $1.40/M (list) | $4.40/M (list) |
| deepinfra-byok | $1.40/M (list) | $4.40/M (list) |
| openrouter-byok | $0.97/M (list) | $3.04/M (list) |
| Z-AI Coding Plan | $1.40/M (list) | $4.40/M (list) |
| ollama-byok | $1.40/M (list) | $4.40/M (list) |
| opencode-zen-byok | $1.40/M (list) | $4.40/M (list) |
| opencode-go-byok | $1.40/M (list) | $4.40/M (list) |
| siliconflow-byok | $1.40/M (list) | $4.40/M (list) |
| commandcode-byok | $1.40/M (list) | $4.40/M (list) |

BYOK routes are billed by your own provider key — AnyRouter charges $0. Rates marked (list) are the provider's published list price.

## Benchmarks

- **GPQA Diamond**: 0.8
- **HLE**: 0.3
- **τ²-Bench Telecom**: 1.0
- **SciCode**: 0.4
- **OTIS Mock AIME**: 0.9
- **SimpleQA (verified)**: 0.4

Benchmark data from [Epoch AI](https://epoch.ai/benchmarks) (CC-BY 4.0).
