Skip to main content
Gateway API keys are how agents and external tools authenticate with your Dench workspace gateway. Manage them at Settings → API Keys. Every workspace has a built-in primary sandbox key and supports additional keys you create for separate environments or integrations.

Create

In Additional Gateway Keys, click Create key, name it (e.g. Production, CI/CD), and click Create key. Copy the full value immediately — it is shown once.
export DENCH_GATEWAY_KEY=dg_live_your_key_here

Reveal

The primary sandbox key is hidden by default. Click Reveal on the key card, then Copy. Only workspace admins can reveal it.

Rotate

Click Rotate key on the primary sandbox card. This issues a new key, updates sandbox secrets, and revokes the old key. Plan rotations during low-traffic periods — gateway access briefly interrupts while the new key propagates.

Revoke

In the Additional Gateway Keys table, click the menu (⋯) on the row, select Revoke key, and confirm. Revocation is immediate and permanent.

Never share secrets

  • Store keys in environment variables or a secrets manager.
  • Never commit keys to source code, even in private repos.
  • Use separate keys per environment (production, staging, dev).
  • Rotate after team changes or suspected exposure.

Reference

  • Primary sandbox key — auto-created with your workspace. Used by the cloud sandbox and the Dench desktop app. Can be revealed and rotated, but not deleted.
  • Additional gateway keys — keys you create for specific integrations, CI/CD, or environments. Revoke when no longer needed.
  • Masked key in the format prefix•••••••last4
  • Scopes — granted permissions (e.g. models:read, chat:completions)
  • Created — provisioning time
  • Last used — most recent request
ColumnDescription
NameThe label you gave the key
KeyPrefix and last 4 characters
Created ByWorkspace member who created the key
30d RequestsGateway requests in the last 30 days
30d CostEstimated cost for those requests
Last UsedTime since last use
StatusActive or Revoked
Click the menu icon on any key row and select View usage to see request counts and estimated cost over the last 30 days.