Create Chat Completion

Creates a completion for the chat message

post/v1/chat/completions

Request

  • The document declares no server URL.
  • Auth: OAuth 2 (password, token URL token)

Request body

modelstring

The name of the model to query.

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..

logit_biasobject nullable
logprobsboolean nullable

Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.

top_logprobsinteger nullable

An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.

max_tokensinteger nullable

The maximum number of tokens to generate.

ninteger nullable

How many completions to generate for each prompt.

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.

seedinteger nullable
streamboolean nullable

Whether to stream the response back to the client. If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. If false, return a single JSON object containing the results.

temperaturenumber nullable

A decimal number that determines the degree of randomness in the response. A value of 1 will always yield the same output. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value greater than 1 introduces more randomness in the output.

top_pnumber nullable

The top_p (nucleus) parameter is used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold, below which all less likely tokens are filtered out. This technique helps to maintain diversity and generate more fluent and natural-sounding text.

userstring nullable

A unique identifier representing end-user.

top_kinteger nullable
min_pnumber nullable
repetition_penaltynumber nullable

Response

Successful Response

idstring
objectstring
createdinteger
modelstring required

Changes

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