Skip to main content

list

List API keys (metadata only; key values are never returned).

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging

Examples

List all API keys in the org

Filter output with --jq

Print just the prefixes of personal keys

Output

Text mode (--output text): Table with columns: NAME, KEY (prefix + ****), TYPE, TEAM. When no keys exist, prints “No API keys found.” to stderr. JSON mode (--output json): payload type managementapi.APIKeys.

create

Create a new API key. The key value is printed to stdout exactly once and cannot be retrieved later; capture or pipe it on creation. --model-id may be repeated to scope the key to specific models and is only valid with --type workspace-export-metrics or --type workspace-invoke.

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT (repeatable)
Restrict the key to a specific model. May be repeated. Only valid with —type workspace-export-metrics or workspace-invoke.
TEXT
Optional human-readable name for the key.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID to create the key in. Defaults to the organization’s default team.
TEXT
required
API key category.One of: personal, workspace-export-metrics, workspace-invoke, workspace-manage-all
BOOL
Enable verbose logging

Examples

Create a personal API key
Create a workspace-invoke key scoped to specific models

Filter output with --jq

Print just the raw key value

Output

Text mode (--output text): Prints the raw API key value on stdout (one line). Also prints “Save this key now. It will not be shown again.” to stderr. JSON mode (--output json): payload type managementapi.APIKey.

delete

Delete an API key. Exactly one of --name or --prefix is required: --name matches the human-readable name, --prefix matches the leading characters shown in org api-key list.

Options

TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Human-readable name of the API key to delete.Mutually exclusive with other flags in group identifier.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Prefix of the API key to delete (as shown in list).Mutually exclusive with other flags in group identifier.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging

Examples

Delete an API key by name
Delete by visible prefix

Filter output with --jq

Print just the deleted key’s prefix

Output

Text mode (--output text): Prints “Deleted API key prefix” to stderr on success; no stdout output. JSON mode (--output json): payload type managementapi.APIKeyTombstone.