Send a request to the chat application.
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.
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). 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.
Specify a published workflow version ID to execute. If not provided, the latest published version is used.
Successful response. The content type and structure depend on the response_mode parameter in the request.
response_mode is blocking, returns application/json with a ChatCompletionResponse object.response_mode is streaming, returns text/event-stream with a stream of ChunkChatEvent objects.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, fixed as advanced-chat.
Complete response content.
Metadata including usage and retriever resources.
Message creation timestamp (Unix epoch seconds).