tdx api-keys#

Manage API keys (tokedex_ik_).

Create, list, view, disable, enable, rotate and revoke API keys. Issued and rotated tokens go only to a new owner-only --token-file, never stdout, JSON or jq. --owner maps the gateway owner object; another personal holder requires --secretless and gateway authorization. Session-only pickup is unavailable; use the dashboard as the holder. Dry-run creates no credential file.

Every command also takes the global flags and reads the environment variables that the command reference lists once.

Commands#

CommandDescriptionType
tdx api-keys listList API keys.Read
tdx api-keys viewRead an API key by public id.Read
tdx api-keys createCreate an API key or a secretless offer.Write
tdx api-keys editUpdate an API key provider restriction.Write
tdx api-keys enableEnable an API key.Write
tdx api-keys disableDisable an API key.Write
tdx api-keys rotateIssue a new secret generation.Write
tdx api-keys revokeRevoke an API key.Write
tdx api-keys pickupClaim a secretless offer as its signed-in holder.Not available yet

tdx api-keys list#

List API keys.

Reads

Read one gateway page of public key metadata. hasMore and nextCursor report truncation; tokens, grants, extensions and secret generations are withheld. See Masked read output. Large pages can exceed these limits; tdx api GET /control/v1/inference-keys --field limit=20 --json reads a smaller page through the generic api command, masked by the same policy.

Shell
# GET /control/v1/inference-keys
tdx api-keys list [flags]

Output fields (inside data)

FieldTypeDescription
keyspublic-key[]Key id, name, status, creation and expiry only.
hasMorebooleanWhether the gateway has another page.
nextCursorstring|nullGateway continuation cursor; null on the final page.

tdx api-keys view#

Read an API key by public id.

Reads

Requires inference_keys.read. Read one key's public metadata: id, name, status, creation, expiry, allowed models and providers, and each secret generation's number and state (current, grace or retired). Tokens, verifiers, owners, grants, extensions and secret-generation timestamps are withheld. Reads are read-only and --dry-run still reads. See Masked read output.

Shell
# GET /control/v1/inference-keys/:keyId
tdx api-keys view --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Output fields (inside data)

FieldTypeDescription
keypublic-key-detailKey id, name, status, creation, expiry, allowedModels and allowedProviders (null for no additional restriction) and generations (number and state only).

tdx api-keys create#

Create an API key or a secretless offer.

Writes

The gateway mints the credential only into a new --token-file (exclusive owner-only 0600 file; existing safe parent required), never stdout, JSON or jq. --owner sends the existing gateway owner object; when omitted the gateway defaults ownership. A personal key for another holder requires --secretless; gateway permissions and workspace policy still apply. Without --owner, user/PAT callers default to their own personal key, while master-key and admin-key callers default to unowned keys. Secretless offers require a personal owner; master-key and admin-key callers can name a personal owner with --owner. Pickup requires an interactive dashboard session and is unavailable to this bearer-only CLI. File preflight happens before POST; a committed mint with failed delivery is reported explicitly, never retried or printed as a fallback. Dry-run reads no secret files or profiles, makes no request and creates no files; the gateway has not checked the requested policy and may reject or adjust it. See Checked request values and Masked write output.

Shell
# POST /control/v1/inference-keys
tdx api-keys create --name <string> [flags]

Required flags

FlagTypeDefaultDescription
--namestringDisplay name.

Optional flags

FlagTypeDefaultDescription
--allowed-modelstringExact public model id from tdx models list; repeat for multiple ids. Repeatable.
--all-modelsbooleanfalseRequest every model allowed by workspace policy.
--allowed-providerstringExact catalogue provider id; repeat for multiple ids. Repeatable.
--all-providersbooleanfalseRemove the additional key restriction; workspace provider policy still applies.
--descriptionstringNon-secret description.
--expires-atdatetimeAbsolute ISO-8601 expiry; omitted uses gateway policy.
--secretlessbooleanfalseCreate an offer without issuing a token.
--token-filepathNew owner-only token file; never overwrite an existing path.
--ownerjsonOwner JSON: kind personal|service|none, userId and workspaceId strings or null; omitted ids become null.

Constraints

  • Exactly one of --allowed-model, --all-models
  • At most one of --allowed-provider, --all-providers
  • At most one of --secretless, --token-file
  • --token-file is required unless --secretless or --dry-run

Output fields (inside data)

FieldTypeDescription
keypublic-keyKey id, name, status, creation and expiry only.
credentialdelivery-metadataDelivery status and destination kind only; never a token or path.
previewwrite-previewRequested changes, unchecked by the gateway; never credentials.

tdx api-keys edit#

Update an API key provider restriction.

Writes

Change only the additional provider restriction. All providers remains bounded by workspace policy. See Masked write output.

Shell
# PATCH /control/v1/inference-keys/:keyId
tdx api-keys edit --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Optional flags

FlagTypeDefaultDescription
--allowed-providerstringExact catalogue provider id; repeat for multiple ids. Repeatable.
--all-providersbooleanfalseRemove the additional key restriction; workspace provider policy still applies.

Constraints

  • Exactly one of --allowed-provider, --all-providers

Output fields (inside data)

FieldTypeDescription
keypublic-key-detail|nullPublic key metadata and provider restriction; null during dry-run.
previewwrite-preview|nullRequested changes only; null after execution.

tdx api-keys enable#

Enable an API key.

Writes

Requires inference_keys.manage. Enable a disabled key by public id; revoked keys stay refused with KEY_REVOKED and expired keys with CONFLICT (exit 6). No request body is sent. A key already in that state is answered unchanged. Dry-run reports the requested change only without reading secret files or profiles, sending requests or creating files. See Checked request values and Masked write output.

Shell
# POST /control/v1/inference-keys/:keyId/enable
tdx api-keys enable --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Output fields (inside data)

FieldTypeDescription
keypublic-keyKey id, name, status, creation and expiry only.
previewwrite-preview|nullRequested change, unchecked by the gateway; null after execution.

tdx api-keys disable#

Disable an API key.

Writes

Requires inference_keys.manage. Disable by public id: the key stops authenticating within the gateway's propagation bound, and tdx api-keys enable reverses it. No request body is sent. A key already in that state is answered unchanged. Dry-run reports the requested change only without reading secret files or profiles, sending requests or creating files. See Checked request values and Masked write output.

Shell
# POST /control/v1/inference-keys/:keyId/disable
tdx api-keys disable --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Output fields (inside data)

FieldTypeDescription
keypublic-keyKey id, name, status, creation and expiry only.
previewwrite-preview|nullRequested change, unchecked by the gateway; null after execution.

tdx api-keys rotate#

Issue a new secret generation.

Writes

Requires inference_keys.manage; a personal key can be rotated only by its holder (otherwise forbidden, exit 4). Issue a new secret generation by public id. The gateway reveals the new token once: it goes only to a new --token-file (exclusive owner-only 0600 file reserved before POST; existing safe parent required; existing files and symlinks are never overwritten), never stdout, JSON, jq, hints or fallbacks. --grace sets how long the previous secret keeps working; omitted, nothing is sent and the gateway default (24h) applies. While an earlier superseded secret is still in grace, the gateway refuses another rotation with ROTATION_IN_PROGRESS (exit 6) unless --end-previous-grace ends that grace now. A committed rotation whose delivery failed or could not be confirmed, including an accepted reply that could not be read, fails with KEY_ROTATED_DELIVERY_FAILED (exit 1) and no token: do not repeat it blindly. A timeout leaves the outcome unknown (REQUEST_TIMEOUT, exit 7): inspect the key with tdx api-keys view before rotating again. Dry-run reads no secret files or profiles, makes no request and creates no files. See Checked request values and Masked write output.

Shell
# POST /control/v1/inference-keys/:keyId/rotate
tdx api-keys rotate --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Optional flags

FlagTypeDefaultDescription
--token-filepathNew owner-only token file; never overwrite an existing path.
--graceone of now, 1h, 24h, 7dHow long the previous secret keeps working; omitted uses the gateway default (24h).
--end-previous-gracebooleanfalseEnd the grace of an earlier secret that is still in grace instead of being refused.

Constraints

  • --token-file is required unless --dry-run

Output fields (inside data)

FieldTypeDescription
keypublic-keyKey id, name, status, creation and expiry only.
rotationrotation-metadataNew generation, previous generation and previous grace end (previousNotAfter); never a token.
credentialdelivery-metadataDelivery status and destination kind only; never a token or path.
previewwrite-preview|nullRequested change, unchecked by the gateway; null after execution.

tdx api-keys revoke#

Revoke an API key.

Writes

Revoke by public id using the gateway default operator reason. Dry-run reports requested revocation only without reading secret files or profiles, sending requests or creating files. See Checked request values and Masked write output.

Shell
# POST /control/v1/inference-keys/:keyId/revoke
tdx api-keys revoke --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Output fields (inside data)

FieldTypeDescription
keypublic-keyKey id, name, status, creation and expiry only.
previewwrite-preview|nullRequested change, unchecked by the gateway; null after execution.

tdx api-keys pickup#

Claim a secretless offer as its signed-in holder.

Not available yet. Running it exits 7 with NOT_IMPLEMENTED.

Unavailable: pickup requires the holder's interactive dashboard session. This bearer-only CLI cannot call the session-only route; use the dashboard. No request or local credential read is performed.

Shell
# POST /control/v1/inference-keys/:keyId/pickup
tdx api-keys pickup --id <string> [flags]

Required flags

FlagTypeDefaultDescription
--idstringPublic resource id; never a credential.

Optional flags

FlagTypeDefaultDescription
--token-filepathNew owner-only token file; never overwrite an existing path.