Skip to content
BYOK Tools

Security

API key security: a checklist for BYOK users

An API key can spend money on your account. Ten practices for storing, scoping, monitoring and revoking keys across every BYOK app you use.

By the BYOK Tools editorial team · 18 November 2026 · 6 min read

An API key is a credential that can spend money. Handle it like a password with a billing account attached and BYOK is as safe as any other software you run. This is the checklist we use ourselves.

Ten practices

  1. One key per app. Create a dedicated key for each tool and name it after that tool. If an app is compromised or retired, you revoke one key without affecting anything else.
  2. Set a hard spend limit. The major providers support monthly caps, prepaid credit or both. Set a limit you could absorb if the key leaked.
  3. Prefer on-device key storage. In the directory, look for the Key stays local badge. These apps keep the key in local storage or the OS keychain and call the provider directly.
  4. Check the network path. If an app proxies requests through its own servers, read its privacy policy and find out what is logged and for how long.
  5. Use scoped keys where the provider supports them. Project keys, restricted permissions and per-key credit limits reduce the damage a single leaked key can do.
  6. Keep keys out of chats, tickets and screenshots. Most leaks come from copy and paste, not from attacks.
  7. Keep keys out of source control. Load keys from environment variables such as OPENAI_API_KEY or ANTHROPIC_API_KEY, keep them in a local .env file, and add that file to .gitignore. Automated scanners find keys in public repositories within minutes of a push. If a key is committed, revoke it first, then clean the history.
  8. Rotate on a schedule. Rotating every few months limits the window in which an unnoticed leak can be used.
  9. Monitor usage. A sudden rise in requests or tokens is the earliest sign of misuse. Check the provider's usage dashboard and enable billing alerts where offered.
  10. Revoke on device loss. If a laptop or phone is lost, revoke every key that was stored on it.

Open source and closed source

Open-source apps let anyone inspect how keys are stored and which hosts receive requests. That does not make them safer by default, but it makes their behaviour verifiable. Closed-source apps from established developers can be equally trustworthy if they document key handling clearly.

Self-hosting for teams

For company-wide BYOK, a self-hosted interface (filter the directory by Self-hostable) keeps keys on your own infrastructure and supports single sign-on and audit logs. Provider keys stay on the server, and staff never see them. More in BYOK for teams.

Separate keys, low limits and fast revocation prevent most problems.

Editorial independence: rankings are based on our own testing and research. Some outbound links may in future be affiliate links; that never affects scores. See our editorial policy.

Get the BYOK Brief

New listings, price changes and model releases. Fortnightly.

Fortnightly: new listings, price changes and model releases. Unsubscribe at any time.