stream: true is set in the request, the API returns responses as server-sent events (SSE). Claude tool calling responses stream tool_use blocks and input_json_delta fragments.text/event-streammessage_start, content_block_start, content_block_delta, message_delta, and message_stoptool_use content blockstool_use for function-calling requestsmessages.tools and input_schema.model field.messages for conversation history.tools to declare callable functions.stream to true for SSE output.X-Api-Key and anthropic-version. Do not add them as regular request parameters.curl --location --request POST 'https://api.kie.ai/claude/v1/messages' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "claude-sonnet-4-6-v1messages",
"messages": [
{
"role": "user",
"content": "What is the weather like in Boston today?"
}
],
"tools": [
{
"name": "get_current_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. Boston, MA"
}
},
"required": [
"location"
]
}
}
],
"thinkingFlag": true,
"stream": false
}'{
"role": "assistant",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 0,
"ephemeral_5m_input_tokens": 0
},
"output_tokens": 57,
"service_tier": "standard",
"cache_creation_input_tokens": 0,
"input_tokens": 600,
"cache_read_input_tokens": 0,
"inference_geo": "not_available"
},
"stop_reason": "tool_use",
"model": "claude-opus-4-5-20251101",
"id": "msg_01VSoxV4a8YWB3DBh9TdM63W",
"credits_consumed": 0.25,
"type": "message",
"content": [
{
"input": {
"location": "Beijing, China"
},
"caller": {
"type": "direct"
},
"name": "get_current_weather",
"id": "toolu_018gdqs2FHxrRjQHLZv1qvbF",
"type": "tool_use"
}
]
}