Skip to main content
POST
/
v1
/
openclaw
/
initiate
Initiate Room
curl --request POST \
  --url https://api.agenthuman.com/v1/openclaw/initiate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "avatar": "<string>",
  "aspect_ratio": "<string>",
  "voice_id": "<string>",
  "enable_transcription": true
}
'
{
  "success": true,
  "room": {
    "name": "ah-01JR4XKPQM7T2N3V5W8Y6Z9B",
    "url": "wss://your-livekit-host.livekit.cloud",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}
What This Does: Creates a LiveKit room and returns the WebSocket URL and a JWT token your client can use to join immediately. The avatar agent connects automatically when the client joins.

Body

All fields are optional. When omitted, server-side defaults are used.
avatar
string
Avatar ID to use for the session (e.g. avat_01KMZHXFPBVCXA5ATK85HCP8G1). Must be an avat_... ID returned by the Upload Face endpoint.
aspect_ratio
string
Video aspect ratio. Must be one of: 1:1, 4:3, 3:4. Defaults to 1:1.
voice_id
string
ElevenLabs voice ID to use for TTS. Defaults to the server-configured voice.
enable_transcription
boolean
Whether to enable real-time transcription of user speech. Defaults to true.

Response

success
boolean
true when the room was created successfully.
room
object
Room connection details.

How It Works

  1. A LiveKit room is created and configured with the options you provide.
  2. A client join token is generated.
  3. When the client connects using the returned url + token, the avatar agent starts automatically.
No separate session call needed. Unlike the /v1/sessions endpoint (which requires you to bring your own LiveKit room), this endpoint handles room creation for you. The avatar agent starts automatically on client join.

Client Integration

const res = await fetch('https://api.agenthuman.com/v1/openclaw/initiate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEY',
  },
  body: JSON.stringify({
    avatar: 'avat_01KMZHXFPBVCXA5ATK85HCP8G1',
    aspect_ratio: '1:1',
    voice_id: 'hpp4J3VqNfWAUOO0d1Us',
  }),
});

const { room } = await res.json();

// Connect with the LiveKit client SDK
import { Room } from 'livekit-client';
const livekitRoom = new Room();
await livekitRoom.connect(room.url, room.token);
{
  "success": true,
  "room": {
    "name": "ah-01JR4XKPQM7T2N3V5W8Y6Z9B",
    "url": "wss://your-livekit-host.livekit.cloud",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}