Best Model for This
Costs assume ~400 tokens input + ~200 tokens output per extraction.
Quick Start
Tips & Best Practices
- Always set
temperature=0— extraction is deterministic, not creative. Higher temperatures introduce variation in field names and values. - Always validate output — use Pydantic or Zod. Models occasionally miss optional fields or format dates differently.
- Provide examples in the system prompt — one example of input + expected output dramatically improves accuracy on complex schemas.
- Use
response_format: json_object— guarantees JSON-parseable output, prevents markdown wrapping or prose before the JSON.
Cost Estimate
Assumes ~400 tokens input + ~200 tokens output per extraction. Token count scales with document length.
Next Steps
- Structured Outputs — enforced JSON schema reference
- Error Handling — handle malformed JSON and retries
- Prompt Caching — cache the system prompt when processing batches