Chat

Chat with a chatbot

Send a message to your chatbot and receive an AI-generated response based on your training data. The chatbot id is determined by your API key — each key is scoped to a single chatbot.

Endpoint

text
POST https://services.chatmount.co/v1/chat

Authentication uses the standard Authorization: Bearer header — see Authentication for key generation and format.

Request body

json
{
  "message": "What are your business hours?",
  "stream": false,
  "session_id": "user-123-session-abc",
  "include_sources": true
}

Fields:

  • message (string, required)— the user’s message. Must be 1–2000 characters.
  • stream (boolean, optional, default false) — when true, the response is sent as Server-Sent Events. See Streaming.
  • session_id (string, optional) — pass the same id across multiple requests to give the bot multi-turn memory. Omit it and each request is treated as an independent conversation. See Sessions.
  • include_sources (boolean, optional, default true) — include source document URLs in the response.

Response body

Response
200 OK
{
  "message": "Our business hours are Monday through Friday, 9am to 5pm EST.",
  "sources": [
    {
      "url": "https://example.com/about",
      "title": "About Us"
    }
  ],
  "usage": {
    "credits_used": 1,
    "credits_remaining": 99
  }
}
  • message (string)— the chatbot’s response.
  • sources (array) — up to 3 source documents used to generate the response. Each entry has url and title. Only included when include_sources: true.
  • usage.credits_used (number) — credits charged for this request.
  • usage.credits_remaining (number) — credits left in your monthly pool, shared with widget chat usage.

Example: cURL

bash
curl -X POST https://services.chatmount.co/v1/chat \
  -H "Authorization: Bearer cm_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "What are your business hours?",
    "include_sources": true
  }'

Related