Configuration

Setting Up Your Keys

LimitAID needs your API keys to query provider limits. Codex and Z.ai keys are found automatically. OpenRouter requires manual setup.

Auto-Discovery

Keys That Find Themselves

LimitAID checks well-known locations on your machine for existing credentials. If you've already logged into one of these tools, there's nothing to configure.

Codex

Reads ~/.codex/auth.json

Logged into Codex? Done.

Z.ai

Reads ~/.config/opencode/opencode.json

Uses your opencode config.

OpenRouter

No auto-discovery

Add keys to keys.conf by hand.

When auto-discovery finds a key, it gets stored under the name default. If you also configure a key for the same provider in your config file, the config file entry takes priority.

Config File

The keys.conf File

For OpenRouter keys (and to override auto-discovered keys for other providers), create a config file at ~/.config/limitaid/keys.conf. Each line maps a named key to a file on disk that holds the raw API key value.

# LimitAID Key Configuration
# Format: <provider>_<name>=<path_to_file_containing_key>

# OpenRouter keys
# openrouter_work=/home/user/.secrets/openrouter_work
# openrouter_personal=/home/user/.secrets/openrouter_personal

# Z.ai keys (overrides auto-discovered key)
# zai_personal=/home/user/.secrets/zai_personal

# Codex keys (overrides auto-discovered key)
# codex_work=/home/user/.secrets/codex_work
Default location: ~/.config/limitaid/keys.conf
Format: <provider>_<name>=<path> — one entry per line
Key files: should contain the raw key with no trailing newline
Providers: codex, openrouter, zai

CLI Overrides

Override Everything From the Command Line

Three flags give you full control without touching a config file.

--conf <path>

Use a custom config file instead of the default location.

--provider-config 'provider::key_value[::name]'

Inject a key directly on the command line. Overrides everything.

-n, --name <name>

Pick a specific named key when you have more than one configured.

Examples

# Use a different config file
./limitaid openrouter --conf ~/my-keys.conf

# Inject a Z.ai key directly, name it "work"
./limitaid zai --provider-config 'zai::sk-abc123::work'

# Select the "work" key from your config file
./limitaid openrouter -n work

Resolution Order

How LimitAID Picks Your Key

When you run a provider command, keys are resolved in a strict priority order.

1

Config file

Entries from keys.conf (or the file specified with --conf) are loaded first.

2

CLI override

--provider-config replaces all discovered or configured keys with a single injected key.

3

Auto-discovery

If nothing turned up a key yet, LimitAID checks well-known locations on your machine.