Videos
curl --request POST \
--url https://api.acedata.cloud/grok/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A cinematic shot of a kitten chasing a butterfly in a sunlit garden",
"model": "grok-imagine-video",
"image_url": "https://cdn.acedata.cloud/5hmkdg.jpg",
"reference_image_urls": [
"<string>"
],
"aspect_ratio": "16:9",
"resolution": "480p",
"duration": 8,
"callback_url": "<string>",
"async": true
}
'import requests
url = "https://api.acedata.cloud/grok/videos"
payload = {
"prompt": "A cinematic shot of a kitten chasing a butterfly in a sunlit garden",
"model": "grok-imagine-video",
"image_url": "https://cdn.acedata.cloud/5hmkdg.jpg",
"reference_image_urls": ["<string>"],
"aspect_ratio": "16:9",
"resolution": "480p",
"duration": 8,
"callback_url": "<string>",
"async": True
}
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: 'A cinematic shot of a kitten chasing a butterfly in a sunlit garden',
model: 'grok-imagine-video',
image_url: 'https://cdn.acedata.cloud/5hmkdg.jpg',
reference_image_urls: ['<string>'],
aspect_ratio: '16:9',
resolution: '480p',
duration: 8,
callback_url: '<string>',
async: true
})
};
fetch('https://api.acedata.cloud/grok/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"task_id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"trace_id": "fb751e1e-4705-49ea-9fd4-5024b7865ea2",
"data": [
{
"id": "grok-imagine-video:41eb9a5f-3b2d-4d1e-9f5a-6c2f1a0b9e77",
"video_url": "https://cdn.acedata.cloud/c8cbf53aa0.mp4",
"state": "succeeded"
}
]
}{
"error": {
"code": "bad_request",
"message": "prompt is required for text-to-video."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "used_up",
"message": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests, please try again later."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}API Reference
Videos
Generate a video with Grok Imagine (xAI) from a text prompt, an input image, and optional reference images.
POST
/
grok
/
videos
Videos
curl --request POST \
--url https://api.acedata.cloud/grok/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A cinematic shot of a kitten chasing a butterfly in a sunlit garden",
"model": "grok-imagine-video",
"image_url": "https://cdn.acedata.cloud/5hmkdg.jpg",
"reference_image_urls": [
"<string>"
],
"aspect_ratio": "16:9",
"resolution": "480p",
"duration": 8,
"callback_url": "<string>",
"async": true
}
'import requests
url = "https://api.acedata.cloud/grok/videos"
payload = {
"prompt": "A cinematic shot of a kitten chasing a butterfly in a sunlit garden",
"model": "grok-imagine-video",
"image_url": "https://cdn.acedata.cloud/5hmkdg.jpg",
"reference_image_urls": ["<string>"],
"aspect_ratio": "16:9",
"resolution": "480p",
"duration": 8,
"callback_url": "<string>",
"async": True
}
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: 'A cinematic shot of a kitten chasing a butterfly in a sunlit garden',
model: 'grok-imagine-video',
image_url: 'https://cdn.acedata.cloud/5hmkdg.jpg',
reference_image_urls: ['<string>'],
aspect_ratio: '16:9',
resolution: '480p',
duration: 8,
callback_url: '<string>',
async: true
})
};
fetch('https://api.acedata.cloud/grok/videos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"task_id": "b8976e18-32dc-4718-9ed8-1ea090fcb6ea",
"trace_id": "fb751e1e-4705-49ea-9fd4-5024b7865ea2",
"data": [
{
"id": "grok-imagine-video:41eb9a5f-3b2d-4d1e-9f5a-6c2f1a0b9e77",
"video_url": "https://cdn.acedata.cloud/c8cbf53aa0.mp4",
"state": "succeeded"
}
]
}{
"error": {
"code": "bad_request",
"message": "prompt is required for text-to-video."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "invalid_token",
"message": "The specified token is invalid or wrong."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "used_up",
"message": "Your balance is not sufficient for current request, please buy more in Ace Data Cloud."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "too_many_requests",
"message": "Too many requests, please try again later."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}{
"error": {
"code": "api_error",
"message": "Internal server error."
},
"trace_id": "2efa9340-b21b-4e26-9e14-4aac95f343ab"
}授權
API token from https://platform.acedata.cloud
標頭
Grok Videos Param Accept
可用選項:
application/json, application/x-ndjson 主體
application/json
Grok Videos Prompt
範例:
"A cinematic shot of a kitten chasing a butterfly in a sunlit garden"
Grok Videos Model
可用選項:
grok-imagine-video, grok-imagine-video-1.5-preview 範例:
"grok-imagine-video"
Grok Videos Image Url
範例:
"https://cdn.acedata.cloud/5hmkdg.jpg"
Grok Videos Reference Image Urls
Grok Videos Aspect Ratio
可用選項:
1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 範例:
"16:9"
Grok Videos Resolution
可用選項:
480p, 720p, 1080p 範例:
"480p"
Grok Videos Duration
必填範圍:
1 <= x <= 30範例:
8
Grok Videos Callback Url
Grok Videos Async

