Class ClaudeUsage
public class ClaudeUsage
- Inheritance
-
objectClaudeUsage
Properties
CacheCreation
Required. Billing and rate-limit usage.
Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems.
Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in usage will not match one-to-one with the exact visible content of an API request or response.
For example, output_tokens will be non-zero, even for an empty string response from Claude.
Total input tokens in a request is the summation of input_tokens, cache_creation_input_tokens, and cache_read_input_tokens.
public CacheCreation CacheCreation { get; set; }
Property Value
CacheCreationInputTokens
Required. The number of input tokens used to create the cache entry.
public int? CacheCreationInputTokens { get; set; }
Property Value
- int?
CacheReadInputTokens
Required. The number of input tokens read from the cache.
public int? CacheReadInputTokens { get; set; }
Property Value
- int?
Container
Required. Information about the container used in this request.
This will be non-null if a container tool (e.g. code execution) was used.
public AnthropicContainer Container { get; set; }
Property Value
InputTokens
Required. The number of input tokens which were used.
public int InputTokens { get; set; }
Property Value
- int
OutputTokens
Required. The number of output tokens which were used.
public int OutputTokens { get; set; }
Property Value
- int
ServerToolUse
Required. The number of server tool requests.
public ServerToolUse ServerToolUse { get; set; }
Property Value
ServiceTier
Required. If the request used the priority, standard, or batch tier. Available options: standard, priority, batch
public string ServiceTier { get; set; }
Property Value
- string