Quick answer
OpenCode itself has no usage window to alert on. UsageAtlas can alert on a local spend or token threshold for OpenCode, and can alert on reset windows for providers you connect separately. Set one rule per threshold; it fires once and waits before repeating.
What can be watched
| Signal | Available | Where it comes from |
|---|---|---|
| Daily tokens | Yes | Local database |
| Daily spend | Yes | Cost field or computed rates |
| Session cost | Yes | Per-message sum |
| Provider window | Only if connected | Provider API |
| Provider balance | Only if connected | Provider API |
Set a spend alert
- Open UsageAtlas and confirm OpenCode is detected.
- Open Alerts and choose the spend threshold.
- Pick a daily or weekly window.
- Leave the app running in the tray or menu bar.
A threshold that fires every day is a budget decision, not an alert. Set it where you would actually change behaviour.
Why not poll for balance
OpenCode does not hold your provider balance. Any alert on remaining capacity has to come from the provider, which is why the two signal types are separate.
Alerts for a tool without a quota
OpenCode has no single account allowance, so there is nothing to alert on by default. The useful alerts are thresholds you set yourself: tokens per day, cost per month, or spend per project. That turns a flexible tool into a predictable one.
- Decide a monthly budget per provider key.
- Set a threshold at the point where you would change behaviour, not at 100%.
- Alert once per cycle to avoid noise.
- Review the threshold monthly as your workflow changes.
UsageAtlas supports spend alerts alongside reported quota alerts. The budget guardrails guide covers the policy side.
Questions, answered
Can I get an alert before an OpenCode request fails?
Only for a provider with a known window. OpenCode does not enforce a single account-wide allowance of its own.
Do alerts work when the app is closed?
No. The app must be running, but it can sit in the tray or menu bar.
Can I alert on cost per session?
Yes, as a threshold. It fires after the session crosses the value, which is retrospective rather than preventive.