Deserialised response from OpenAI's Chat Completions endpoint (POST /v1/chat/completions), returned by OpenAiClient.getChatCompletion. Wraps the generated choices, the model that produced them and the token usage for a single chat completion request. It is used internally by the LLM providers and the translation service that call OpenAI directly, and is not exposed to app scripts. Serialised as a chat-response element.
Group: AI Agents
Properties
| Property | Returns | Description |
|---|---|---|
| choices | List<Map<String,Object>> | Completion choices generated by the model. Each entry is the raw OpenAI JSON for one choice, including its message and finish reason; most callers only use the first choice. |
| created | Integer | Unix timestamp, in seconds, of when OpenAI created this chat completion. |
| id | String | Unique identifier OpenAI assigned to this chat completion. |
| model | String | Name of the OpenAI model that generated this response, for example gpt-4o. |
| object | String | Object type string OpenAI returns for this response, typically "chat.completion". |
| serviceTier | String | Service tier OpenAI used to process this request, for example "default" or "flex". |
| systemFingerprint | String | Fingerprint identifying the backend configuration the model ran with. OpenAI changes this value when a change to the backend may affect the determinism of results for the same request. |
| usage | CompletionsUsage | Token usage recorded by OpenAI for this chat completion request. |
Methods
getId()
Returns: String
Unique identifier OpenAI assigned to this chat completion.
getObject()
Returns: String
Object type string OpenAI returns for this response, typically "chat.completion".
getCreated()
Returns: Integer
Unix timestamp, in seconds, of when OpenAI created this chat completion.
getModel()
Returns: String
Name of the OpenAI model that generated this response, for example gpt-4o.
getSystemFingerprint()
Returns: String
Fingerprint identifying the backend configuration the model ran with. OpenAI changes this value when a change to the backend may affect the determinism of results for the same request.
getChoices()
Returns: List<Map<String,Object>>
Completion choices generated by the model. Each entry is the raw OpenAI JSON for one choice, including its message and finish reason; most callers only use the first choice.
getUsage()
Returns: CompletionsUsage
Token usage recorded by OpenAI for this chat completion request.
getServiceTier()
Returns: String
Service tier OpenAI used to process this request, for example "default" or "flex".