Skip to content

Send a message

post/chat
StreamsAny keyUses credits

Send messages to a chatbot and receive a response. The API supports both streaming and non-streaming modes, as well as OpenAI-compatible response formats.

When stream is set to true, the response is a stream of text chunks that should be consumed with a ReadableStream reader and TextDecoder.

When openAIFormat is set to true, responses match OpenAI's /chat/completions API format. For streaming responses, this means Server-Sent Events (SSE) in OpenAI's chunk format. If the request fails after the stream has started, it ends with HTTP 200 and no data: [DONE].

When skipCache is set to true, the response cache is bypassed and the LLM is invoked even if a cached response exists for the same messages array. This is useful for regenerating answers. Credits, rate limits, AI actions, and the chat webhook all behave identically to a normal send — its payload for a skipCache: true request includes regenerate: true. The persisted conversation's trailing assistant message (if any) is replaced by the new response.

Request body

Sending 2 of 10 fields
Required
messagesarray of object
The messages of the conversation, oldest first. Every role must be user or assistant, and the last message must not be empty.
chatbotIdstring
The ID of the chatbot.

Only these fields are sent (application/json).

Try it · POST /chat
curl 'https://api.chat-data.com/api/v2/chat' \  -H "Authorization: Bearer $CHAT_DATA_API_KEY" \  -H 'Content-Type: application/json' \  -d '{  "messages": [    {      "role": "assistant",      "content": "Hi! How can I help you today?"    },    {      "role": "user",      "content": "What are your opening hours?"    }  ],  "chatbotId": "6650f1c2a9e4b83d2c7a1f05"}'
Loading…

Responses

The chatbot's answer as plain text, streamed in chunks when stream is true. With openAIFormat set, an OpenAI-compatible JSON object instead, or text/event-stream chunks when streaming.

Content type: text/plain

Example

We're open Monday to Friday, 9am to 6pm EST.Outside those hours you can email [email protected] and we'll reply the next business day.

Last updated October 14, 2026