Anthropic API
DeepSeek adds Anthropic API format compatibility, letting developers call DeepSeek models via the Anthropic SDK by pointing the base URL to api.deepseek.com/anthropic.
To meet your needs for using the Anthropic API ecosystem, our API now supports the Anthropic API format with a base_url of https://api.deepseek.com/anthropic. With simple configuration, you can integrate DeepSeek's capabilities into the Anthropic API ecosystem. Integrating DeepSeek Models into Claude Code Please refer to integrating Agent tools. Calling DeepSeek Models via Anthropic API Install Anthropic SDK pip install anthropic Configure environment variables export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic export ANTHROPIC_API_KEY=${YOUR_API_KEY} Call API import anthropic client = anthropic.Anthropic() message = client.messages.create( model="deepseek-v4-pro", max_tokens=1000, system="You are a helpful assistant.", messages=[ { "role": "user", "content": [ { "type": "text", "text": "Hi, how are you?" } ] } ] ) print(message.content) Note: When you pass an unsupported model name to DeepSeek's Anthropic API, the API backend will automatically map it to the deepseek-v4-flash model.
Anthropic API Compatibility Details HTTP Header FieldSupport Status anthropic-betaIgnored anthropic-versionIgnored x-api-keyFully Supported Simple Fields FieldSupport Status modelUse…
- api-docs.deepseek.comAnthropic APIprimary