Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
cache_creation | OptionalNullable[components.AnthropicCacheCreation] | ➖ | N/A | { “ephemeral_1h_input_tokens”: 0, “ephemeral_5m_input_tokens”: 100 } |
completion_tokens | int | ✅ | The tokens generated | |
completion_tokens_details | OptionalNullable[components.BatchListItemCompletionTokensDetails] | ➖ | N/A | |
cost | OptionalNullable[float] | ➖ | Cost of the completion | |
cost_details | OptionalNullable[components.CostDetails] | ➖ | Breakdown of upstream inference costs | { “upstream_inference_completions_cost”: 0.0004, “upstream_inference_cost”: null, “upstream_inference_prompt_cost”: 0.0008 } |
is_byok | Optional[bool] | ➖ | Whether a request was made using a Bring Your Own Key configuration | |
iterations | List[components.AnthropicUsageIteration] | ➖ | N/A | |
prompt_tokens | int | ✅ | Including images, input audio, and tools if any | |
prompt_tokens_details | OptionalNullable[components.BatchListItemPromptTokensDetails] | ➖ | Breakdown of tokens used in the prompt. | |
server_tool_use | OptionalNullable[components.BatchListItemServerToolUse] | ➖ | Usage for server-side tool execution (e.g., web search) | |
service_tier | OptionalNullable[str] | ➖ | The service tier used by the upstream provider for this request | |
speed | OptionalNullable[components.AnthropicSpeed] | ➖ | N/A | standard |
total_tokens | int | ✅ | Sum of the above two fields |