Home / Guides / OpenCode Usage

How to Check Your OpenCode Usage

Run opencode stats. It's a documented command in OpenCode itself, and it shows token usage and cost for your OpenCode sessions. Here's what it covers, how to use its flags, and what it does not document about a provider-account limit.

Documentedopencode.ai: CLI docs, stats· verified 2026-08-17

Last updated 2026-08-17 · Every source below was checked on that date · By Soren Starck

Quick answer

opencode stats, “Show token usage and cost statistics for your OpenCode sessions.”

Documentedopencode.ai: CLI docs, stats· verified 2026-08-17

That's OpenCode session token usage and cost, not your provider account's remaining quota or billing balance. That provider-account distinction is this page's own inference from what the command is documented to cover, not a documented field of opencode stats itself. For a comparison of tools that track OpenCode usage, including SessionWatcher, see best OpenCode usage trackers for Mac.

The opencode stats command

OpenCode's CLI documentation describes opencode stats as showing token usage and cost statistics for your OpenCode sessions. Run it with no flags for the full picture, or compose the documented flags to narrow what you see:

  • --days, show stats for the last N days (default: all time).
  • --tools, number of tools to show (default: all).
  • --models, show a model usage breakdown, hidden by default; optionally pass a top-N count.
  • --project, filter by project (default: all projects; pass an empty string for the current project).

Documentedopencode.ai: CLI docs, stats command and flags· verified 2026-08-17

Three documented flag examples

These compose the flags above exactly as documented; none of them are undocumented shortcuts.

  • opencode stats --days 7, usage and cost for the last 7 days.
  • opencode stats --models 5, include a breakdown by model, top 5.
  • opencode stats --project "", filter to the current project only.

Documentedopencode.ai: CLI docs, stats flags· verified 2026-08-17

What this command does not tell you

opencode stats is documented as OpenCode session token usage and cost, nothing more. Your remaining rate-limit headroom, spend cap, or billing balance belongs to whichever provider OpenCode is connected to. That distinction is this page's own inference from what the command is documented to cover, not a claim about an output field the docs don't mention. Check the provider's own dashboard for that number.

Providers: it's not a fixed short list

OpenCode's provider documentation states that it uses AI SDK and Models.dev to support 75+ LLM providers and local models, not a hard-coded handful. Credentials are added with /connect, provider keys are stored in ~/.local/share/opencode/auth.json, and provider configuration lives in the provider section.

Documentedopencode.ai: provider docs· verified 2026-08-17

The current OpenCode project

OpenCode's official repository is anomalyco/opencode , “the open source coding agent.” Older links to the project's previous repository location are out of date.

Documentedgithub.com: anomalyco/opencode· verified 2026-08-17

Where this guide stops

This page only answers what opencode stats shows and how to read it. It doesn't compare tracking tools feature-by-feature. That comparison lives on best OpenCode usage trackers for Mac. For SessionWatcher's current OpenCode offering, see SessionWatcher for OpenCode.

Frequently Asked Questions

How do I check my OpenCode usage?

Run opencode stats. It shows token usage and cost statistics for your OpenCode sessions. Add --days, --models, or --project to narrow the view.

Documentedopencode.ai: CLI docs, stats· verified 2026-08-17

Does opencode stats show my remaining provider quota or billing balance?

Not as a documented output. It covers OpenCode session token usage and cost. That a remaining provider quota or billing balance instead belongs to whichever provider OpenCode is connected to is this page's own inference from what the command is documented to cover, not a documented field of opencode stats itself.

Documentedopencode.ai: CLI docs, stats· verified 2026-08-17

Which providers does OpenCode support?

75+ LLM providers and local models via AI SDK and Models.dev, not a fixed short list. Add credentials with /connect.

Documentedopencode.ai: provider docs· verified 2026-08-17

Sources

Every claim above links its source at the point it is made. This table collects the same set with the date it was checked for this guide.

SourceUsed forVerified
opencode.ai: CLI docsThe opencode stats command, its description, and its --days/--tools/--models/--project flags.2026-08-17
opencode.ai: provider docs75+ LLM providers and local models via AI SDK and Models.dev; /connect; auth.json storage; provider config section.2026-08-17
github.com: anomalyco/opencodeCurrent official repository, replacing the project's previous, now-archived repository location.2026-08-17

SessionWatcher is an independent product and is not affiliated with, endorsed by, or sponsored by the OpenCode project.

Measurement note for this page

This is an existing-page rewrite, not a new page. Its success criterion is unique visitors on this exact page who complete the DataFast goal guide_internal_link_clicked with properties source=guide-opencode-stats-2026-08 and target=best-opencode-usage-trackers, measured over the first 56 complete days after this rewrite's first complete indexable day.

The frozen baseline, from DataFast, is 422 visitors and $0 revenue / 0 payments on this exact page over the trailing 30 days, extracted 2026-08-17. The prior outbound link was untracked, so no page-specific tracked-link baseline exists.

Success requires at least 15 unique goal completions, provided the page received at least 300 DataFast visitors in the window. Below 300 visitors, the result is inconclusive rather than a pass or fail. Full contract, including source verification dates: config/opencode-usage-guide-experiment.mjs.

SessionWatcher

Stop going to look.
Keep opencode usage in your menu bar.

Native macOS menu bar app. Track Claude and Codex usage, costs, and rate limits in real-time.

★★★★★Trusted by developers daily
nicojerome

“Fast, simple, and does exactly what it should. Definitely worth it.”

@nicojerome on GitHub

Download Free

macOS 14+. 7-day Bundle trial. No credit card.