> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatling.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat with Knowledge Base AI

> Chat with the AI using the knowledge base as the response source.

## 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](https://docs.chatling.ai/api-reference/v2/ai-kb/list-ai-models.md) endpoint.

**conversation\_id** `string`

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.

**contact\_id** `string`

The ID of the contact to associate with the conversation.

**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](https://docs.chatling.ai/api-reference/v2/ai-kb/list-ai-languages.md) 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](https://docs.chatling.ai/chatbot/ai/instructions.md) 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`

**properties**

**conversation\_id** `string`

The unique identifier of the conversation.

**response** `string`

The response from the AI.

**sources** `array`

**properties**

**type** `string`

The type of the source, such as `webpage` or `document`.

**title** `string`

The title of the source.

**url** `string`

The URL of the source if it's a webpage.

```json Response theme={null}
{
    "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"
            },
        ]
    }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.