PromptTokensDetails - Python SDK

PromptTokensDetails method reference

The Python SDK and docs are currently in beta. Report issues on GitHub.

Detailed prompt token usage

Fields

FieldTypeRequiredDescription
audio_tokensOptional[int]Audio input tokens
cache_write_tokensOptional[int]Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
cached_tokensOptional[int]Cached prompt tokens
video_tokensOptional[int]Video input tokens