[GH-ISSUE #6684] [Feature]: NanoGPT subscription usage and model cost indicators #3743

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

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

Originally assigned to: @SpicyMarinara on GitHub.

HELLO! So, I've already implemented this locally, and tested it, so i think it works great, and here's the FR. I'll add screenshots of my local implementation below, and in the eventual PR too, obviously. Also, this FR and the feature itself was primarily written by my agent, fyi.

What problem does this solve?

NanoGPT subscription users cannot see how much of their weekly limit they have used without
leaving Marinara and opening the NanoGPT dashboard. There is also no way to tell
which models in the dropdown are covered by a subscription and which consume
quota at a higher rate.

Two specific gaps:

  1. Quota is invisible. NanoGPT Subscription enforces weekly input-token quotas. You
    only discover you are near the limit when generation starts failing.
  2. Model cost is invisible. Some models consume more input tokens per token
    sent (specifically 2x for something like GLM 5.3). Others are not in the subscription at all and bill to
    the paid balance instead. The model dropdown shows neither, so the expensive
    choice looks identical to the cheap one.

Proposed solution

  1. Optional Management Token field on the NanoGPT connection, below the API
    key. Management tokens can be created with a usage:read-only scope, so the
    inference key never has to be used for quota reads. It is used when present
    and falls back to the API key otherwise. This is simply because the nanoGPT
    documentation itself recommends it.

  2. "Show subscription usage" toggle (off by default, per connection) that
    displays weekly input-token quotas. When enabled, the meter appears
    in three places:

    • the connection editor,
    • the chat settings connection section (under the context budget),
    • the inline connection picker above the composer.
  3. Model list indicators, using data already returned by the existing
    detailed=true models call:

    • an Nx pill on models the subscription covers that consume more than one
      input token per token sent,
    • a green 1x pill when covered at the normal rate,
    • a Paid pill when the model is not in the subscription.

Alternatives considered

  • Reusing the API key for quota reads only. Works, and is the fallback, but
    it means a quota display holds a credential that can spend balance. The
    management token is the safer default.
  • Fetching usage from the models endpoint. No usage data is returned there.
  • Always showing the meter. Rejected as the default: it costs one request per
    refresh and some users do not want a second progress bar in the chat UI, hence
    the per-connection toggle.
  • Implementing the Usage meter for other providers: Gonna be so honest, I didn't see ME supported Claude Subscription, which also has a clear usage bar, though it uses local Claude Code, so it'd probably work differently in the backend. Also, NovelAI has a new opus tier usage for diffusion v5, but i checked the documentation and it doesn't have an endpoint to get the remaining usage yet.. if ever.

Additional context

Endpoints used (both hosts are hardcoded because neither is derivable from the
stored base URL of https://nano-gpt.com/api/v1):

  • Management tokens: https://nano-gpt.com/api/management/v1/subscription/usage
  • Inference keys: https://api.nano-gpt.com/api/subscription/v1/usage

Notes for review:

  • subscription.inputTokenMultiplier is not in NanoGPT's published OpenAPI
    dump, but is returned by the live API and verified by direct request. It is
    nested under subscription alongside included.
  • percentUsed is a fraction, not a percentage, and can exceed 1.
  • A null quota means "not configured"; a degraded: true response means
    "unknown" and is rendered as unknown rather than as zero or full.
  • A usage:read-only token returns 403 on /api-keys, which is expected.

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.

Local Examples:

Image Image Image Image Image Image Image Image
Originally created by @ylli-selmani on GitHub (Sep 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6684 Originally assigned to: @SpicyMarinara on GitHub. HELLO! So, I've already implemented this locally, and tested it, so i think it works great, and here's the FR. I'll add screenshots of my local implementation below, and in the eventual PR too, obviously. Also, this FR and the feature itself was primarily written by my agent, fyi. ## What problem does this solve? NanoGPT subscription users cannot see how much of their weekly limit they have used without leaving Marinara and opening the NanoGPT dashboard. There is also no way to tell which models in the dropdown are covered by a subscription and which consume quota at a higher rate. Two specific gaps: 1. **Quota is invisible.** NanoGPT Subscription enforces weekly input-token quotas. You only discover you are near the limit when generation starts failing. 2. **Model cost is invisible.** Some models consume more input tokens per token sent (specifically 2x for something like GLM 5.3). Others are not in the subscription at all and bill to the paid balance instead. The model dropdown shows neither, so the expensive choice looks identical to the cheap one. ## Proposed solution 1. **Optional Management Token field** on the NanoGPT connection, below the API key. Management tokens can be created with a `usage:read`-only scope, so the inference key never has to be used for quota reads. It is used when present and falls back to the API key otherwise. This is simply because the nanoGPT documentation itself recommends it. 2. **"Show subscription usage" toggle** (off by default, per connection) that displays weekly input-token quotas. When enabled, the meter appears in three places: - the connection editor, - the chat settings connection section (under the context budget), - the inline connection picker above the composer. 3. **Model list indicators**, using data already returned by the existing `detailed=true` models call: - an `Nx` pill on models the subscription covers that consume more than one input token per token sent, - a green `1x` pill when covered at the normal rate, - a `Paid` pill when the model is not in the subscription. ## Alternatives considered - **Reusing the API key for quota reads only.** Works, and is the fallback, but it means a quota display holds a credential that can spend balance. The management token is the safer default. - **Fetching usage from the models endpoint.** No usage data is returned there. - **Always showing the meter.** Rejected as the default: it costs one request per refresh and some users do not want a second progress bar in the chat UI, hence the per-connection toggle. - **Implementing the Usage meter for other providers:** Gonna be so honest, I didn't see ME supported Claude Subscription, which also has a clear usage bar, though it uses local Claude Code, so it'd probably work differently in the backend. Also, NovelAI has a new opus tier usage for diffusion v5, but i checked the documentation and it doesn't have an endpoint to get the remaining usage yet.. if ever. ## Additional context Endpoints used (both hosts are hardcoded because neither is derivable from the stored base URL of `https://nano-gpt.com/api/v1`): - Management tokens: `https://nano-gpt.com/api/management/v1/subscription/usage` - Inference keys: `https://api.nano-gpt.com/api/subscription/v1/usage` Notes for review: - `subscription.inputTokenMultiplier` is **not** in NanoGPT's published OpenAPI dump, but is returned by the live API and verified by direct request. It is nested under `subscription` alongside `included`. - `percentUsed` is a **fraction**, not a percentage, and can exceed 1. - A null quota means "not configured"; a `degraded: true` response means "unknown" and is rendered as unknown rather than as zero or full. - A `usage:read`-only token returns 403 on `/api-keys`, which is expected. ## 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. ## Local Examples: <img width="348" height="203" alt="Image" src="https://github.com/user-attachments/assets/13f5c284-da22-4920-a617-04eecef5274c" /> <img width="438" height="327" alt="Image" src="https://github.com/user-attachments/assets/ad8cf54d-662b-4648-90f3-392150bde718" /> <img width="441" height="329" alt="Image" src="https://github.com/user-attachments/assets/a897d059-9791-4d1f-af37-5bd576e25338" /> <img width="439" height="332" alt="Image" src="https://github.com/user-attachments/assets/d3bef206-a69f-41c3-9532-f473cd766686" /> <img width="436" height="327" alt="Image" src="https://github.com/user-attachments/assets/08e4e737-7811-4f68-a26b-0351f8941d7b" /> <img width="416" height="154" alt="Image" src="https://github.com/user-attachments/assets/ee465944-a3fc-4e8d-a2d0-6c84aec2f763" /> <img width="389" height="339" alt="Image" src="https://github.com/user-attachments/assets/63234eb9-b45f-455a-b3e3-1d57aeed3b06" /> <img width="354" height="334" alt="Image" src="https://github.com/user-attachments/assets/60ba01d2-5a80-4514-8927-047e38ae8692" />
bsakaguchi 2026-10-21 06:06:45 +07:00
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#3743
No description provided.