跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    mhenrique94

    Openrouter Costs

    opencode-openrouter-costs·v0.1.1·可观测与分析

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

    GitHub 星标

    0

    月装机量

    441

    近 7 天 44

    综合评分

    35.8

    生态多维模型

    最近提交

    14 天前

    2026-09-20

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

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

    OpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    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

    同类生态推荐