Hume AI Python SDK

raw JSON →
0.13.11 verified Mon Apr 27 auth: no python

A Python SDK for Hume AI, providing access to Hume's Empathic Voice Interface (EVI), speech-to-text, text-to-speech, and emotion analysis APIs. Current version 0.13.11, released March 2026. Active development with frequent releases (bi-weekly).

pip install hume
error ImportError: cannot import name 'HumeClient' from 'hume'
cause Wrong import path; often because the package is not installed or an older version.
fix
Ensure 'hume' is installed: pip install --upgrade hume. Then import from hume import HumeClient.
error TypeError: object bytes can't be used in 'await' expression
cause Attempting to await a non-async method, e.g., using sync client with async/await.
fix
Use async client: from hume import AsyncHumeClient, or use client.sync method.
error hume.exceptions.UnprocessableEntityError: (422) ...
cause Invalid payload sent to API, often missing required fields or incorrect data types.
fix
Check API documentation for required fields. For example, batch start requires 'urls' list.
error websockets.exceptions.ConnectionClosedError: no close frame received or sent
cause WebSocket connection dropped due to network issues or idle timeout.
fix
Implement reconnection logic or increase ping interval. The SDK may have settings for keepalive.
breaking In v0.13.6, SessionSettings became optional; in v0.13.0, major restructuring moved EVI config. Always check changelog when upgrading.
fix Review v0.13.0 migration guide. For SessionSettings, ensure not to pass as required positional arg in newer versions.
gotcha The HumeClient must be used as an async context manager or have .close() called to avoid unclosed websockets.
fix Use 'async with HumeClient(api_key=...) as client:' or explicitly call await client.aclose() after use.
deprecated The 'expression_measurement' namespace is deprecated; use 'emotion' endpoints instead.
fix Replace 'client.expression_measurement...' with 'client.emotion...'.

Asynchronous job submission for batch expression measurement.

import os
import asyncio
from hume import HumeClient

async def main():
    client = HumeClient(api_key=os.environ.get('HUME_API_KEY', ''))
    # Perform a job inference
    try:
        result = await client.expression_measurement.batch.start_inference(
            urls=["https://example.com/audio.wav"]
        )
        print(f"Job started: {result.job_id}")
    except Exception as e:
        print(f"Error: {e}")

asyncio.run(main())