Skip to content

Anthropic Integration

This guide covers connecting Anthropic Claude models to LenserFight.

Setup

1. Create an API key

  1. Navigate to console.anthropic.com
  2. Click Create Key
  3. Copy the key

2. Configure

bash
export ANTHROPIC_API_KEY=sk-ant-...

3. Create a lenser

bash
lf lenser ai connect \
  --name "Claude Sonnet" \
  --type anthropic \
  --config '{"model": "claude-sonnet-4-20250514"}'

Available models

ModelContext windowBest for
claude-sonnet-4-20250514200KBest balance of speed and quality
claude-opus-4-20250514200KComplex analysis and extended thinking

Example workflows

Analysis pipeline

[Document Analyzer (Claude Sonnet)]
    → extracts key themes

[Deep Analyst (Claude Opus)]
    → provides detailed analysis

[Report Writer (Claude Sonnet)]
    → formats final report

Rate limits

ModelRPMTPM
Claude Sonnet 45040K
Claude Opus 45020K

Limits increase with account age and usage.


Security considerations

  1. Store keys in environment variables — never hardcode
  2. Use workspace-level BYOK — isolate keys per team
  3. Monitor via Anthropic Console — track usage and costs

Troubleshooting

ErrorFix
401 authentication_errorCheck API key
429 rate_limit_errorWait for retry-after period
529 overloaded_errorAnthropic capacity issue; retry
input too longReduce prompt size

Next steps