Skip to main content

Authentication

All requests to the Sensia API must include a valid API key. Authentication is done via the X-API-Key HTTP header.

The API Key header

Include your key in every request using the X-API-Key header:

POST /predict HTTP/1.1
Host: api.sensia.ai
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxx | sk_demo_xxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

Getting your API key

A demo key can be provided for free in order to test the API and it's functionality. A duration of 90 days is set for demo keys, after which they will expire and need to be renewed. A live key provides higher rate limits and unlimited access to our latest model.

To get your demo or live API key, please contact us at laura@sensia.bio

warning

Keep your API key secret. Never expose it in client-side code, public repositories, or logs. If a key is compromised, contact us immediately to revoke it and issue a new one.

Error responses

If authentication fails, the API returns:

{
"detail": "Invalid or missing API key"
}
HTTP StatusMeaning
401Missing X-API-Key header
403Key is invalid, expired, or revoked