# OrChat — OpenRouter Chat CLI (Token Analytics) > Chat with OpenRouter models in the terminal with streaming, token/cost analytics, file attachments, and safe command gating; verified 81★ via PyPI. ## Install Copy the content below into your project: ## Quick Use ```bash pip install orchat orchat --setup orchat --model "anthropic/claude-3-opus" ``` ## Intro Chat with OpenRouter models in the terminal with streaming, token/cost analytics, file attachments, and safe command gating; verified 81★ via PyPI. **Best for:** Terminal-native chat + controlled shell execution workflows **Works with:** Python 3.9+ · OpenRouter API key · local files/images (attachments) **Setup time:** 5–15 minutes ### Key facts (verified) - GitHub: 81 stars · 6 forks · pushed 2026-02-15. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `pip install orchat`. ## Main - Use `orchat --setup` to store your OpenRouter key and defaults; then pick models dynamically during sessions. - Use attachments (`@file`) to include local context while keeping paths safe and sizes bounded. - Rely on command gating: OrChat shows a risk panel before you approve shell commands requested by the assistant. - Track token usage and cost from API-reported counts to keep sessions budgeted. ### Source-backed notes - README describes OpenRouter-based streaming chat, token/cost tracking, and conversation persistence. - README explicitly documents a command risk panel (safe/warning/critical) before execution approval. ### FAQ - **Do I need OpenRouter credit?**: Yes — the README mentions 402 errors when your OpenRouter balance is insufficient. - **Can I disable command execution?**: Only approve what you trust; treat the risk panel as your gate. - **How do I keep costs down?**: Pick cheaper models and watch token analytics during long sessions. ## Source & Thanks > Source: https://github.com/oop7/OrChat > License: MIT > GitHub stars: 81 · forks: 6 --- ## Quick Use ```bash pip install orchat orchat --setup orchat --model "anthropic/claude-3-opus" ``` ## Intro 在终端通过 OpenRouter 聊天:流式输出、token/费用统计、文件附件、会话管理与命令风险面板;已验证 81★,可用 pip 安装并通过 `--setup` 向导完成配置,适合日常终端工作流。 **Best for:** 终端聊天 + 受控执行命令(带风险提示)的工作流 **Works with:** Python 3.9+ · OpenRouter API key · 本地文件/图片附件 **Setup time:** 5–15 minutes ### Key facts (verified) - GitHub:81 stars · 6 forks;最近更新 2026-02-15。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口命令:`pip install orchat`。 ## Main - 先用 `orchat --setup` 配好 OpenRouter key 与默认项;会话中可动态选择模型。 - 用 `@文件` 附件注入本地上下文,同时注意路径安全与大小限制。 - 命令执行有护栏:assistant 请求执行时会展示风险面板,需人工确认再运行。 - 用 token/费用统计控预算,让终端聊天更可控、更可复盘。 ### Source-backed notes - README 介绍 OpenRouter 流式聊天、token/费用统计与会话管理能力。 - README 明确“命令风险面板”会在执行前分级提示,降低误操作风险。 ### FAQ - **需要 OpenRouter 余额吗?**:需要。README 提到余额不足会出现 402 错误。 - **能完全禁用命令执行吗?**:至少可做到“默认不执行”;只批准你明确信任的命令。 - **如何控成本?**:选更便宜的模型,并持续关注 token/费用统计。 ## Source & Thanks > Source: https://github.com/oop7/OrChat > License: MIT > GitHub stars: 81 · forks: 6 --- Source: https://tokrepo.com/en/workflows/orchat-openrouter-chat-cli-token-analytics Author: Script Depot