curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "wan3.0-video",
prompt: "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
resolution: "720P",
size: "16:9",
duration: 5,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Ungültige Anfrageparameter",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentifizierung fehlgeschlagen, bitte API-Schlüssel prüfen",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Unzureichendes Kontoguthaben, bitte aufladen und erneut versuchen",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Zu viele Anfragen, bitte später erneut versuchen",
"type": "rate_limit_error"
}
}
Wan3.0
Wan3.0 Videogenerierung
- All-in-one-Referenzvideomodell Alibaba Cloud Wanxiang 3.0 (einheitlicher Einstieg)
- Text-to-Video / erstes Einzelbild / erstes+letztes Einzelbild / multimodale Referenz / Datei- oder Link-Referenz
- Auflösung 480P / 720P / 1080P, Dauer 2–30 Sekunden
- Unterstützt Bilder, Video, Audio, Dokumente und öffentliche Webseiten als Referenzen
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "wan3.0-video",
prompt: "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
resolution: "720P",
size: "16:9",
duration: 5,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Ungültige Anfrageparameter",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentifizierung fehlgeschlagen, bitte API-Schlüssel prüfen",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Unzureichendes Kontoguthaben, bitte aufladen und erneut versuchen",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Zu viele Anfragen, bitte später erneut versuchen",
"type": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "wan3.0-video",
prompt: "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
resolution: "720P",
size: "16:9",
duration: 5,
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop",
"resolution": "720P",
"size": "16:9",
"duration": 5,
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Ungültige Anfrageparameter",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentifizierung fehlgeschlagen, bitte API-Schlüssel prüfen",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Unzureichendes Kontoguthaben, bitte aufladen und erneut versuchen",
"type": "payment_required"
}
}
{
"error": {
"code": 429,
"message": "Zu viele Anfragen, bitte später erneut versuchen",
"type": "rate_limit_error"
}
}
Autorisierung
string
erforderlich
Alle Endpunkte erfordern eine Bearer-Token-AuthentifizierungAPI-Key über die Seite zur API-Key-Verwaltung abrufen:
Authorization: Bearer YOUR_API_KEY
Generierungsmodi
Modellname ist festwan3.0-video. Der Modus ergibt sich aus den Anfragefeldern:
| Modus | Typische Eingaben |
|---|---|
| Text-to-Video | nur prompt |
| Erstes-Einzelbild-Video | ein Eintrag in image_urls (Frame-Familie) |
| Erstes + letztes Einzelbild | zwei Einträge in image_urls oder image_with_roles mit first_frame / last_frame |
| Referenzvideo | Referenzbilder / Videos / Audio; Prompt kann Labels im Stil „图1 / 视频1 / 音频1“ nutzen |
| Datei- / Seitenreferenz | file_url oder link_url (prompt optional) |
Anfrageparameter
Grundlagen
string
erforderlich
Fester Wert:
wan3.0-videoboolean
Standard:"false"
Legt fest, ob der Inhalt vor dem Absenden des Videoauftrags moderiert wird.
true: Prompts und Eingabebilder mitomni-moderation-latestprüfenfalseoder nicht angegeben: keine Moderationsanfrage und damit keine zusätzlichen Moderationskosten oder Verzögerung (Standard)
string
Textbeschreibung. Erforderlich, sofern keine Medienfelder angegeben sind (mindestens Prompt oder Medien).
- Max. 20.000 Zeichen; Überschuss wird ohne Fehler automatisch abgeschnitten
- Im Referenzmodus mit „图N / 视频N / 音频N“ auf Assets verweisen; Indizes folgen der Reihenfolge innerhalb jedes Medientyps
string
Standard:"1080P"
Ausgabeauflösung (Groß-/Kleinschreibung egal)
480P720P1080P(Standard, höchster Preis)
Ohne
resolution wird mit 1080P abgerechnet. Bei Kostenbewusstsein explizit 480P oder 720P übergeben.string
Standard:"adaptive"
Seitenverhältnis.
aspect_ratio wird ebenfalls akzeptiert.adaptive(Standard)16:9/4:3/1:1/3:4/9:16
integer
Standard:"5"
Dauer in Sekunden:
2–30: feste Ausgabelänge (Standard5)-1: Dauer bestimmt das Modell
Bei Referenzvideo-Eingabe: Gesamtdauer der Eingabevideos + Ausgabe ≤ 30 Sekunden. Bei
duration: -1 muss die vom Modell gewählte Länge dieses Limit ebenfalls einhalten.boolean
Standard:"true"
Ob die Ausgabe eine Audiospur enthält. Standard
true. Preis ist mit und ohne Audio gleich.integer
Zufalls-Seed im Bereich
[0, 2147483647]boolean
Standard:"false"
Ob ein Wasserzeichen hinzugefügt wird. Standard
falsestring
Wie bloße
image_urls klassifiziert werden:frame— Familie erstes/letztes Einzelbildreference— Referenzfamilie
Medieneingaben
string[]
Array von Bild-URLs. Rollenzuweisung folgt den gegenseitigen Ausschlussregeln.Öffentliche URL oder Base64 (
data:image/png;base64,...).object[]
Bilder mit expliziten Rollen. Jedes Element:
url: Bildadresserole:first_frame/last_frame/reference_image(übliche Aliase akzeptiert)
string[]
Referenzvideos, bis zu 5 Clips; je 1–15 s, gesamt ≤ 15 s
string[]
Referenzaudio, bis zu 5 Clips; je 1–15 s, gesamt ≤ 15 s
string
Einzelnes Referenzaudio (Einzelwertform von
audio_urls)string
URL des Referenzdokuments, höchstens 1. Nicht zusammen mit
link_url.Formate u. a. docx / doc / xlsx / xls / pptx / ppt / pdf / txt / key / pages / numbers / md, ≤100 MB, ≤50 Seiten.string
Öffentliche Webseiten-URL, höchstens 1. Nur Seiten ohne Login. Nicht zusammen mit
file_url.Gegenseitiger Ausschluss von Medienfamilien
Medien gehören zu einer von zwei Familien und dürfen nicht gemischt werden (Validierung vor Submit → 400, kein Task, keine Abrechnung):| Familie | Mitglieder | Bedeutung |
|---|---|---|
| Frame-Familie | first_frame, last_frame | Strenges erstes / letztes Einzelbild des Videos |
| Referenzfamilie | reference_image, reference_video, reference_audio, file, link | Modell interpretiert Inhalte frei |
Zuordnung bloßer image_urls
- Wenn
generation_typegesetzt → diesen verwenden (frame/reference) - Sonst, wenn die Anfrage bereits Eingaben der Referenzfamilie hat (
video_urls/audio_urls/audio_url/file_url/link_url) → alsreference_imagebehandeln - Sonst → Frame-Familie: erstes Element
first_frame, zweiteslast_frame(wie beiwan2.7)
image_with_roles verwenden.
Medienlimits und Formate
| Typ | Limits |
|---|---|
| Erstes / letztes Einzelbild | je ≤ 1 |
| Referenzbilder | ≤ 10 |
| Referenzvideo | ≤ 5 Clips, je 1–15 s, gesamt ≤15 s; mp4/mov; Kante 240–4096 px, Seitenverhältnis ≤8:1, ≤100 MB |
| Referenzaudio | ≤ 5 Clips, je 1–15 s, gesamt ≤15 s; wav/mp3; ≤15 MB |
| Bilder | JPEG/JPG/PNG (kein Alpha) / BMP / WEBP; Kante 240–8000 px, Seitenverhältnis ≤8:1, ≤20 MB |
| Dokumente | ≤100 MB, ≤50 Seiten |
| Webseiten | Öffentliche, login-freie URLs |
Anfragebeispiele
Text-to-Video
{
"model": "wan3.0-video",
"prompt": "A kitten runs across a moonlit rooftop, neon lights of the city flicker in the distance, cinematic quality, smooth camera move.",
"resolution": "720P",
"size": "16:9",
"duration": 5
}
Erstes-Einzelbild-Video
{
"model": "wan3.0-video",
"prompt": "The person in the frame starts freestyle rapping, camera slowly pushes in",
"image_urls": ["https://example.com/first.png"],
"resolution": "720P",
"duration": 5
}
Erstes + letztes Einzelbild
{
"model": "wan3.0-video",
"prompt": "Smile gradually becomes laughter, background light shifts from cool to warm",
"image_urls": [
"https://example.com/first.png",
"https://example.com/last.jpg"
],
"duration": 5
}
image_with_roles:
{
"model": "wan3.0-video",
"prompt": "Smile gradually becomes laughter",
"image_with_roles": [
{"url": "https://example.com/first.png", "role": "first_frame"},
{"url": "https://example.com/last.jpg", "role": "last_frame"}
],
"duration": 5
}
Multimodale Referenz
{
"model": "wan3.0-video",
"prompt": "视频1抱着图1,在图3的椅子上弹奏一支舒缓的乡村民谣,并说道:\"今天的阳光真好。\"",
"generation_type": "reference",
"image_urls": [
"https://example.com/object1.jpg",
"https://example.com/object2.png",
"https://example.com/chair.png"
],
"video_urls": ["https://example.com/role.mp4"],
"resolution": "480P",
"duration": 5
}
Bei vorhandenenvideo_urlswerden bloßeimage_urlsautomatisch als Referenzbilder klassifiziert;generation_type: "reference"macht die Absicht klarer.
Datei-Referenzvideo
prompt kann weggelassen werden; die Generierung wird vom Dokumentinhalt gesteuert:
{
"model": "wan3.0-video",
"file_url": "https://example.com/glass.pptx",
"resolution": "480P",
"duration": 10
}
Webseiten-Referenzvideo
{
"model": "wan3.0-video",
"prompt": "Turn this article into a short educational video",
"link_url": "https://example.com/article/123",
"duration": 15
}
Abrechnung
Pro Sekunde × Auflösung (an offizielle Listenpreise angelehnt). Audio an/aus ändert den Preis nicht:| Auflösung | Einzelpreis | 5 s | 30 s |
|---|---|---|---|
| 480P | ¥0.30 / s | ¥1.50 | ¥9.00 |
| 720P | ¥0.60 / s | ¥3.00 | ¥18.00 |
| 1080P | ¥1.20 / s | ¥6.00 | ¥36.00 |
- Standard ist 1080P (teuerste Stufe); bei Kostenbewusstsein
480P/720Pübergeben - Abrechnungssekunden: bei
2–30die angeforderteduration; bei-1die tatsächlichen Ausgabesekunden audio: true/falsebeeinflusst den Preis nicht
Limits und Hinweise
| Punkt | Hinweise |
|---|---|
| Dauer | Ganzzahl 2–30 oder -1 (Modell bestimmt die Dauer) |
| Mit Videoeingabe | Gesamtdauer Eingabevideo + Ausgabedauer ≤ 30 s |
| Latenz | Typisch 1–5 Minuten; länger bei langen Clips |
| Ergebnis-URL | Nach Erfolg auf die Plattform-CDN gespiegelt für langfristigen Zugriff |
| Prompt | ≤20.000 Zeichen; Überschuss wird abgeschnitten |
Häufige Fehler
Alle sind synchrone 400 (kein Task, keine Abrechnung):| Fall | Vorgehen |
|---|---|
| Mischen von Frame- und Referenzfamilie | Eine Familie über generation_type wählen oder Rollen mit image_with_roles setzen |
Sowohl file_url als auch link_url | Eines wählen |
Ungültiges duration | Nur 2–30 oder -1 |
| Nicht unterstützte Auflösung (z. B. 4K) | Nur 480P / 720P / 1080P |
| Mehr als 10 Referenzbilder | Auf ≤10 reduzieren |
Leerer prompt und leere Medien | Mindestens eines angeben |
Response
integer
Statuscode; 200 bei Erfolg
array
Ergebnisse abfragenDie Videogenerierung ist asynchron. Task-Status abrufen oder
GET /v1/videos/generations/{task_id} pollen.Empfohlenes Intervall 5–10 Sekunden; Generierung dauert typisch 1–5 Minuten. Bei Erfolg URLs in result.videos verwenden.