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
}
'
import requests

url = "https://api.agenthuman.com/v1/openclaw/initiate"

payload = {
"avatar": "<string>",
"aspect_ratio": "<string>",
"voice_id": "<string>",
"enable_transcription": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
avatar: '<string>',
aspect_ratio: '<string>',
voice_id: '<string>',
enable_transcription: true
})
};

fetch('https://api.agenthuman.com/v1/openclaw/initiate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agenthuman.com/v1/openclaw/initiate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'avatar' => '<string>',
'aspect_ratio' => '<string>',
'voice_id' => '<string>',
'enable_transcription' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.agenthuman.com/v1/openclaw/initiate"

payload := strings.NewReader("{\n \"avatar\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"enable_transcription\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.agenthuman.com/v1/openclaw/initiate")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"avatar\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"enable_transcription\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.agenthuman.com/v1/openclaw/initiate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"avatar\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"voice_id\": \"<string>\",\n \"enable_transcription\": true\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "room": {
    "name": "ah-01JR4XKPQM7T2N3V5W8Y6Z9B",
    "url": "wss://your-livekit-host.livekit.cloud",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }
}
{
  "success": false,
  "error": {
    "message": "Unauthorized"
  }
}
{
  "success": false,
  "error": {
    "message": "LiveKit is not configured on this server"
  }
}
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..."
  }
}
{
  "success": false,
  "error": {
    "message": "Unauthorized"
  }
}
{
  "success": false,
  "error": {
    "message": "LiveKit is not configured on this server"
  }
}