All integrationsLLM Provider
Anthropic Integration
Run Claude 3.5 Sonnet and Claude 3 Opus via FastAPI.
Switch to Anthropic Claude with a single environment variable change. The kit's unified LLM abstraction handles Claude's message format, streaming protocol, and token counting automatically.
Setup in 4 steps
- 1Add ANTHROPIC_API_KEY to your .env file
- 2Set LLM_PROVIDER=anthropic in config
- 3Your existing llm.chat() calls work unchanged
- 4Token counting maps automatically to Anthropic's usage format
What's included
- Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku — configurable
- Streaming via Anthropic's native streaming protocol, abstracted
- Token counting normalised across providers for consistent billing
- System prompt support with Claude's preferred message structure
- Fallback to OpenAI if Anthropic is unavailable
Code example
# .env — just change the provider
ANTHROPIC_API_KEY=sk-ant-...
LLM_PROVIDER=anthropic
LLM_MODEL=claude-3-5-sonnet-20241022
# Zero code changes in your business logic
response = await llm.chat(
messages=[{"role": "user", "content": prompt}],
stream=True, # Kit handles Anthropic's stream format
)Full documentation: /docs/llm-providers
Anthropic integration pre-wired and ready.
FastAPI AI Kit ships with Anthropic configured out of the box. No manual setup required.
Ready to ship your AI backend this weekend?
Join developers who skipped weeks of boilerplate and went straight to building.
No subscriptions · One-time payment · Lifetime updates
