最近更新时间:2025-10-11 14:12:47
如您遇到问题,可参考Claude Code官方文档
npm install -g @anthropic-ai/claude-codeexport ANTHROPIC_AUTH_TOKEN=${KSC_API_KEY}
export ANTHROPIC_MODEL=deepseek-v3.1
export ANTHROPIC_BASE_URL=https://kspmas.ksyun.com
export BASH_DEFAULT_TIMEOUT_MS=86400000 # 默认 60 s → 24 h
export BASH_MAX_TIMEOUT_MS=86400000 注:设置
BASH_DEFAULT_TIMEOUT_MS和BASH_MAX_TIMEOUT_MS是为了防止输出过长,触发 Claude Code 客户端超时,这里设置的超时时间为 24小时。
claude 命令,即可开始使用了。cd my-project
claudepip install anthropicexport ANTHROPIC_BASE_URL=https://kspmas.ksyun.com
export ANTHROPIC_API_KEY=${KSC_API_KEY}import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="deepseek-v3.1",
max_tokens=1000,
system="You are a helpful assistant.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Hi, how are you?"
}
]
}
]
)
print(message.content)
# 输出example: [TextBlock(citations=None, text="Hey! I'm doing great, thanks for asking! ? How about you? What's on your mind today?", type='text')]Field | Support Status |
anthropic-beta | Ignored |
anthropic-version | Ignored |
x-api-key | Supported |
Field | Support Status |
model | deepseek-v3.1 kimi-k2-0905-preview kimi-k2-turbo-preview |
max_tokens | Fully Supported |
container | Ignored |
mcp_servers | Ignored |
metadata | Ignored |
service_tier | Ignored |
stop_sequences | Fully Supported |
stream | Fully Supported |
system | Fully Supported |
temperature | Fully Supported (range [0.0 ~ 2.0]) |
thinking | Ignored |
top_k | Ignored |
top_p | Fully Supported |
Field | Support Status |
name | Fully Supported |
input_schema | Fully Supported |
description | Fully Supported |
cache_control | Ignored |
Value | Support Status |
none | Fully Supported |
auto | Supported ( |
any | Supported ( |
tool | Supported ( |
Field | Variant | Sub-Field | Support 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" | Ignored | ||
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 |
纯净模式
