@sap-ai-sdk/orchestration
Version:
SAP Cloud SDK for AI is the official Software Development Kit (SDK) for **SAP AI Core**, **SAP Generative AI Hub**, and **Orchestration Service**.
62 lines • 1.96 kB
TypeScript
import type { CacheCreationTokenDetails } from './cache-creation-token-details.js';
/**
* Usage of tokens in the response
*/
export type TokenUsage = {
/**
* Number of tokens in the generated completion.
*/
completion_tokens: number;
/**
* Number of tokens in the prompt.
*/
prompt_tokens: number;
/**
* Total number of tokens used in the request (prompt + completion).
*/
total_tokens: number;
/**
* Details of the prompt tokens.
*/
prompt_tokens_details?: {
/**
* Audio input tokens present in the prompt.
*/
audio_tokens?: number;
/**
* Cached tokens present in the prompt.
*/
cached_tokens?: number;
/**
* Number of tokens written to the cache (Anthropic only).
*
*/
cache_creation_tokens?: number;
cache_creation_token_details?: CacheCreationTokenDetails;
} & Record<string, any>;
/**
* Breakdown of tokens used in a completion.
*/
completion_tokens_details?: {
/**
* When using Predicted Outputs, the number of tokens in the
* prediction that appeared in the completion.
*
*/
accepted_prediction_tokens?: number;
/**
* Audio input tokens generated by the model.
*/
audio_tokens?: number;
/**
* Tokens generated by the model for reasoning.
*/
reasoning_tokens?: number;
/**
* When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
*
*/
rejected_prediction_tokens?: number;
} & Record<string, any>;
} & Record<string, any>;
//# sourceMappingURL=token-usage.d.ts.map