POST
/
v1
/
completions
{
  "choices": [
    {
      "finish_reason": "<string>",
      "index": 123,
      "logprobs": {
        "text_offset": [
          123
        ],
        "token_logprobs": [
          123
        ],
        "tokens": [
          "<string>"
        ],
        "top_logprobs": [
          {}
        ]
      },
      "text": "<string>"
    }
  ],
  "created": 123,
  "id": "<string>",
  "model": "<string>",
  "object": "<string>",
  "system_fingerprint": "<string>",
  "usage": {
    "completion_tokens": 123,
    "prompt_tokens": 123,
    "total_tokens": 123
  }
}

Body

application/json
best_of
integer | null

Number of sequences that are generated from the prompt.best_of must be greater than or equal to n.

echo
boolean | null

Echo back the prompt in addition to the completion.

frequency_penalty
number | null

Penalizes new tokens based on their frequency in the generated text so far.

logit_bias
object | null

Modify the likelihood of specified tokens appearing in the completion.

logprobs
integer | null

Number of log probabilities to return per output token.

max_tokens
integer | null

Maximum number of tokens to generate per output sequence.

model
string
required

Model name to use for completion.

n
integer | null

Number of output sequences to return.

presence_penalty
number | null

Penalizes new tokens based on whether they appear in the generated text so far

prompt
required

The prompt to generate completions from.

repetition_penalty
number | null

Controls the likelihood of the model generating repeated texts

seed
integer | null
stop

Strings that stop the generation when they are generated.

stream
boolean | null
suffix
string | null

The suffix that comes after a completion of inserted text.

temperature
number | null

Controls the randomness of the sampling.

top_p
number | null

Controls the cumulative probability of the top tokens to consider.

user
string | null

Response

200 - application/json
choices
object[]
required
created
integer
required
id
string
required
model
string
required
object
string
default: text_completion
system_fingerprint
string
default: todo
usage
object | null

An OpenAI API compatible schema for a chat completion stats.