# model auf "grok-imagine-1.5-video-ext" setzen
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
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: "grok-imagine-1.5-video-ext",
prompt: "A dog running on the beach, sunny weather, slow motion",
size: "16:9",
duration: 6,
resolution: "720p"
};
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));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "Access forbidden, you do not have permission to access this resource",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please try again later",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "Bad gateway, server temporarily unavailable",
"type": "bad_gateway"
}
}
Grok Imagine
Grok Imagine 1.5 Videogenerierung
- Asynchroner Verarbeitungsmodus, gibt eine Task-ID für nachfolgende Abfragen zurück
- Hochwertige KI-Videogenerierung, unterstützt Text-to-Video und Image-to-Video
- Flexible Optionen für Seitenverhältnis und Qualität für verschiedene kreative Anforderungen
POST
/
v1
/
videos
/
generations
# model auf "grok-imagine-1.5-video-ext" setzen
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
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: "grok-imagine-1.5-video-ext",
prompt: "A dog running on the beach, sunny weather, slow motion",
size: "16:9",
duration: 6,
resolution: "720p"
};
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));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "Access forbidden, you do not have permission to access this resource",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please try again later",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "Bad gateway, server temporarily unavailable",
"type": "bad_gateway"
}
}
Modellname: Verwenden Sie für diesen Endpunkt
grok-imagine-1.5-video-ext.# model auf "grok-imagine-1.5-video-ext" setzen
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
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: "grok-imagine-1.5-video-ext",
prompt: "A dog running on the beach, sunny weather, slow motion",
size: "16:9",
duration: 6,
resolution: "720p"
};
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));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "Access forbidden, you do not have permission to access this resource",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "Internal server error, please try again later",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "Bad gateway, server temporarily unavailable",
"type": "bad_gateway"
}
}
Autorisierungen
string
erforderlich
Alle APIs erfordern eine Authentifizierung per Bearer TokenAPI-Schlüssel abrufen:Besuchen Sie die Seite zur API-Schlüsselverwaltung, um Ihren API-Schlüssel zu erhaltenFügen Sie ihn dem Anfrage-Header hinzu:
Authorization: Bearer YOUR_API_KEY
Anfrageparameter
string
Standard:"grok-imagine-1.5-video-ext"
erforderlich
Name des VideogenerierungsmodellsUnterstützte Modelle:
grok-imagine-1.5-video-ext— Grok-Videogenerierung
"grok-imagine-1.5-video-ext"Verwenden Sie in neuen Anfragen einheitlich
grok-imagine-1.5-video-ext.boolean
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
erforderlich
Beschreibung des Videoinhalts, unterstützt mehrere Sprachen
string
Standard:"16:9"
VideogrößeOptionen:
16:9— Querformat (Standard)9:16— Hochformat1:1— Quadrat3:2— Querformat2:3— Hochformat
integer
Standard:6
Videodauer (Sekunden)Bereich: 6–15 (mindestens 6 Sekunden, maximal 15 Sekunden)⚠️ Hinweis: Muss eine einfache Zahl sein (z. B.
6), keine Anführungszeichen, sonst tritt ein Fehler aufstring
Standard:"480p"
VideoqualitätOptionen:
480p— Standardauflösung (Standard)720p— Hohe Auflösung
string[]
Liste der Referenzbild-URLsEinschränkungen:
- Maximal 7 Bilder
- Müssen öffentlich zugängliche URLs sein
- Base64-Format wird nicht unterstützt
Nach dem Hochladen eines Referenzbildes wird das Seitenverhältnis automatisch an das Seitenverhältnis des Referenzbildes angepasst.
Antwort
integer
Statuscode der Antwort
object[]
Aufgabenergebnis abfragenDie Videogenerierung ist eine asynchrone Aufgabe. Nach der Einreichung wird eine
task_id zurückgegeben. Verwenden Sie den Endpunkt Aufgabenstatus abrufen, um Fortschritt und Ergebnis abzufragen.Anwendungsfälle
Fall 1: Text-zu-Video
{
"model": "grok-imagine-1.5-video-ext",
"prompt": "A dog running on the beach, sunny weather, slow motion",
"size": "16:9",
"duration": 6
}
Fall 2: Bild-zu-Video
{
"model": "grok-imagine-1.5-video-ext",
"prompt": "Bring the scene to life with natural dynamic effects",
"image_urls": ["https://example.com/start.png"],
"size": "16:9",
"duration": 10,
"resolution": "720p"
}