Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
cache_creation | OptionalNullable[components.AnthropicCacheCreation] | :heavy_minus_sign: | N/A | { “ephemeral_1h_input_tokens”: 0, “ephemeral_5m_input_tokens”: 100 } |
completion_tokens | int | :heavy_check_mark: | The tokens generated | |
completion_tokens_details | OptionalNullable[components.BatchObjectCompletionTokensDetails] | :heavy_minus_sign: | N/A | |
cost | OptionalNullable[float] | :heavy_minus_sign: | Cost of the completion | |
cost_details | OptionalNullable[components.CostDetails] | :heavy_minus_sign: | 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] | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | |
iterations | List[components.AnthropicUsageIteration] | :heavy_minus_sign: | N/A | |
prompt_tokens | int | :heavy_check_mark: | Including images, input audio, and tools if any | |
prompt_tokens_details | OptionalNullable[components.BatchObjectPromptTokensDetails] | :heavy_minus_sign: | Breakdown of tokens used in the prompt. | |
server_tool_use | OptionalNullable[components.BatchObjectServerToolUse] | :heavy_minus_sign: | Usage for server-side tool execution (e.g., web search) | |
service_tier | OptionalNullable[str] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | |
speed | OptionalNullable[components.AnthropicSpeed] | :heavy_minus_sign: | N/A | standard |
total_tokens | int | :heavy_check_mark: | Sum of the above two fields |