Skip to main content
You can access Claude models at up to 50% off official Anthropic pricing by routing the Anthropic Python SDK through Flatkey. Set the base_url parameter once and your existing SDK code works as-is — no other changes required.

Installation

pip

Basic setup

python
When using the Anthropic SDK, set base_url to https://router.flatkey.ai (without /v1). The SDK appends the path automatically.

Sending a message

python

System prompts

python

Streaming

python

Multi-turn conversations

python

Available Claude models

See the Model Directory for all Claude models and current pricing.
You can also use Claude models with the OpenAI SDK through Flatkey — just set model="claude-sonnet-4-5" in a client.chat.completions.create() call. Use whichever SDK fits your project.