Authentication
How THROUGHPUTS authenticates requests and how to keep your keys safe.
Every request to the THROUGHPUTS API must include a Bearer token. This doc covers how to create, use, rotate, and revoke API keys.
API keys
API keys are strings that start with thp_live_ (production) or thp_test_
(sandbox). Create them in the dashboard under
API Keys.
Sending a key
Send your key in the Authorization header:
curl https://api.throughputs.dev/v1/models \
-H "Authorization: Bearer thp_live_xxx"With the OpenAI SDK
Pass apiKey and baseURL to the constructor — that's it:
from openai import OpenAI
client = OpenAI(
api_key="thp_live_xxx",
base_url="https://api.throughputs.dev/v1",
)Load the key from an environment variable in production. Never hardcode it.
Key scopes
Every key has a scope that limits what it can do:
| Scope | Description |
|---|---|
full | Read-write access to all endpoints. Default for new keys. |
read-only | List models, fetch pricing. Cannot make completions requests. |
completions-only | Chat/embeddings only. Cannot manage keys or billing. |
Restrict every key to the minimum it needs. A backend service that only
answers user chats should get completions-only, not full.
Rotation
Rotate keys every 90 days, or immediately if one is leaked.
- Create a new key in the dashboard.
- Update your application to use the new key (e.g. roll the env var).
- Wait until requests on the old key drop to zero (check the dashboard).
- Revoke the old key.
THROUGHPUTS never deletes a revoked key — it just stops accepting requests. You can audit historical usage on revoked keys forever.
Security best practices
- Never commit keys. Use a secrets manager or
.envfiles (and.gitignorethem). - Never ship keys in client-side code. All requests must originate from your backend.
- Set per-key spend limits in the dashboard to cap blast radius.
- Use scoped keys. Don't give a key
fullaccess ifread-onlywill do. - Rotate on schedule. Treat rotation as a quarterly hygiene task, not an incident response.
What happens if a key leaks
If you suspect a key is compromised:
- Revoke it immediately in the dashboard. Outstanding requests on that key start failing within seconds.
- Check the usage graph for the compromised key. THROUGHPUTS support can refund clearly-attributable abuse.
- Create a new key with the same scope and roll your deployment.