GuideChat Models

ChatGPT

Reference for the ChatGPT chat completion response object and streaming chunk format, covering id, choices, model and usage fields with JSON examples.

Response Object

ParameterTypeDescription
idstringUnique identifier for the chat completion
choicesarrayList of chat completion choices. There can be more than one if n is greater than 1
createdintegerUnix timestamp (in seconds) of when the chat completion was created
modelstringThe model used for the chat completion
system_fingerprintstringThis fingerprint represents the backend configuration the model runs with
objectstringThe object type, always chat.completion
usageobjectUsage statistics for the completion request
completion_tokensintegerNumber of tokens in the generated completion
prompt_tokensintegerNumber of tokens in the prompt
total_tokensintegerTotal number of tokens used in the request (prompt + completion)
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "gpt-3.5-turbo-0613",
  "system_fingerprint": "fp_44709d6fcb",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "\n\nHello there, how may I assist you today?",
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 9,
    "completion_tokens": 12,
    "total_tokens": 21
  }
}

Chat Completion Chunk Object

ParameterTypeDescription
idstringUnique identifier for the chat completion. Each chunk has the same ID
choicesarrayList of chat completion choices. There can be more than one if n is greater than 1
createdintegerUnix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp
modelstringThe model that generated the completion
system_fingerprintstringThis fingerprint represents the backend configuration the model runs with
objectstringThe object type, always chat.completion.chunk
{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]}

....

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":" today"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"?"},"finish_reason":null}]}

{"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-3.5-turbo-0613", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}

On this page