Skip to content

[Feature]: OpenRouter, TokenRouter, and Ollama Cloud usage tracking (status bar + Accounts) #21476

Description

@deeepanshu

Problem or use case

Orca’s AI Provider Accounts / status-bar rate-limit strip already tracks Claude, Codex, Gemini, Antigravity, OpenCode Go, Kimi, MiniMax, and Grok. Several API gateways that Orca users (and OMP panes inside Orca) already call are missing:

Provider Role for Orca users Gap today
OpenRouter Multi-model API gateway used from OMP and other agents No Accounts row, no status-bar chip
TokenRouter OpenAI-compatible router with per-key quotas + wallet Same
Ollama Cloud Hosted cloud models (ollama-cloud/* in OMP) Same; users leave Orca to check ollama.com/settings/usage

This is the same class of request as Fireworks (#20812), DeepSeek (#12869), Cursor (#15516), Copilot (#6892).

Out of scope for this issue: making these first-class agent launch targets. This request is only live usage / quota in Accounts + the status bar.

Proposed solution

Add three optional usage providers, following MiniMax / Grok / Fireworks patterns:

  1. Credentials in Settings → Accounts (desktop-safe storage; mirror MiniMax API-key paste)
  2. Fetchers under the existing rate-limit pipeline that map vendor payloads into ProviderRateLimits (session / weekly / monthly and/or a money/credit balance readout where % windows do not apply — same display path Fireworks proposes)
  3. Status-bar chips + visibility toggles in Appearance
  4. unavailable = not configured; exhausted-but-configured balances stay visible
  5. Focused unit tests per fetcher

Confirmed vendor endpoints (probed 2026-09-18)

OpenRouter — API key (OPENROUTER_API_KEY / paste sk-or-…):

  • GET https://openrouter.ai/api/v1/auth/key → per-key usage_*, optional limit / limit_remaining, free_model_daily_requests.{used,limit,remaining}
  • GET https://openrouter.ai/api/v1/credits → { total_credits, total_usage } (remaining ≈ credits − usage)

Suggested UI:

  • Primary: remaining credit balance (money), analogous to Fireworks
  • Secondary when present: free-model daily request window as a % bar; optional key spend limit when limit is set

TokenRouter — management key preferred; API key as fallback:

  • Management: GET https://api.tokenrouter.com/api/management/self/wallet → topUpBalance, toppedUpSpent, vouchers (Management API docs)
  • Management: GET https://api.tokenrouter.com/api/management/api-keys → per-key remain_quota / used_quota / unlimited_quota
  • API key fallback: GET https://api.tokenrouter.com/v1/dashboard/billing/usage + …/subscription (OpenAI-shaped; soft/hard limits are not always meaningful)

Suggested UI:

  • Primary: wallet topUpBalance (money remaining)
  • Optional secondary: selected API key remain/used quota when not unlimited_quota

Ollama Cloud — API key (OLLAMA_CLOUD_API_KEY / paste from ollama.com/settings/keys):

  • GET https://ollama.com/api/usage →
    limits.session.usage and limits.weekly.usage (0–1 fractions in practice) plus per-model request counts and period activity cost

Suggested UI:

  • Best fit for existing session + weekly % bars (same shape as Claude/Codex chips)
  • Optional activity cost under the row

Implementation slices (reviewable PRs)

  1. Ollama Cloud first — maps cleanly onto existing session/weekly windows; smallest UI delta
  2. OpenRouter — credit balance + optional free-tier daily window (Fireworks-like money readout)
  3. TokenRouter — management-key wallet + optional per-key quota

Shared plumbing per provider (same checklist as #12869):

  • Extend rate-limit state / ProviderRateLimits['provider']
  • Credential storage + Accounts pane row
  • Fetcher + unit tests
  • Status-bar roster / visibility wiring
  • i18n strings

Alternatives or additional context

Related

I can implement these as focused PRs (Ollama Cloud → OpenRouter → TokenRouter) after maintainers confirm the credential + display shapes above.

Activity

  1. added theissue type on Sep 19, 2026
  2. jamesjfoong commented on Nov 3, 2026

    @jamesjfoong

    Ollama Cloud implemented in PR #37829: Ollama joins the rate-limit providers (documented balance + 30d usage endpoints, sealed OLLAMA_API_KEY entry in Settings ▸ Accounts, status-bar bar + letter). OpenRouter/TokenRouter remain open in this issue — happy to follow the same pattern for them if the approach lands well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions