## Basic model info - Model name: heygen/heygen heygen-voice-1 - Model description: HeyGen Voice 1 is HeyGen's text-to-speech model, ranked first on the Artificial Analysis speech leaderboard at launch. It reads up to 5,000 characters in 39 languages with 24 public voices, or clones a voice from a short recording, and returns 44.1 kHz WAV. $0.03 per 1,000 characters. - Endpoint name: text-to-speech ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/heygen/heygen-voice-1/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input model for HeyGen Voice text-to-speech.", "properties": { "expressiveness_boost": { "default": 1, "description": "How expressive the delivery is, from 0 (flat) to 1 (most expressive)", "maximum": 1, "minimum": 0, "title": "Expressiveness Boost", "type": "number", "x-sr-order": 402 }, "language": { "anyOf": [ { "enum": [ "ar", "be", "bg", "ca", "cs", "da", "de", "el", "en", "es", "fa", "fi", "fr", "he", "hi", "hr", "hu", "id", "it", "ja", "ko", "mk", "ms", "nl", "pl", "pt", "ro", "ru", "sk", "sl", "sr", "sv", "ta", "th", "tl", "tr", "uk", "vi", "zh" ], "type": "string" }, { "type": "null" } ], "description": "Language of the text (ISO 639-1). Detected from the text when omitted", "title": "Language", "x-sr-order": 401 }, "reference_audio": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" }, { "type": "null" } ], "description": "Recording of a single speaker to clone instead of using a public voice (public URL). Only the first 3 minutes are used. Same price", "title": "Reference Audio", "x-sr-order": 302 }, "text": { "description": "The text to speak, up to 5,000 characters. Billed per character", "maxLength": 5000, "minLength": 1, "title": "Text", "type": "string", "x-sr-order": 201 }, "voice": { "default": "Jonah", "description": "HeyGen public voice. Ignored when reference_audio is set", "enum": [ "Jonah", "Nadine", "Tabitha", "Soren", "Elowen", "Vincent", "Jocelyn", "Marielle", "Corinne", "Lucian", "Kieran", "Hugh", "Noelle", "Bram", "Ewan", "Iona", "Cecily", "Simon", "Weston", "Felicity", "Gareth", "Rory", "Meredith", "Sabrina" ], "title": "Voice", "type": "string", "x-sr-order": 301 } }, "required": [ "text" ], "title": "TextToSpeechInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "44.1 kHz WAV speech plus the counts used for billing.", "properties": { "audio": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "duration": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "description": "Duration of the audio in seconds", "title": "Duration" }, "input_character_count": { "description": "Number of characters in the input text, used for billing", "title": "Input Character Count", "type": "integer" } }, "required": [ "audio", "input_character_count" ], "title": "HeygenVoiceOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "expressiveness_boost": 1, "language": null, "reference_audio": null, "text": "", "voice": "Jonah" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("heygen/heygen-voice-1/text-to-speech", { input: { text: '', voice: 'Jonah', reference_audio: null, language: null, expressiveness_boost: 1 }, logs: true, onQueueUpdate: (update) => { console.log(`Status Update: ${update.status}, Request ID: ${update.request_id}`); }, }); console.log(result.data); console.log(result.requestId); ``` ### Python ```python import sunra_client result = sunra_client.subscribe( "heygen/heygen-voice-1/text-to-speech", arguments={ "text": "", "voice": "Jonah", "reference_audio": None, "language": None, "expressiveness_boost": 1 }, with_logs=True, on_enqueue=print, on_queue_update=print, ) print(result) ``` ### Java ```java import ai.sunra.client.*; import java.util.Map; import com.google.gson.JsonObject; var client = SunraClient.withEnvCredentials(); var response = client.subscribe( "heygen/heygen-voice-1/text-to-speech", SubscribeOptions.builder() .input(Map.of( "text", "", "voice", "Jonah", "reference_audio", null, "language", null, "expressiveness_boost", 1)) .resultType(JsonObject.class) .onQueueUpdate(update -> System.out.printf( "\nStatus Update: %s, Request ID: %s%n", update.getStatus(), update.getRequestId() )) .logs(true) .build() ); System.out.println("Completed!"); System.out.println(response.getData()); ``` ### Kotlin ```kotlin import ai.sunra.client.kt.* import com.google.gson.JsonObject val client = createSunraClient() val response = client.subscribe( endpointId = "heygen/heygen-voice-1/text-to-speech", input = mapOf( "text" to "", "voice" to "Jonah", "reference_audio" to null, "language" to null, "expressiveness_boost" to 1), options = ai.sunra.client.kt.SubscribeOptions(logs = true), onUpdate = { update -> println("\nStatus Update: ${update.status}, Request ID: ${update.requestId}") } ) println("Completed!") println(response.data) ``` ### Curl ```bash curl --request POST \ --url https://api.sunra.ai/v1/queue/heygen/heygen-voice-1/text-to-speech \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"text":"","voice":"Jonah","reference_audio":null,"language":null,"expressiveness_boost":1}' ``` ## Model readme >