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.5-video-apimart",
    "prompt": "A dog running on the beach, sunny weather, slow motion",
    "size": "16:9",
    "duration": 6,
    "quality": "720p"
  }'
{
  "code": 200,
  "data": [
    {
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
      "status": "submitted"
    }
  ]
}
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-apimart",
    "prompt": "A dog running on the beach, sunny weather, slow motion",
    "size": "16:9",
    "duration": 6,
    "quality": "720p"
  }'
{
  "code": 200,
  "data": [
    {
      "task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
      "status": "submitted"
    }
  ]
}

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

Request Parameters

model
string
default:"grok-imagine-1.5-video-apimart"
required
Video generation model nameSupported models:
  • grok-imagine-1.5-video-apimart - Grok Video Generation
Example: "grok-imagine-1.5-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[]
List of reference image URLsLimits:
  • Maximum 7 images
  • Must be publicly accessible URLs
  • Base64 format is not supported
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 array
Query Task ResultVideo generation is an async task. After submission, a 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.5-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.5-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"
}