Installation
Basic Setup
Via OpenRouter (Recommended)
Native API
Available Models
OpenRouter Model IDs
When using OpenRouter, prefix models withanthropic/:
Configuration Options
Capabilities
Input Formats
Images
Claude requires base64-encoded images (URLs are downloaded automatically):PDFs
Extended Thinking
Claude models support extended thinking for complex reasoning:max_tokens (OpenRouter) or budget_tokens (native):
Prompt Caching
Claude supports prompt caching for repeated extractions with the same schema:cacheCreationInputTokens: Tokens written to cachecacheReadInputTokens: Tokens read from cache
Structured Output
Claude 4.5 models support native structured output viaoutput_format. Older models use tool calling:
- Sonnet 4.5+: Native
output_formatwithjson_schema - Opus 4.1+: Native
output_formatwithjson_schema - Haiku: Tool calling fallback
Production Setup
Pricing
Via OpenRouter (approximate):Example: Contract Analysis
Next Steps
OpenAI
GPT-4 models
Gemini models