Deployments.ai Docs
Command reference

deployments api-key

Environment-scoped API credentials

CommandSummary
deployments api-key createCreate an API key
deployments api-key listList API keys
deployments api-key usageList API-key request activity
deployments api-key rotateRotate an API key
deployments api-key revokeRevoke an API key

deployments api-key create

Create an API key.

deployments api-key create --name <name> --service-account <service-account>
  • Calls POST /v1/api-keys (SDK createApiCredential).
  • Needs an environment: --env or the saved context.
  • Sends an idempotency key. The CLI generates one per run; pass --idempotency-key to retry safely.
  • Output contains secrets. They are redacted unless you pass --reveal.
FlagTypeRequiredDefaultDescription
--namestringyesResource name
--service-accountstringyesOwning service account ID
--scopesstring (a,b,c)Capability scopes
--expiresstringExpiration timestamp

Also accepts the global flags.

deployments api-key list

List API keys.

deployments api-key list
  • Calls GET /v1/api-keys (SDK listApiCredentials).
  • Needs an environment: --env or the saved context.
  • Paginated. --page-size sets the page size; pass the returned cursor as --cursor for the next page.
FlagTypeRequiredDefaultDescription
--cursorstring (cursor)Pagination cursor
--page-sizestring (number)Page size

Also accepts the global flags.

deployments api-key usage

List API-key request activity.

deployments api-key usage
  • Calls GET /v1/api-key-usage (SDK listApiCredentialUsage).
  • Needs an environment: --env or the saved context.
  • Paginated. --page-size sets the page size; pass the returned cursor as --cursor for the next page.
FlagTypeRequiredDefaultDescription
--cursorstring (cursor)Pagination cursor
--page-sizestring (number)Page size
--api-credentialstringAPI credential ID
--sincestringStart timestamp
--untilstringEnd timestamp

Also accepts the global flags.

deployments api-key rotate

Rotate an API key.

deployments api-key rotate <id>
  • Calls POST /v1/api-keys/{id}/rotate (SDK rotateApiCredential).
  • Needs an environment: --env or the saved context.
  • Destructive. Live runs ask for confirmation; pass --yes in scripts or with --json.
  • Sends an idempotency key. The CLI generates one per run; pass --idempotency-key to retry safely.
  • Output contains secrets. They are redacted unless you pass --reveal.
FlagTypeRequiredDefaultDescription
<id>positionalyesResource ID
--reasonstringReason for this operation

Also accepts the global flags.

deployments api-key revoke

Revoke an API key.

deployments api-key revoke <id>
  • Calls DELETE /v1/api-keys/{id} (SDK revokeApiCredential).
  • Needs an environment: --env or the saved context.
  • Destructive. Live runs ask for confirmation; pass --yes in scripts or with --json.
  • Sends an idempotency key. The CLI generates one per run; pass --idempotency-key to retry safely.
FlagTypeRequiredDefaultDescription
<id>positionalyesResource ID
--reasonstringReason for this operation

Also accepts the global flags.

On this page