Class AnthropicUsage
Inheritance
Namespace: Glitch9.AIDevKit.Anthropic
Assembly: .dll
Syntax
public class AnthropicUsage
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.
Declaration
public CacheCreation CacheCreation { get; set; }
Property Value
Type | Description |
---|---|
CacheCreation |
CacheCreationInputTokens
Required. The number of input tokens used to create the cache entry.
Declaration
public int? CacheCreationInputTokens { get; set; }
Property Value
Type | Description |
---|---|
int? |
CacheReadInputTokens
Required. The number of input tokens read from the cache.
Declaration
public int? CacheReadInputTokens { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public AnthropicContainer Container { get; set; }
Property Value
Type | Description |
---|---|
AnthropicContainer |
InputTokens
Required. The number of input tokens which were used.
Declaration
public int InputTokens { get; set; }
Property Value
Type | Description |
---|---|
int |
OutputTokens
Required. The number of output tokens which were used.
Declaration
public int OutputTokens { get; set; }
Property Value
Type | Description |
---|---|
int |
ServerToolUse
Required. The number of server tool requests.
Declaration
public ServerToolUse ServerToolUse { get; set; }
Property Value
Type | Description |
---|---|
ServerToolUse |
ServiceTier
Required. If the request used the priority, standard, or batch tier. Available options: standard, priority, batch
Declaration
public string ServiceTier { get; set; }
Property Value
Type | Description |
---|---|
string |