Custom Integration: Monitor your Ollama.com Cloud usage limits in Home Assistant
Hey everyone,
If you use Ollama’s cloud services, you have probably run into their usage limits at some point. Since there is currently no official API to monitor this, I wrote a custom integration to bring these limits directly into Home Assistant so you can track them and set up automations or alerts.
Because there is no API, the integration works by using your ollama.com session cookie to fetch your settings page and scrape the usage metrics out of the HTML.
My personal usecase is to be able to switch to a different service provider before my voice assistant stops working. Once a offical API is released this integration will be deprovisioned as someone else or myself will add the API into the official Ollama integration.
What it tracks:
- Session & Weekly Usage (expressed as percentages)
- Session & Weekly Remaining (so you know how much headroom you have left)
- Reset Timers (e.g., “resets in 4 hours” or “resets in 3 days”)
- Model Info (the models you have run and request counts)
How to set it up:
- Copy the repository URL (https://github.com/vithusel/ollama-cloud-usage) and add it as a Custom Repository in HACS (select “Integration” as the category).
- Install the integration and restart Home Assistant.
- Add the integration from Settings → Devices & Services.
- Enter a friendly name for the account and paste in your browser’s
Cookiestring from ollama.com.
You can get your cookie by logging into ollama.com, opening your browser’s Developer Tools (F12), reloading the page under the Network tab, clicking on the settings document request, and copying the value of the Cookie request header.
A note on cookies:
These session cookies generally last from several weeks to a few months. Once yours expires, the sensors will show as unavailable. To fix this, you do not have to delete and re-add the integration; you can just click the three dots on the integration card, select Reconfigure, and paste a fresh cookie string.
The integration also fully supports multiple accounts if you need to monitor more than one.
Feel free to check out the project, report any issues, or contribute:
