bestmodelfor.ai
Data updated 2026-10-18USD/CNY 6.6862 ECB 2026-10-1639 official prices · 27 plans · 20 tips

← Tool tips

Verified Claude Code

Force output to match your format with --json-schema

What it does

Pass a JSON Schema to a -p call; the validated object appears in the structured_output field, no hand parsing or retries.

How

claude -p "Extract the latest version from CHANGELOG" --output-format json \
  --json-schema '{"type":"object","properties":{"version":{"type":"string"}},"required":["version"]}'

How much to trust this

Applies to≥ 2.1.84
VerifiedOct 17, 2026 · v2.1.296 · tested locally
本机实际运行,structured_output 返回 {'prime': 7};changelog 最早在 2.1.84 提到该参数
Depends on--json-schema-p
Source