LlmapiPortalChatCompletionResponse
LlmapiPortalChatCompletionResponse =
object
Defined in: src/client/types.gen.ts:776
Portal carries non-OpenAI fields scoped to the portal under a single key so they don’t collide with the embedded SDK type’s custom JSON marshaling.
Properties
cached_tokens?
optionalcached_tokens:number
Defined in: src/client/types.gen.ts:781
CachedTokens are the prompt tokens served from the provider’s cache (cache-hit reads), summed across the MCP tool loop. Omitted from the response when zero (no cache hit reported).
client_injected_tools?
optionalclient_injected_tools:string[]
Defined in: src/client/types.gen.ts:785
ClientInjectedTools are tool names the client provided in the original request.
cost_micro_usd?
optionalcost_micro_usd:number
Defined in: src/client/types.gen.ts:789
CostMicroUSD is what we charge the user (today identical to what we paid the provider).
credits_used?
optionalcredits_used:number
Defined in: src/client/types.gen.ts:793
CreditsUsed is CostMicroUSD in credits.
extra_fields?
optionalextra_fields:LlmapiChatCompletionExtraFields
Defined in: src/client/types.gen.ts:794
image_model?
optionalimage_model:string
Defined in: src/client/types.gen.ts:800
ImageModel is set when an image generation tool was called during the request. This allows the client to detect that the response contains generated images and render them appropriately, even when the orchestrating model is a text model.
inference_id?
optionalinference_id:string
Defined in: src/client/types.gen.ts:804
InferenceID is the unique identifier for this inference request.
init_completion_tokens?
optionalinit_completion_tokens:number
Defined in: src/client/types.gen.ts:808
InitCompletionTokens are the completion tokens from the first LLM call (before the MCP tool loop).
init_prompt_tokens?
optionalinit_prompt_tokens:number
Defined in: src/client/types.gen.ts:812
InitPromptTokens are the prompt tokens from the first LLM call (before the MCP tool loop).
messages?
optionalmessages:OpenaiChatCompletionMessageParamUnion[]
Defined in: src/client/types.gen.ts:819
Messages contains the full conversation history when local tools need execution. This is populated when the model requests tools that are not MCP tools (client-side tools). The client should execute these tools and send a new request with this message history plus the tool results appended.
portal_injected_tools?
optionalportal_injected_tools:string[]
Defined in: src/client/types.gen.ts:823
PortalInjectedTools are tool names the portal’s classifier added to the request.
pricing_source?
optionalpricing_source:string
Defined in: src/client/types.gen.ts:827
PricingSource is which lookup calculated the costs.
provider_cost_micro_usd?
optionalprovider_cost_micro_usd:number
Defined in: src/client/types.gen.ts:831
ProviderCostMicroUSD is what we paid the provider.
tool_call_events?
optionaltool_call_events:LlmapiToolCallEvent[]
Defined in: src/client/types.gen.ts:835
ToolCallEvents is an array of tool call events.
tool_cost_micro_usd?
optionaltool_cost_micro_usd:number
Defined in: src/client/types.gen.ts:839
ToolCostMicroUSD is the aggregate cost from MCP tool calls (subset of CostMicroUSD).
tools_checksum?
optionaltools_checksum:string
Defined in: src/client/types.gen.ts:843
ToolsChecksum is the checksum of the tool schemas used by the AI Portal.