Skip to main content
POST
https://api.apimart.ai
/
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": "sora-2-preview",
    "prompt": "A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist",
    "duration": 8,
    "aspect_ratio": "landscape",
    "image_urls": ["https://example.com/reference-image.jpg"]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KG1Q38PBV1RJ2C033ZS9RYF7"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/videos/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "sora-2-preview",
    "prompt": "A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist",
    "duration": 8,
    "aspect_ratio": "landscape",
    "image_urls": ["https://example.com/reference-image.jpg"]
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KG1Q38PBV1RJ2C033ZS9RYF7"
    }
  ]
}

Authorizations

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

Body

model
string
default:"sora-2-preview"
required
Video generation model nameSupported models:
  • sora-2-preview - Standard version
  • sora-2-pro-preview - Pro version (supports higher resolution)
Example: "sora-2-preview" or "sora-2-pro-preview"
prompt
string
required
Text description for video generationDescribe the video content you want to generate in detail, including scenes, actions, atmosphere, etc.Example: "A majestic waterfall cascading down rocky cliffs, creating a beautiful rainbow in the mist"
duration
integer
default:"4"
Video duration (seconds)Only supports the following duration values:
  • 4 - 4 second video
  • 8 - 8 second video
  • 12 - 12 second video
Other duration values will return an error.Example: 8
aspect_ratio
string
default:"landscape"
Video aspect ratioSupported formats:
  • landscape or 16:9 - Landscape (16:9)
  • portrait or 9:16 - Portrait (9:16)
Does not support square (1:1) videos.Example: "landscape"
resolution
string
default:"standard"
Video resolution (only supported by sora-2-pro-preview)Supported values:
  • standard - Standard resolution (Portrait 720x1280, Landscape 1280x720)
  • high - High resolution (Portrait 1024x1792, Landscape 1792x1024)
Example: "high"
image_urls
array<url>
Reference image URL array for image-to-videoImportant limitation: Only the first image is used as referenceWhen using reference images, the API will automatically detect the image aspect ratio and override the user-provided aspect_ratio parameter.Solutions:
  • To precisely control the output video aspect ratio, do not use reference images (pure text-to-video)
  • If you must use reference images, ensure the reference image itself has the target aspect ratio
Example: ["https://example.com/reference-image.jpg"]Limitations:
  • Maximum file size: 10MB
  • Supported formats: .jpeg, .jpg, .png, .webp

Response

code
integer
Response status code, 200 on success
data
array
Response data array

Pricing

  • Billing method: Per video duration (seconds)
  • Specific pricing: Please refer to Pricing Page