Generates text responses based on incoming messages.

This endpoint generates relevant text responses based on the content of incoming messages.

post/v1/knowledge-models/{knowledge_model_id}/chat/completions

Path parameters

knowledge_model_idstring required

Query parameters

extensionstring nullable

Headers

X-KM-Extensionstring nullable

Request body

modelstring

Alias of the LLM to be used in the chat session.

temperaturenumber nullable

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

max_completion_tokensinteger nullable

The maximum number of tokens that can be generated in the completion.

top_pnumber nullable

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

frequency_penaltynumber nullable

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

presence_penaltynumber nullable

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

streamboolean

Response generation in stream mode.

toolsstring[] nullable

This field is not handled in the code.

tool_choicestring nullable

This field is not handled in the code.

ninteger nullable

This field is not handled in the code.

search_domain_filterstring[] nullable

List of domain names to filter the search results. If not provided, all domains will be searched. Perplexity only

search_modestring nullable

The search mode to use. Possible value is 'academic'. Perplexity only

disable_searchboolean nullable

Flag to disable search functionality. Perplexity only

media_responseobject nullable

Media response configuration. Perplexity only

Example request

{
  "messages": [
    {
      "name": "First message"
    }
  ]
}

Response

Successful Response

OR
OR

Changes

No recorded changes to this endpoint across all 1 revision of this API.