An API key works like a password for a program. It is also a spending authority: whoever holds it can use your balance.
How it works
LLM APIs treat the key as a bearer token. The client sends it on every request:
curl https://inference.broadnet.ai/v1/models \
-H "Authorization: Bearer $BROADNET_API_KEY"
RFC 6750 defines a bearer token as one where “any party in possession of the token” can use it. There is no second factor. That is why the same RFC says clients must always send bearer tokens over TLS (https://).
The provider looks up the key, finds the account, checks limits and policies, and then serves or refuses the request. A missing or wrong key usually returns 401; a key refused by policy, such as an IP allow list, usually returns 403.
Why it matters
A leaked key is one of the most common ways an API bill runs away, because bots scan public code for secrets. It can also expose data if the key reaches endpoints that return account details. Good practice, in line with the OWASP secrets guidance:
- Load keys from environment variables or a secrets manager. Never commit them or bake them into container images.
- Give each app or agent its own key, so you can revoke one without stopping everything.
- Rotate keys on a schedule and immediately after any suspected leak.
- Limit where a key works, for example with an allow list of server IPs.
On BroadNet Inference
BroadNet separates two credentials. An inference key calls models on /v1/*. A portal credential automates the account: keys, allowed IPs and purchases. Treat the second as full account authority.
Both are shown once. BroadNet keeps only a SHA-256 hash, so it cannot show the key again. A pay-as-you-go key lasts one year, and an account can hold up to ten live keys. Each key can carry its own list of allowed IPs. After a revocation or an allow-list change, new requests stop within five seconds.
Plan keys for the flat-rate plans are separate and never draw on your balance. Setup steps are in API keys and IP allow lists, and the status codes are in errors and retries.
Common mistakes
- Logging full request headers. That writes the key into your logs.
- Sharing one key across a team. You lose the ability to revoke one person’s access.
- Sending the key to support. Send the
X-Request-IDheader value instead.