nan usage
nan (nan.builders) token and request usage in the Paseo Usage modal.
该插件的概览尚未翻译为你的语言,因此以英文显示。
Adds nan (nan.builders) usage to the Paseo Usage modal.
nan is an OpenAI-compatible inference API for open models on a shared EU cluster. This plugin registers a Paseo usage source, so a nan card appears beside the built-in Claude, Codex, Cursor, and other cards, on every client connected to the daemon, including mobile.
How it works
The plugin calls GET https://api.nan.builders/v1/usage from the daemon with your nan inference API key (sk-...) as a bearer token, month-to-date in UTC. Paseo renders a nan card with:
- Live quota rings (
used/capper model, each model's real reset time, and glm5.3's rolling 4h window when reported). When the quota service does not answer, the plugin falls back to the published monthly catalog quotas (deepseek-v4-flash 3B, mimo-v2.6-flash 1B, qwen3.8-flash 500M, glm5.3-flash 2B, shared image pool 100 req) computed from the daily usage rows - Tokens and API requests so far this month, plus lifetime tokens
- A per-model breakdown (tokens and requests for each model)
Requests go only to the fixed origins api.nan.builders and cloud-api.nan.builders; a quota-service failure never hides the usage counters, and mirror hosts (custom api_base) show counters without rings.
Setup
Paseo discovers the key from, in order of preference:
- the
NAN_API_KEYenvironment variable on the daemon machine ~/.nan/credentials.jsonor~/.nan/config.json(JSON withapi_key/apiKey, or a plain-text key file)- the login OpenCode created through
/connectfor thenanintegration: thecredentialtable of OpenCode v2'sopencode.db(read-only), with a fallback to v1'sauth.json - the global
~/.config/opencode/opencode.json/.jsonc(the setup the nan docs teach:provider.nan.options.apiKeyin plain text), parsed JSONC-style with OpenCode's{env:VAR}and{file:path}substitutions; project configs are never scanned
Generate an inference API key under "API Keys" in your settings at cloud.nan.builders. Keep it out of repositories and shared configs: the plugin only stores a pointer to where the key lives, never the key itself. The OpenCode store reads a key OpenCode already keeps on disk; to exclude that store entirely, set NAN_USAGE_NO_OPENCODE=1 in the daemon environment.
Reports refresh through Paseo's usage cache (5 minutes). The nan usage endpoint allows 30 requests per minute; a 429 is retried once when the Retry-After fits inside the fetch deadline.
Requires Paseo 0.11 or newer on the daemon and Enable plugins in the daemon's settings.

