LlmapiChatCompletionResponse
LlmapiChatCompletionResponse =
Omit<GeneratedLlmapiChatCompletionResponse,"usage"> &object
Defined in: src/clientCompat.ts:77
Override the generated LlmapiChatCompletionResponse so legacy top-level
fields (tools_checksum, tool_call_events, inference_id, …) and
cost-on-usage (usage.cost_micro_usd, usage.credits_used) remain readable
by SDK consumers that haven’t migrated to the new portal envelope.
The portal returns the strict OpenAI-compliant shape on the wire; the SDK’s
streaming buildFinalResponse populates both paths so reads on either side
succeed. Non-streaming direct calls (postApiV1ChatCompletions) return only
the wire shape — legacy fields are undefined there, matching the optional
typing below.
TODO(deprecate-legacy-chat-completion-mirrors) [#548]: the legacy top-level
fields and the cost-on-usage fields below are slated for removal in the
next SDK MAJOR bump, paired with the mirror-emission in
strategies/completions.ts buildFinalResponse. See that TODO for the full
deprecation plan.
Type Declaration
client_injected_tools?
optionalclient_injected_tools:string[]
image_model?
optionalimage_model:string
inference_id?
optionalinference_id:string
messages?
optionalmessages:LlmapiMessage[]
portal_injected_tools?
optionalportal_injected_tools:string[]
tool_call_events?
optionaltool_call_events:LlmapiToolCallEvent[]
tools_checksum?
optionaltools_checksum:string
usage?
optionalusage:LlmapiChatCompletionUsage