ModelSheep
All models

GLM OCR API

GLM OCR converts document images to Markdown or JSON for developers parsing invoices, forms and reports, from $0.027.

  • Image in, text out
  • not published token context
  • 0.9B parameters, FP8
  • MIT licence
from openai import OpenAI

client = OpenAI(
    base_url="https://api.modelsheep.com",
    api_key=API_KEY_MODELSHEEP,
)

response = client.chat.completions.create(
    model="zai-org/GLM-OCR",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "Read the text in this image."
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://modelsheep.com/invoice.png"
                    }
                }
            ]
        }
    ],
)

print(response.choices[0].message.content)

How to use the GLM OCR API

  1. 1

    Create a ModelSheep account and copy an API key from the dashboard.

  2. 2

    Point the OpenAI SDK at the base url https://api.modelsheep.com and set the model to zai-org/GLM-OCR.

  3. 3

    Send one user message that holds a text part and an image part, pass the image as a URL or a base64 data URL, and read the Markdown or JSON back from the first choice.

What GLM OCR is

GLM OCR is a document recognition model from Z.ai. It reads a page image and returns the text, tables and formulas. Z.ai trained it for two tasks. It parses a document or extracts named fields. Other vision models in this catalogue answer open questions about an image. GLM OCR transcribes the page.

What it does well

  • Converts a scanned invoice or receipt to Markdown.
  • Rebuilds a table from a report page as HTML.
  • Extracts named fields from a form or certificate to JSON.

What it is not for

  • Open questions about a photo. The model card lists two tasks: document parsing and information extraction. The model does not describe a scene or discuss an image.
  • Long documents in one call. The context window holds not published tokens. One dense page and a long JSON answer can fill it. Send one page per request.

Calling it

Call POST /chat/completions with the model string zai-org/GLM-OCR. Include a text part and an image part in the same user message. The image must be a URL or a base64 data URL. Pass a JSON schema in response_format when you need fields. A loose instruction returns loose text.

zai-org/GLM-OCR /chat/completions

SDKs and languages

GLM OCR answers on an HTTP endpoint, so any language that can post JSON reaches it. These are the ones the box above writes out.

OpenAI SDK
PythonTypeScript
Anthropic SDK
PythonTypeScript
HTTP
cURLPythonTypeScriptGoRustJavaC#PHP

Specifications

AuthorZ.ai
Categoryvision
Acceptstext, image
Returnstext
Total parameters0.9B
Active parametersdense, all of them
Scorenot rated
Languages8 namedChinese, English, French, Spanish, Russian, German, Japanese and Korean. Z.ai ends the list with "etc.", so eight is a floor. Arabic is not supported today.
Precision servedFP8
Contextnot publishedZ.ai publishes no window for this model. Send one page a request.
Vectorn/a
Pulls1.7M in the last 30 daysWeights pulled from Hugging Face, read on 2026-09-24. It counts the repository, not this API.
LicenseMIT

Price

Input

$0.027

per million tokens

Output

$0.027

per million tokens

Against OpenRouter

10%

below the cheapest of 1 provider

The cheapest OpenRouter price for this model was $0.030 in and $0.030 out, with a median of $0.030 and $0.030 across the comparable providers. Read on 2026-09-17.

License

Z.ai publishes the weights under the MIT licence, which permits commercial use. The full Z.ai document pipeline adds the PP-DocLayoutV3 layout component under Apache 2.0. Read both licences before you self-host that pipeline.

Similar models

DeepSeek V4 Flash 0731deepseek-ai/DeepSeek-V4-Flash-0731🤗
Parameters
284B, 13B
Context
1M
Input per 1M
$0.027
Output per 1M
$0.117
Released
Jul 2026
Pulls, 30 days
4M
License
MIT
Faster Whisper Large v3Systran/faster-whisper-large-v3🤗
Parameters
1.55B
Context
0K
Input per 1M
$0.024 /hr
Output per 1M
n/a
Released
Nov 2023
Pulls, 30 days
973.5K
License
MIT
Nemotron 3 Embed 8Bnvidia/Nemotron-3-Embed-8B-BF16🤗
Parameters
7.953B
Context
33K
Vector
4096
Input per 1M
$0.031
Output per 1M
n/a
Released
Jul 2026
Pulls, 30 days
97.1K
License
OpenMDW 1.1

Start using GLM OCR

Point the OpenAI SDK at api.modelsheep.com. Your prompts stay in Germany, and nothing is retained.