Медиа
Медиа модели
Каталог моделей генерации медиа и схемы входных параметров
GET
/
v1
/
media
/
models
Получить список media models
curl --request GET \
--url https://speshu.ai/api/v1/media/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://speshu.ai/api/v1/media/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://speshu.ai/api/v1/media/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{
"object": "list",
"data": [
{
"id": "flux-2/pro-text-to-image",
"object": "model",
"media_type": "image",
"input_schema": {},
"owned_by": "kie",
"pricing": {
"currency": "RUB",
"type": "tiered"
}
}
]
}Эндпоинт возвращает доступные модели для изображений, видео, музыки и аудио. У каждой модели есть
input_schema. Используйте её как источник правды для поля input.
Пример
curl "https://speshu.ai/api/v1/media/models" \
-H "Authorization: Bearer <SPESHU_AI_API_KEY>"
Ответ
{
"object": "list",
"data": [
{
"id": "flux-2/pro-text-to-image",
"object": "model",
"owned_by": "speshu",
"media_type": "image",
"pricing": {
"currency": "RUB",
"type": "tiered",
"tiers": [
{ "params": { "resolution": "1K" }, "price": "15.00" }
]
},
"input_schema": {
"type": "object",
"properties": {
"prompt": { "type": "string" },
"aspect_ratio": { "type": "string" },
"resolution": { "type": "string" }
},
"required": ["prompt", "aspect_ratio", "resolution"]
}
}
]
}
Поля модели
| Поле | Описание |
|---|---|
id | ID модели для POST /async/media/tasks. |
owned_by | Провайдер или владелец модели. |
media_type | Тип медиа: image, video, music или audio. |
pricing | Информация о стоимости. |
input_schema | JSON Schema для поля input. |
Категории
Изображения
Text-to-image, image-to-image, редактирование, апскейл и фон.
Видео
Text-to-video, image-to-video, motion control, extend и upscale.
Музыка и аудио
TTS, STT, sound effects и генерация музыки.
⌘I
Получить список media models
curl --request GET \
--url https://speshu.ai/api/v1/media/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://speshu.ai/api/v1/media/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/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://speshu.ai/api/v1/media/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://speshu.ai/api/v1/media/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{
"object": "list",
"data": [
{
"id": "flux-2/pro-text-to-image",
"object": "model",
"media_type": "image",
"input_schema": {},
"owned_by": "kie",
"pricing": {
"currency": "RUB",
"type": "tiered"
}
}
]
}