CH·02CLI reference

deeprelay api-keys update

Change an API key's name or limits

Change an API key's name or limits

Synopsis

Changes an API key's name or limits. Only the flags you pass change; everything else stays as it is. Scopes cannot be changed after creation — create a new key instead.

  • --name
  • --budget sets the monthly budget; --clear-budget removes it
  • --allow-model (repeatable) replaces the allowlist; --all-models removes it
  • --rps , --burst set the rate limit
  • --expires sets the expiry; --never-expires removes it
  • --fallback-model (repeatable, in priority order, at most 3) replaces the backup-model list; --no-fallback turns model fallback off

A value and its opposite (--budget with --clear-budget, --allow-model with --all-models, --expires with --never-expires, --fallback-model with --no-fallback) are refused, as is an update with no flags. An update can never take a key past the limits of the key making the change; the server refuses with an explanation. The updated key is printed; its secret is not.

Lowering a budget below this month's spend takes effect immediately: the key's next request is refused until the budget resets.

Backup models

The backup list is tried, in order, only when every provider for the requested model fails before the first byte of the response (an error, a timeout or a first-token stall); a response that has started is never switched. The list holds at most 3 models, each a chat model in the catalog and inside the key's allowlist when it has one. A plan-covered request stays plan-covered, so a backup your plan does not cover is marked (wallet only) and used only for wallet-billed requests; one that has left the catalog is marked (unavailable) and skipped. api-keys get shows each backup's current price and marks the ones that cost more than the key's most-used model. A single request can override the list with the X-Deeprelay-Fallback-Models header, which can never reach a model the key may not call. Backup lists are not applied to Liquid.

Examples

# Raise a budget and allow a second model
deeprelay api-keys update 11111111-2222-3333-4444-555555555555 --budget 20 \
  --allow-model deeprelay/deepseek-v4.1-flash --allow-model deeprelay/qwen3-embedding-8b

# Set two backup models, tried in this order
deeprelay api-keys update 11111111-2222-3333-4444-555555555555 \
  --fallback-model deeprelay/glm-5.3 --fallback-model deeprelay/kimi-k3

# Turn model fallback off
deeprelay api-keys update 11111111-2222-3333-4444-555555555555 --no-fallback

# Remove every limit except the rate limit
deeprelay api-keys update 11111111-2222-3333-4444-555555555555 \
  --clear-budget --all-models --never-expires
deeprelay api-keys update <key-id> [flags]

Options

      --all-models                   Remove the allowlist so the key can call every model
      --allow-model stringArray      Replace the allowlist with these model ids (repeatable)
      --budget string                Monthly budget in dollars, e.g. 5 or 12.50
      --burst int                    Burst size
      --clear-budget                 Remove the monthly budget
      --expires string               Expiry, RFC3339 or YYYY-MM-DD in UTC
      --fallback-model stringArray   Replace the backup list. Backup model tried when every provider for the requested model fails before the first byte (repeatable, in order; max 3)
  -h, --help                         help for update
      --name string                  New key name
      --never-expires                Remove the expiry
      --no-fallback                  Turn model fallback off for this key
      --rps int                      Requests per second

Options inherited from parent commands

      --api-base string   API base URL (override with DEEPRELAY_API_BASE env) (default "https://api.deeprelay.ai/v1")
      --debug             Enable debug logging to stderr
      --no-preflight      Skip the plan/credit check before inference requests (override with DEEPRELAY_NO_PREFLIGHT env)
  -o, --output string     Output format: table|json (default table on TTY, json otherwise) (default "table")

SEE ALSO

  • deeprelay api-keys - Create and manage API keys with budgets, model allowlists and rate limits

← The deeprelay CLI