Skip to content

fix(kiro): bill measured tokens without estimated cache - #629

Merged
caigee-cmd merged 1 commit into
mainfrom
chore/compare-kiro-billing-cache
Dec 2, 2026
Merged

caigee-cmd merged 1 commit into
mainfrom
chore/compare-kiro-billing-cache

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Kiro does not return prompt-cache reads or writes. /v1/messages now reports the input Kiro measured and the output it produced, with no estimated cache_read_input_tokens or cache_creation_input_tokens.
  • A billing client prices a reported cache write above a normal input. The previous estimate put the whole first prompt in that field, so the bill ran about 25% high.
  • Input stays the stated token count when Kiro sends one, otherwise the context-window share. Output stays the stated count when Kiro sends one, otherwise the count of the produced text.

Test plan

  • go test ./internal/providers/kiro/ ./internal/gateway/ -count=1
  • Call /v1/messages against a Kiro account and confirm the final message_delta.usage has input_tokens and output_tokens only, with no cache read or cache creation fields.

Kiro does not report cache reads or writes. Drop the local prompt-cache
estimate from usage so /v1/messages charges the measured input and output
instead of a cache-write price.
@caigee-cmd
caigee-cmd merged commit c56f8d7 into main Dec 2, 2026
6 checks passed
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.

1 participant