Omahub
← All plugins
R

Agent Usage: Z.ai + Synthetic

by radbug

Adds Z.ai Coding Plan and Synthetic quota records to Omarchy's built-in Agents panel.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
a0d7eab
Scanned
1 month ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

No obvious issues detected

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Low
AI risk level
Low
Recommendation
install
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
a0d7eab
Reviewed
1 month ago

The plugin is a benign service that periodically runs two Python collectors to fetch usage quotas from Z.ai and Synthetic APIs, then writes the results as JSON files for the Omarchy agents panel. It handles API keys carefully (HTTPS only, no redirects, keys only sent to trusted domains) and performs atomic writes. No malicious or suspicious behavior was found.

  • Reads API keys from environment variables or opencode's auth.json, but only uses them for the intended API calls and does not exfiltrate them.
  • Writes files to the user's state directory, which is expected for the panel integration.
How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/alvarosaavedra/omarchy-agent-usage-zai-synthetic --enable
Widgets #bar #quickshell #ai

Agent Usage: Z.ai + Synthetic

An Omarchy service plugin that adds Z.ai (GLM Coding Plan) and Synthetic (synthetic.new) usage records to Omarchy's built-in Agents panel — the panel that already ships Claude, Codex, and Fireworks tabs.

How it works

The built-in omarchy.agents panel draws one tab per JSON record in ~/.local/state/omarchy/agents/usage/. Omarchy runs its packaged omarchy-agent-usage-* collectors itself, but only scans OMARCHY_PATH/bin, so third-party providers need their own publisher.

This plugin is a headless service that:

  1. Runs the bundled Python collectors for Z.ai and Synthetic every 5 minutes (and on shell start).
  2. Validates each collector's JSON output.
  3. Publishes the records to the usage state directory with atomic writes.

The records follow the exact contract the panel consumes (label / percent / resetsAt limits, tier label, auth-help text), so the Z.ai and Synthetic tabs appear with no panel changes.

What it shows

  • Z.ai — plan tier (lite/standard/pro), the 5-hour session token window, the 7-day token window, and the monthly web-search allowance, straight from api.z.ai usage monitor.
  • Synthetic — the rolling 5-hour session budget, the weekly token budget, and the hourly search allowance (plus the legacy daily free-tool-call budget when an account reports it), from api.synthetic.new/v2/quotas.

Requirements

  • Omarchy (Quattro) with the built-in Agents widget enabled (omarchy plugin list should show omarchy.agents enabled).
  • python3 (already required by Omarchy's own Fireworks collector).
  • Credentials — either environment variables or an opencode sign-in:
    • Z.ai: ZAI_API_KEY, or a zai-coding-plan / zai entry in opencode's auth.json
    • Synthetic: SYNTHETIC_API_KEY, or a synthetic entry in opencode's auth.json

Without credentials the tabs still appear, showing the unavailable state plus setup instructions — the same behavior as the built-in collectors.

Install

omarchy plugin add https://github.com/alvarosaavedra/omarchy-agent-usage-zai-synthetic.git --enable

For a local checkout:

omarchy plugin add ~/Projects/omarchy-agent-usage-zai-synthetic --enable

Remove

omarchy plugin remove alvarosaavedra.agent-usage-zai-synthetic
rm -f ~/.local/state/omarchy/agents/usage/zai.json ~/.local/state/omarchy/agents/usage/synthetic.json

The panel has no expiry for records, so removing the last-written files stops the (now stale) tabs from lingering.

Development

omarchy plugin validate .
qmllint -I /usr/share/omarchy/shell Service.qml

The collectors run standalone for quick debugging:

python3 collectors/omarchy-agent-usage-zai | jq .
python3 collectors/omarchy-agent-usage-synthetic | jq .

License

MIT