Creation completed
Given a hint, the model will return one or more predicted completions and can also return the probability of the surrogate marker for each position. Complete creation for the provided prompts and parameters…
/v1/completionsBody Parametersapplication/json
Defaults to 1 Generate best_of completions on the server side and return the "best" completion (the one with the highest log probability for each token). Unable to stream results. When used with n, best_of controls the number of candidate completions, and n specifies the number to return – best_of must be greater than n. Note: Because this parameter generates many completions, it can drain your token quota quickly. Please use with caution and make sure you have reasonable settings for max_tokens and stop.
The default is false. In addition to completion, prompts are also echoed.
Defaults to 0 - a number between 2.0 and 2.0. Positive values penalize new tokens based on the current existing frequency of the text, reducing the likelihood that the model will repeat the same line verbatim.
Defaults to null The probability of occurrence of the specified token in modification completion. Accepts a JSON object that maps a token (specified by the token ID in the GPT tokenizer) to an associated bias value, -100 to 100. You can use this tokenizer tool (available for GPT-2 and GPT-3) to convert text into token IDs. Mathematically speaking, the bias is added to the resulting logit before sampling the model. The exact effect varies from model to model, but values between -1 and 1 should reduce or increase the likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the token in question. For example, you can pass {"50256": -100} to prevent the <|endoftext|> token from being generated.
Default is null Includes the log probabilities of the logprobs most likely tokens, as well as the selected token. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API always returns the logprob of the sampled token, so there may be at most logprobs+1 elements in the response. The maximum value of logprobs is 5.
Default is 16 The maximum number of tokens generated in completion. The hint's token count plus max_tokens cannot exceed the model's context length. Python code example for counting tokens.
The ID of the model to use. You can use the List models API to view all available models, or view our Model Overview for their descriptions.
Default is 1 The number of completions generated for each prompt. Note: Because this parameter generates many completions, it can drain your token quota quickly. Please use with caution and make sure you have reasonable settings for max_tokens and stop.
Defaults to 0 - a number between 2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the current text, increasing the likelihood that the model discusses new topics. For more information on frequency and presence penalties, see .
Generates a completed prompt, encoded as a string, an array of strings, an array of tokens, or an array of token arrays. Note that <|endoftext|> is the document delimiter that the model sees during training, so if no hints are specified, the model will generate the beginning of a new document.
If specified, our system will do its best to sample deterministically so that repeated requests with the same seed and parameters should return the same results. Determinism is not guaranteed and you should refer to the system_fingerprint response parameter to monitor your backend for changes.
Defaults to null for a maximum of 4 sequences at which the API will stop generating more tokens. The text returned will not contain stop sequences.
The default is false whether to flow back part of the progress. If set, the token will be sent as a data-only server-sent event when available, and the stream is terminated by a data: [DONE] message. Object message. Python code examples.
Defaults to null The suffix that appears after completion of inserted text.
Defaults to 1 The 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. We generally recommend changing this or top_p, not both.
Represents a unique identifier for the end user, which can help OpenAI monitor and detect abuse. learn more.
End-user identifier (for risk control / billing)
Responses
List of candidate results
Creation time (Unix timestamp)
Resource or task ID
Model name / model ID
Object type identifier, e.g. chat.completion
Backend configuration fingerprint
Token usage statistics
