Anthropic (Claude)
Anthropic's Claude models are the recommended primary provider for Contract Lucidity. Claude excels at structured document analysis, legal reasoning, and following complex instructions with high fidelity -- all critical for contract intelligence.
Getting an API Key
- Go to console.anthropic.com
- Create an account or sign in
- Navigate to Settings > API Keys
- Click Create Key
- Give the key a descriptive name (e.g.,
contract-lucidity-prod) - Copy the key immediately -- it will not be shown again
Store your API key securely. CL encrypts API keys at rest in the database (api_key_encrypted column), but the key is transmitted in plaintext during initial configuration. Always use HTTPS in production.
Recommended Models
Claude Sonnet 4.6 -- Best for Most Tasks
| Property | Value |
|---|---|
| Model ID | claude-sonnet-4-6 |
| Context Window | 1M tokens (GA) |
| Max Output | 16,000 tokens |
| Input Price | $3.00 / 1M tokens |
| Output Price | $15.00 / 1M tokens |
| Best For | Extraction, classification, clause analysis, generation |
Claude Sonnet 4.6 provides the optimal balance of quality, speed, and cost for the majority of CL pipeline stages. It handles structured JSON extraction reliably, classifies documents accurately, and produces well-formatted clause analysis. The 1M token context window (now GA) enables processing very large contracts without chunking.
Claude Opus 4.6 -- Best for Complex Analysis
| Property | Value |
|---|---|
| Model ID | claude-opus-4-6 |
| Context Window | 1M tokens (GA) |
| Max Output | 32,000 tokens |
| Input Price | $5.00 / 1M tokens |
| Output Price | $25.00 / 1M tokens |
| Best For | Complex reasoning, risk assessment reports, nuanced legal analysis |
Claude Opus 4.6 is Anthropic's most capable model. Use it for the Reasoning capability when processing high-value or complex contracts that require nuanced analysis, multi-factor risk assessment, or detailed negotiation recommendations. The 1M token context window (now GA) allows entire contract portfolios to be analyzed in a single pass.
Assign Sonnet 4.6 to Extraction & Classification, Document Understanding, and Generation. Reserve Opus 4.6 for Reasoning only. This reduces costs by ~60% compared to using Opus 4.6 for everything, with negligible quality difference on routine tasks.
Claude Haiku 4.5 -- Budget Option
| Property | Value |
|---|---|
| Model ID | claude-haiku-4-5-20251001 |
| Context Window | 200K tokens |
| Max Output | 8,192 tokens |
| Input Price | $1.00 / 1M tokens |
| Output Price | $5.00 / 1M tokens |
| Best For | High-volume extraction on straightforward documents |
Haiku 4.5 is significantly faster and cheaper. Consider it for Extraction & Classification when processing large batches of standard-form contracts (NDAs, SOWs) where speed matters more than nuance.
Model pricing as of March 2026. Verify current pricing at platform.claude.com/docs/en/about-claude/pricing.
Configuration in Contract Lucidity
Adding Anthropic as a Provider
- Navigate to Settings > AI Providers
- Click Add Provider
- Select Anthropic as the provider type
- Paste your API key
- Click Save & Verify
Mapping Capabilities
After adding the provider, go to Settings > AI Capabilities and assign Anthropic models to each capability:
Anthropic does not offer a native embedding model. When the Anthropic provider is configured for the Embeddings capability, CL routes embedding calls to the Voyage AI API using your Anthropic API key. Voyage AI models such as voyage-3 and voyage-3-lite are purpose-built for retrieval tasks and integrate seamlessly.
Alternatively, you can configure OpenAI as a second provider specifically for embeddings (recommended -- see the OpenAI guide).
Cost Considerations
Estimating Monthly Spend
| Volume | Documents/Month | Avg Pages | Est. Monthly Cost (Sonnet 4.6) | Est. Monthly Cost (Opus 4.6 for Reasoning) |
|---|---|---|---|---|
| Small firm | 50 | 15 | ~$25 | +$15 |
| Mid-size | 200 | 20 | ~$130 | +$80 |
| Am Law 200 | 1,000 | 25 | ~$750 | +$500 |
| Am Law 100 | 5,000+ | 30 | ~$4,500 | +$3,000 |
Prompt Caching
Anthropic automatically caches system prompts for Claude Sonnet 4.6 and Opus 4.6. Since CL reuses the same system prompts across all documents of the same type, you benefit from:
- 90% cost reduction on cached prompt tokens (input)
- Automatic activation -- no configuration needed
- Greatest savings when processing batches of similar documents
Batch Processing
Anthropic offers a Message Batches API with 50% cost savings. CL does not currently use batch mode (documents are processed individually in real-time), but this is on the roadmap for high-volume deployments.
Rate Limits
Anthropic uses a tiered rate limit system based on cumulative spend. Rate limits are measured in requests per minute (RPM), input tokens per minute (ITPM), and output tokens per minute (OTPM).
| Tier | Spend Required | RPM | Input TPM (Sonnet) | Output TPM (Sonnet) |
|---|---|---|---|---|
| Tier 1 | $5 | 50 | 20,000 | 4,000 |
| Tier 2 | $40 | 1,000 | 40,000 | 8,000 |
| Tier 3 | $200 | 2,000 | 80,000 | 16,000 |
| Tier 4 | $400 | 4,000 | 2,000,000+ | 400,000+ |
At Tier 1, you can only process roughly one document at a time due to the 50 RPM limit. For production use, ensure you are at least at Tier 2 by adding credits to your Anthropic account.
If CL encounters a rate limit error, the Celery task will retry once after 30 seconds (max_retries=1, default_retry_delay=30). Persistent rate limiting will cause the document to fail.
Checking Your Tier
- Log in to console.anthropic.com
- Navigate to Settings > Plans & Billing
- Your current tier and limits are displayed under Usage Limits
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid or expired API key | Regenerate key at console.anthropic.com |
429 Too Many Requests | Rate limit exceeded | Wait and retry, or upgrade tier |
overloaded_error | Anthropic capacity issues | Transient -- retry in a few minutes |
| Documents fail at classification | API key valid but no capability mapping | Go to Settings > AI Capabilities and assign models |
| Embeddings fail with Anthropic provider | Voyage AI key issue or model mismatch | Ensure model name is a valid Voyage model (e.g., voyage-3), or switch Embeddings to OpenAI |