Send Chat Message
Send a request to the chat application.
Authorizations
API Key authentication. For all API requests, include your API Key in the Authorization HTTP Header, prefixed with Bearer. Example: Authorization: Bearer {API_KEY}. Strongly recommend storing your API Key on the server-side, not shared or stored on the client-side, to avoid possible API-Key leakage that can lead to serious consequences.
Body
Request body to send a chat message.
User input/question content.
Allows the entry of various variable values defined by the App. Contains key/value pairs. Refer to the user_input_form field in the Get App Parameters response to discover the variable names and types expected by your app.
User identifier, unique within the application. This identifier scopes data access — conversations, messages, and files are only visible when queried with the same user value.
Mode of response return. streaming (recommended) uses SSE. blocking returns after completion (may be interrupted for long processes; not supported in Agent Assistant mode). Cloudflare timeout is 100 s. When omitted, defaults to blocking behavior.
streaming, blocking Conversation ID to continue a conversation. Pass the previous message's conversation_id. To start a new conversation, omit this field or pass an empty string. The response will return a conversation_id — pass it in subsequent messages to continue that conversation.
File list for multimodal understanding, including images, documents, audio, and video. To attach a local file, first upload it via Upload File and use the returned id as upload_file_id with transfer_method: local_file.
Auto-generate conversation title. If false, use the Rename Conversation API with auto_generate: true for async title generation.
Response
Successful response. The content type and structure depend on the response_mode parameter in the request.
- If
response_modeisblocking, returnsapplication/jsonwith aChatCompletionResponseobject. - If
response_modeisstreaming, returnstext/event-streamwith a stream of Server-Sent Events.
Event type, fixed as message.
Task ID for request tracking and stop response API.
Unique ID of this response event.
Unique message ID. Use this as the message_id parameter when calling feedback or suggested questions endpoints.
Conversation ID.
App mode. chat for Chatbot apps, agent-chat for Agent apps.
Complete response content.
Metadata including usage and retriever resources.
Message creation timestamp (Unix epoch seconds).