Skip to navigation

Authentication

Authenticate requests with an API key.

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

  1. Sign in to the Hume Platform, or create an account.
  2. On the API keys page, select Create API key.
  3. Name the key for whatever will use it, and choose its permissions and when it expires.
  4. 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.

cURL
curl https://api.cloud.hume.ai/v0/decisions/run \
-H "X-Hume-Api-Key: $HUME_API_KEY"

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.

401 Unauthorized
{
"message": "Unauthorized",
"request_id": "req_01JB8XF1N3PA"
}

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.

Next steps