ollama-usage

Monitor your Ollama Cloud usage from the terminal

curl -fsSL https://ontech7.github.io/ollama-usage/install.sh | sh

paste this in terminal, or install manually

…or let your AI agent set it all up — status line included:

Set up ollama-usage with the Claude Code status line

paste this to your AI agent, or read AI-SETUP.md for what it does step by step

How it works

Ollama Cloud has no usage API. This reads the same numbers your settings page shows, from the terminal — so you can see them without leaving your editor.

  1. 1

    Authenticate once

    ollama-usage auth stores your ollama.com session cookie locally. Nothing is sent anywhere else.

  2. 2

    It reads your settings page

    Each call fetches your own settings page and parses the two windows out of it. Results are cached, so a status line does not hammer the site.

  3. 3

    Pick your output

    A table, --json for scripts, a one-line status, or watch to get alerted when you cross a threshold.

zsh
$ ollama-usage

                   Ollama Cloud usage
┏━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Window ┃ Used  ┃ Resets      ┃ Models                ┃
┡━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━┩
│ 5h     │ 38.0% │ 18:40 04/08 │ qwen3-coder:480b (12) │
│ weekly │ 8.0%  │ —           │ qwen3-coder:480b (57) │
└────────┴───────┴─────────────┴───────────────────────┘

Live in your status line

One line, always visible. ollama-usage status never errors and always exits 0, so it is safe to wire into a status bar.

status line
$ ollama-usage status
🦙 38% 5h · 8% 7d

$ ollama-usage status --monochrome
🦙 38% 5h · 8% 7d

Each window is colored as a whole — green for the 5-hour window, blue for the weekly one. Pass --monochrome (or set NO_COLOR) for a plain line.

One command sets it up

ollama-usage setup --status-line writes the status line into ~/.claude/settings.json for you (add --project for this repo only, --dry-run to preview, --force to replace an existing one). To switch between Ollama and Claude models in one status line — Ollama usage for Ollama models, Claude's own rate limits for Claude models — see the README.