POST
/
chatbots
/
{chatbotId}
/
ai
/
kb
/
chat
curl --request POST \
  --url https://api.chatling.ai/v2/chatbots/{chatbotId}/ai/kb/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "message": "<string>",
  "ai_model_id": 123,
  "conversation_id": 123,
  "language_id": 123,
  "temperature": 123,
  "instructions": [
    {}
  ]
}'
{
    "status": "success",
    "data": {
        "conversation_id": "3154224116",
        "response": "We offer a variety of AI models to power your chatbot. Here are the models available:\n\n- **GPT-4o**\n- **GPT-4 Turbo**\n- **GPT-3.5 Turbo**\n- **Claude 3.5 Sonnet**\n- **Claude 3 Opus**\n- **Claude 3 Sonnet**\n- **Claude 3 Haiku**\n\nThese models ensure that you can select the best fit for your specific needs and use cases.",
        "sources": [
            {
                "type": "webpage",
                "title": "Supported AI Models - Chatling Documentation",
                "url": "https://docs.chatling.ai/ai/supported-ai-models"
            },
            {
                "type": "webpage",
                "title": "Pricing | Chatling",
                "url": "https://chatling.ai/pricing"
            },
        ]
    }
}

Request parameters

Path

chatbotId
string
required

The chatbot ID.

Body

message
string
required

The message to send to the AI.

ai_model_id
integer
required

The ID of the AI model to use for the response. To get a list of available AI models, use the List AI models endpoint.

conversation_id
integer

The ID of the conversation. This allows the AI to remember the context of the conversation.

If left blank, a new conversation will be created.

language_id
integer
default: "1"

The ID of the language to use for the AI response. To get a list of available languages, use the List languages endpoint.

temperature
float
default: "0"

The temperature to be used by the AI. The temperature controls the randomness of the response. A lower temperature value, such as 0, will make the outputs more focused and deterministic, whereas a higher temperature, such as 1, will make the responses more diverse and unpredictable.

instructions
array

List of instructions to tailor the AI’s response. It can be used to provide additional context to the AI, such as the desired tone or style of the response.

Must be an array of strings.

Response

status
string

The status of the request. Will be success if the request was successful, otherwise error.

data
object
{
    "status": "success",
    "data": {
        "conversation_id": "3154224116",
        "response": "We offer a variety of AI models to power your chatbot. Here are the models available:\n\n- **GPT-4o**\n- **GPT-4 Turbo**\n- **GPT-3.5 Turbo**\n- **Claude 3.5 Sonnet**\n- **Claude 3 Opus**\n- **Claude 3 Sonnet**\n- **Claude 3 Haiku**\n\nThese models ensure that you can select the best fit for your specific needs and use cases.",
        "sources": [
            {
                "type": "webpage",
                "title": "Supported AI Models - Chatling Documentation",
                "url": "https://docs.chatling.ai/ai/supported-ai-models"
            },
            {
                "type": "webpage",
                "title": "Pricing | Chatling",
                "url": "https://chatling.ai/pricing"
            },
        ]
    }
}