The Unkey CLI gives you direct access to the Unkey API from your terminal. Create and manage API keys, configure rate limits, set permissions, and query analytics, all without leaving the command line.Documentation Index
Fetch the complete documentation index at: https://unkey-mintlify-ea078f9f.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Installation
- npm
- GitHub Releases
Authentication
Before using the CLI, authenticate with your root key:~/.unkey/config.toml. All subsequent commands use it automatically.
You can also pass a key per-command or via environment variable:
Usage
All API operations live under theunkey api command, organized by resource:
Resources
| Resource | Description |
|---|---|
apis | Create, get, delete API namespaces and list their keys |
keys | Create, verify, update, delete keys and manage their permissions and roles |
identities | Create, get, update, delete identities for grouping keys |
permissions | Create, get, delete permissions and roles |
ratelimit | Apply rate limits and manage overrides |
analytics | Query key verification data with SQL |
Examples
Create an API and issue a key:Output
By default, the CLI prints the request ID with latency, followed by the response data:--output=json to get the raw API response envelope (meta + data) as JSON on stdout:
Global Flags
Every command accepts these flags:| Flag | Description |
|---|---|
--root-key | Override the root key (also: UNKEY_ROOT_KEY env var) |
--api-url | Override the API base URL (default: https://api.unkey.com) |
--config | Path to config file (default: ~/.unkey/config.toml) |
--output | Output format. Use json for raw JSON |

