访问地址:国内 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 'Content-Type: application/json' \
--data '{
"model": "claude-opus-5-5",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": [
"location"
]
}
}
],
"messages": [
{
"role": "user",
"content": "What is the weather like in San Francisco?"
}
]
}'{
"id": "msg_01XFDUDYJgAACzvnptvVo6EL",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-5-5",
"content": [
{
"type": "text",
"text": "你好!很高兴见到你。有什么我可以帮忙的吗?"
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 12,
"output_tokens": 18,
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0
}
}