Chat API

You can talk to chatbots by using our API if you currently have a paid subscription. You can get API key from: Dashboard > Subscription > API Keys (First section of the page)

Send message to chatbot

POST https://api.chatfast.io/v1/chat/send-message

Send a message to chatbot and receive corresponding answer.

Request header

X-Api-KeystringRequired

This is your ChatFast API key.

Request body

chatBotIdstringRequired

ID of the chatBot to use. You can find this ID by going to setting of chatbot.


messagestringRequired

The message you want to send to chatbot.


chatIdstringOptional

The ID of chat session. When user sends the first message you don't need to provide chatId. However, response of chatbot will contain ID of current session, we strongly recommend to use this ID for every API call after as chatbot will maintain the context of conversation.


streambooleanOptional

If set, partial message deltas will be sent, like in ChatFast. Words/characters will be sent as data-only server-sent events as they become available.

Example

curl --location 'https://api.chatfast.io/v1/chat/send-message' \

--header 'X-Api-Key: {YOUR_CHATFAST_API_KEY}' \

--header 'Content-Type: application/json' \

--data '{

"chatId": null,

"chatBotId": "00000000-0000-0000-0000-123456789012",

"message": "Hello! What can ChatFast do?",

"stream": false,

}'

Response

{"chatId": "12345678-0000-0000-0000-000000000000", "response": "Hi! ChatFast helps you create your own GPT chatbot from your data." }