# GLM-5.1

> Z.ai's flagship model for long-horizon agents and complex engineering tasks.

Agent resources: the index of everything machine-readable is https://www.ohmygpt.com/llms.txt; the integration skill (endpoints, auth, SDK and coding-tool setup) is https://www.ohmygpt.com/skill.md.

- Model ID: `zhipu/glm-5.1`
- Status: available
- Released: 2026-04-08
- Context: 200K tokens
- Max output: 128K tokens
- Input: text; output: text
- Knowledge cutoff: 2025-04
- Capability score: 150 (as of 2026-11-02, see https://www.ohmygpt.com/rankings.md)
- Human preference rating (LMArena text): 1463

## Prices (USD)

| Item | Price | Unit |
| --- | --- | --- |
| Input | $0.66–$0.9636 | per 1M tokens |
| Output | $2.6408–$3.8544 | per 1M tokens |
| Cache read | $0.132–$0.20878 | per 1M tokens |
| Cache write (5 min) | $0.8248–$1.10 | per 1M tokens |

## Providers

Without a prefix each request goes to the best-priced healthy provider. To pin one, send the model as `<provider>:zhipu/glm-5.1`.

| Provider | Pinned model ID | Location | Input | Output | Trains on your data |
| --- | --- | --- | --- | --- | --- |
| Zhipu AI (ChatGLM) | `chatglm:zhipu/glm-5.1` | China | $0.9636 | $3.8544 | no |
| Alibaba Cloud (Model Studio Intl) | `alibaba:zhipu/glm-5.1` | Global (HK/DE/JP) | $0.66–$0.88 | $2.6408–$3.0808 | no |

## Endpoints

| API | Request | model |
| --- | --- | --- |
| OpenAI Chat | POST https://api.ohmygpt.com/v1/chat/completions | `zhipu/glm-5.1` |
| OpenAI Responses | POST https://api.ohmygpt.com/v1/responses | `zhipu/glm-5.1` |
| Anthropic Messages | POST https://api.ohmygpt.com/v1/messages | `zhipu/glm-5.1` |
| Google Gemini | POST https://api.ohmygpt.com/v1/models/zhipu/glm-5.1:generateContent | `zhipu/glm-5.1` |

## Example

```bash
curl https://api.ohmygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $OHMYGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zhipu/glm-5.1",
    "messages": [
      {
        "role": "user",
        "content": "Hello"
      }
    ]
  }'
```

Web page: https://www.ohmygpt.com/models/zhipu/glm-5.1
