Skip to main content

Anthropic API

To meet the demand for using the Anthropic API ecosystem, our API has added support for the Anthropic API format. With simple configuration, you can integrate the capabilities of DeepSeek into the Anthropic API ecosystem.

Use DeepSeek in Claude Code

  1. Install Claude Code
npm install -g @anthropic-ai/claude-code
  1. Config Environment Variables
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=${YOUR_API_KEY}
export ANTHROPIC_MODEL=deepseek-chat
export ANTHROPIC_SMALL_FAST_MODEL=deepseek-chat
  1. Enter the Project Directory, and Execute Claude Code
cd my-project
claude

Invoke DeepSeek Model via Anthropic API

  1. Install Anthropic SDK
pip install anthropic
  1. Config Environment Variables
export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_API_KEY=${DEEPSEEK_API_KEY}
  1. Invoke the API
import anthropic

client = anthropic.Anthropic()

message = client.messages.create(
model="deepseek-chat",
max_tokens=1000,
system="You are a helpful assistant.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Hi, how are you?"
}
]
}
]
)
print(message.content)

Anthropic API Compatibility Details

HTTP Header

FieldSupport Status
anthropic-betaIgnored
anthropic-versionIgnored
x-api-keyFully Supported

Simple Fields

FieldSupport Status
modelUse DeepSeek Model Instead
max_tokensFully Supported
containerIgnored
mcp_serversIgnored
metadataIgnored
service_tierIgnored
stop_sequencesFully Supported
streamFully Supported
systemFully Supported
temperatureFully Supported (range [0.0 ~ 2.0])
thinkingIgnored
top_kIgnored
top_pFully Supported

Tool Fields

tools

FieldSupport Status
nameFully Supported
input_schemaFully Supported
descriptionFully Supported
cache_controlIgnored

tool_choice

ValueSupport Status
noneFully Supported
autoSupported (disable_parallel_tool_use is ignored)
anySupported (disable_parallel_tool_use is ignored)
toolSupported (disable_parallel_tool_use is ignored)

Message Fields

FieldVariantSub-FieldSupport Status
content string Fully Supported
array, type="text" text Fully Supported
cache_control Ignored
citations Ignored
array, type="image" Not Supported
array, type = "document" Not Supported
array, type = "search_result" Not Supported
array, type = "thinking" Fully Supported
array, type="redacted_thinking" Not Supported
array, type = "tool_use" id Fully Supported
input Fully Supported
name Fully Supported
cache_control Ignored
array, type = "tool_result" tool_use_id Fully Supported
content Fully Supported
cache_control Ignored
is_error Ignored
array, type = "server_tool_use" Not Supported
array, type = "web_search_tool_result" Not Supported
array, type = "code_execution_tool_result" Not Supported
array, type = "mcp_tool_use" Not Supported
array, type = "mcp_tool_result" Not Supported
array, type = "container_upload" Not Supported