Skip to content

ReferenceEnvironment variables

Environment variables

The three environment variables zquota reads, their defaults, and how the matching flags override them.

zquota reads three environment variables. Each has a flag that overrides it for one run.

Variable Flag Default What it sets
ZAI_API_KEY --api-key none The API key, sent to Z.ai as a bearer token. Required unless --api-key is given.
ZAI_TIMEZONE --timezone, -z Europe/London The IANA timezone for Resets at and resets_at.
ZAI_API_URL --api-url https://api.z.ai/api/monitor/usage/quota/limit The quota endpoint.

The key zquota sends in the Authorization: Bearer header. zquota checks for it after checking the flags and before making a request; with neither the variable nor --api-key, it prints ERROR: ZAI_API_KEY is not set and exits with code 1. An empty --api-key '' doesn’t override the variable.

An IANA timezone name such as America/New_York, Asia/Tokyo or UTC. --timezone overrides it. A name zquota doesn’t recognise, including one shaped like a file path such as /etc/localtime, gets WARNING: unknown timezone '<name>'; using Europe/London on standard error, and the run carries on in Europe/London. An empty value counts as unset, so zquota uses Europe/London without a warning.

Replaces the quota endpoint, for testing or a proxy. --api-url overrides it. An empty value counts as unset, so zquota uses Z.ai’s endpoint. A file:// URL reads a saved response from disk; see Configuration.

zquota has no variables for the output format, colour, --watch or --threshold, and it doesn’t read NO_COLOR. It also has no config file. Colour is decided by whether standard output is a terminal and by --no-color.