curl --request POST \
--url https://api.boson.ai/v1/videos/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref_image": "<string>",
"model": "higgs-avatar",
"input": "<string>",
"input_tts": {
"input": "Hello, this is a test.",
"model": "higgs-tts-3",
"voice": "default",
"response_format": "mp3",
"stream": false,
"ref_audio": "<string>",
"ref_text": "<string>"
},
"size": "640x640"
}
'import requests
url = "https://api.boson.ai/v1/videos/stream"
payload = {
"ref_image": "<string>",
"model": "higgs-avatar",
"input": "<string>",
"input_tts": {
"input": "Hello, this is a test.",
"model": "higgs-tts-3",
"voice": "default",
"response_format": "mp3",
"stream": False,
"ref_audio": "<string>",
"ref_text": "<string>"
},
"size": "640x640"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ref_image: '<string>',
model: 'higgs-avatar',
input: '<string>',
input_tts: {
input: 'Hello, this is a test.',
model: 'higgs-tts-3',
voice: 'default',
response_format: 'mp3',
stream: false,
ref_audio: '<string>',
ref_text: '<string>'
},
size: '640x640'
})
};
fetch('https://api.boson.ai/v1/videos/stream', 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.boson.ai/v1/videos/stream",
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([
'ref_image' => '<string>',
'model' => 'higgs-avatar',
'input' => '<string>',
'input_tts' => [
'input' => 'Hello, this is a test.',
'model' => 'higgs-tts-3',
'voice' => 'default',
'response_format' => 'mp3',
'stream' => false,
'ref_audio' => '<string>',
'ref_text' => '<string>'
],
'size' => '640x640'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.boson.ai/v1/videos/stream"
payload := strings.NewReader("{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.boson.ai/v1/videos/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boson.ai/v1/videos/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Create a video (streaming)
Same request body as POST /v1/videos, but the response body IS the live fragmented-MP4 (fMP4) byte stream — frames arrive as they are generated, so playback can start before the clip is complete. The video id rides back in the X-Video-Id header; the full MP4 is stored too, so a later GET /v1/videos/{video_id}/content works.
curl --request POST \
--url https://api.boson.ai/v1/videos/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ref_image": "<string>",
"model": "higgs-avatar",
"input": "<string>",
"input_tts": {
"input": "Hello, this is a test.",
"model": "higgs-tts-3",
"voice": "default",
"response_format": "mp3",
"stream": false,
"ref_audio": "<string>",
"ref_text": "<string>"
},
"size": "640x640"
}
'import requests
url = "https://api.boson.ai/v1/videos/stream"
payload = {
"ref_image": "<string>",
"model": "higgs-avatar",
"input": "<string>",
"input_tts": {
"input": "Hello, this is a test.",
"model": "higgs-tts-3",
"voice": "default",
"response_format": "mp3",
"stream": False,
"ref_audio": "<string>",
"ref_text": "<string>"
},
"size": "640x640"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ref_image: '<string>',
model: 'higgs-avatar',
input: '<string>',
input_tts: {
input: 'Hello, this is a test.',
model: 'higgs-tts-3',
voice: 'default',
response_format: 'mp3',
stream: false,
ref_audio: '<string>',
ref_text: '<string>'
},
size: '640x640'
})
};
fetch('https://api.boson.ai/v1/videos/stream', 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.boson.ai/v1/videos/stream",
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([
'ref_image' => '<string>',
'model' => 'higgs-avatar',
'input' => '<string>',
'input_tts' => [
'input' => 'Hello, this is a test.',
'model' => 'higgs-tts-3',
'voice' => 'default',
'response_format' => 'mp3',
'stream' => false,
'ref_audio' => '<string>',
'ref_text' => '<string>'
],
'size' => '640x640'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.boson.ai/v1/videos/stream"
payload := strings.NewReader("{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.boson.ai/v1/videos/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boson.ai/v1/videos/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ref_image\": \"<string>\",\n \"model\": \"higgs-avatar\",\n \"input\": \"<string>\",\n \"input_tts\": {\n \"input\": \"Hello, this is a test.\",\n \"model\": \"higgs-tts-3\",\n \"voice\": \"default\",\n \"response_format\": \"mp3\",\n \"stream\": false,\n \"ref_audio\": \"<string>\",\n \"ref_text\": \"<string>\"\n },\n \"size\": \"640x640\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"type": "<string>"
}
}Authorizations
Your Boson API key, sent as Authorization: Bearer $BOSON_API_KEY.
Body
Provide a ref_image plus exactly one driving input: input (audio-to-video) or input_tts (text-to-video).
Reference image (the face to animate): an http(s) URL, data URI, or base64-encoded raw image bytes. Supported formats: PNG, JPEG, WEBP. Inline (base64 / data-URI) payloads: max 10 MB.
Avatar model ID / public alias.
higgs-avatar Audio-to-video: the driving speech audio as an http(s) URL, data URI, or base64-encoded raw audio bytes. Supported formats: AAC, WAV, MP3, FLAC, OPUS. Max duration: 60 s (it sets the output video length). Provide exactly one of input / input_tts.
Text-to-video: a speech request (the same body as POST /v1/audio/speech). The gateway synthesizes the voice and the avatar lip-syncs to it. The nested stream field is not supported. Provide exactly one of input / input_tts.
Show child attributes
Show child attributes
Output video size (WxH): square 640x640, landscape 640x480, or portrait 480x640.
640x640, 640x480, 480x640 Response
The fragmented-MP4 (fMP4) byte stream.
The response is of type file.