News · November 22, 2026

API key security: the practices that matter

Store, restrict, monitor and revoke an sk-ef-… key: the habits that limit the impact of a leak without breaking your integrations.

· 4 min read · Effrenus Team · RSS

securityapikeys

An Effrenus API key is a bearer of credits: while it is valid, it can call the deployed models and consume the account balance. A leaked key does not expose your card details, but it can drain a budget and cause cascading failures across your integrations. Key security therefore comes down to a few simple habits, applied from day one.

What a key actually contains

A key looks like sk-ef-…. It is shown only once, at creation or rotation: the gateway keeps only a SHA-256 hash and a short display prefix. In other words, nobody — not even support — can recover the full value of a lost key. If it is lost, replace it; do not try to “recover” it.

The portal keeps the key in the browser's sessionStorage for the current session, not in a persistent cookie. That is convenient for testing, but insufficient for a server integration: there, the key belongs in a secrets manager.

Storage: the key must not lie around

The rules that prevent most incidents:

  • Never in Git. A local .env, a config file or a committed notebook is a leak waiting to happen; add secrets to .gitignore and check history before publishing.
  • Never in public browser code. A variable prefixed NEXT_PUBLIC_, VITE_, or injected into JavaScript is readable by every visitor.
  • One secret per environment. A development key must not be able to spend the production budget; create distinct, clearly named keys.
  • Secrets manager or environment variables. On a server, prefer a vault (Vault, cloud secrets, system variables) to a world-readable file; restrict access to the process that calls the API.
  • No key in logs. HTTP libraries and frameworks may log request headers; make sure Authorization is masked or excluded.

A key pasted into a ticket, a team chat or a screenshot must be considered compromised, even if the message was deleted.

Rotation and revocation

POST /v1/account/rotate-key revokes the old key and issues a new one while preserving the balance. Revocation is immediate: the old value returns 401 / key_disabled on the next request.

In practice, put rotation into a written procedure:

  1. notify the people involved and list the services that use the key;
  2. trigger rotation and retrieve the new value;
  3. update the vault or environment variables;
  4. redeploy services that read the key at startup;
  5. verify a real request and watch for 401 / 403 for a few minutes.

For a confirmed leak, do not wait to see what happens: revoke first, investigate afterwards. An instance administrator can revoke a key without rotation if a service merely needs to be stopped.

Detecting abnormal consumption

Token-based billing makes gaps visible quickly. Monitor:

  • the balance and recent request history in the portal;
  • GET /v1/me, which returns the balance, the 30-day usage summary and recent requests;
  • unexpected 401 / 403 errors in your application logs, which may indicate a revoked key or use elsewhere;
  • low-balance alerts: they prevent a service from stopping without warning.

A spike in tokens on an expensive model outside normal usage hours is a signal to check. When in doubt, revoke the key: the service will restart with a new one, and the budget will be protected.

What the key does not protect

A key does not control what you put in a prompt. Do not place business secrets, passwords or unnecessary personal data in a request: prompt content is not logged by the gateway, but it travels through your infrastructure and may be exposed by a client-side log. The Data and logs page details the metadata kept and the retention periods.

A key also does not restrict which models are available: every key on an instance can access the deployed models. Separation happens by account and budget, not by model tier.

Production checklist

  • a key dedicated to each environment, named and documented;
  • the secret in a vault, never in the repository;
  • Authorization headers masked in logs;
  • a tested rotation procedure;
  • balance and authentication-error monitoring;
  • a named contact to revoke in an emergency.

For admin routes and exports, see the documentation; for retention rules, see Data and logs. A well-handled key is a boring key — and that is exactly what you want.

Read next

From reading to API calls

Create a key, top up from €5 and test the catalogue.

Create API key

← All news