curl --request POST \
--url https://polza.ai/api/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-3",
"input": {
"prompt": "Космический корабль в стиле киберпанк",
"aspect_ratio": "16:9",
"images": [
{
"type": "url",
"data": "https://example.com/image.png"
}
],
"callBackUrl": "<string>",
"seed": 42,
"watermark": "MyBrand",
"image_resolution": "2K",
"quality": "high",
"output_format": "png",
"max_images": 1,
"isEnhance": false,
"guidance_scale": 2.5,
"strength": 0.8,
"enable_safety_checker": true,
"upscale_factor": "2",
"font_inputs": [
{
"font_url": "https://example.com/fonts/custom-font.ttf",
"text": "Hello World"
}
],
"super_resolution_references": [
"https://example.com/reference1.jpg"
]
},
"provider": {
"allow_fallbacks": true,
"order": [
"OpenAI",
"Anthropic"
],
"only": [
"OpenAI",
"Google"
],
"ignore": [
"DeepInfra"
],
"sort": "price",
"max_price": {
"prompt": 10,
"completion": 20,
"image": 5,
"audio": 15,
"request": 1
}
},
"async": false,
"user": "user-123"
}
'import requests
url = "https://polza.ai/api/v1/media"
payload = {
"model": "seedream-3",
"input": {
"prompt": "Космический корабль в стиле киберпанк",
"aspect_ratio": "16:9",
"images": [
{
"type": "url",
"data": "https://example.com/image.png"
}
],
"callBackUrl": "<string>",
"seed": 42,
"watermark": "MyBrand",
"image_resolution": "2K",
"quality": "high",
"output_format": "png",
"max_images": 1,
"isEnhance": False,
"guidance_scale": 2.5,
"strength": 0.8,
"enable_safety_checker": True,
"upscale_factor": "2",
"font_inputs": [
{
"font_url": "https://example.com/fonts/custom-font.ttf",
"text": "Hello World"
}
],
"super_resolution_references": ["https://example.com/reference1.jpg"]
},
"provider": {
"allow_fallbacks": True,
"order": ["OpenAI", "Anthropic"],
"only": ["OpenAI", "Google"],
"ignore": ["DeepInfra"],
"sort": "price",
"max_price": {
"prompt": 10,
"completion": 20,
"image": 5,
"audio": 15,
"request": 1
}
},
"async": False,
"user": "user-123"
}
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({
model: 'seedream-3',
input: {
prompt: 'Космический корабль в стиле киберпанк',
aspect_ratio: '16:9',
images: [{type: 'url', data: 'https://example.com/image.png'}],
callBackUrl: '<string>',
seed: 42,
watermark: 'MyBrand',
image_resolution: '2K',
quality: 'high',
output_format: 'png',
max_images: 1,
isEnhance: false,
guidance_scale: 2.5,
strength: 0.8,
enable_safety_checker: true,
upscale_factor: '2',
font_inputs: [{font_url: 'https://example.com/fonts/custom-font.ttf', text: 'Hello World'}],
super_resolution_references: ['https://example.com/reference1.jpg']
},
provider: {
allow_fallbacks: true,
order: ['OpenAI', 'Anthropic'],
only: ['OpenAI', 'Google'],
ignore: ['DeepInfra'],
sort: 'price',
max_price: {prompt: 10, completion: 20, image: 5, audio: 15, request: 1}
},
async: false,
user: 'user-123'
})
};
fetch('https://polza.ai/api/v1/media', 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://polza.ai/api/v1/media",
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' => 'seedream-3',
'input' => [
'prompt' => 'Космический корабль в стиле киберпанк',
'aspect_ratio' => '16:9',
'images' => [
[
'type' => 'url',
'data' => 'https://example.com/image.png'
]
],
'callBackUrl' => '<string>',
'seed' => 42,
'watermark' => 'MyBrand',
'image_resolution' => '2K',
'quality' => 'high',
'output_format' => 'png',
'max_images' => 1,
'isEnhance' => false,
'guidance_scale' => 2.5,
'strength' => 0.8,
'enable_safety_checker' => true,
'upscale_factor' => '2',
'font_inputs' => [
[
'font_url' => 'https://example.com/fonts/custom-font.ttf',
'text' => 'Hello World'
]
],
'super_resolution_references' => [
'https://example.com/reference1.jpg'
]
],
'provider' => [
'allow_fallbacks' => true,
'order' => [
'OpenAI',
'Anthropic'
],
'only' => [
'OpenAI',
'Google'
],
'ignore' => [
'DeepInfra'
],
'sort' => 'price',
'max_price' => [
'prompt' => 10,
'completion' => 20,
'image' => 5,
'audio' => 15,
'request' => 1
]
],
'async' => false,
'user' => 'user-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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://polza.ai/api/v1/media"
payload := strings.NewReader("{\n \"model\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\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://polza.ai/api/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://polza.ai/api/v1/media")
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\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "gen_581761234567890123",
"object": "media.generation",
"status": "pending",
"created": 1703001234,
"model": "google/gemini-2.5-flash-image",
"completed_at": 1703001244,
"data": "<unknown>",
"usage": {
"input_units": 1,
"output_units": 1,
"duration_seconds": 5,
"input_tokens": 10,
"output_tokens": 0,
"total_tokens": 10,
"cost_rub": 1.5,
"cost": 1.5
},
"error": {
"code": "BAD_GATEWAY",
"message": "Ошибка генерации медиа контента"
},
"content": "Банан и яблоко — это фрукты.",
"reasoning_summary": "Preparing image generation prompt with camera settings...",
"warnings": [
"Параметр isEnhance не поддерживается OpenRouter и будет проигнорирован"
]
}POST Media
Универсальный API генерации медиа (изображения, видео, аудио)
curl --request POST \
--url https://polza.ai/api/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-3",
"input": {
"prompt": "Космический корабль в стиле киберпанк",
"aspect_ratio": "16:9",
"images": [
{
"type": "url",
"data": "https://example.com/image.png"
}
],
"callBackUrl": "<string>",
"seed": 42,
"watermark": "MyBrand",
"image_resolution": "2K",
"quality": "high",
"output_format": "png",
"max_images": 1,
"isEnhance": false,
"guidance_scale": 2.5,
"strength": 0.8,
"enable_safety_checker": true,
"upscale_factor": "2",
"font_inputs": [
{
"font_url": "https://example.com/fonts/custom-font.ttf",
"text": "Hello World"
}
],
"super_resolution_references": [
"https://example.com/reference1.jpg"
]
},
"provider": {
"allow_fallbacks": true,
"order": [
"OpenAI",
"Anthropic"
],
"only": [
"OpenAI",
"Google"
],
"ignore": [
"DeepInfra"
],
"sort": "price",
"max_price": {
"prompt": 10,
"completion": 20,
"image": 5,
"audio": 15,
"request": 1
}
},
"async": false,
"user": "user-123"
}
'import requests
url = "https://polza.ai/api/v1/media"
payload = {
"model": "seedream-3",
"input": {
"prompt": "Космический корабль в стиле киберпанк",
"aspect_ratio": "16:9",
"images": [
{
"type": "url",
"data": "https://example.com/image.png"
}
],
"callBackUrl": "<string>",
"seed": 42,
"watermark": "MyBrand",
"image_resolution": "2K",
"quality": "high",
"output_format": "png",
"max_images": 1,
"isEnhance": False,
"guidance_scale": 2.5,
"strength": 0.8,
"enable_safety_checker": True,
"upscale_factor": "2",
"font_inputs": [
{
"font_url": "https://example.com/fonts/custom-font.ttf",
"text": "Hello World"
}
],
"super_resolution_references": ["https://example.com/reference1.jpg"]
},
"provider": {
"allow_fallbacks": True,
"order": ["OpenAI", "Anthropic"],
"only": ["OpenAI", "Google"],
"ignore": ["DeepInfra"],
"sort": "price",
"max_price": {
"prompt": 10,
"completion": 20,
"image": 5,
"audio": 15,
"request": 1
}
},
"async": False,
"user": "user-123"
}
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({
model: 'seedream-3',
input: {
prompt: 'Космический корабль в стиле киберпанк',
aspect_ratio: '16:9',
images: [{type: 'url', data: 'https://example.com/image.png'}],
callBackUrl: '<string>',
seed: 42,
watermark: 'MyBrand',
image_resolution: '2K',
quality: 'high',
output_format: 'png',
max_images: 1,
isEnhance: false,
guidance_scale: 2.5,
strength: 0.8,
enable_safety_checker: true,
upscale_factor: '2',
font_inputs: [{font_url: 'https://example.com/fonts/custom-font.ttf', text: 'Hello World'}],
super_resolution_references: ['https://example.com/reference1.jpg']
},
provider: {
allow_fallbacks: true,
order: ['OpenAI', 'Anthropic'],
only: ['OpenAI', 'Google'],
ignore: ['DeepInfra'],
sort: 'price',
max_price: {prompt: 10, completion: 20, image: 5, audio: 15, request: 1}
},
async: false,
user: 'user-123'
})
};
fetch('https://polza.ai/api/v1/media', 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://polza.ai/api/v1/media",
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' => 'seedream-3',
'input' => [
'prompt' => 'Космический корабль в стиле киберпанк',
'aspect_ratio' => '16:9',
'images' => [
[
'type' => 'url',
'data' => 'https://example.com/image.png'
]
],
'callBackUrl' => '<string>',
'seed' => 42,
'watermark' => 'MyBrand',
'image_resolution' => '2K',
'quality' => 'high',
'output_format' => 'png',
'max_images' => 1,
'isEnhance' => false,
'guidance_scale' => 2.5,
'strength' => 0.8,
'enable_safety_checker' => true,
'upscale_factor' => '2',
'font_inputs' => [
[
'font_url' => 'https://example.com/fonts/custom-font.ttf',
'text' => 'Hello World'
]
],
'super_resolution_references' => [
'https://example.com/reference1.jpg'
]
],
'provider' => [
'allow_fallbacks' => true,
'order' => [
'OpenAI',
'Anthropic'
],
'only' => [
'OpenAI',
'Google'
],
'ignore' => [
'DeepInfra'
],
'sort' => 'price',
'max_price' => [
'prompt' => 10,
'completion' => 20,
'image' => 5,
'audio' => 15,
'request' => 1
]
],
'async' => false,
'user' => 'user-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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://polza.ai/api/v1/media"
payload := strings.NewReader("{\n \"model\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\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://polza.ai/api/v1/media")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://polza.ai/api/v1/media")
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\": \"seedream-3\",\n \"input\": {\n \"prompt\": \"Космический корабль в стиле киберпанк\",\n \"aspect_ratio\": \"16:9\",\n \"images\": [\n {\n \"type\": \"url\",\n \"data\": \"https://example.com/image.png\"\n }\n ],\n \"callBackUrl\": \"<string>\",\n \"seed\": 42,\n \"watermark\": \"MyBrand\",\n \"image_resolution\": \"2K\",\n \"quality\": \"high\",\n \"output_format\": \"png\",\n \"max_images\": 1,\n \"isEnhance\": false,\n \"guidance_scale\": 2.5,\n \"strength\": 0.8,\n \"enable_safety_checker\": true,\n \"upscale_factor\": \"2\",\n \"font_inputs\": [\n {\n \"font_url\": \"https://example.com/fonts/custom-font.ttf\",\n \"text\": \"Hello World\"\n }\n ],\n \"super_resolution_references\": [\n \"https://example.com/reference1.jpg\"\n ]\n },\n \"provider\": {\n \"allow_fallbacks\": true,\n \"order\": [\n \"OpenAI\",\n \"Anthropic\"\n ],\n \"only\": [\n \"OpenAI\",\n \"Google\"\n ],\n \"ignore\": [\n \"DeepInfra\"\n ],\n \"sort\": \"price\",\n \"max_price\": {\n \"prompt\": 10,\n \"completion\": 20,\n \"image\": 5,\n \"audio\": 15,\n \"request\": 1\n }\n },\n \"async\": false,\n \"user\": \"user-123\"\n}"
response = http.request(request)
puts response.read_body{
"id": "gen_581761234567890123",
"object": "media.generation",
"status": "pending",
"created": 1703001234,
"model": "google/gemini-2.5-flash-image",
"completed_at": 1703001244,
"data": "<unknown>",
"usage": {
"input_units": 1,
"output_units": 1,
"duration_seconds": 5,
"input_tokens": 10,
"output_tokens": 0,
"total_tokens": 10,
"cost_rub": 1.5,
"cost": 1.5
},
"error": {
"code": "BAD_GATEWAY",
"message": "Ошибка генерации медиа контента"
},
"content": "Банан и яблоко — это фрукты.",
"reasoning_summary": "Preparing image generation prompt with camera settings...",
"warnings": [
"Параметр isEnhance не поддерживается OpenRouter и будет проигнорирован"
]
}О Media API
Универсальный эндпоинт для генерации медиа контента. Поддерживает различные модели и провайдеров через единый интерфейс.Общие параметры
| Параметр | Тип | Обязательный | Описание |
|---|---|---|---|
model | string | Да | ID модели для генерации |
input | object | Да | Параметры генерации (зависят от модели) |
async | boolean | Нет | Принудительный асинхронный режим |
user | string | Нет | Идентификатор конечного пользователя |
provider | object | Нет | Конфигурация роутинга по провайдерам |
Передача файлов (URL и base64)
Для моделей, поддерживающих image-to-image или video-to-video, медиа файлы передаются в массивеimages или videos. Каждый элемент — объект с полями:
| Поле | Тип | Описание |
|---|---|---|
type | "url" | "base64" | Формат данных |
data | string | URL файла или base64-строка (с data URI или без) |
Пример с base64
curl -X POST "https://polza.ai/api/v1/media" \
-H "Authorization: Bearer <POLZA_AI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "seedream-3",
"input": {
"prompt": "Сделай изображение ярче и добавь закат на фоне",
"images": [
{
"type": "base64",
"data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
}
]
}
}'
{
"model": "gpt-image-1",
"input": {
"prompt": "Объедини эти изображения в коллаж",
"images": [
{ "type": "url", "data": "https://example.com/photo1.png" },
{ "type": "base64", "data": "data:image/jpeg;base64,/9j/4AAQSkZJRg..." }
]
}
}
data:image/png;base64,...), так и без — просто строка base64.
Если провайдер не поддерживает base64 напрямую, файл автоматически загружается в хранилище и передаётся как URL.Типы контента
- Изображения (Nano Banana, Seedream, GPT Image и др.)
- Видео (Veo, Wan, Kling, Seedance, Sora и др.)
- Аудио — синтез речи (TTS) и распознавание речи (STT)
Хранение результатов
При генерации медиа контента Polza.ai автоматически:- Скачивает результат у AI провайдера на собственное хранилище
- Хранит файлы 7 дней для повторного доступа
- Раздаёт через CDN для быстрого доступа внутри России
PERMANENT.Руководства по моделям
Подробные примеры, параметры и особенности каждой модели — в руководствах:Видео
Изображения
Аудио
Ответ
Возвращает объект Media Status со статусомpending:
{
"id": "aig_abc123",
"object": "media.generation",
"status": "pending",
"created": 1703001244,
"model": "google/veo3"
}
Авторизации
API ключ передаётся в заголовке: Authorization: Bearer <POLZA_AI_API_KEY>
Тело
ID модели для генерации
"seedream-3"
Входные параметры генерации
- Изображение
- Видео
- Аудио (TTS)
- Музыка
Show child attributes
Show child attributes
Настройки роутинга провайдеров
Show child attributes
Show child attributes
Асинхронный режим генерации. При true возвращается taskId для опроса статуса
false
Уникальный идентификатор конечного пользователя для отслеживания и предотвращения злоупотреблений
"user-123"
Ответ
Уникальный идентификатор генерации
"gen_581761234567890123"
Тип объекта
"media.generation"
Статус генерации
pending, processing, completed, failed, cancelled "pending"
Временная метка создания (Unix timestamp)
1703001234
ID модели, которая генерирует контент
"google/gemini-2.5-flash-image"
Временная метка завершения (Unix timestamp)
1703001244
Данные сгенерированного контента
Информация об использовании ресурсов
Show child attributes
Show child attributes
Информация об ошибке (если failed)
Show child attributes
Show child attributes
Текстовый ответ модели (если вернула текст вместо/вместе с изображением)
"Банан и яблоко — это фрукты."
Краткое резюме рассуждений модели
"Preparing image generation prompt with camera settings..."
Предупреждения (неподдерживаемые параметры и т.д.)
[
"Параметр isEnhance не поддерживается OpenRouter и будет проигнорирован"
]Была ли эта страница полезной?