Skip to content

models: a Bedrock-routed model renders as its raw id, and aliasing it would merge it into the direct-API row #1449

Closed

Description

@ulises-c

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 claude rendered the Bedrock row as the raw id anthropic.claude-haiku-4-5-20251001-v1:0 next to Haiku 4.5. Pricing was correct (LiteLLM carries the Bedrock rows), so the dollars were right but the row was unreadable.
  • codeburn models --provider hermes likewise showed openai.gpt-5.6-luna and openai.gpt-5.6-sol verbatim.
  • The obvious fix — aliasing the Bedrock id onto the friendly name so it reads Haiku 4.5 — would be worse: modelBreakdown is 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; --provider is the tool that produced the session, not the billing endpoint.
  • Reading billing_provider out of ~/.hermes/state.db by 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:M version, :300k context tags, arn:aws:bedrock:… and LiteLLM's bedrock/ wrappers. Vendor segment from a fixed table so dotted versions (gpt-4.1-mini, glm-4.7) are never mistaken for a route.
  • getShortModelName renders 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.
  • looksLikeLocalModel consults 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

PR: #1448


This is the pilot of a three-step series toward a metered-vs-subscription split:

  1. 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 / getModelRoute and the <name> (<Route>) row convention.
  2. 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, OpenCode providerID, Cline apiProvider, …), carry it on the call. Includes the list of routes others can add after it.
  3. Show metered vs subscription spend, and slice by billing route, on every surface (CLI --billing/--route, payload, tab strip) #1451 — surfaces: --route on 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

  1. ulises-c commented on Sep 15, 2026

    @ulises-c
    ContributorAuthor

    Implementation: #1448. Follow-up for filtering/drill-through by route (and OpenRouter via Hermes billing_provider): #1450.

  2. added a commit that references this issue on Sep 15, 2026
    4c5591a
  3. ulises-c commented on Sep 15, 2026

    @ulises-c
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions