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

‹ Docs

Quickstart

Talk to a live avatar, get an API secret, then run your own.

1 Talk to an avatar

Pick a model and start a live conversation in this page: no install and no account.

wise-pup, the Expression 2 sample avatar

Live in your browser, no account. Up to 1 minute; allow the microphone when asked.

The avatar renders in the bitHuman cloud, and the conversation runs on bitHuman's servers.

2 Get your API secret

Sign up at bithuman.ai and choose the Creator plan or higher (plans): from 2026-10-19 a Free account's API secret is refused. Then create an API secret and export it. The live demo and the web embed need neither, and the CLI can sign in with bithuman login instead.

Shell
export BITHUMAN_API_SECRET="<your API secret>"

Create an API secret ↗ · How the API secret works

3 Pick your platform

What are you building? The Website, Terminal, Python and REST steps run as pasted after you export your API secret. The app platforms show the core calls; their page has the complete first run. New to the words? Key terms.

A live avatar on your website

bitHuman cloud In the browser (WebGPU)
Needs
No account for the sample avatar
Models
Essence 2, Expression 2
  1. Paste the embed into any page

    HTML
    <iframe src="https://www.bithuman.ai/embed/A23WJF0199" allow="microphone *" style="width:100%;height:600px;border:0"></iframe>
  2. Open the page and allow the microphone

    The avatar appears, asks for the microphone and answers when you speak. The wise-pup sample ends each session after 1 minute; embed your own agent for your site.

  3. Render in the visitor's tab (optional)

    Add ?render=local to the embed URL: with WebGPU the avatar renders in the tab, and a device that can't render it in real time shows a message instead of falling back to the cloud. The avatar's web bundle downloads once (50–200 MB), then comes from the cache.

With the web embed the conversation runs on bitHuman's servers, including when the avatar renders in the tab.

An avatar inside your iPhone or iPad app

Needs
Xcode 26+ · Physical device · API secret
Models
Essence 2, Expression 2
  1. Add the Swift package

    Package.swift
    .package(url: "https://gitlab.com/bithuman/sdk/homebrew-bithuman", from: "2.22.1")
    // then: .product(name: "Expression2", package: "homebrew-bithuman")
  2. Download the sample avatar

    Shell
    curl -fL -o A23WJF0199.imx "https://api.bithuman.ai/v1/agent/A23WJF0199/model/download?model=expression-2"

    The iOS page also fetches the shared engine and a 16 kHz speech clip.

  3. Feed audio, draw frames

    Swift
    // excerpt: the core loop; the complete first frame is on the iOS page
    import Expression2
    
    Expression2Credential.set(apiSecret)
    let engine = try Expression2Engine.create(
        avatarContainer: avatarURL, sharedEngineContainer: sharedEngineURL, stagingDir: stagingURL)
    engine.feed(samples)      // [Float], 16 kHz mono
    engine.flushTail()        // end of the reply
    for await frame in engine.frames(audioClock: { played() }) {
        show(frame.bgr, frame.width, frame.height)
        if frame.endsReply { break }
    }

An avatar on your Mac

Needs
Apple silicon · Xcode 26+ · API secret
Models
Essence 2, Expression 2
  1. Clone the macOS example

    Shell
    git clone https://gitlab.com/bithuman/sdk/bithuman-examples.git
    cd bithuman-examples/swift/macos-expression2
    ./setup.sh
  2. Run it

    Shell
    export BITHUMAN_API_SECRET="<your API secret>"
    swift run -c release MacOSExpression2

An avatar inside your Android app

Needs
Physical device · JDK 17 · API secret
Models
Essence 2, Expression 2
  1. Add the repository and the dependency

    Gradle
    // excerpt: settings.gradle.kts and app/build.gradle.kts; the full setup is on the Android page
    // settings.gradle.kts
    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            exclusiveContent {   // ai.bithuman resolves from bitHuman's repository only
                forRepository { maven { url = uri("https://maven.bithuman.ai") } }
                filter { includeGroup("ai.bithuman") }
            }
        }
    }
    // app/build.gradle.kts
    android {
        defaultConfig { ndk { abiFilters += "arm64-v8a" } }
        packaging { jniLibs { useLegacyPackaging = true } }   // required
    }
    dependencies {
        implementation("ai.bithuman:expression2-android:0.6.2")
    }
  2. Keep the API secret out of your source

    Put bithuman.apiSecret=… in your project's local.properties (git-ignored), or export BITHUMAN_API_SECRET before you build; the Gradle block on the Android page reads it into BuildConfig.

  3. Feed audio, pull frames

    Kotlin
    // excerpt: off the main thread; pcm16k is 16 kHz mono float
    Expression2Credential.set(BuildConfig.BITHUMAN_API_SECRET)
    val model = Expression2ModelStore(context).fetch("A23WJF0199")   // first run only
    Expression2Avatar.create(context, model, Expression2Options()).use { avatar ->
        val frame = avatar.newFrameBitmap()
        avatar.feed(pcm16k)
        avatar.flushTail()
        while (avatar.hasPendingTail || avatar.queuedFrames > 0) {
            if (avatar.pull(frame) != null) show(frame) else Thread.sleep(10)
        }
    }

An avatar inside your Flutter app

Needs
Physical device · Dart 3.11.5+ · API secret
Models
Essence 2, Expression 2
  1. Clone the example app

    Shell
    git clone https://gitlab.com/bithuman/sdk/bithuman-examples.git
    cd bithuman-examples/app/avatar_chat
    flutter pub get
  2. Run it on your phone

    Shell
    flutter run --release --dart-define=AGENT_CODE=A23WJF0199
  3. Add the plugin to your own app

    pubspec.yaml
    dependencies:
      bithuman:
        git:
          url: https://gitlab.com/bithuman/sdk/homebrew-bithuman.git
          path: packages/flutter-plugin
          ref: flutter-plugin-v2.6.40

    Then, in android/app/build.gradle.kts, set minSdk = 29, ndk { abiFilters += "arm64-v8a" } and packaging { jniLibs { useLegacyPackaging = true } }; the Flutter page's Install section shows the block.

Render from Python

Your computer or server No GPU needed Creator plan or higher
Needs
Python 3.10+ · API secret
Models
Essence 2, Expression 2
  1. Install

    Shell
    python3 -m venv .venv && source .venv/bin/activate
    pip install "bithuman[expression-2]"
  2. Download the sample avatar and speech

    Shell
    export BITHUMAN_API_SECRET="<your API secret>"
    curl -fL -o wise-pup.imx "https://api.bithuman.ai/v1/agent/A23WJF0199/model/download?model=expression-2"
    curl -fsSLo speech.wav https://docs.bithuman.ai/samples/speech.wav
  3. Render

    Python
    import bithuman
    
    with bithuman.open("wise-pup.imx") as avatar:
        frames = [image for image in avatar.render("speech.wav")]
    print(len(frames), "frames of", frames[0].shape)
    # → 300 frames of (720, 416, 3)

An avatar from your terminal

Your computer or server No GPU needed Creator plan or higher
Needs
macOS or Linux · ffmpeg
Models
Essence 2, Expression 2
  1. Install the CLI

    Shell
    # macOS: brew tap bithuman/bithuman https://gitlab.com/bithuman/sdk/homebrew-bithuman && brew install bithuman/bithuman/bithuman-cli
    curl -fsSL https://install.bithuman.ai | sh
  2. Sign in

    Shell
    bithuman login
  3. Render a talking video

    Shell
    curl -fsSLo speech.wav https://docs.bithuman.ai/samples/speech.wav
    bithuman render wise-pup speech.wav -o out.mp4
    # → out.mp4: 416×720, 300 frames, 15.0 s

    bithuman run wise-pup opens a live conversation instead.

A face for your LiveKit voice agent

Your computer or server bitHuman cloud Creator plan or higher
Needs
A LiveKit project · API secret
Models
Essence 2, Expression 2
  1. Install

    Shell
    pip install "livekit-agents[openai,silero]" livekit-plugins-bithuman python-dotenv
  2. Set the credentials

    Shell
    export BITHUMAN_MASTER_SECRET="<your API secret>"
    export BITHUMAN_AGENT_ID=A23WJF0199
    export LIVEKIT_URL=wss://your-project.livekit.cloud
    export LIVEKIT_API_KEY=… LIVEKIT_API_SECRET=…
    export OPENAI_API_KEY=…
  3. Run the worker

    Shell
    python agent.py dev
    # → join the room from the LiveKit Agents Playground; the avatar appears and answers

    Copy agent.py, a complete worker, from the LiveKit page.

Call the REST API

bitHuman cloud Creator plan or higher
Needs
API secret
Models
Essence 2, Expression 2
  1. Check your API secret

    Shell
    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}
  2. Render a sample agent speaking your audio

    Shell
    curl -s -X POST https://api.bithuman.ai/v1/video/generate \
      -H "api-secret: $BITHUMAN_API_SECRET" -H "Content-Type: application/json" \
      -d '{"model": "expression-2", "agent_code": "A23WJF0199", "input": {"type": "audio", "audio_url": "https://docs.bithuman.ai/samples/speech-16k-short.wav"}}'
    # → {"success": true, "job_id": "vid_…", "status": "processing"}

A kiosk, fully offline

Fully offline Business & Enterprise
Needs
Business or Enterprise plan · Expression 2 on Linux x86_64; Essence 1 on Linux (x86_64, ARM64) and Apple silicon Macs; Essence 2 later
Models
Expression 2, Essence 1

Offline license is only available to Business and Enterprise clients who want to run realtime avatars completely locally, off the internet — e.g. kiosks, trade shows, ATM machines, embedded screens. Linux and macOS computers (Apple silicon); bought in the Console or through sales.