Docs index: /llms.txt · every page as Markdown: add .md

‹ Overview

Your API secret

The one credential for every bitHuman surface, and where each platform reads it.

Creator plan or higher

One API secret works for the REST API, the CLI, Python, Swift, Android and LiveKit. It needs a bitHuman account (sign up) on the Creator plan or higher (pricing). The live demo and embedding a public agent need none; creating your own agents needs the Creator plan.

Get one

Create an API secret under Developer → API Secrets, then export it:

export BITHUMAN_API_SECRET="<your API secret>"
curl -s -X POST https://api.bithuman.ai/v1/validate -H "api-secret: $BITHUMAN_API_SECRET"
# → {"valid":true}

Where each platform reads it

PlatformEnvironmentIn code
REST API—header api-secret
CLIBITHUMAN_API_SECRETbithuman login stores a credential for you
PythonBITHUMAN_API_SECRET (read by bithuman.open)api_secret= on AsyncBithuman.create() only; bithuman.open() reads the environment
AppleBITHUMAN_API_SECRETEssence2Credential.set / Expression2Credential.set
Android—Essence2Credential.set(secret) / Expression2Credential.set(secret) before fetch() and create(); fetch the secret from your backend in a shipped app
LiveKit workerthe same API secret, set as BITHUMAN_MASTER_SECRET on the worker, never as BITHUMAN_API_SECRETrooms see only a short-lived token minted from it, never the secret (LiveKit)
Web embed—none for a public agent; an embed token for a private one

Keep it safe

What a shipped app holds

The Swift package and the Android SDK authenticate with your API secret, so every copy of an app you distribute carries it. Treat that secret as exposed: whoever extracts it can call the API as your account, spend your credits and create more secrets.

  • Fetch the secret from your backend when the app starts. Never compile it into a build you ship.
  • Give each app its own secret, so you can rotate one without touching the others (API secrets).
  • Watch your balance, and rotate the secret at once if usage looks wrong.

Next