Skip to content
    ↑↓ select↵ openesc close
    mhenrique94

    Openrouter Costs

    opencode-openrouter-costs·v0.1.1·Observability

    OpenCode TUI plugin — sidebar widget showing OpenRouter session cost and account balance

    GitHub stars

    0

    Monthly installs

    441

    44 in 7 days

    Composite score

    35.8

    Multi-signal model

    Last commit

    14 days ago

    2026-09-20

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-openrouter-costs@0.1.1"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    English | Português (BR)

    OpenCode TUI plugin — sidebar widget showing OpenRouter session cost and account balance.

    Install

    # From npm (recommended)
    npx opencode-openrouter-costs
    
    # From source (GitHub)
    npx github:mhenrique94/opencode-openrouter-costs
    

    The installer asks for your preferred language (English or Portuguese) on first run. All subsequent output — installer instructions and the widget itself — will use that language.

    What it does

    Adds a compact widget to the OpenCode sidebar (above "MCP Servers"):

    OpenRouter
    Session: $0.0523
    Balance: $4.21
    
    • Session — cost of the current session (resets on new session)
    • Balance — remaining OpenRouter account credit

    Requirements

    • OpenCode >= 1.18.30
    • OpenRouter provider configured (via /models or OPENROUTER_API_KEY)

    Uninstall

    npx opencode-openrouter-costs --remove
    

    Language

    The widget supports English and Portuguese (BR). The language is chosen at install time and persisted in ~/.config/opencode/openrouter-cost.json. To switch later, re-run the installer or edit the config file directly:

    {"lang": "pt"}
    

    Valid values: "en" or "pt".

    Contributing / Releasing

    See RELEASING.md for the release workflow and maintenance playbook.

    License

    MIT

    Similar plugins