import requests headers = {"Authorization": "Bearer " + AIMLAPI_KEY} res = requests.post( "https://api.aimlapi.com/v1/ocr", headers=headers, json={ "model": "zhipu/glm-ocr", "document": "https://example.com/invoice.pdf" }, ).json() print(res)
const res = await fetch("https://api.aimlapi.com/v1/ocr", { method: "POST", headers: { Authorization: `Bearer ${AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ model: "zhipu/glm-ocr", document: "https://example.com/invoice.pdf", }), }).then((r) => r.json()); console.log(res);
curl -s https://api.aimlapi.com/v1/ocr \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "zhipu/glm-ocr", "document": "https://example.com/invoice.pdf" }'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Output | |
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| OCRBench | 94% | Text recognition + reasoning over images of text | Source | July 12, 2026 |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
GLM-OCR This page | Document text extraction | |||
| Document text extraction | ||||
| Document text extraction | ||||
| Document text extraction |
GLM-OCR takes document, image as input and returns text.
GLM-OCR became available on February 9, 2026.
GLM-OCR is priced at $0.013 / page.
GLM-OCR is billed per generation — a fixed charge per output rather than by prompt length.
GLM-OCR was built by Zhipu AI.
Use zhipu/glm-ocr as the model id on AI/ML API.
Yes. GLM-OCR is served through AI/ML API, so the same key and endpoint format used for other models applies.
GLM-OCR is described as a document understanding model that extracts text and structured content from images and documents, not just plain OCR.