GLM-OCR API

zhipu/glm-ocr
Unlike traditional OCR engines that simply output raw text, GLM-OCR preserves formatting, hierarchy, and layout relationships.
Output
$0.013 / page
Released
Feb 9, 2026

How to use GLM-OCR API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to zhipu/glm-ocr.
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.

GLM-OCR API Pricing

TypePrice
Output
$0.013 / page

GLM-OCR Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
OCRBench
94%
Text recognition + reasoning over images of textSourceJuly 12, 2026

GLM-OCR vs other models

ModelInputOutputContextBest for
GLM-OCR
This page
$0.013 / page
Document text extraction
$5.2 / 1K pages
Document text extraction
$2.6 / 1K pages
Document text extraction
$0.0078 / page
Document text extraction

Frequently asked questions

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.

Start building with GLM-OCR

Get API Key
1000+ models, one API.