Use the chat completion API to create conversational search experiences using LLM technology
/chats
route enables AI-powered conversational search by integrating Large Language Models (LLMs) with your Meilisearch data.
search
and chatCompletions
actions, such as the default chat API key.
Chat queries only search indexes its API key can access. The default chat API key has access to all indexes.
Name | Type | Description |
---|---|---|
uid | String | Unique identifier for the chat completions workspace |
offset
and limit
query parameters.
Query parameter | Description | Default value |
---|---|---|
offset | Number of workspaces to skip | 0 |
limit | Number of workspaces to return | 20 |
Name | Type | Description |
---|---|---|
results | Array | An array of workspaces |
offset | Integer | Number of workspaces skipped |
limit | Integer | Number of workspaces returned |
total | Integer | Total number of workspaces |
200 Ok
Name | Type | Description |
---|---|---|
workspace_uid * | String | uid of the requested index |
200 Ok
Name | Type | Description |
---|---|---|
system | String | A prompt added to the start of the conversation to guide the LLM |
searchDescription | String | A prompt to explain what the internal search function does |
searchQParam | String | A prompt to explain what the q parameter of the search function does and how to use it |
searchIndexUidParam | String | A prompt to explain what the indexUid parameter of the search function does and how to use it |
Name | Type | Description |
---|---|---|
workspace_uid | String | The workspace identifier |
200 OK
apiKey
field.
Name | Type | Description |
---|---|---|
workspace_uid | String | The workspace identifier |
Name | Type | Description |
---|---|---|
source | String | LLM source: "openAi" , "azureOpenAi" , "mistral" , "gemini" , or "vLlm" |
orgId | String | Organization ID for the LLM provider (required for azureOpenAi) |
projectId | String | Project ID for the LLM provider |
apiVersion | String | API version for the LLM provider (required for azureOpenAi) |
deploymentId | String | Deployment ID for the LLM provider (required for azureOpenAi) |
baseUrl | String | Base URL for the provider (required for azureOpenAi and vLlm) |
apiKey | String | API key for the LLM provider (optional for vLlm) |
prompts | Object | Prompts object containing system prompts and other configuration |
200 OK
apiKey
is write-only and will not be returned in the response.
Name | Type | Description |
---|---|---|
workspace_uid | String | The workspace identifier |
200 OK
apiKey
field.
Name | Type | Description |
---|---|---|
workspace | String | The chat completion workspace unique identifier (uid) |
Name | Type | Required | Description |
---|---|---|---|
model | String | Yes | Model to use and will be related to the source LLM in the workspace settings |
messages | Array | Yes | Array of message objects with role and content |
stream | Boolean | No | Enable streaming responses (default: true ) |
stream: true
) are supported.Name | Type | Description |
---|---|---|
role | String | Message role: "system" , "user" , or "assistant" |
content | String | Message content |