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

Overview

GLM-OCR API Overview

GLM-OCR goes beyond character detection. It analyzes document layout and semantic structure, enabling accurate reconstruction of content in a format that mirrors the original document. Headings remain headings, lists stay structured, tables retain alignment, and multi-column layouts are interpreted correctly.

This structural awareness significantly reduces the need for post-processing. Instead of spending time cleaning unstructured text, developers and enterprises receive output that is immediately usable in automation pipelines, databases, content systems, or AI-powered applications.

Core Capabilities

Structured Text Extraction from Complex Sources

GLM-OCR processes a wide variety of inputs, including scanned PDFs, photographed documents, screenshots, and multi-column layouts. It performs reliably even on documents that mix text blocks, tables, and graphical elements.

Intelligent Table Recognition

Tables are often the most challenging component of document digitization. GLM-OCR detects table boundaries, column relationships, header structures, and multi-row formatting with high precision. Instead of flattening tables into fragmented lines of text, it reconstructs them in structured Markdown format, preserving alignment and hierarchy.

Multi-Page Document Support

GLM-OCR seamlessly handles multi-page documents while maintaining section continuity and structural hierarchy. Page order is preserved, and logical relationships between sections remain intact.

Technical Overview

GLM-OCR supports standard image formats such as JPEG and PNG, along with scanned and digital PDF files. Multi-page processing is handled natively, eliminating the need for page-by-page orchestration.

The output is delivered as structured Markdown, designed to preserve formatting and document hierarchy while remaining easy to transform into other structured formats when required.

API Pricing

  • OCR (per computation page): $0.013

Use Cases for GLM-OCR

Document Automation

Automate repetitive document processing tasks in finance, legal, HR, and operations. Extract structured data directly from PDFs and scanned files without manual entry.

AI-Powered Knowledge Systems

Feed clean Markdown into search indexes, retrieval-augmented generation systems, and enterprise AI assistants to improve accuracy and reduce noise.

Invoice and Financial Data Extraction

Extract line items, totals, dates, and structured financial data from invoices and statements with formatting preserved.

Academic and Research Digitization

Convert scanned academic papers and multi-page research documents into structured, searchable text.

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 100%
  • Error rate (24h): 0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

Use cases

Document text extraction: GLM-OCR is documented as suitable for extracting text from PDFs, DOCX, PPTX, XLSX, HTML, images, and scanned documents, including mixed text-image documents.

Scanned business documents: It is documented as suitable for processing scanned documents such as invoices, contracts, forms, reports, receipts, certificates, and cards, with structured JSON output for key information extraction.

Tables and structured layouts: GLM-OCR is documented as suitable for text extraction from tables and other structured layouts, including complex tables with merged cells and multi-level headers, with HTML or Markdown-style output.

Formula and mathematical content: It is documented as suitable for recognizing formulas and mathematical expressions, including structured output for equations and notation.

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
$0.0065 / page
Document text extraction
$0.0039 / page
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.