Authentication
Every request to the API carries an API key in the X-Hume-Api-Key header. A request without a valid key is rejected with 401 Unauthorized.
API keys
- Sign in to the Hume Platform, or create an account.
- On the API keys page, select Create API key.
- Name the key for whatever will use it, and choose its permissions and when it expires.
- Create the key and copy it. The key is shown only once.
A key’s expiry cannot be extended. Before a key expires, create a new one and switch your code to it.
Sending the key
Set the X-Hume-Api-Key header on every request. The request below lists your organization’s runs.
A missing, invalid or expired key is rejected with 401 Unauthorized before the request reaches the service. The body has a message, plus a request_id when a key was sent and rejected, but no type or code. See Errors.
Browsers
An API key must never ship in client-side code, so call the API from a server you control. To use the API from a web page, relay through that server: the browser sends audio to your server, which forwards it to Hume with the key attached and returns the answers.