[GH-ISSUE #7646] [Feature]: Claude and ChatGPT plan usage in the subscription usage meter #4227

Closed
opened 2026-10-21 06:12:55 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7646

Originally assigned to: @ylli-selmani on GitHub.

I've already built this on a branch (PR incoming), so this FR mostly documents the feature. Written with my agent, fyi.

What problem does this solve?

#6686 added a subscription usage meter for NanoGPT, but it is the only plan Marinara can show. Claude (Subscription) and OpenAI (ChatGPT) connections run on plans with their own limits: a 5-hour window and a weekly window. Today you find out you hit one when generation starts failing, or you open Claude Code / Codex / claude.ai to check. From a phone over the network there is no quick way to look at all.

These limits are also much easier to hit by surprise than NanoGPT's 60M weekly tokens, because the plan windows are shared with everything else you do on that account.

Separately, the NanoGPT meter shows how much is used but not when the window resets, although NanoGPT already reports it.

Proposed solution

  1. Claude (Subscription): read the plan's 5-hour and weekly windows through the Claude Agent SDK that Marinara already ships (the same data as Claude Code's /usage). No prompt is sent, so a reading costs nothing.
  2. OpenAI (ChatGPT): read the same two windows from the endpoint the Codex CLI itself uses for its limits, with the existing Codex login.
  3. Per-window switches: under the existing Show subscription usage switch, a 5-hour window and a Weekly window checkbox per connection. The server only reads the windows that are on.
  4. Same meter, same three places: the connection editor, the chat's Connection settings, and the Connections quick switcher by the chat input (desktop and phone). Each window reads like "58% · resets in 2h".
  5. NanoGPT reset time: "42M remaining · resets in 4d" under the bar, and "resets in 4d" in the quick switcher.

Known limits, stated in the UI:

  • Plans report a percentage and a reset time only, no token counts.
  • The numbers are account-wide (Claude Code, claude.ai and Marinara together), not Marinara's share.
  • The Claude SDK marks its usage call as experimental. It is isolated in one file and shows "unavailable" if it fails, never a fake 0%.
  • A Claude (Subscription) connection with an API key bills through the API and has no plan windows.

Alternatives considered

  • A mockup first: skipped, since the data lookup already worked and the UI is the NanoGPT meter with different labels.
  • Grok CLI (Subscription): left out, there is no documented way to read its remaining usage.
  • Google Vertex AI: pay-per-use, no plan window to show.

Other subscriptions with a usage endpoint can be added later on the same shape.

Additional context

  • #6686 (NanoGPT usage meter) and #7109 (meter and cost pills in the shared model picker) built the meter this extends.
  • The ChatGPT reading has only been tested against the payload shape from the Codex source. It needs a live check by someone with a ChatGPT plan.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7646 Originally assigned to: @ylli-selmani on GitHub. I've already built this on a branch (PR incoming), so this FR mostly documents the feature. Written with my agent, fyi. ## What problem does this solve? #6686 added a subscription usage meter for NanoGPT, but it is the only plan Marinara can show. Claude (Subscription) and OpenAI (ChatGPT) connections run on plans with their own limits: a 5-hour window and a weekly window. Today you find out you hit one when generation starts failing, or you open Claude Code / Codex / claude.ai to check. From a phone over the network there is no quick way to look at all. These limits are also much easier to hit by surprise than NanoGPT's 60M weekly tokens, because the plan windows are shared with everything else you do on that account. Separately, the NanoGPT meter shows how much is used but not when the window resets, although NanoGPT already reports it. ## Proposed solution 1. **Claude (Subscription):** read the plan's 5-hour and weekly windows through the Claude Agent SDK that Marinara already ships (the same data as Claude Code's `/usage`). No prompt is sent, so a reading costs nothing. 2. **OpenAI (ChatGPT):** read the same two windows from the endpoint the Codex CLI itself uses for its limits, with the existing Codex login. 3. **Per-window switches:** under the existing **Show subscription usage** switch, a **5-hour window** and a **Weekly window** checkbox per connection. The server only reads the windows that are on. 4. **Same meter, same three places:** the connection editor, the chat's Connection settings, and the Connections quick switcher by the chat input (desktop and phone). Each window reads like "58% · resets in 2h". 5. **NanoGPT reset time:** "42M remaining · resets in 4d" under the bar, and "resets in 4d" in the quick switcher. Known limits, stated in the UI: - Plans report a percentage and a reset time only, no token counts. - The numbers are account-wide (Claude Code, claude.ai and Marinara together), not Marinara's share. - The Claude SDK marks its usage call as experimental. It is isolated in one file and shows "unavailable" if it fails, never a fake 0%. - A Claude (Subscription) connection with an API key bills through the API and has no plan windows. ## Alternatives considered - **A mockup first:** skipped, since the data lookup already worked and the UI is the NanoGPT meter with different labels. - **Grok CLI (Subscription):** left out, there is no documented way to read its remaining usage. - **Google Vertex AI:** pay-per-use, no plan window to show. Other subscriptions with a usage endpoint can be added later on the same shape. ## Additional context - #6686 (NanoGPT usage meter) and #7109 (meter and cost pills in the shared model picker) built the meter this extends. - The ChatGPT reading has only been tested against the payload shape from the Codex source. It needs a live check by someone with a ChatGPT plan. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4227
No description provided.