访问地址:国内 https://4sapi.org、https://4stoken.com;海外https://4sapi.top、https://4sapi.com、https://us.4sapi.com;纯 API 专线https://4sapi.ai;北美低延迟https://4sapi.net。详见《国内外直连域名》。
claude-opus-5-5claude-opus-5-5、claude-opus-4-6、claude-opus-5、claude-haiku-4-5-20251001、claude-opus-4-8、claude-opus-4-7、claude-haiku-4-5-20251001-thinking、claude-opus-4-5-20251101-thinking 等curl --location 'https://4sapi.org/v1/messages' \
--header 'Accept: application/json' \
--header 'Authorization: sk-' \
--header 'anthropic-version: 2026-10-21' \
--header 'Content-Type: application/json' \
--data '{
"model": "claude-opus-5-5",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": "Use the code execution tool to calculate the mean and standard deviation of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
}
],
"tools": [
{
"type": "code_execution_20250825",
"name": "code_execution"
}
]
}'{
"model": "claude-opus-5-5",
"id": "msg_011CgRuoPPugEG4niU2coV2e",
"type": "message",
"role": "assistant",
"content": [
{
"type": "server_tool_use",
"id": "srvtoolu_01TpU4RgbFdfERWhZN9VgrUB",
"name": "code_execution",
"input": {
"code": "a,b=1,1\nfor _ in range(13):a,b=b,a+b\nprint(b)"
}
},
{
"type": "code_execution_tool_result",
"tool_use_id": "srvtoolu_01TpU4RgbFdfERWhZN9VgrUB",
"content": {
"type": "code_execution_result",
"stdout": "610",
"stderr": "",
"return_code": 0,
"content": [],
"abort_reason": null
}
},
{
"type": "text",
"text": "610"
}
],
"container": {
"id": "container_01VvrUB7kK5UeWPNdK4pzGje",
"expires_at": "2026-10-27T02:56:37.446184Z"
},
"stop_reason": "end_turn",
"stop_sequence": null,
"stop_details": null,
"usage": {
"input_tokens": 2039,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"cache_creation": {
"ephemeral_5m_input_tokens": 0,
"ephemeral_1h_input_tokens": 0
},
"output_tokens": 80,
"output_tokens_details": {
"thinking_tokens": 0
},
"service_tier": "standard",
"inference_geo": "global",
"speed": "standard",
"server_tool_use": {
"web_search_requests": 0,
"web_fetch_requests": 0
}
},
"diagnostics": null
}