[GH-ISSUE #12532] Cloud usage stats. #8315

Open
opened 2026-04-12 20:52:50 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @rick-github on GitHub (Oct 7, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12532

The new usage stats in https://ollama.com/settings are welcome, but it would be very useful if they were available via /api/me.

Originally created by @rick-github on GitHub (Oct 7, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12532 The new usage stats in https://ollama.com/settings are welcome, but it would be very useful if they were available via `/api/me`.
GiteaMirror added the cloudfeature request labels 2026-04-12 20:52:50 -05:00
Author
Owner

@mkadrlik commented on GitHub (Oct 9, 2025):

Issue predicated from https://discord.com/channels/1128867683291627614/1425630280730935397

<!-- gh-comment-id:3387088753 --> @mkadrlik commented on GitHub (Oct 9, 2025): Issue predicated from https://discord.com/channels/1128867683291627614/1425630280730935397
Author
Owner

@prologic commented on GitHub (Jan 19, 2026):

In addition, we we have this available in the Ollama Mac Statusbar App? 🙏

<!-- gh-comment-id:3765990396 --> @prologic commented on GitHub (Jan 19, 2026): In addition, we we have this available in the Ollama Mac Statusbar App? 🙏 <!-- Failed to upload "Screenshot 2026-01-19 at 11.00.11.png" -->
Author
Owner

@iamhenry commented on GitHub (Feb 14, 2026):

An endpoint would be helpful. I'd like to build an opencode plugin for it

<!-- gh-comment-id:3902497851 --> @iamhenry commented on GitHub (Feb 14, 2026): An endpoint would be helpful. I'd like to build an opencode plugin for it
Author
Owner

@markabrahams commented on GitHub (Feb 27, 2026):

Yeah because

curl -s -X GET -H 'Cookie: __Secure-session=<session-key>' 'https://ollama.com/settings' | awk '/Session usage/ { session_line=1; next }
session_line && /width: [0-9]+\.[0-9]+%/ { match($0, /[0-9]+\.[0-9]+%/); print "Session usage: " substr($0, RSTART, RLENGTH); session_line=0 }
/Weekly usage/ { weekly_line=1; next }
weekly_line && /width: [0-9]+\.[0-9]+%/ { match($0, /[0-9]+\.[0-9]+%/); print "Weekly usage: " substr($0, RSTART, RLENGTH); weekly_line=0 }
'

was the automation we needed, not the automation we deserved.

<!-- gh-comment-id:3970727786 --> @markabrahams commented on GitHub (Feb 27, 2026): Yeah because ``` curl -s -X GET -H 'Cookie: __Secure-session=<session-key>' 'https://ollama.com/settings' | awk '/Session usage/ { session_line=1; next } session_line && /width: [0-9]+\.[0-9]+%/ { match($0, /[0-9]+\.[0-9]+%/); print "Session usage: " substr($0, RSTART, RLENGTH); session_line=0 } /Weekly usage/ { weekly_line=1; next } weekly_line && /width: [0-9]+\.[0-9]+%/ { match($0, /[0-9]+\.[0-9]+%/); print "Weekly usage: " substr($0, RSTART, RLENGTH); weekly_line=0 } ' ``` was the automation we needed, not the automation we deserved.
Author
Owner

@luminexo commented on GitHub (Mar 27, 2026):

Adding a specific use case for this feature:

Autonomous agents with adaptive behavior

I'm building autonomous agents that run periodic heartbeats (background tasks). Currently, there's no way to know how much of the subscription quota has been consumed, so the agent can't adapt its behavior:

  • When quota is abundant: Run longer tasks, more exploration
  • When quota is low: Reduce heartbeat duration, defer non-essential work
  • When quota is critical: Pause and wait for reset

Current workaround limitations:

The scraping approach mentioned in previous comments works but is fragile:

  • Requires session cookies (breaks when session expires)
  • Tied to specific HTML structure
  • Not officially supported

Proposed API:

A simple endpoint like GET /api/me returning:

{
  "plan": "pro",
  "session": { "used": 45000, "limit": 100000, "resets_at": "2026-03-27T10:00:00Z" },
  "weekly": { "used": 320000, "limit": 500000, "resets_at": "2026-04-03T00:00:00Z" }
}

This would enable agents to make intelligent decisions about resource allocation without manual intervention.

Thanks for considering this!

<!-- gh-comment-id:4140633321 --> @luminexo commented on GitHub (Mar 27, 2026): Adding a specific use case for this feature: **Autonomous agents with adaptive behavior** I'm building autonomous agents that run periodic heartbeats (background tasks). Currently, there's no way to know how much of the subscription quota has been consumed, so the agent can't adapt its behavior: - **When quota is abundant:** Run longer tasks, more exploration - **When quota is low:** Reduce heartbeat duration, defer non-essential work - **When quota is critical:** Pause and wait for reset **Current workaround limitations:** The scraping approach mentioned in previous comments works but is fragile: - Requires session cookies (breaks when session expires) - Tied to specific HTML structure - Not officially supported **Proposed API:** A simple endpoint like `GET /api/me` returning: ```json { "plan": "pro", "session": { "used": 45000, "limit": 100000, "resets_at": "2026-03-27T10:00:00Z" }, "weekly": { "used": 320000, "limit": 500000, "resets_at": "2026-04-03T00:00:00Z" } } ``` This would enable agents to make intelligent decisions about resource allocation without manual intervention. Thanks for considering this!
Author
Owner

@FAI-Solutions commented on GitHub (Apr 11, 2026):

A working solution (if you're using Open WebUI with Ollama)

If you're trying to monitor Ollama cloud usage, there’s already a practical workaround.

Check out the Ollama Usage Monitor extension:
https://github.com/FAI-Solutions/open-webui-extensions

It fills the current gap in Ollama’s API by extracting and displaying cloud usage data directly from your session (via browser cookies) in a simple, readable format.

Until native usage tracking is officially supported, this is likely the most straightforward solution available.

If you're not using Open WebUI, the same approach can still be applied — just adapt the method to your own setup or tooling.

<!-- gh-comment-id:4230121275 --> @FAI-Solutions commented on GitHub (Apr 11, 2026): ### A working solution (if you're using Open WebUI with Ollama) If you're trying to monitor Ollama cloud usage, there’s already a practical workaround. Check out the Ollama Usage Monitor extension: [https://github.com/FAI-Solutions/open-webui-extensions](https://github.com/FAI-Solutions/open-webui-extensions) It fills the current gap in Ollama’s API by extracting and displaying cloud usage data directly from your session (via browser cookies) in a simple, readable format. Until native usage tracking is officially supported, this is likely the most straightforward solution available. If you're not using Open WebUI, the same approach can still be applied — **just adapt the method to your own setup or tooling**.
Author
Owner

@Jannled commented on GitHub (Apr 12, 2026):

A working solution (if you're using Open WebUI with Ollama)

If you're trying to monitor Ollama cloud usage, there’s already a practical workaround.

Check out the Ollama Usage Monitor extension: https://github.com/FAI-Solutions/open-webui-extensions

It fills the current gap in Ollama’s API by extracting and displaying cloud usage data directly from your session (via browser cookies) in a simple, readable format.

Until native usage tracking is officially supported, this is likely the most straightforward solution available.

If you're not using Open WebUI, the same approach can still be applied — just adapt the method to your own setup or tooling.

I don't assume malicious intent here, but I find it kinda rude to do an unlabeled self advertisement. But the AI that probably wrote this comment has no sense of human feelings so whatever.

If someone finds this useful: Please be vigilant and do your own checks before installing, as Open WebUI extensions are pure Python code and are therefore a beautiful attack vector. The currently published version seems to be fine, however I have not done a detailed analysis and cannot look into the future.

<!-- gh-comment-id:4230690723 --> @Jannled commented on GitHub (Apr 12, 2026): > ### A working solution (if you're using Open WebUI with Ollama) > > If you're trying to monitor Ollama cloud usage, there’s already a practical workaround. > > Check out the Ollama Usage Monitor extension: https://github.com/FAI-Solutions/open-webui-extensions > > It fills the current gap in Ollama’s API by extracting and displaying cloud usage data directly from your session (via browser cookies) in a simple, readable format. > > Until native usage tracking is officially supported, this is likely the most straightforward solution available. > > If you're not using Open WebUI, the same approach can still be applied — **just adapt the method to your own setup or tooling**. I don't assume malicious intent here, but I find it kinda rude to do an unlabeled self advertisement. But the AI that probably wrote this comment has no sense of human feelings so whatever. If someone finds this useful: **Please be vigilant** and do your own checks before installing, as Open WebUI extensions are pure Python code and are therefore a beautiful attack vector. The currently published version seems to be fine, however I have not done a detailed analysis and cannot look into the future.
Author
Owner

@FAI-Solutions commented on GitHub (Apr 12, 2026):

Not sure why you would count this as "unlabeled self advertisement" — I thought it was pretty obvious I made it but I can edit and add a line if that helps?

I wrote this about four weeks ago after digging through github and mostly finding people asking for the same thing, but no real solution (usually threads were closed and pointed back here). That is exactly the reason why I posted it here to give working code to others (would have saved me half or even full day, if there was some code to recycle).

Anyways from technical point of view this is an easy workaround to retrieve the weekly usage, as well as the 5-hour run usage from ollama. And an Idea or a starting point for people to build similar extraction methods for other tools (like opencode).

Please be vigilant and do your own checks before installing

On that I agree 100%, which should always be the default, especially when broad permissions are granted.

<!-- gh-comment-id:4231345488 --> @FAI-Solutions commented on GitHub (Apr 12, 2026): Not sure why you would count this as "unlabeled self advertisement" — I thought it was pretty obvious I made it but I can edit and add a line if that helps? I wrote this about four weeks ago after digging through github and mostly finding people asking for the same thing, but no real solution (usually threads were closed and pointed back here). That is exactly the reason why I posted it here to give working code to others (would have saved me half or even full day, if there was some code to recycle). Anyways from technical point of view this is an easy workaround to retrieve the weekly usage, as well as the 5-hour run usage from ollama. And an Idea or a starting point for people to build similar extraction methods for other tools (like opencode). > Please be vigilant and do your own checks before installing **On that I agree 100%, which should always be the default, especially when broad permissions are granted.**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#8315