Skip to main content

Completion object

Represents a completion response from the API. Note: streaming and non-streaming completions share the same shape (unlike the chat endpoint).
FieldTypeDescription
idstringUnique completion id
choicesarrayGenerated completions for the prompt
createdintegerUnix timestamp (seconds)
modelstringModel used
system_fingerprintstringBackend fingerprint
objectstringAlways text_completion
usageobjectToken usage
completion_tokensintegerTokens in the completion
prompt_tokensintegerTokens in the prompt
total_tokensintegerTotal tokens (prompt + completion)
{
  "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
  "object": "text_completion",
  "created": 1589478378,
  "model": "gpt-3.5-turbo",
  "choices": [
    {
      "text": "\n\nThis is indeed a test",
      "index": 0,
      "logprobs": null,
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 5,
    "completion_tokens": 7,
    "total_tokens": 12
  }
}