## Basic model info - Model name: heygen/heygen heygen-video-1 - Model description: HeyGen Video 1 is HeyGen's general-purpose video model: one call renders a 5 to 15 second clip with dialogue, ambience and sound effects. Start from a text prompt, a first-frame image, or up to 12 reference images, videos and audio clips that keep people, products and places consistent. 480p and 768p cost $0.02 per second; 1080p and 2K cost $0.06 per second. - Endpoint name: text-to-video ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/heygen/heygen-video-1/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input model for HeyGen Video text-to-video.", "properties": { "prompt": { "description": "What happens in the clip, including any dialogue, ambience and sound effects. Audio is always generated with the video", "maxLength": 32000, "minLength": 1, "title": "Prompt", "type": "string", "x-sr-order": 201 }, "aspect_ratio": { "default": "16:9", "description": "Aspect ratio of the video", "enum": [ "21:9", "16:9", "4:3", "1:1", "3:4", "9:16" ], "title": "Aspect Ratio", "type": "string", "x-sr-order": 402 }, "seed": { "anyOf": [ { "maximum": 4294967295, "minimum": 0, "type": "integer" }, { "type": "null" } ], "description": "Seed for reproducibility; random when omitted", "title": "Seed", "x-sr-order": 501 }, "duration": { "default": 5, "description": "Length of the clip in seconds (5-15). Billed per second", "enum": [ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ], "title": "Duration", "type": "integer", "x-sr-order": 403 }, "prompt_enhancement": { "default": "turbo", "description": "How much the prompt is expanded before generation: quality and ultraquality are slower, disabled sends the prompt as written. Does not change the price", "enum": [ "turbo", "quality", "ultraquality", "disabled" ], "title": "Prompt Enhancement", "type": "string", "x-sr-order": 404 }, "resolution": { "default": "768p", "description": "Output resolution. 480p and 768p cost the same per second; 1080p and 2k cost 3x", "enum": [ "480p", "768p", "1080p", "2k" ], "title": "Resolution", "type": "string", "x-sr-order": 401 } }, "required": [ "prompt" ], "title": "TextToVideoInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "Output model with video duration for post_calculated pricing.", "properties": { "seed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "description": "Seed used for the generation; pass it back to reproduce the video", "title": "Seed" }, "output_video_dur": { "description": "Billed duration in seconds: the requested duration (the delivered clip runs slightly longer)", "title": "Output Video Dur", "type": "integer" }, "video": { "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" } }, "required": [ "video", "output_video_dur" ], "title": "HeygenVideoOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "", "aspect_ratio": "16:9", "seed": null, "duration": 5, "prompt_enhancement": "turbo", "resolution": "768p" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("heygen/heygen-video-1/text-to-video", { input: { prompt: '', resolution: '768p', duration: 5, prompt_enhancement: 'turbo', seed: null, aspect_ratio: '16:9' }, 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-video-1/text-to-video", arguments={ "prompt": "", "resolution": "768p", "duration": 5, "prompt_enhancement": "turbo", "seed": None, "aspect_ratio": "16:9" }, 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-video-1/text-to-video", SubscribeOptions.builder() .input(Map.of( "prompt", "", "resolution", "768p", "duration", 5, "prompt_enhancement", "turbo", "seed", null, "aspect_ratio", "16:9")) .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-video-1/text-to-video", input = mapOf( "prompt" to "", "resolution" to "768p", "duration" to 5, "prompt_enhancement" to "turbo", "seed" to null, "aspect_ratio" to "16:9"), 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-video-1/text-to-video \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"prompt":"","resolution":"768p","duration":5,"prompt_enhancement":"turbo","seed":null,"aspect_ratio":"16:9"}' ``` ## Model readme >