Anthropic SDK Token Usage Logger

SkillCommunication

See exactly how many tokens each Anthropic API request uses, how long it takes, and what it costs. This skill records that data for every request and saves it as structured logs in CloudWatch Logs, so you can track usage and spending over time.

Available today. Use it from your connected AI after setup.

Add the skill, then make Anthropic API requests as usual. Each request's token usage, timing, and cost will be logged to CloudWatch Logs for you to review.

Then ask your AI: use the Anthropic SDK Token Usage Logger skill

What your AI can do with it

  • Track token usage for every Anthropic API request
  • Record input and output token counts from each response
  • Measure how long each request takes
  • Calculate the cost of each request
  • Save structured usage logs to CloudWatch Logs

What this skill tells your AI

The instructions your AI receives, as published by agentskillexchange/skills in skills/anthropic-sdk-token-usage-logger/SKILL.md and read by ahel’s review.

Instruments Anthropic API calls to log token usage, latency, and cost per request using the Anthropic TypeScript SDK. Wraps the anthropic.messages.create method to capture usage.input_tokens, usage.output_tokens, and timing from the API response. Writes structured logs to CloudWatch Logs via the AWS SDK v3 CloudWatchLogsClient.

Installation

Use the upstream install or setup path that matches your environment:

  • npm install @anthropic-ai/sdk

Requirements and caveats from upstream:

  • Node.js 18+

Basic usage or getting-started notes:

Documentation

Source

Signals

GitHub stars
38
Forks
53
Last commit
Sep 2026

ahel review

  • S4info
    community integration — published by agentskillexchange, not anthropic

Automated review, not a security audit. Ruleset v1.

Advanced
Catalog kind
skill
Gateway key
anthropic-sdk-token-usage-logger
Source
github.com/agentskillexchange/skills