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.

SessionWatcher

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

Native app for the Mac menu bar and the Windows taskbar. Track Claude, Codex and 18 more tools' 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

Prices go up Nov 1, midnight Paris time. Prices go up Nov 1

Download Free for Mac

macOS 14+. Free for 7 days, no credit card.

Download free: 7-day trial, no card

For Mac (macOS 14+). opencode and everything in Pro are included. Nothing is charged when it ends.

Rather buy now? Pro covers opencode: $24 a year or $59 once →