Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/zai-org/GLM-skillsnpx agentmods add skills/zai-org/glm-skills/glmocr-sdkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/zai-org/glm-skills/glmocr-sdk)<a href="https://agentmods.dev/skills/zai-org/glm-skills/glmocr-sdk"><img src="https://agentmods.dev/badge/skills/zai-org/glm-skills/glmocr-sdk/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/zai-org/glm-skills/glmocr-sdk"><img src="https://agentmods.dev/badge/skills/zai-org/glm-skills/glmocr-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00174 | $0.02783 |
| Opus 5 | $0.00087 | $0.01392 |
| Sonnet 5 | $0.00035 | $0.00557 |
| Haiku 4.5 | $0.00017 | $0.00278 |
Grade A, and why
glmocr-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 349 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OpenClaw Skill: glmocr
Parses documents (images, PDFs, scans) via the GLM-OCR SDK.
📌 On-demand: This skill requires only
ZHIPU_API_KEYin the environment. No YAML config files or GPU needed.
⚡ Quick Start
# Install
pip install glmocr
# Set API key (once)
export ZHIPU_API_KEY=sk-xxx
# or add to .env file in working directory:
echo "ZHIPU_API_KEY=sk-xxx" >> .env
# One-liner
import glmocr
result = glmocr.parse("document.pdf")
print(result.markdown_result)
print(result.to_dict())
# CLI — pass API key directly (no env setup needed)
glmocr parse image.png --api-key sk-xxx
# Or load from a specific .env file
glmocr parse image.png --env-file /path/to/.env
# Or rely on env var / auto-discovered .env (set once, then omit)
glmocr parse image.png
glmocr parse ./scans/ --output ./output/ --stdout
Configuration Priority
Constructor kwargs > os.environ > .env file > config.yaml > built-in defaults
Agents override everything via constructor kwargs or env vars — no YAML editing needed.
Key Environment Variables
| Variable | Description | Example |
|---|---|---|
ZHIPU_API_KEY |
API key (required for MaaS) | sk-abc123 |
GLMOCR_MODEL |
Model name | glm-ocr |
GLMOCR_TIMEOUT |
Request timeout (seconds) | 600 |
GLMOCR_ENABLE_LAYOUT |
Layout detection on/off | true |
GLMOCR_LOG_LEVEL |
DEBUG / INFO / WARNING / ERROR |
INFO |
Python API
Convenience function (single call)
import glmocr
# Single file → PipelineResult
result = glmocr.parse("invoice.png")
# Multiple files → list[PipelineResult]
results = glmocr.parse(["page1.png", "page2.png", "report.pdf"])
Class-based (multiple calls / resource reuse)
from glmocr import GlmOcr
parser = GlmOcr(api_key="sk-xxx") # mode auto-set to "maas"
parser = GlmOcr(mode="maas") # reads ZHIPU_API_KEY from env
# Always use as context manager or call .close()
with GlmOcr(api_key="sk-xxx") as parser:
result = parser.parse("document.png")
print(result.markdown_result)
parser.close() # if not using `with`
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 349 lines · 174 tokens per session scan A 22cd58294841
glmocr-sdk is a skill published in the GitHub repository zai-org/GLM-skills (474 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 174 tokens to every session and 2,783 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
mk:multimodal
Process images, video, audio, PDFs with Gemini API. Generate images (Nano Banana 2), videos (Veo 3), speech (MiniMax TTS), music (MiniMax). Convert documents to Markdown. Multi-provider fallback (Gemini → MiniMax → OpenRouter). Activate when task references media files, asks to…
A set of instructions for working with PDF files, which are documents designed to preserve their layout across devices.
paddleocr-doc-parsing
A document-parsing tool configuration for extracting structured Markdown or JSON from complex PDFs and document images, including tables, formulas, charts, and multi-column pages.
paddleocr-text-recognition
An optical character recognition tool configuration for extracting text from images, photos, scans, screenshots, and scanned PDFs. OCR means converting text visible in an image into machine-readable text.
invoice-document-pdf
Generating invoices, contracts, forms, receipts, and business documents as professional PDFs.
report-generation
Creating structured PDF reports from data, templates, and AI-generated content using professional toolchains.