const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
input_video_duration: 1800,
input_audio_duration: 11,
size: '<string>',
resolution: '<string>',
aspect_ratio: '<string>',
seed: 123,
sample_count: 2,
negative_prompt: '<string>',
generate_audio: true,
enhance_prompt: true,
compression_quality: 123,
person_generation: '<string>',
resize_mode: '<string>',
input_references: [{type: 'image_url', image_url: {url: '<string>'}, reference_type: '<string>'}],
frame_images: [{type: 'image_url', image_url: {url: '<string>'}}],
provider_params: {},
provider_options: {},
output: {access: 'both'},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
}
})
};
fetch('https://api.phaseo.app/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"input_video_duration": 1800,
"input_audio_duration": 11,
"size": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"sample_count": 2,
"negative_prompt": "<string>",
"generate_audio": True,
"enhance_prompt": True,
"compression_quality": 123,
"person_generation": "<string>",
"resize_mode": "<string>",
"input_references": [
{
"type": "image_url",
"image_url": { "url": "<string>" },
"reference_type": "<string>"
}
],
"frame_images": [
{
"type": "image_url",
"image_url": { "url": "<string>" }
}
],
"provider_params": {},
"provider_options": {},
"output": { "access": "both" },
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"input_video_duration": 1800,
"input_audio_duration": 11,
"size": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"sample_count": 2,
"negative_prompt": "<string>",
"generate_audio": true,
"enhance_prompt": true,
"compression_quality": 123,
"person_generation": "<string>",
"resize_mode": "<string>",
"input_references": [
{
"type": "image_url",
"image_url": {
"url": "<string>"
},
"reference_type": "<string>"
}
],
"frame_images": [
{
"type": "image_url",
"image_url": {
"url": "<string>"
}
}
],
"provider_params": {},
"provider_options": {},
"output": {
"access": "both"
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phaseo.app/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'duration' => 123,
'input_video_duration' => 1800,
'input_audio_duration' => 11,
'size' => '<string>',
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'seed' => 123,
'sample_count' => 2,
'negative_prompt' => '<string>',
'generate_audio' => true,
'enhance_prompt' => true,
'compression_quality' => 123,
'person_generation' => '<string>',
'resize_mode' => '<string>',
'input_references' => [
[
'type' => 'image_url',
'image_url' => [
'url' => '<string>'
],
'reference_type' => '<string>'
]
],
'frame_images' => [
[
'type' => 'image_url',
'image_url' => [
'url' => '<string>'
]
]
],
'provider_params' => [
],
'provider_options' => [
],
'output' => [
'access' => 'both'
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>",
"websocket_url": "<string>",
"model": "<string>",
"request_id": "<string>",
"session_id": "<string>",
"status": "queued",
"lifecycle_status": "pending",
"cancel_url": "<string>",
"output_access": "bytes",
"generation_id": "<string>",
"native_video_id": "<string>",
"created_at": 123,
"started_at": 123,
"completed_at": 123,
"object": "video",
"poll_after_seconds": 20,
"provider": "<string>",
"seconds": 123,
"size": "<string>",
"audio": true,
"content_url": "<string>",
"download_url": "<string>",
"expires_at": 123,
"progress": 123,
"progress_source": "<string>",
"asset": {
"id": "<string>",
"mime_type": "<string>",
"bytes": 123,
"sha256": "<string>",
"width": 123,
"height": 123,
"duration_seconds": 123
},
"outputs": [
{
"index": 123,
"mime_type": "<string>",
"bytes_available": true,
"content_url": "<string>",
"download_url": "<string>",
"expires_at": 123
}
],
"billing": {
"currency": "<string>",
"estimated_provider_cost": "<string>",
"estimated_user_cost": "<string>",
"settled_provider_cost": "<string>",
"settled_user_cost": "<string>",
"state": "pending",
"billable": true,
"total_nanos": 123,
"estimated_nanos": 123,
"reserved_nanos": 123,
"reservation_id": "<string>",
"reservation_status": "<string>",
"charge_reason": "<string>",
"charged": true,
"billed_at": "<string>"
},
"webhook": {
"url": "<string>",
"events": [
"<string>"
],
"has_secret": true,
"delivery": {
"total_attempts": 123,
"delivered_events": 123,
"delivered_event_types": [
"video.completed"
],
"pending_retries": 123,
"next_retry_at": "<string>",
"last_attempt_at": "<string>",
"last_attempt_status": "delivered",
"last_response_status": 123,
"last_delivered_at": "<string>",
"last_failure_at": "<string>",
"last_error_message": "<string>"
},
"attempts": [
{
"id": "<string>",
"delivery_key": "video.completed",
"event_type": "video.completed",
"status": "delivered",
"attempt_number": 123,
"max_attempts": 123,
"tried_at": "<string>",
"delivered_at": "<string>",
"next_retry_at": "<string>",
"response_status": 123,
"error_message": "<string>",
"response_body_preview": "<string>"
}
]
},
"next_webhook_retry_at": "<string>",
"last_webhook_progress": 123,
"last_webhook_progress_at": "<string>",
"last_webhook_dispatched_at": "<string>",
"usage": {
"cost": 123,
"is_byok": true
},
"error": null
}वीडियो बनाएँ
एसिंक्रोनस वीडियो जनरेशन जॉब बनाता है। जॉब अंतिम स्थिति तक पहुँचने तक लौटाए गए polling_url को हर 20 सेकंड में पोल करें।
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
prompt: '<string>',
duration: 123,
input_video_duration: 1800,
input_audio_duration: 11,
size: '<string>',
resolution: '<string>',
aspect_ratio: '<string>',
seed: 123,
sample_count: 2,
negative_prompt: '<string>',
generate_audio: true,
enhance_prompt: true,
compression_quality: 123,
person_generation: '<string>',
resize_mode: '<string>',
input_references: [{type: 'image_url', image_url: {url: '<string>'}, reference_type: '<string>'}],
frame_images: [{type: 'image_url', image_url: {url: '<string>'}}],
provider_params: {},
provider_options: {},
output: {access: 'both'},
provider: {
order: ['<string>'],
only: ['<string>'],
ignore: ['<string>'],
include_alpha: true,
allow_fallbacks: true,
require_parameters: true,
required_execution_region: '<string>',
required_data_region: '<string>',
require_zero_data_retention: true,
zdr: true,
enforce_distillable_text: true,
quantizations: ['<string>'],
sort: '<string>',
max_price: {prompt: 123, completion: 123, image: 123, audio: 123, request: 123},
preferred_min_throughput: 123,
preferred_max_latency: 123
}
})
};
fetch('https://api.phaseo.app/v1/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.phaseo.app/v1/videos"
payload = {
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"input_video_duration": 1800,
"input_audio_duration": 11,
"size": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"sample_count": 2,
"negative_prompt": "<string>",
"generate_audio": True,
"enhance_prompt": True,
"compression_quality": 123,
"person_generation": "<string>",
"resize_mode": "<string>",
"input_references": [
{
"type": "image_url",
"image_url": { "url": "<string>" },
"reference_type": "<string>"
}
],
"frame_images": [
{
"type": "image_url",
"image_url": { "url": "<string>" }
}
],
"provider_params": {},
"provider_options": {},
"output": { "access": "both" },
"provider": {
"order": ["<string>"],
"only": ["<string>"],
"ignore": ["<string>"],
"include_alpha": True,
"allow_fallbacks": True,
"require_parameters": True,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": True,
"zdr": True,
"enforce_distillable_text": True,
"quantizations": ["<string>"],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.phaseo.app/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"duration": 123,
"input_video_duration": 1800,
"input_audio_duration": 11,
"size": "<string>",
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"sample_count": 2,
"negative_prompt": "<string>",
"generate_audio": true,
"enhance_prompt": true,
"compression_quality": 123,
"person_generation": "<string>",
"resize_mode": "<string>",
"input_references": [
{
"type": "image_url",
"image_url": {
"url": "<string>"
},
"reference_type": "<string>"
}
],
"frame_images": [
{
"type": "image_url",
"image_url": {
"url": "<string>"
}
}
],
"provider_params": {},
"provider_options": {},
"output": {
"access": "both"
},
"provider": {
"order": [
"<string>"
],
"only": [
"<string>"
],
"ignore": [
"<string>"
],
"include_alpha": true,
"allow_fallbacks": true,
"require_parameters": true,
"required_execution_region": "<string>",
"required_data_region": "<string>",
"require_zero_data_retention": true,
"zdr": true,
"enforce_distillable_text": true,
"quantizations": [
"<string>"
],
"sort": "<string>",
"max_price": {
"prompt": 123,
"completion": 123,
"image": 123,
"audio": 123,
"request": 123
},
"preferred_min_throughput": 123,
"preferred_max_latency": 123
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.phaseo.app/v1/videos"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.phaseo.app/v1/videos")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.phaseo.app/v1/videos",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => '<string>',
'prompt' => '<string>',
'duration' => 123,
'input_video_duration' => 1800,
'input_audio_duration' => 11,
'size' => '<string>',
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'seed' => 123,
'sample_count' => 2,
'negative_prompt' => '<string>',
'generate_audio' => true,
'enhance_prompt' => true,
'compression_quality' => 123,
'person_generation' => '<string>',
'resize_mode' => '<string>',
'input_references' => [
[
'type' => 'image_url',
'image_url' => [
'url' => '<string>'
],
'reference_type' => '<string>'
]
],
'frame_images' => [
[
'type' => 'image_url',
'image_url' => [
'url' => '<string>'
]
]
],
'provider_params' => [
],
'provider_options' => [
],
'output' => [
'access' => 'both'
],
'provider' => [
'order' => [
'<string>'
],
'only' => [
'<string>'
],
'ignore' => [
'<string>'
],
'include_alpha' => true,
'allow_fallbacks' => true,
'require_parameters' => true,
'required_execution_region' => '<string>',
'required_data_region' => '<string>',
'require_zero_data_retention' => true,
'zdr' => true,
'enforce_distillable_text' => true,
'quantizations' => [
'<string>'
],
'sort' => '<string>',
'max_price' => [
'prompt' => 123,
'completion' => 123,
'image' => 123,
'audio' => 123,
'request' => 123
],
'preferred_min_throughput' => 123,
'preferred_max_latency' => 123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.phaseo.app/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"duration\": 123,\n \"input_video_duration\": 1800,\n \"input_audio_duration\": 11,\n \"size\": \"<string>\",\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"sample_count\": 2,\n \"negative_prompt\": \"<string>\",\n \"generate_audio\": true,\n \"enhance_prompt\": true,\n \"compression_quality\": 123,\n \"person_generation\": \"<string>\",\n \"resize_mode\": \"<string>\",\n \"input_references\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n },\n \"reference_type\": \"<string>\"\n }\n ],\n \"frame_images\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": \"<string>\"\n }\n }\n ],\n \"provider_params\": {},\n \"provider_options\": {},\n \"output\": {\n \"access\": \"both\"\n },\n \"provider\": {\n \"order\": [\n \"<string>\"\n ],\n \"only\": [\n \"<string>\"\n ],\n \"ignore\": [\n \"<string>\"\n ],\n \"include_alpha\": true,\n \"allow_fallbacks\": true,\n \"require_parameters\": true,\n \"required_execution_region\": \"<string>\",\n \"required_data_region\": \"<string>\",\n \"require_zero_data_retention\": true,\n \"zdr\": true,\n \"enforce_distillable_text\": true,\n \"quantizations\": [\n \"<string>\"\n ],\n \"sort\": \"<string>\",\n \"max_price\": {\n \"prompt\": 123,\n \"completion\": 123,\n \"image\": 123,\n \"audio\": 123,\n \"request\": 123\n },\n \"preferred_min_throughput\": 123,\n \"preferred_max_latency\": 123\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>",
"websocket_url": "<string>",
"model": "<string>",
"request_id": "<string>",
"session_id": "<string>",
"status": "queued",
"lifecycle_status": "pending",
"cancel_url": "<string>",
"output_access": "bytes",
"generation_id": "<string>",
"native_video_id": "<string>",
"created_at": 123,
"started_at": 123,
"completed_at": 123,
"object": "video",
"poll_after_seconds": 20,
"provider": "<string>",
"seconds": 123,
"size": "<string>",
"audio": true,
"content_url": "<string>",
"download_url": "<string>",
"expires_at": 123,
"progress": 123,
"progress_source": "<string>",
"asset": {
"id": "<string>",
"mime_type": "<string>",
"bytes": 123,
"sha256": "<string>",
"width": 123,
"height": 123,
"duration_seconds": 123
},
"outputs": [
{
"index": 123,
"mime_type": "<string>",
"bytes_available": true,
"content_url": "<string>",
"download_url": "<string>",
"expires_at": 123
}
],
"billing": {
"currency": "<string>",
"estimated_provider_cost": "<string>",
"estimated_user_cost": "<string>",
"settled_provider_cost": "<string>",
"settled_user_cost": "<string>",
"state": "pending",
"billable": true,
"total_nanos": 123,
"estimated_nanos": 123,
"reserved_nanos": 123,
"reservation_id": "<string>",
"reservation_status": "<string>",
"charge_reason": "<string>",
"charged": true,
"billed_at": "<string>"
},
"webhook": {
"url": "<string>",
"events": [
"<string>"
],
"has_secret": true,
"delivery": {
"total_attempts": 123,
"delivered_events": 123,
"delivered_event_types": [
"video.completed"
],
"pending_retries": 123,
"next_retry_at": "<string>",
"last_attempt_at": "<string>",
"last_attempt_status": "delivered",
"last_response_status": 123,
"last_delivered_at": "<string>",
"last_failure_at": "<string>",
"last_error_message": "<string>"
},
"attempts": [
{
"id": "<string>",
"delivery_key": "video.completed",
"event_type": "video.completed",
"status": "delivered",
"attempt_number": 123,
"max_attempts": 123,
"tried_at": "<string>",
"delivered_at": "<string>",
"next_retry_at": "<string>",
"response_status": 123,
"error_message": "<string>",
"response_body_preview": "<string>"
}
]
},
"next_webhook_retry_at": "<string>",
"last_webhook_progress": 123,
"last_webhook_progress_at": "<string>",
"last_webhook_dispatched_at": "<string>",
"usage": {
"cost": 123,
"is_byok": true
},
"error": null
}प्राधिकरण
Bearer टोकन से प्रमाणीकरण
बॉडी
वांछित अवधि सेकंड में (प्रदाता/मॉडल पर निर्भर)।
स्रोत वीडियो की अवधि सेकंड में। जब प्रदाता स्रोत वीडियो की अवधि को उत्पन्न आउटपुट से अलग बिल करता है तब आवश्यक।
0 < x <= 3600स्रोत ऑडियो की घोषित अवधि सेकंड में, प्रदाता की सीमा जाँचने के लिए। आधिकारिक उपयोग न बताने वाले प्रदाता अपनी समर्थित इनपुट-अवधि की अधिकतम सीमा पर बिल कर सकते हैं।
2 <= x <= 20स्पष्ट आयाम (जैसे 1280x720)। resolution या aspect_ratio के साथ नहीं दिया जा सकता।
480p, 720p, 1080p, 1K, 2K, 4K। aspect_ratio के साथ दिया जा सकता है। size के साथ नहीं दिया जा सकता।
आस्पेक्ट अनुपात जैसे 16:9, 9:16, 1:1। resolution के साथ दिया जा सकता है। size के साथ नहीं दिया जा सकता।
1 <= x <= 4जनरेशन को निर्देशित करने वाले HTTPS चित्र, ऑडियो या वीडियो इनपुट। समर्थित प्रकार, भूमिकाएँ, संख्या और संयोजन चुने गए मॉडल पर निर्भर हैं। जॉब भेजने से पहले GET /videos/models देखें। इस स्कीमा में छोड़ा गया एकवचन संगतता alias input_reference एक multipart चित्र या file_id और image_url में से ठीक एक वाला ऑब्जेक्ट स्वीकार करता है। समर्थन प्रदाता पर निर्भर है।
प्रकार सहित HTTPS मीडिया इनपुट। चित्रों के लिए image_url और ऑडियो या वीडियो के लिए media_url उपयोग करें। भूमिकाएँ बताती हैं कि मॉडल इनपुट का कैसे उपयोग करे; समर्थन प्रदाता और मॉडल के अनुसार बदलता है।
- Option 1
- Option 2
Show child attributes
Show child attributes
पहले/अंतिम फ़्रेम के HTTPS चित्र। हर frame_type एक बार आ सकता है। साथ में input_reference या input_references में फ़्रेम भूमिकाएँ न दें।
1 - 2 elementsShow child attributes
Show child attributes
केवल प्रदाता-विशिष्ट एक्सटेंशन। पूरे अनुरोध का passthrough और दोहराए गए रूटिंग, prompt, callback या बिलिंग फ़ील्ड अस्वीकार किए जाते हैं।
कैनोनिकल प्रदाता ID (जैसे atlascloud या byteplus) से पहचाने जाने वाले एक्सटेंशन। केवल चुने गए प्रदाता के विकल्प आगे भेजे जाते हैं। provider_params के साथ नहीं दिया जा सकता। रूटिंग, prompt, callback, अवधि, रिज़ॉल्यूशन और आउटपुट-संख्या के लिए सत्यापित शीर्ष-स्तरीय फ़ील्ड उपयोग करने होंगे।
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
गेटवे चयन के लिए प्रदाता रूटिंग प्राथमिकताएँ।
Show child attributes
Show child attributes
प्रतिक्रिया
वीडियो का जवाब
एसिंक्रोनस जॉब के सामान्यीकृत जीवनचक्र अपडेट की सदस्यता लेने के लिए WebSocket URL।
queued, processing, completed, failed, cancelled, expired पोलिंग, WebSocket और webhook उपभोक्ताओं के लिए सामान्यीकृत एसिंक्रोनस जीवनचक्र स्थिति।
pending, running, completed, failed, cancelled, expired संगतता के लिए आरक्षित; वर्तमान में हमेशा null।
bytes, signed_url, both प्रदाता का मूल वीडियो/जॉब ID, जब वह गेटवे के स्वामित्व वाले ID से अलग हो।
"video"
20
जब output_access में bytes शामिल हों तब मौजूद (प्रमाणित एंडपॉइंट)।
स्थिति completed होने पर सीधे डाउनलोड के लिए प्रथम-पक्ष हस्ताक्षरित URL।
हस्ताक्षरित download_url की समय-सीमा समाप्त होने का Unix टाइमस्टैम्प (सेकंड)।
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
सुरक्षित रूप से साफ़ किया गया एसिंक्रोनस webhook कॉन्फ़िगरेशन और डिलीवरी स्थिति। सीक्रेट कभी नहीं लौटाए जाते; has_secret बताता है कि हस्ताक्षरित डिलीवरी सक्षम हैं या नहीं। हस्ताक्षरित डिलीवरी में x-phaseo-signature, x-phaseo-timestamp, x-phaseo-event-id, x-phaseo-event-type, x-phaseo-delivery-key, x-phaseo-attempt और x-phaseo-max-attempts हेडर शामिल होते हैं।
Show child attributes
Show child attributes
अगले निर्धारित उपयोगकर्ता-webhook पुनः प्रयास का ISO टाइमस्टैम्प, यदि कतार में हो।
webhook उपभोक्ताओं को भेजा गया सबसे हालिया मोटा प्रगति स्तर।
सबसे हालिया webhook प्रगति स्तर भेजे जाने का ISO टाइमस्टैम्प।
सबसे हालिया webhook भेजने के प्रयास का ISO टाइमस्टैम्प।
Show child attributes
Show child attributes
वाज़ दिस पेज हेल्पफुल