zai-ocr-skill

zai-ocr-skill is a skill for Claude Code, Codex from darellchua2/opencode-config-template. It costs 52 tokens per session (1,498 once invoked), scanned A, original, Apache-2.0.

A document-reading recipe that extracts text and layout from images or PDFs through Z.AI’s GLM-OCR service. It keeps reading order, blocks, and tables structured.

In plain words
What is it for?
Use it to turn scanned documents or PDFs into structured text for later processing.
Why use it?
It helps when plain image descriptions lose the document’s structure, making dense pages and tables harder to use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to turn scanned documents or PDFs into structured text for later processing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/zai-ocr-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add darellchua2/opencode-config-template --skill zai-ocr-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for zai-ocr-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-ocr-skill/github.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-ocr-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-ocr-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-ocr-skill/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.

agentmods 80×15 button for zai-ocr-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/zai-ocr-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/zai-ocr-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,498 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 6 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Supply Chain · line 46
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
  • high Supply Chain · line 75
    Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
    Fix: Avoid downloading and executing remote scripts. Use trusted packages from PyPI/npm. If remote fetch is required, verify checksums and use HTTPS.
  • medium Data Exfiltration · line 46
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 75
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 44
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 72
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01498
Opus 5.5 $0.00021 $0.00599
Sonnet 5.5 $0.00010 $0.00300
Haiku 4.5 $0.00005 $0.00150

Measured 2mo ago against content hash a28c19bd3516, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zai-ocr-skill scanned grade A with 1 finding 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 2mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

> Harness binding (§Portability contract): the `ZAI_API_KEY` env var is the portable credential row — it alone works on every harness. The `~/.local/share/opencode/auth.json` fallback reads OpenCode's credential store (b
skills/zai-ocr-skill/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What I do

I provide the exact recipe for an agent to extract text with layout structure from an image or PDF via the Z.AI GLM-OCR layout_parsing API. Unlike a vision-chat description, the dedicated endpoint returns the document's text organized by detected layout (blocks, reading order, tables).

Why a skill (not vision chat)

  • POST /layout_parsing is a dedicated document-extraction endpoint — richer and more faithful for dense/structured documents than asking a chat model to describe an image.
  • Input is an http(s) URL. Base64 is documented in the API schema but every base64 form is rejected server-side with code 1214 (verified 2026-08-30: png/jpeg/pdf × raw/data-URI/padded/unpadded) — local files use the vision fallback in Path B.

Prerequisite — API key resolution

Harness binding (§Portability contract): the ZAI_API_KEY env var is the portable credential row — it alone works on every harness. The ~/.local/share/opencode/auth.json fallback reads OpenCode's credential store (bonus row; ignore elsewhere — export the env var). Other/none (no auth.json store): export ZAI_API_KEY — the env var alone is sufficient. Recipe execution needs bash + curl + jq (any harness with a shell tool).

KEY="${ZAI_API_KEY:-$(jq -r '.["zai"].key // .["zai-coding-plan"].key // empty' \
     ~/.local/share/opencode/auth.json 2>/dev/null)}"
[ -z "$KEY" ] && { echo "ZAI_API_KEY not found — set it (export ZAI_API_KEY) or run \`opencode auth login\` (Z.AI)."; exit 1; }

If neither source has the key, stop and report — do not proceed.

Recipe

Path A — file already has a public URL (full layout result)

FILE_URL="https://example.com/document.png"           # REQUIRED — public http(s) URL, png/jpg/pdf
BASE="${ZAI_MEDIA_ENDPOINT:-https://api.z.ai/api/paas/v4}"  # pay-as-you-go ONLY

RESP=$(curl -sS --max-time 180 -X POST "$BASE/layout_parsing" \
  -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
  -d "{\"model\":\"glm-ocr\",\"file\":\"$FILE_URL\"}")

printf '%s' "$RESP" | python3 -c '
import sys, json
d = json.load(sys.stdin)
if d.get("error"):
    sys.stderr.write("API error: " + json.dumps(d["error"]) + "\n"); sys.exit(1)
print(d.get("md_results") or "(empty md_results)")
for page in d.get("layout_details", []):
    for el in page:
        print("[" + str(el.get("label", "")) + "] " + str(el.get("content", "")))'

Read the full file on GitHub · 119 lines

Changes

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.

  1. 2mo ago Changed · +2 lines a28c19bd3516
  2. 3mo ago First seen · 117 lines · 52 tokens per session scan A 193810735cb6

Subscribe to this mod's changes

zai-ocr-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 1,498 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

zai-ocr-skill compared with skills from other repositories

zai-ocr-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
zai-ocr-skilldarellchua2/opencode-config-templateSkill62mo agoApache-2.0A52Claude Code, Codex
apify-youtube-transcript-scrapersickn33/agentic-awesome-skillsSkill51ktodayMITA48Claude Code
report-to-pdfasgeirtj/system_prompts_leaksSkill74kyesterdayCC0-1.0A17Claude Code, Codex
skill-doc-deliverynyldn/claude-octopusSkill4.5ktodayMITA29Claude Code
pdf-extract-create-workflowHKUDS/OpenSpaceSkill8.1k23d agoMITA22Claude Code, Codex
document-direct-pythonHKUDS/OpenSpaceSkill8.1k23d agoMITA20Claude Code, Codex
pdf-verification-cliHKUDS/OpenSpaceSkill8.1k23d agoMITA19Claude Code, Codex