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

PropertyReturnsDescription
choicesList<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.
createdIntegerUnix timestamp, in seconds, of when OpenAI created this chat completion.
idStringUnique identifier OpenAI assigned to this chat completion.
modelStringName of the OpenAI model that generated this response, for example gpt-4o.
objectStringObject type string OpenAI returns for this response, typically "chat.completion".
serviceTierStringService tier OpenAI used to process this request, for example "default" or "flex".
systemFingerprintStringFingerprint 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.
usageCompletionsUsageToken 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".

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.