Skip to content

v0.30.0 — subscription usage graphed per window and read every 15 minutes, and Overview states subscription value beside spend

Choose a tag to compare

@izzoa izzoa released this 10 Nov 05:12
· 5 commits to main since this release

Highlights

  • Subscription cards graph each plan's usage over its window. Under the usage line, each limit window (5-hour, weekly, monthly) gets a small 0–100% chart over its span, with the reset marked as a dashed line and the window, its latest percent and its reset stated in words beside it. A window with no reading yet shows its empty track and says so, never a plotted 0%. Model-limit windows (ChatGPT's per-model buckets) sit behind a closed model limit graphs disclosure, and the charts hide with the usage line while the card states a plan pause or a needed reconnect.
  • Plan usage is read about every 15 minutes, even with no traffic. A background schedule reads each subscription plan's usage endpoint (40 providers per tick, 4 at a time), sharing Refresh usage's 5-minute cooldown, and keeps 35 days of readings. Claude (/api/oauth/usage) and ChatGPT (/wham/usage) join Kimi Code, Z.ai, MiniMax and OpenCode Go as usage sources, and their cards gain Refresh usage. Every read uses polyrouter's own identity, never the imitation one, never spends plan quota, never changes routing, and never changes a plan's stored billing state. The Claude and ChatGPT endpoints are undocumented; docs/self-hosting.md states the terms caution.
  • A per-provider switch for the schedule. Edit on a subscription provider shows Check plan usage on a schedule, on by default. Turned off, the plan is read only when you press Refresh usage (and, for Claude, ChatGPT and OpenCode Go, from the usage their traffic reports).
  • Overview states the value served on subscription beside spend. When the range holds subscription traffic, a line under the spend figure reads $3.12 served on subscription, at API rates · excluded from spend (Costs' words), and the Requests row states its share (all on subscription plans or 12 on subscription plans). With none, neither appears. Spend still means money owed.
  • The headline strip ends level. On Overview and Costs the other figures now sit as rows beside spend (label, figure, qualification) with their figures on one column, so neither side leaves a blank band; at phone width the rows stack under spend. Costs keeps every figure and word.
  • Kimi Code and Z.ai offer identity imitation when you connect them. The plan's detail in Add provider → Subscription shows the identity-imitation switch, off, behind the same confirmation as Edit, and Connect sends your choice, so the first Test already uses it.

Upgrade notes

  • One migration runs on boot (0046): a new table, plan_usage_sample, and a provider.check_plan_usage column, default on for every existing row. No data is rewritten and there is no backfill: the history starts at upgrade. No new environment variable.
  • After the upgrade, polyrouter reads every subscription plan's usage endpoint about every 15 minutes, Claude and ChatGPT included. To keep a provider to reads you press, turn off Check plan usage on a schedule in its Edit dialog.
  • New endpoint: GET /api/providers/:id/plan-usage/history (owner-scoped). PATCH /api/providers/:id accepts checkPlanUsage (boolean; null is a 400, and a non-subscription or pasted-credential row refuses it with a 422). POST /api/providers/key-presets/connect accepts an optional imitateClientIdentity.
  • Pull ghcr.io/izzoa/polyrouter:0.30.0 (or :latest) and restart. The optional semantic variant is ghcr.io/izzoa/polyrouter:0.30.0-semantic.

Full package changelogs live in packages/*/CHANGELOG.md.