Authentication & API keys
How BlazeInfer authenticates requests and how to manage keys.
Every request is authenticated with a Bearer token in the Authorization
header:
Authorization: Bearer blz_...Only Authorization: Bearer is accepted. The Anthropic-style x-api-key
header is not read. SDKs and tools that send it by default, such as the
Anthropic SDK with ANTHROPIC_API_KEY, get a 401 unless you configure them
to send a Bearer token instead.
Creating and managing keys
- Create keys in the console under API keys → Create key.
- A key is shown once, at creation time. Store it in a secret manager or an environment variable immediately.
- Keys start with the
blz_prefix, so secret-scanning tools can spot a leaked key. - A key can have an optional expiry.
- Keys belong to an account and a workspace, so a team can scope keys to different workstreams.
- Revoke a key from the same console page. Revoked keys stop working immediately.
Never hard-code a key
Read the key from the BLAZE_API_KEY environment variable in every example on
this site. Do not commit keys to a repository or ship them in a browser bundle.
See Security best practices.
Onboarding order
The console enforces an order: sign up → verify phone and billing address → add credits → create a key → call the API. A key with no credit balance does not work.
Error responses for authentication
| Situation | Status | Body |
|---|---|---|
| Missing key | 401 | JSON {"error":{"message":"api key required","type":"invalid_request_error"}} |
| Invalid, expired, revoked or blocked key | 401 | JSON {"error":{"message":"invalid api key","type":"invalid_request_error"}} |
Key sent only in the x-api-key header | 401 | JSON {"error":{"message":"api key required","type":"invalid_request_error"}} |
Authorization: Token …, a lowercase bearer …, or an empty Bearer | 401 | JSON {"error":{"message":"api key required","type":"invalid_request_error"}} |
| Key store unreachable | 503 | JSON, type: "server_error" |
The word Bearer needs a capital B.