CostDetails
Breakdown of model-provider cost. When the customer supplies the provider key, usage.cost is zero and upstream_inference_cost reports the provider spend, split into prompt and completion components.
Usage profiles
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
| In webhook payloads | View fields |
In requests
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
upstreamInferenceCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Total upstream provider cost (USD) on BYOK routes. |
upstreamInferencePromptCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to prompt tokens (USD). |
upstreamInferenceCompletionCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to completion tokens (USD). |
In responses
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
upstreamInferenceCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Total upstream provider cost (USD) on BYOK routes. |
upstreamInferencePromptCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to prompt tokens (USD). |
upstreamInferenceCompletionCost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to completion tokens (USD). |
In webhook payloads
Webhook JSON uses protobuf field names (snake_case).
| Field | Type | Presence | Meaning |
|---|---|---|---|
upstream_inference_cost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Total upstream provider cost (USD) on BYOK routes. |
upstream_inference_prompt_cost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to prompt tokens (USD). |
upstream_inference_completion_cost | number (float) or string (NaN, Infinity, -Infinity) | Optional | Upstream cost attributed to completion tokens (USD). |
Where used
| Reference | Relationship |
|---|---|
| Append a message without generating | POST /api/v1/llm/append-message |
| Send a message to a conversation | POST /api/v1/llm/send-message |
| Send a message and wait for the result | POST /api/v1/llm/send-message-sync |
| Withdraw your rating on a message | POST /api/v1/llm/delete-message-rating |
| Get full conversation state | POST /api/v1/llm/conversation-state |
| Rate an assistant message | POST /api/v1/llm/rate-message |
| Submit client-side tool results and wait for the next segment | POST /api/v1/llm/submit-client-tool-results-sync |
| llm.generation_completed | Webhook JSON uses protobuf field names (snake_case). |
| llm.message_published | Webhook JSON uses protobuf field names (snake_case). |
| Usage | Nested in model |
| Usage | Nested in model |
| Usage | Nested in model |
Download the public reference contract.
Document: DOC-API-MODEL-cost-details.