Skip to navigation

Authentication

Create an API key on the Hume Platform, and send it with every request to a Hume API.

Every Hume API takes an API key in the X-Hume-Api-Key header. Keys for every product are created on the same page of the Hume Platform.

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 key as the HUME_API_KEY environment variable, and set the X-Hume-Api-Key header on every request. The SDKs send the key for you, and read it from HUME_API_KEY when you pass none to the client.

cURL
export HUME_API_KEY="<your API key>"
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. A 403 Forbidden means your organization is not permitted to use the API. For Audio Decisions, a 403 can also mean the credential does not grant access to the API, for example because the key’s permissions leave it out. Realtime Expression Measurement sessions send the key once, on the WebSocket handshake. See each product’s authentication page for its details.

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 media to your server, which forwards it to Hume with the key attached and returns the results.

Product authentication pages