Repository navigation
Description
The problem, in your words
I run Claude Code and Codex on fixed-fee subscriptions (Claude Max, ChatGPT), and on top of that I dip into API usage — Claude through AWS Bedrock, other models through OpenRouter. The subscriptions cost the same every month whatever I do; the API usage is the variable part, and it is the number I want to watch. CodeBurn cannot separate the two today: the same model billed through Bedrock and through the subscription shows up as one line — or as an unreadable raw id — so a report cannot answer "how much of this month is metered?", let alone "how much of it went through Bedrock?".
The existing knobs each assume the split follows something other than the call: codeburn plan treats a whole harness as under the plan, proxy-path a whole project, model-flat-rate a whole SKU. Hermes records cost_status = included for subscription sessions and CodeBurn honours it as $0 (hermes.ts:483), but that provenance is not a dimension anywhere. The route (Bedrock / direct / OpenRouter / subscription) is what actually decides whether a call is metered.
Two tools on this machine record Bedrock-routed calls today, and each writes Bedrock's id where a direct call writes Anthropic's / OpenAI's:
| Tool | Direct | Through Bedrock |
|---|---|---|
Claude Code (CLAUDE_CODE_USE_BEDROCK=1) |
claude-haiku-4-5-20251001 |
anthropic.claude-haiku-4-5-20251001-v1:0 (the configured us./global. profile prefix is dropped in the transcript) |
Hermes (--provider bedrock) |
claude-fable-5-1 |
anthropic.claude-fable-5-1, openai.gpt-5.6-luna (state.db also stores billing_provider = bedrock) |
Evidence (real sessions, this week):
codeburn models --provider clauderendered the Bedrock row as the raw idanthropic.claude-haiku-4-5-20251001-v1:0next toHaiku 4.5. Pricing was correct (LiteLLM carries the Bedrock rows), so the dollars were right but the row was unreadable.codeburn models --provider hermeslikewise showedopenai.gpt-5.6-lunaandopenai.gpt-5.6-solverbatim.- The obvious fix — aliasing the Bedrock id onto the friendly name so it reads
Haiku 4.5— would be worse:modelBreakdownis keyed by display name (src/parser.ts:1789), so the Bedrock spend would silently merge into the direct row and the distinction would be gone. - Side effect:
looksLikeLocalModel(src/models.ts) treats any:in the id as an Ollama tag, so a Bedrock id whose price is missing is excluded from Unpriced as "free local inference" rather than flagged.
What you tried
codeburn model-alias anthropic.claude-haiku-4-5-20251001-v1:0 claude-haiku-4-5— makes the name readable but merges the rows (see above).--provider bedrock— rejected;--provideris the tool that produced the session, not the billing endpoint.- Reading
billing_providerout of~/.hermes/state.dbby hand.
Proposed change
Treat the billing door as a route on the model, derived from the id shape, and keep it visible in the display name so aggregation keeps the rows apart:
getModelRoute(id)→{ id: 'bedrock', label: 'Bedrock', baseModel }for Bedrock's foundation-model ids,us./eu./global.inference-profile prefixes, the-vN:Mversion,:300kcontext tags,arn:aws:bedrock:…and LiteLLM'sbedrock/wrappers. Vendor segment from a fixed table so dotted versions (gpt-4.1-mini,glm-4.7) are never mistaken for a route.getShortModelNamerenders a routed id as"<base short name> (Bedrock)"—Haiku 4.5 (Bedrock),GPT-5.6 Luna (Bedrock). Every Bedrock spelling of one model folds to one row; direct ids are unchanged; pricing still runs on the full id so cross-region profiles keep their uplifted rate.looksLikeLocalModelconsults the route first.
Bedrock first; the same hook is where OpenRouter / Vertex / Azure spellings belong once a provider is shown to record them. ### Prior art
- models: grok-4.5-build and grok-4.5 collapse to one 'Grok 4.5' display name, showing duplicate rows #1029 → hardening: cache-scope escape hatch, promptSource on large lines, distinct Grok 4.5 rows #1031:
grok-4.5vsgrok-4.5-buildcollapsed to one row; fixed with a display-name suffix (Grok 4.5 (build)), ids and pricing untouched. Same mechanism as proposed here. - codeburn models shows raw ids (gpt-5.6-*, accounts/fireworks/models/*) and duplicate rows that report resolves correctly #967 → fix(models): resolve and merge raw ids in models report #1053: rows merge by alias-resolved canonical id; "distinct SKUs that only share a label stay two rows." Bedrock ids are distinct SKUs in LiteLLM (a
us.profile prices above the bare id). - Trend view and
codeburn modelsgroup the same model under different rows #1239 → fix(models): group Trend rows and the models command by the same display name #1241: OpenCode's two spellings of MiniMax-M3 were merged, with the split kept asrawModels. Different case: same door, same price. Bedrock vs direct is two invoices, so it falls under fix(models): resolve and merge raw ids in models report #1053, not fix(models): group Trend rows and the models command by the same display name #1241. Since fix(models): group Trend rows and the models command by the same display name #1241 also made Trend usegetShortModelName, the desktop andcodeburn modelsagree on Bedrock rows for free. - fix(hermes): unwrap known routers; fail closed on unknown models #1039 / Price and label OrcaRouter gateway model ids as the model they route to #1118 / fix(models): price cliproxy-gateway routed ids as the models they wrap #1364: routing wrappers (
cp/,orcarouter/,cliproxy/) are peeled on purpose — they are client plumbing with no price or invoice of their own. Bedrock is not that class. - Unpriced warning fires on subscription-billed models where $0 is correct, and its suggested model-alias fix would fabricate spend #968 → fix(models): treat subscription SKUs as honestly $0 #1050: flat-rate is a billing property orthogonal to model identity, handled as a third state. Same shape of problem.
looksLikeLocalModel's:rule dates from Quiet routine pricing warnings + menubar recovery from stuck-loading #266 (May), before any Bedrock user; it never considered-v1:0.
PR: #1448
This is the pilot of a three-step series toward a metered-vs-subscription split:
- models: a Bedrock-routed model renders as its raw id, and aliasing it would merge it into the direct-API row #1449 (this) + feat(models): carry the billing route on the call; key every model row on it #1448 — Bedrock, detected from the model id. Introduces
ModelRoute/getModelRouteand the<name> (<Route>)row convention. - Add OpenRouter as a billing route and carry metered/subscription on each call: read the endpoint from the provider's own column, not the model id (with a list of routes to follow) #1450 — OpenRouter, and any route that does not rename the model: read the endpoint from the provider's own column (Hermes
billing_provider, OpenCodeproviderID, ClineapiProvider, …), carry it on the call. Includes the list of routes others can add after it. - Show metered vs subscription spend, and slice by billing route, on every surface (CLI --billing/--route, payload, tab strip) #1451 — surfaces:
--routeon the CLI, route fields in the menubar payload, a "By billing" grouping on the menubar / dock / desktop tab strips beside today's "By tool".
Activity
ulises-c commentedon Sep 15, 2026
Implementation: #1448. Follow-up for filtering/drill-through by route (and OpenRouter via Hermes
billing_provider): #1450.feat(models): keep a Bedrock-routed model in its own row
ulises-c commentedon Sep 15, 2026
Series updated: #1450 is now the OpenRouter / provider-column route issue (with the follow-on route list); #1451 covers the CLI filter and the GUI "By billing" grouping.