Skip to main content
Anthropic provides Claude models with excellent document understanding and structured output capabilities.

Installation

Basic Setup

Native API

Available Models

OpenRouter Model IDs

When using OpenRouter, prefix models with anthropic/:

Configuration Options

Capabilities

Input Formats

Images

Claude requires base64-encoded images (URLs are downloaded automatically):
Supported formats: PNG, JPEG, WebP, GIF (max 5MB per image, 8000x8000 max).

PDFs

PDF limits: 32MB per file, 100 pages for full visual analysis.

Extended Thinking

Claude models support extended thinking for complex reasoning:
Reasoning is configured via max_tokens (OpenRouter) or budget_tokens (native):

Prompt Caching

Claude supports prompt caching for repeated extractions with the same schema:
Cache metrics are returned in the response:
  • cacheCreationInputTokens: Tokens written to cache
  • cacheReadInputTokens: Tokens read from cache

Structured Output

Claude 4.5 models support native structured output via output_format. Older models use tool calling:
Model support:
  • Sonnet 4.5+: Native output_format with json_schema
  • Opus 4.1+: Native output_format with json_schema
  • Haiku: Tool calling fallback

Production Setup

Pricing

Via OpenRouter (approximate):

Example: Contract Analysis

Next Steps

OpenAI

GPT-4 models

Google

Gemini models