# GLM-OCR

> GLM-OCR is Z.ai's open-weight 0.9B document OCR model. It reads text, tables and formulas from page images, and extracts structured fields through a JSON schema. AnyRouter routes it through a BYOK host.

**ID**: `z-ai/glm-ocr`  
**Creator**: Zhipu AI  
**Category**: multimodal  
**Context**: 8K tokens  
**Pricing**: $0.03 / $0.03 per 1M · billed by your provider (BYOK)  
**Released**: 2026-11-22  
**Links**: [Weights on Hugging Face](https://huggingface.co/zai-org/GLM-OCR) · [Announcement](https://github.com/zai-org/GLM-OCR) · [Paper](https://arxiv.org/abs/2603.10910) · [AnyRouter release](https://anyrouter.dev/blog/releases/glm-ocr)  
**Web page**: https://anyrouter.dev/model/z-ai/glm-ocr

**Input modalities**: text, image  
**Output modalities**: text  

**Capabilities**: ocr, document-parsing

**Supported parameters**: frequency_penalty, max_tokens, presence_penalty, response_format, seed, stop, structured_outputs, temperature, top_p

## 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-ocr",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in 3 words."
    }
  ]
}'
```

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| phala-byok | $0.03/M (list) | $0.03/M (list) |

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

## Model card

- Architecture: dense [1]
- Total parameters: 0.9B [1]
- Native context: 8192 tokens [1]
- License: MIT, open weights (https://huggingface.co/zai-org/GLM-OCR) [1]

### Strengths [1]

- Combines a CogViT visual encoder, a token-downsampling connector and a 0.5B GLM decoder for complex document layouts
- Uses multi-token prediction and full-task reinforcement learning for recognition and generalization
- Vendor reports 94.62 on OmniDocBench V1.5, first overall in its results table
- A vendor throughput test measured 1.86 PDF pages and 0.67 images per second at one concurrency

### Known limits [1]

- Supports two prompt families only, document parsing and strict-schema information extraction
- Full page parsing needs the GLM-OCR SDK with PP-DocLayoutV3 layout analysis; the model alone handles regions
- The hosted Phala listing exposes an 8,192-token window and one page image per request

### Use cases [1]

- Parsing invoices, forms and tables from page images
- Extracting typed fields with a JSON schema
- Recognizing formulas in scanned documents

### API notes [1]

- Task prompts are Text Recognition, Table Recognition and Formula Recognition
- Information extraction prompts must state a JSON schema; response_format json_schema is supported
- Chat completion requests carry one image and the task prompt, with text returned

### Links

- announcement: https://github.com/zai-org/GLM-OCR
- model card: https://huggingface.co/zai-org/GLM-OCR
- paper: https://arxiv.org/abs/2603.10910
- docs: https://docs.z.ai/guides/vlm/glm-ocr

### Sources

1. [GLM-OCR model card](https://huggingface.co/zai-org/GLM-OCR/raw/main/README.md) (accessed 2026-11-30)

## Source

- Upstream docs: https://huggingface.co/zai-org/GLM-OCR
