feat: add Nous Portal account usage tracking (#33376) - #33888
feat: add Nous Portal account usage tracking (#33376)#33888ousiaresearch wants to merge 1 commit into
Conversation
Queries Nous inference API /credits, /usage, or /account/usage endpoints to report credit consumption, falling back to a connectivity check via /models when usage endpoints are unavailable. Uses the same OAuth credential resolution path as inference traffic.
|
Thanks for the contribution. This is already implemented on current Automated hermes-sweeper review evidence:
The linked issue discussion noted that a server-side billing API was the original blocker; the current Portal-account implementation resolves that path. |
|
+1 to this - and there's a broader use case beyond hermes balance. I build tokenaudit (https://github.com/DPS0340/tokenaudit), an open-source read-only CLI that scans provider usage APIs and reports itemized cost savings (OpenAI, Anthropic, OpenRouter, NeuralWatt supported). The pieces seem mostly in place already: the dashboard queries with groupBy: model / granularity: day server-side, and the Portal's OAuth AS metadata already supports dynamic client registration + PKCE public clients - so either a usage:read scope or an OpenRouter-style /api/v1/activity endpoint (the Portal is OpenRouter-powered) would unblock both this issue and external tooling. Full details of what I've verified: DPS0340/tokenaudit#1. Happy to build against a draft spec. |
What does this PR do?
Adds credit/usage tracking for Nous Portal provider. Queries /credits, /usage, or /account/usage endpoints to report consumption, falling back to connectivity check via /models.
Fixes #33376
Type of Change
Changes Made
agent/account_usage.py: Added_fetch_nous_account_usage(),_parse_nous_usage_payload(), and_nous_connectivity_snapshot()functionsfetch_account_usage()dispatchHow to Test
Checklist