nanobot: 2026-09-14 21:12:30 — usage: skill + script fully English
This commit is contained in:
@@ -8,38 +8,49 @@ description: >
|
||||
|
||||
# Usage
|
||||
|
||||
Zobrazí spotřebu kreditů na Ollama Cloud pro aktuální API klíč.
|
||||
Shows Ollama Cloud credit usage for the current API key.
|
||||
|
||||
## Spuštění
|
||||
## Run
|
||||
|
||||
```bash
|
||||
uv run skills/usage/scripts/ollama_usage.py
|
||||
```
|
||||
|
||||
Skript čte `OLLAMA_API_KEY` z `workspace/.env` (vytvořeného uživatelem).
|
||||
Pokud chybí nebo klíč nefunguje (401/403), řekni to uživateli — nescrapuj web.
|
||||
The script reads `OLLAMA_API_KEY` from the `workspace/.env` file (created by
|
||||
the user). If it is missing or the key fails (401/403), tell the user —
|
||||
never scrape the website.
|
||||
|
||||
## Výstup
|
||||
## Output
|
||||
|
||||
Text v češtině, přesně tento formát:
|
||||
Format (script prints it, present it to the user as-is):
|
||||
|
||||
- `Session: <value> %, resets in X hours — <model> (<req count>), …`
|
||||
- `Weekly: <value> %, resets in Y days — <model> (<req count>), …`
|
||||
- `Modely (počet požadavků, weekly okno):` — seznam modelů s requesty
|
||||
```
|
||||
Ollama Cloud usage
|
||||
Session: <pct> %, resets in X hours — <model> (<req count>), …
|
||||
Weekly: <pct> %, resets in Y days — <model> (<req count>), …
|
||||
Models (request count, weekly window):
|
||||
<model>: <count>
|
||||
```
|
||||
|
||||
## Reset časy — odvození, ne API
|
||||
Present the script output to the user in Czech (translate the labels, keep
|
||||
the numbers exact).
|
||||
|
||||
`/api/usage` **neobsahuje reset timestamps** (ty existují jen v HTML UI).
|
||||
Skript je počítá: session = do další celé hodiny UTC (dashboard ukazuje
|
||||
„Resets in 1 hour"), weekly = do nejbližšího pondělí 00:00 UTC.
|
||||
Důvod: session usage šel v testu nahoru během pár minut (rolling okno),
|
||||
weekly se mění pomalu, konzistentní s hodinovým/týdenním oknem.
|
||||
Kdyby se ukázalo, že okno není kalendářové, uprav `until_next_*`.
|
||||
## Reset times — derived, not from the API
|
||||
|
||||
## Poznámky
|
||||
`/api/usage` contains **no reset timestamps** (they exist only in the HTML
|
||||
UI). The script computes them: session = until the next full hour UTC (the
|
||||
dashboard shows "Resets in 1 hour"), weekly = until the next Monday 00:00
|
||||
UTC. Rationale: session usage climbed in real time during testing (rolling
|
||||
window), weekly changes slowly — consistent with hourly/weekly windows.
|
||||
If the window turns out not to be calendar-based, fix `until_next_*`.
|
||||
|
||||
- Endpoint: `GET https://ollama.com/api/usage`, hlavička
|
||||
`Authorization: Bearer <key>` (ověřeno 2026-09, issue #15132 je zastaralá).
|
||||
- `limits.*.usage` je zlomek limitu plánu (× 100 = % jako na dashboardu).
|
||||
- `activity.cost` u Pro plánu vrací $0.00000 — nefunkční, ve výstupu vynechán.
|
||||
- Klíč z `~/.ollama/id_ed25519` nefunguje — jen API key z ollama.com.
|
||||
## Notes
|
||||
|
||||
- Endpoint: `GET https://ollama.com/api/usage`, header
|
||||
`Authorization: Bearer <key>` (verified 2026-09; issue #15132 is stale).
|
||||
- `limits.*.usage` is a fraction of the plan limit (× 100 = % as on the
|
||||
dashboard).
|
||||
- `activity.cost` returns $0.00000 on the Pro plan — broken, omitted from
|
||||
the output.
|
||||
- The `~/.ollama/id_ed25519` key does not work — only an API key minted at
|
||||
ollama.com/settings/keys.
|
||||
Reference in New Issue
Block a user