Claude · Schema

Usage

Token usage information for the request.

Artificial IntelligenceChatbotConversational AIGenerative AILarge Language ModelsMachine LearningNatural Language Processing

Properties

Name Type Description
input_tokens integer The number of input tokens consumed.
output_tokens integer The number of output tokens generated.
cache_creation_input_tokens integer The number of input tokens used to create a cache entry.
cache_read_input_tokens integer The number of input tokens read from cache.
View JSON Schema on GitHub

JSON Schema

claude-messages-usage-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Usage",
  "type": "object",
  "description": "Token usage information for the request.",
  "properties": {
    "input_tokens": {
      "type": "integer",
      "description": "The number of input tokens consumed."
    },
    "output_tokens": {
      "type": "integer",
      "description": "The number of output tokens generated."
    },
    "cache_creation_input_tokens": {
      "type": "integer",
      "description": "The number of input tokens used to create a cache entry."
    },
    "cache_read_input_tokens": {
      "type": "integer",
      "description": "The number of input tokens read from cache."
    }
  }
}