curl -X POST 'https://openapi.visionstory.ai/api/v1/video' \
-H 'X-API-Key: sk-vs-xxxxxxxxxxxxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}'
import requests
url = "https://openapi.visionstory.ai/api/v1/video"
headers = {
"X-API-Key": "sk-vs-xxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
}
payload = {
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": None,
"voice_change": False,
"voice_id": "Alice",
"denoise": False
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://openapi.visionstory.ai/api/v1/video", {
method: "POST",
headers: {
"X-API-Key": "sk-vs-xxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}`)
req, _ := http.NewRequest("POST", "https://openapi.visionstory.ai/api/v1/video", bytes.NewBuffer(payload))
req.Header.Set("X-API-Key", "sk-vs-xxxxxxxxxxxxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.visionstory.ai/api/v1/video"))
.header("X-API-Key", "sk-vs-xxxxxxxxxxxxxxxxxxx")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
<?php
$ch = curl_init("https://openapi.visionstory.ai/api/v1/video");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: sk-vs-xxxxxxxxxxxxxxxxxxx",
"Content-Type: application/json",
]);
$payload = <<<'JSON'
{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}
JSON;
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
require "net/http"
require "uri"
uri = URI("https://openapi.visionstory.ai/api/v1/video")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = "sk-vs-xxxxxxxxxxxxxxxxxxx"
request["Content-Type"] = "application/json"
request.body = <<~JSON
{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}
JSON
response = http.request(request)
puts response.body
import Foundation
var request = URLRequest(url: URL(string: "https://openapi.visionstory.ai/api/v1/video")!)
request.httpMethod = "POST"
request.setValue("sk-vs-xxxxxxxxxxxxxxxxxxx", forHTTPHeaderField: "X-API-Key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = """
{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}
""".data(using: .utf8)
let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8) ?? "")
using System;
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://openapi.visionstory.ai/api/v1/video");
request.Headers.Add("X-API-Key", "sk-vs-xxxxxxxxxxxxxxxxxxx");
var payload = """
{
"client_request_id": "client_request_a1b2c3d4e5f6",
"model_id": "vs_character_v4",
"avatar_id": "4321918387609092991",
"text_script": {
"text": "string",
"voice_id": "Alice",
"speech_rate": "normal"
},
"audio_script": {
"audio_url": "https://cdn.visionstory.ai/example.png",
"inline_data": null,
"voice_change": false,
"voice_id": "Alice",
"denoise": false
},
"aspect_ratio": "9:16",
"resolution": "720p",
"emotion": "cheerful",
"background_color": ""
}
""";
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());