Authentication
Each model has its own API key. Send it as a bearer token on every request.
Every request sends the model’s key in the Authorization header:
Authorization: Bearer hs_0123456789abcdef0123456789abcdef
The key
- Format:
hs_followed by 32 hexadecimal characters. - One per model. A key calls only the model it belongs to.
- Where: the model’s api tab, for the model’s owner. Teammates don’t see it.
- Stored as a hash. Heura Studios never keeps the key itself, so copy it when it’s shown.
Rotating a key
New key on the api tab replaces the key at once: apps and scripts using the old one stop working on their next request. The website agent isn’t affected, since it doesn’t use the key.
A missing or wrong key
{
"error": {
"message": "Incorrect API key. Find this AI's key under Deploy in Heura Studios.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"
}
}
The response is 401. A valid key on an account whose plan doesn’t include the API gets 403 with plan_required.
Keeping keys safe
- Call the API from your server. Never put a key in browser or mobile code; for a website, use the website agent, which needs no key.
- Keep keys in environment variables or a secret manager.
- Rotate a key the moment you suspect it leaked.