AI & LLM
OpenAI Chat Completion Response JSON Example
A real-world JSON example of an OpenAI Chat Completions API response — choices, message content, finish reason, and token usage. Copy-ready for building LLM integrations and cost tracking.
Field Reference
idrequiredstringUnique identifier for this completion, prefixed chatcmpl- — useful for logging and support requestschoicesrequiredarrayOne entry per requested completion (n parameter) — usually a single-element array unless multiple completions were requestedchoices[].finish_reasonrequiredstringWhy generation stopped: 'stop' (natural end), 'length' (hit max_tokens), 'tool_calls', or 'content_filter'choices[].message.contentrequiredstring | nullThe generated text — null when the model instead returned a tool_calls arrayusage.total_tokensrequirednumberprompt_tokens + completion_tokens — the number billing is based onmodelrequiredstringThe exact model version that served the request, useful since 'latest' aliases can change silentlyVariants
Tool Callfinish_reason is 'tool_calls' instead of 'stop', and content is null — the model wants to call a function.
Common Use Cases
- →Parsing the assistant's reply out of an LLM API integration
- →Tracking per-request token usage for cost monitoring and rate limiting
- →Building a mock LLM response for frontend development against a chat UI before wiring up the real API
openaillmchat completiongptAItokens
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
API DesignREST API ResponseGeneric REST API response wrapper with data payload, status, and pagination meta.API DesignError ResponseREST API error JSON with status code, machine-readable error code, and validation details.API DesignPagination ResponsePaginated list response JSON with offset, cursor, total, and navigation links.