API Key Management
Create, list, update, enable, disable, delete, copy, and export API keys with the Dwellir CLI.
Use dwellir keys to create, list, update, and delete API keys for your Dwellir account.
The CLI never prints a full API key. Every output format shows keys masked, for example d8d3****eef9. To use a key, copy it to the clipboard or write it to .env. This behavior starts in CLI 0.3.0.
The Dwellir CLI cannot create or assign IP whitelists. Use API key IP whitelisting in the dashboard.
List all keys
dwellir keys listWith JSON output:
dwellir keys list --json{
"ok": true,
"data": [
{
"api_key": "d8d3****eef9",
"name": "production",
"enabled": true,
"created_at": "2025-10-14T14:07:24.592946",
"updated_at": "2025-10-14T14:07:24.592946"
}
],
"meta": {
"command": "keys.list",
"timestamp": "2026-02-26T12:00:00Z"
}
}The api_key field shows the first and last four characters of the key. The masked value does not work as a credential.
The daily_quota and monthly_quota fields appear only when a quota has been set on the key. Keys without quotas omit these fields (shown as "Unlimited" in human output).
Select a key
Commands that act on one key take the key name, for example production. The masked value from keys list and the full key value also work. Names match without regard to case.
If two keys have the same name, the CLI returns an error that lists both masked values. Select one by its masked value, or give each key a unique name.
Create a key
dwellir keys create --name my-keyOptionally set quotas at creation time:
dwellir keys create --name ci-key --daily-quota 100000 --monthly-quota 3000000| Flag | Description |
|---|---|
--name | A descriptive name for the key (required) |
--daily-quota | Maximum requests per day (0 = unlimited) |
--monthly-quota | Maximum requests per month (0 = unlimited) |
The output shows the new key masked. To use it, run dwellir keys copy my-key or dwellir keys env my-key.
Use a key
Copy a key to the clipboard
dwellir keys copy my-keyThe CLI sends the key to the clipboard tool on standard input, not as a command argument. It selects the tool for your platform:
| Platform | Clipboard tool |
|---|---|
| macOS | pbcopy |
| Windows and WSL | clip.exe |
| Linux with Wayland | wl-copy |
| Linux with X11 | xclip or xsel |
| Termux | termux-clipboard-set |
On Linux, the display server selects the tool, not the distribution. Over SSH or in CI there is no clipboard. The command then fails with the clipboard_unavailable error code. Use keys env instead.
Write a key to .env
dwellir keys env my-keyThe command writes DWELLIR_API_KEY='<key>' to .env in the current directory. It does not print the key.
| Flag | Default | Description |
|---|---|---|
--env-file | .env | Environment file: .env or .env.local |
--var | DWELLIR_API_KEY | Variable name |
--replace | false | Replace an existing value |
The CLI applies the same file rules as dwellir project setup:
- The file gets mode
0600. - The CLI adds an ignore rule for the file to
.gitignore. - The CLI refuses a file that Git tracks.
- The CLI refuses to overwrite an existing variable unless you pass
--replace.
Your application reads DWELLIR_API_KEY at runtime. For example, load .env into a shell session:
set -a; . ./.env; set +a
curl -s "https://api-ethereum-mainnet.n.dwellir.com/$DWELLIR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'To write the key and the endpoint URLs together, use dwellir project setup.
Update a key
Change the name or quotas of an existing key:
dwellir keys update my-key --name new-name --daily-quota 50000Only the flags you pass are updated. For example, to change just the daily quota:
dwellir keys update my-key --daily-quota 200000Enable and disable a key
Temporarily disable a key without deleting it:
dwellir keys disable my-keyRe-enable it later:
dwellir keys enable my-keyA disabled key returns 403 errors for any API requests made with it.
Delete a key
Permanently remove an API key:
dwellir keys delete my-keyScripting example
Create a temporary key, write it to .env, and delete it after the job:
# Unique per run, so a leftover key from an earlier or parallel run never shares the name
KEY_NAME="ci-$(date +%Y%m%d-%H%M%S)-$$"
# Create the key and write it to .env without printing it
dwellir keys create --name "$KEY_NAME" --daily-quota 50000
dwellir keys env "$KEY_NAME"
# Load DWELLIR_API_KEY into the environment
set -a; . ./.env; set +a
# ... use the key ...
# Clean up
dwellir keys delete "$KEY_NAME"Next steps
- Discover endpoints to use with your keys
- Monitor usage for your keys
- Run
dwellir keys --helpfor the full list of flags