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-usage-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Usage",
  "title": "Usage",
  "type": "object",
  "description": "Token usage information for the request.",
  "required": [
    "input_tokens",
    "output_tokens"
  ],
  "properties": {
    "input_tokens": {
      "type": "integer",
      "description": "The number of input tokens consumed.",
      "example": 25
    },
    "output_tokens": {
      "type": "integer",
      "description": "The number of output tokens generated.",
      "example": 150
    },
    "cache_creation_input_tokens": {
      "type": "integer",
      "description": "The number of input tokens used to create a cache entry.",
      "example": 10
    },
    "cache_read_input_tokens": {
      "type": "integer",
      "description": "The number of input tokens read from cache.",
      "example": 10
    }
  }
}