Skip to main content
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

UsageFields and validation
In requestsView fields
In responsesView fields

In requests​

Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request

API JSON uses JSON field names (camelCase).

FieldTypePresenceMeaning
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-prompttokenspromptTokensstring (int64)OptionalPrompt-token usage reported by the model provider. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-completiontokenscompletionTokensstring (int64)OptionalCompletion-token usage reported by the model provider. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-totaltokenstotalTokensstring (int64)OptionalTotal token usage reported by the model provider. Pattern: ^-?\d+$.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-costestimatecostEstimatenumber (double) or string (NaN, Infinity, -Infinity)OptionalEstimated cost in USD.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-completiontokensdetailscompletionTokensDetailsCompletionTokensDetailsOptionalBreakdown of completion tokens.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-prompttokensdetailspromptTokensDetailsPromptTokensDetailsOptionalBreakdown of prompt tokens (cache).
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-costdetailscostDetailsCostDetailsOptionalBreakdown of upstream provider cost (BYOK routes).
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#request-field-isbyokisByokbooleanOptionalWhether 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).

FieldTypePresenceMeaning
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-prompttokensSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-prompttokenspromptTokensstring (int64)OptionalPrompt-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-completiontokenscompletionTokensstring (int64)OptionalCompletion-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-totaltokenstotalTokensstring (int64)OptionalTotal 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-costestimatecostEstimatenumber (double) or string (NaN, Infinity, -Infinity)OptionalEstimated cost in USD.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-completiontokensdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-completiontokensdetailscompletionTokensDetailsCompletionTokensDetailsOptionalBreakdown of completion tokens.
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-prompttokensdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-prompttokensdetailspromptTokensDetailsPromptTokensDetailsOptionalBreakdown of prompt tokens (cache).
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-costdetailsSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-costdetailscostDetailsCostDetailsOptionalBreakdown of upstream provider cost (BYOK routes).
Section ID: DOC-API-MODEL-schema-1j1vov2uoh#field-isbyokSection ID: DOC-API-MODEL-schema-1j1vov2uoh#response-field-isbyokisByokbooleanOptionalWhether this generation used the customer's own model-provider key.

Where used​

Section ID: DOC-API-MODEL-schema-1j1vov2uoh#where-used

ReferenceRelationship
Withdraw your rating on a messagePOST /api/v1/llm/delete-message-rating
Get full conversation statePOST /api/v1/llm/conversation-state
Rate an assistant messagePOST /api/v1/llm/rate-message
Send a message and wait for the resultPOST /api/v1/llm/send-message-sync
Submit client-side tool results and wait for the next segmentPOST /api/v1/llm/submit-client-tool-results-sync
Append a message without generatingPOST /api/v1/llm/append-message
Send a message to a conversationPOST /api/v1/llm/send-message
ReceiveMessageRequestAPI JSON uses JSON field names (camelCase).
ClientToolDispatchAPI JSON uses JSON field names (camelCase).
Models containing this value
ModelRelationship
LLMGenerationCompletedEventNested in model
LLMGenerationCompletedEventNested in model
MessageNested in model
MessageNested in model
UsageByModelNested in model
UsageByModelNested in model

Download the public reference contract.

Document ID: DOC-API-MODEL-schema-1j1vov2uoh