Skip to content

Completions

ModelsExpand Collapse
Completion object { id, choices, created, 4 more }
id: string
choices: array of object { finish_reason, index, text, logprobs }
finish_reason: "stop" or "length" or "content_filter"
One of the following:
"stop"
"length"
"content_filter"
index: number
text: string
logprobs: optional object { text_offset, token_logprobs, tokens, top_logprobs }
text_offset: optional array of number
token_logprobs: optional array of number
tokens: optional array of string
top_logprobs: optional array of map[number]
created: number
model: string
object: optional "text_completion"
system_fingerprint: optional string
usage: optional CompletionUsage { completion_tokens, prompt_tokens, total_tokens, 2 more }

Usage statistics for the completion request.

completion_tokens: number
prompt_tokens: number
total_tokens: number
completion_tokens_details: optional object { accepted_prediction_tokens, audio_tokens, reasoning_tokens, rejected_prediction_tokens }

Breakdown of tokens used in a completion.

accepted_prediction_tokens: optional number
audio_tokens: optional number
reasoning_tokens: optional number
rejected_prediction_tokens: optional number
prompt_tokens_details: optional object { audio_tokens, cached_tokens }

Breakdown of tokens used in the prompt.

audio_tokens: optional number
cached_tokens: optional number
CompletionUsage object { completion_tokens, prompt_tokens, total_tokens, 2 more }

Usage statistics for the completion request.

completion_tokens: number
prompt_tokens: number
total_tokens: number
completion_tokens_details: optional object { accepted_prediction_tokens, audio_tokens, reasoning_tokens, rejected_prediction_tokens }

Breakdown of tokens used in a completion.

accepted_prediction_tokens: optional number
audio_tokens: optional number
reasoning_tokens: optional number
rejected_prediction_tokens: optional number
prompt_tokens_details: optional object { audio_tokens, cached_tokens }

Breakdown of tokens used in the prompt.

audio_tokens: optional number
cached_tokens: optional number