Skip to main content
OpenAPI

API Key Security

Secure storage, usage guidelines, and incident response for API Keys.

Key visibility

The full key is shown in plaintext only at creation time. It cannot be retrieved afterward. Always copy and securely store it immediately after creation.

Authorization scope

  • Set the shortest practical expiration to minimize the risk window if a key is compromised.
  • A key's capabilities never exceed those of its creator — resources the creator cannot access remain inaccessible to the key.

Secure storage

Follow these principles strictly:
  • Do not share keys in plaintext via email or instant messaging
  • Do not leave keys in command-line history (avoid pasting directly into shell commands)
  • Do not commit keys to Git repositories

Best practices

RecommendationDetails
Use environment variables or a secrets managere.g., Vault, KMS — avoid plaintext storage
Rotate regularlyNever leave a key unrotated indefinitely
Separate by environmentUse distinct keys for development, staging, and production

Leak response

If a key is compromised, take the following steps immediately:
  1. Delete or disable the compromised key
  2. Create a new key and update all dependent configurations
  3. Contact your security team to assess the blast radius
For key creation instructions, see Obtain API Key.