Skip to content

feat(ai): Add granular cost attributes for cache and reasoning#461

Merged
vgrozdanic merged 2 commits into
mainfrom
vg/granular-cost-attrs
Jul 3, 2026
Merged

feat(ai): Add granular cost attributes for cache and reasoning#461
vgrozdanic merged 2 commits into
mainfrom
vg/granular-cost-attrs

Conversation

@vgrozdanic

@vgrozdanic vgrozdanic commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • Add three new cost attributes mirroring the usage token sub-categories:
    • gen_ai.cost.cache_read.input_tokens — cost of cached input tokens in USD
    • gen_ai.cost.cache_creation.input_tokens — cost of cache-write input tokens in USD
    • gen_ai.cost.reasoning.output_tokens — cost of reasoning output tokens in USD
  • Update gen_ai.cost.input_tokens and gen_ai.cost.output_tokens descriptions to accurately reflect they include ALL costs (not just raw tokens), and point to the new granular fields for breakdown

Add three new cost attributes that mirror the usage token sub-categories:
- gen_ai.cost.cache_read.input_tokens
- gen_ai.cost.cache_creation.input_tokens
- gen_ai.cost.reasoning.output_tokens

Update existing cost descriptions to accurately reflect they include
ALL costs (not just raw tokens), and point to the new granular fields
for breakdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vgrozdanic vgrozdanic requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners July 2, 2026 08:44
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (ai) Add granular cost attributes for cache and reasoning by vgrozdanic in #461

🤖 This preview updates automatically when you update the PR.

@vgrozdanic vgrozdanic marked this pull request as draft July 2, 2026 08:45
Comment thread model/attributes/gen_ai/gen_ai__cost__input_tokens.json

@Lms24 Lms24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from conventions perspective. Had a question about the semantics change

Comment thread model/attributes/gen_ai/gen_ai__cost__output_tokens.json
Comment thread model/attributes/gen_ai/gen_ai__cost__input_tokens.json
@vgrozdanic vgrozdanic merged commit a252d61 into main Jul 3, 2026
17 checks passed
@vgrozdanic vgrozdanic deleted the vg/granular-cost-attrs branch July 3, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants