List the available video engines
curl --request GET \
--url https://api.samsa.ai/public/v1/videos/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/videos/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/videos/models', 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.samsa.ai/public/v1/videos/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/videos/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/videos/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/videos/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"modes": [
"<string>"
],
"supports_end_frame": true,
"durations": [
123
],
"resolutions": [
"<string>"
],
"aspect_ratios": [
"<string>"
],
"supports_audio": true,
"credits_per_second": 123,
"durations_by_resolution": {
"1080p": [
8
]
},
"durations_with_end_frame": [
8
],
"default_resolution": "1080p",
"resolution_multipliers": {
"1080p": 2,
"720p": 1
},
"audio_credit_multiplier": 1.67
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}Videogenerierung
Video-Engines auflisten
Der öffentliche Video-Engine-Katalog — Modi, Dauern, Auflösungen und Preise pro Engine.
GET
/
videos
/
models
List the available video engines
curl --request GET \
--url https://api.samsa.ai/public/v1/videos/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.samsa.ai/public/v1/videos/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.samsa.ai/public/v1/videos/models', 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.samsa.ai/public/v1/videos/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.samsa.ai/public/v1/videos/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.samsa.ai/public/v1/videos/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.samsa.ai/public/v1/videos/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"name": "<string>",
"modes": [
"<string>"
],
"supports_end_frame": true,
"durations": [
123
],
"resolutions": [
"<string>"
],
"aspect_ratios": [
"<string>"
],
"supports_audio": true,
"credits_per_second": 123,
"durations_by_resolution": {
"1080p": [
8
]
},
"durations_with_end_frame": [
8
],
"default_resolution": "1080p",
"resolution_multipliers": {
"1080p": 2,
"720p": 1
},
"audio_credit_multiplier": 1.67
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "aspect_ratio"
}
}Gibt den Katalog der verfügbaren Video-Engines zurück. Jeder Eintrag listet die
Modi, die er unterstützt, gültige
durations (und durations_by_resolution /
durations_with_end_frame, wo sie sich unterscheiden), resolutions,
aspect_ratios, ob er einen Endframe oder Audio unterstützt, sowie seine
Credit-Preise (credits_per_second, resolution_multipliers,
audio_credit_multiplier).
Lies diesen Endpoint, bevor du
POST /videos/generations aufrufst, damit du
eine gültige Kombination aus engine + duration + resolution übergibst — nicht
unterstützte Werte liefern 422.⌘I

