Type to search.

Generate a chat completion

Base URL
https://{kibana_url}
  • POST /api/observability_ai_assistant/chat/complete
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Preview This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Create a new chat completion by using the Observability AI Assistant.

The API returns the model's response based on the current conversation context.

It also handles any tool requests within the conversation, which may trigger multiple calls to the underlying large language model (LLM).

This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Request body

connectorId string required

A unique identifier for the connector.

conversationId string

A unique identifier for the conversation if you are continuing an existing conversation.

disableFunctions boolean

Flag indicating whether all function calls should be disabled for the conversation. If true, no calls to functions will be made.

instructions union oneOf[]

An array of instruction objects, which can be either simple strings or detailed objects.

One of:

A simple instruction represented as a string.

messages object[] required

An array of message objects containing the conversation history.

@timestamp string required

The timestamp when the message was created.

message object required

The main content of the message.

content string

The content of the message.

data string

Additional data associated with the message.

event string

The event related to the message.

name string

The name associated with the message.

role enum required

The role of the message sender.

Values: system assistant function user elastic
persist boolean required

Indicates whether the conversation should be saved to storage. If true, the conversation will be saved and will be available in Kibana.

title string

A title for the conversation.

Response

Successful response

application/json

Response Type: object