الانتقال إلى المحتوى الرئيسي
POST
/
grok
/
videos
Grok 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-1.5-fast",
  "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-1.5-fast",
    "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-1.5-fast',
    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-1.5-fast: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"
}

التفويضات

Authorization
string
header
مطلوب

الترويسات

accept
enum<string>

Grok Videos Param Accept

الخيارات المتاحة:
application/json,
application/x-ndjson

الجسم

application/json
prompt
string

Grok Videos Prompt

مثال:

"A cinematic shot of a kitten chasing a butterfly in a sunlit garden"

model
enum<string>
افتراضي:grok-imagine-video-1.5-fast

Grok Videos Model

الخيارات المتاحة:
grok-imagine-video-1.5-fast,
grok-imagine-video-1.5
مثال:

"grok-imagine-video-1.5-fast"

image_url
string

Grok Videos Image Url

مثال:

"https://cdn.acedata.cloud/5hmkdg.jpg"

reference_image_urls
string[]

Grok Videos Reference Image Urls

aspect_ratio
enum<string>

Grok Videos Aspect Ratio

الخيارات المتاحة:
1:1,
16:9,
9:16,
4:3,
3:4,
3:2,
2:3
مثال:

"16:9"

resolution
enum<string>
افتراضي:480p

Grok Videos Resolution

الخيارات المتاحة:
480p,
720p,
1080p
مثال:

"480p"

duration
integer
افتراضي:8

Grok Videos Duration

النطاق المطلوب: 1 <= x <= 30
مثال:

8

callback_url
string

Grok Videos Callback Url

async
boolean

Grok Videos Async

الاستجابة

Grok Videos Response 200

success
boolean

Grok Videos Response 200 Success

task_id
string

Grok Videos Response 200 Task Id

trace_id
string

Grok Videos Response 200 Trace Id

data
object[]

Grok Videos Response 200 Data