Skip to main content
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": "grok-imagine-1.0-video-apimart",
    "prompt": "A dog running on the beach, sunny weather, slow motion",
    "size": "16:9",
    "duration": 6,
    "quality": "720p"
  }'
{
  "code": 200,
  "data": {
    "id": "task_01JNXXXXXXXXXXXXXXXXXX",
    "status": "submitted",
    "progress": 0,
    "created": 1710000000,
    "type": "video"
  }
}
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.0-video-apimart",
    "prompt": "A dog running on the beach, sunny weather, slow motion",
    "size": "16:9",
    "duration": 6,
    "quality": "720p"
  }'
{
  "code": 200,
  "data": {
    "id": "task_01JNXXXXXXXXXXXXXXXXXX",
    "status": "submitted",
    "progress": 0,
    "created": 1710000000,
    "type": "video"
  }
}

Authorizations

Authorization
string
required
All APIs require Bearer Token authenticationGet API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"grok-imagine-1.0-video-apimart"
required
Video generation model nameSupported models:
  • grok-imagine-1.0-video-apimart - Grok Video Generation
Example: "grok-imagine-1.0-video-apimart"
prompt
string
required
Video content description, supports multiple languages
size
string
default:"16:9"
Video sizeOptions:
  • 16:9 - Landscape (default)
  • 9:16 - Portrait
  • 1:1 - Square
  • 3:2 - Landscape
  • 2:3 - Portrait
duration
integer
default:6
Video duration (seconds)Range: 6-30 (minimum 6 seconds, maximum 30 seconds)⚠️ Note: Must be a plain number (e.g. 6), do not add quotes, otherwise an error will occur
quality
string
default:"480p"
Video qualityOptions:
  • 480p - Standard definition (default)
  • 720p - High definition
image_urls
string[]
Reference image URL array for image-to-video mode. When provided, the system will use the first image as a reference.
After uploading a reference image, the aspect ratio will automatically match the reference image’s aspect ratio.

Response

code
integer
Response status code
data
object
Response data object
Query Task ResultVideo generation is an async task. After submission, an id (i.e. task_id) will be returned. Use the Get Task Status endpoint to query generation progress and results.

Use Cases

Case 1: Text-to-Video

{
  "model": "grok-imagine-1.0-video-apimart",
  "prompt": "A dog running on the beach, sunny weather, slow motion",
  "size": "16:9",
  "duration": 6
}

Case 2: Image-to-Video

{
  "model": "grok-imagine-1.0-video-apimart",
  "prompt": "Bring the scene to life with natural dynamic effects",
  "image_urls": ["https://example.com/start.png"],
  "size": "16:9",
  "duration": 10,
  "quality": "720p"
}