Section ID:
DOC-API-MODEL-schema-1j1vov2uoh#overview
Usage
Usage accounting
Type-reference view: API Schema 9frhv4euve, API Schema 9ftjkkjhfa. Request and response views describe this type; they do not declare an endpoint.
Meaning and usage
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#meaning
See the definition above.
Usage profiles
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#fields
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
In requests
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-prompttokenspromptTokens | string (int64) | Optional | Prompt-token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-completiontokenscompletionTokens | string (int64) | Optional | Completion-token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-totaltokenstotalTokens | string (int64) | Optional | Total token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-costestimatecostEstimate | number (double) or string (NaN, Infinity, -Infinity) | Optional | Estimated cost in USD. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-completiontokensdetailscompletionTokensDetails | CompletionTokensDetails | Optional | Breakdown of completion tokens. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-prompttokensdetailspromptTokensDetails | PromptTokensDetails | Optional | Breakdown of prompt tokens (cache). |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-costdetailscostDetails | CostDetails | Optional | Breakdown of upstream provider cost (BYOK routes). |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-isbyokisByok | boolean | Optional | Whether this generation used the customer's own model-provider key. |
In responses
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#response
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-prompttokensSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-prompttokenspromptTokens | string (int64) | Optional | Prompt-token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-completiontokensSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-completiontokenscompletionTokens | string (int64) | Optional | Completion-token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-totaltokensSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-totaltokenstotalTokens | string (int64) | Optional | Total token usage reported by the model provider. Pattern: ^-?\d+$. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-costestimateSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-costestimatecostEstimate | number (double) or string (NaN, Infinity, -Infinity) | Optional | Estimated cost in USD. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-completiontokensdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-completiontokensdetailscompletionTokensDetails | CompletionTokensDetails | Optional | Breakdown of completion tokens. |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-prompttokensdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-prompttokensdetailspromptTokensDetails | PromptTokensDetails | Optional | Breakdown of prompt tokens (cache). |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-costdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-costdetailscostDetails | CostDetails | Optional | Breakdown of upstream provider cost (BYOK routes). |
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-isbyokSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-isbyokisByok | boolean | Optional | Whether this generation used the customer's own model-provider key. |
Where used
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#where-used
| Reference | Relationship |
|---|---|
| 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 |
| Send a message and wait for the result | POST /api/v1/llm/send-message-sync |
| Submit client-side tool results and wait for the next segment | POST /api/v1/llm/submit-client-tool-results-sync |
| Append a message without generating | POST /api/v1/llm/append-message |
| Send a message to a conversation | POST /api/v1/llm/send-message |
| ReceiveMessageRequest | API JSON uses JSON field names (camelCase). |
| ClientToolDispatch | API JSON uses JSON field names (camelCase). |
Models containing this value
| Model | Relationship |
|---|---|
| LLMGenerationCompletedEvent | Nested in model |
| LLMGenerationCompletedEvent | Nested in model |
| Message | Nested in model |
| Message | Nested in model |
| UsageByModel | Nested in model |
| UsageByModel | Nested in model |
Download the public reference contract.
Document ID: DOC-API-MODEL-schema-1j1vov2uoh