curl --request POST \
--url https://api.budgetpixel.com/v1/videos/magi-2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"end_image": "<string>",
"generate_audio": true,
"image": "<string>",
"length_seconds": 5,
"reference_audios": [
"<string>"
],
"reference_images": [
"<string>"
],
"reference_videos": [
"<string>"
],
"resolution": "1080p",
"seed": 1073741823
}
'import requests
url = "https://api.budgetpixel.com/v1/videos/magi-2"
payload = {
"prompt": "<string>",
"end_image": "<string>",
"generate_audio": True,
"image": "<string>",
"length_seconds": 5,
"reference_audios": ["<string>"],
"reference_images": ["<string>"],
"reference_videos": ["<string>"],
"resolution": "1080p",
"seed": 1073741823
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
end_image: '<string>',
generate_audio: true,
image: '<string>',
length_seconds: 5,
reference_audios: ['<string>'],
reference_images: ['<string>'],
reference_videos: ['<string>'],
resolution: '1080p',
seed: 1073741823
})
};
fetch('https://api.budgetpixel.com/v1/videos/magi-2', 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.budgetpixel.com/v1/videos/magi-2",
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([
'prompt' => '<string>',
'end_image' => '<string>',
'generate_audio' => true,
'image' => '<string>',
'length_seconds' => 5,
'reference_audios' => [
'<string>'
],
'reference_images' => [
'<string>'
],
'reference_videos' => [
'<string>'
],
'resolution' => '1080p',
'seed' => 1073741823
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.budgetpixel.com/v1/videos/magi-2"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\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.budgetpixel.com/v1/videos/magi-2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.budgetpixel.com/v1/videos/magi-2")
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 \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"characters": [
{
"handle": "barry",
"name": "Barry",
"official": true,
"page_url": "<string>"
}
],
"id": "<string>",
"message": "<string>",
"model": "<string>",
"status": "pending"
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}Generate video with Magi 2
Sand AI Magi 2 — 1080p video with synchronized native sound (dialogue, sound effects, ambience), any length from 4 to 30 seconds. Text-to-video; image-to-video from a start frame and an optional end frame; and reference-to-video mixing up to 10 reference images, up to 5 reference video clips (2-30s each, 30s combined) and up to 5 reference audio clips (30s combined). A reference video can guide motion and camera work, or be restyled by the prompt. Reference media can’t be combined with start/end frames. 120 credits per second of output in every mode, with sound on or off; reference images, videos and audio are free.
Asynchronous. Returns a job id (the video is not in this response). Poll GET /v1/videos/{id} until status is succeeded — the video URL is in that response’s video_url.
Examples, sample output and pricing: Magi 2
curl --request POST \
--url https://api.budgetpixel.com/v1/videos/magi-2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"end_image": "<string>",
"generate_audio": true,
"image": "<string>",
"length_seconds": 5,
"reference_audios": [
"<string>"
],
"reference_images": [
"<string>"
],
"reference_videos": [
"<string>"
],
"resolution": "1080p",
"seed": 1073741823
}
'import requests
url = "https://api.budgetpixel.com/v1/videos/magi-2"
payload = {
"prompt": "<string>",
"end_image": "<string>",
"generate_audio": True,
"image": "<string>",
"length_seconds": 5,
"reference_audios": ["<string>"],
"reference_images": ["<string>"],
"reference_videos": ["<string>"],
"resolution": "1080p",
"seed": 1073741823
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
end_image: '<string>',
generate_audio: true,
image: '<string>',
length_seconds: 5,
reference_audios: ['<string>'],
reference_images: ['<string>'],
reference_videos: ['<string>'],
resolution: '1080p',
seed: 1073741823
})
};
fetch('https://api.budgetpixel.com/v1/videos/magi-2', 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.budgetpixel.com/v1/videos/magi-2",
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([
'prompt' => '<string>',
'end_image' => '<string>',
'generate_audio' => true,
'image' => '<string>',
'length_seconds' => 5,
'reference_audios' => [
'<string>'
],
'reference_images' => [
'<string>'
],
'reference_videos' => [
'<string>'
],
'resolution' => '1080p',
'seed' => 1073741823
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.budgetpixel.com/v1/videos/magi-2"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\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.budgetpixel.com/v1/videos/magi-2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.budgetpixel.com/v1/videos/magi-2")
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 \"prompt\": \"<string>\",\n \"end_image\": \"<string>\",\n \"generate_audio\": true,\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"reference_audios\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"reference_videos\": [\n \"<string>\"\n ],\n \"resolution\": \"1080p\",\n \"seed\": 1073741823\n}"
response = http.request(request)
puts response.read_body{
"characters": [
{
"handle": "barry",
"name": "Barry",
"official": true,
"page_url": "<string>"
}
],
"id": "<string>",
"message": "<string>",
"model": "<string>",
"status": "pending"
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}Magi 2 on BudgetPixel
Authorizations
Body
Text description of the video, up to 8,000 characters: subjects, action, camera movement, dialogue (in quotes), sound effects and ambience. With reference media, say how to use them ("keep the person from the reference image", "follow the dance in the reference video"). Write @handle to cast a character: a BudgetPixel AI influencer or one of your own (GET /v1/characters).
Optional reference images (up to 10, free) that guide a subject, character or style in reference-to-video mode (they are references, not a first frame). Each item is a public image URL, a data URI, raw base64, or an uploaded-file URL from POST /v1/uploads. Can't be combined with image/end_image.
10Optional reference video clips (up to 5; each 2-30s, 30s combined; MP4/MOV, ≤50MB each), free. A reference video guides motion and camera work (a dance copied move for move), or is restyled by the prompt: an edit keeps the clip's motion and framing, though a big lighting change (day to night) comes out weak. Each item is a public video URL or an uploaded-file URL from POST /v1/uploads. Can't be combined with image/end_image.
5Response
Job accepted.