Create Completion

Creates a completion for the chat message

post/v1/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.

best_ofinteger nullable

Generates best_of completions server-side and returns the best (the one with the highest log probability per token). Results cannot be streamed. When used with n, best_of controls the number of candidate completions and n specifies how many to return - best_of must be greater than n.

echoboolean nullable

Echo back the prompt in addition to the completion

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

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
raw_modeboolean nullable

Response

Successful Response

idstring
createdinteger
modelstring required
system_fingerprintstring
objectstring

Changes

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