Create an API namespace for organizing keys by environment, service, or product.
Use this to separate production from development keys, isolate different services, or manage multiple products. Each API gets a unique identifier and dedicated infrastructure for secure key operations.
Important: API names must be unique within your workspace and cannot be changed after creation.
Required permissions:
api.*.create_api(to create APIs in any workspace)
See the API reference for the full HTTP endpoint documentation.
Usage#
Flags#
Human-readable name for this API namespace within your workspace. Use a descriptive name like Payment Service (prod) or user-api-dev to identify its purpose and environment. Must be 3-256 characters.
Global Flags#
| Flag | Type | Description |
|---|---|---|
--root-key | string | Override root key ($UNKEY_ROOT_KEY) |
--api-url | string | Override API base URL (default: https://api.unkey.com) |
--config | string | Path to config file (default: ~/.unkey/config.toml) |
--output | string | Output format. Use json for raw JSON |
--body | string | Send this JSON string as the request body. You cannot combine it with request-building flags. |
Examples#
Output#
Default output shows the request ID, followed by the created API:
With --output=json, the full response envelope is returned: