## Basic model info - Model name: kling/kling kling-voice - Model description: Create custom voices from audio files for use in Kling video generation. - Endpoint name: create-voice ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/kling/kling-voice/latest.json) ### Model input schema The model input schema is: ```json { "description": "Input model for creating a custom voice.", "properties": { "voice_name": { "description": "Name for this voice (used for display in your voice library).", "maxLength": 100, "minLength": 1, "title": "Voice Name", "type": "string", "x-sr-order": 201 }, "voice_url": { "description": "URL of the voice audio file. Supports .mp3/.wav audio or .mp4/.mov video. Duration must be 5-30 seconds with clean, single-voice audio.", "title": "Voice Url", "type": "string", "x-sr-order": 301 } }, "required": [ "voice_url", "voice_name" ], "title": "CreateVoiceInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "description": "Output model for created voice.", "properties": { "voice_id": { "description": "Unique identifier for the created voice", "title": "Voice Id", "type": "string" }, "voice_name": { "description": "Name of the voice", "title": "Voice Name", "type": "string" } }, "required": [ "voice_id", "voice_name" ], "title": "CreateVoiceOutput", "type": "object" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "voice_name": "", "voice_url": "" } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("kling/kling-voice/create-voice", { input: { voice_url: '', voice_name: '' }, 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( "kling/kling-voice/create-voice", arguments={ "voice_url": "", "voice_name": "" }, 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( "kling/kling-voice/create-voice", SubscribeOptions.builder() .input(Map.of( "voice_url", "", "voice_name", "")) .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 = "kling/kling-voice/create-voice", input = mapOf( "voice_url" to "", "voice_name" to ""), 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/kling/kling-voice/create-voice \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"voice_url":"","voice_name":""}' ``` ## Model readme undefined