OpenCode

OpenCode usage across multiple providers

Track OpenCode usage when you switch between providers. Why blending totals hides cost, and how to keep a per-provider view.

Quick answer

OpenCode records a provider and model on each message, so usage can be grouped by provider. Do that before totalling cost: the same token count means different money at different providers, and a blended total cannot tell you where to cut.

Why blending hides the answer

Two providers can charge different rates for the same model name. If you sum tokens and apply one average rate, the total looks reasonable and points at the wrong fix.

ViewShowsHides
All providersTotal volumeRate differences
Per providerWhere money goesModel mix
Per provider + modelBothNothing important
Per sessionTask costCross-provider trend

Keep the view clean

  • Name sessions by task so provider rows are readable.
  • Do not reuse one API key across teams if you need attribution.
  • Record which provider is subscription-backed; its marginal cost is zero.
  • Recheck rates when a provider changes pricing.

Use the split to decide

  1. Sort providers by cost per completed task.
  2. Move the most expensive routine task to a cheaper provider.
  3. Keep the premium provider for work that needs it.
  4. Repeat the comparison monthly, not weekly.

UsageAtlas keeps provider and model fields from the OpenCode database, so this split is available without custom SQL.

Keeping several providers straight

Multiple providers means multiple rate cards and multiple limits. The trap is treating a combined token count as a cost: a million tokens from a cheap model and a million from an expensive one are not the same money.

QuestionSplit byWhy
What did the month cost?Provider and modelDifferent rates
Where am I limited?Provider keySeparate quotas
Which project is expensive?Working directoryAttribution
Is a provider worth keeping?Cost per completed taskNot raw tokens

UsageAtlas groups OpenCode sessions by model and project, and shows other tools in the same window. See model usage for the split.

Questions, answered

Does OpenCode tag messages with the provider?

Yes. The provider and model are part of the message metadata, which is what makes a provider split possible.

Can I use two providers in one session?

Yes. Switching models mid-session is supported, and each message keeps its own provider.

How do I compare a subscription provider with a metered one?

Value the subscription usage at API rates to get a shadow cost, then compare that with the metered provider.

Browse by topic