Chat
Stream chat response
Streams a chat response in real-time using server-sent events (SSE). Supports both AI SDK format (with messages array) and custom format (with message object).
OpenAPI specificationPOST
/api/v1/chat/streamAuthentication
x-api-key
Request
curl --globoff --request POST \
--url 'https://api.example.com/api/v1/chat/stream' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{}'Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.
Replace https://api.example.com with the API server URL.
Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.
Parameters
x-component-idheader · stringOptional component ID for component-specific chat context
Request body schema or example
{
"type": "object",
"properties": {
"messages": {
"description": "Messages array for AI SDK format - list of conversation messages with roles",
"example": [
{
"role": "user",
"content": "Hello"
},
{
"role": "assistant",
"content": "Hi there!"
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image",
"image_url": {
"url": "https://example.com/image.jpg"
}
}
]
}
],
"type": "array",
"items": {
"type": "string"
}
},
"message": {
"description": "Single message for custom format - contains text and optional images",
"allOf": [
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text content of the message"
},
"images": {
"description": "Images attached to the message",
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "URL of the image"
},
"base64": {
"type": "string",
"description": "Base64 encoded image data"
},
"mimeType": {
"type": "string",
"description": "MIME type of the image"
},
"caption": {
"type": "string",
"description": "Caption for the image"
}
}
}
}
}
}
]
},
"componentId": {
"type": "string",
"description": "Component ID"
},
"userId": {
"type": "string",
"description": "User ID"
},
"groupIds": {
"description": "Group IDs for access control",
"type": "array",
"items": {
"type": "string"
}
},
"sessionId": {
"type": "string",
"description": "Session ID"
},
"id": {
"type": "string",
"description": "Session ID (AI SDK uses \"id\")"
},
"timezone": {
"type": "string",
"description": "IANA timezone string (e.g. \"America/New_York\")"
},
"context": {
"type": "object",
"description": "Additional context"
},
"trigger": {
"type": "string",
"description": "Trigger for AI SDK (what triggered the message)"
}
}
}