stream: true is set in the request, the API returns responses as server-sent events (SSE) with Content-Type: text/event-stream. This allows for progressive response delivery, where message deltas are sent incrementally as they are generated. Each event contains partial message content, enabling real-time display of responses in your application.text/event-streamdata: followed by JSONfinish_reasonmessages array share the exact same JSON structure:type field is fixed as "image_url"image_url key name remains unchanged for all file typesurl value points to your specific media filetools parameter is an optional array that allows you to define functions the model can call. The array can contain multiple objects.curl --location --request POST 'https://api.kie.ai/claude-sonnet-4-5/v1/chat/completions' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://file.aiquickdraw.com/custom-page/akr/section-images/1759055072437dqlsclj2.png"
}
}
]
}
],
"tools": [
{
"type": "function",
"function": {
"name": "googleSearch"
}
}
],
"stream": true,
"include_thoughts": true,
"reasoning_effort": "high"
}'{
"id": "chatcmpl-example-123",
"object": "chat.completion",
"created": 1677652288,
"model": "claude-sonnet-4-5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "string"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 50,
"total_tokens": 60
}
}