APIKO
Video Series

Grok Imagine Video 1.5 API

  • One model for text-to-video with only prompt, and image-to-video with first_image_url and an optional last_image_url. Reference images, videos and audio are not accepted.
  • Videos of 1 to 15 seconds at 480p, 720p or 1080p, 24 fps.
  • Every video comes with sound effects, ambience and speech generated with the picture; audio cannot be turned off, and generate_audio: false is rejected before any charge. Describe the sound you want in the prompt.
  • Asynchronous: POST /v1/videos returns a task id; poll GET /v1/videos/{id} or GET /v1/tasks/{id} until the task completes, then download /v1/videos/{id}/content.
  • Result links are APIKO-signed and kept for 24 hours; download anything you need to keep.
  • Billing
    • Charged per output second at the price of the chosen resolution, sound included; prices are on the model page.
    • Billed seconds = the duration you request. First and last frames carry no extra charge.
    • A task that fails is refunded in full.
POST
/
v1
/
videos
TASK_ID=$(curl https://api.apiko.app/v1/videos \
  -H "Authorization: Bearer $APIKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine-video-1.5",
  "duration": 8,
  "resolution": "480p",
  "aspect_ratio": "16:9",
  "prompt": "A slow tracking shot beside a sea turtle gliding over a coral reef as sunlight filters through the water. Sound: gentle underwater ambience."
}' | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')

while :; do
  TASK=$(curl -s https://api.apiko.app/v1/videos/$TASK_ID \
    -H "Authorization: Bearer $APIKO_API_KEY")
  printf '%s\n' "$TASK"
  printf '%s' "$TASK" | grep -qE '"status": *"(completed|failed)"|"error": *\{' && break
  sleep 5
done
{
  "id": "task_abc123",
  "object": "video",
  "model": "grok-imagine-video-1.5",
  "status": "completed",
  "progress": 100,
  "video_url": "https://api.apiko.app/v1/tasks/task_abc123/artifacts/video/content?access=…"
}

Authorizations

Authorization
stringrequired
All requests use Bearer authentication: Authorization: Bearer <API_KEY>.
Create a key in Console → API Keys.
Routes
string
  • POST /v1/videos — create a video task
  • GET /v1/videos/{id} — query the task and read video_url
  • GET /v1/tasks/{id} — query the same task in the shared task format

Body

application/json
model
stringdefault:grok-imagine-video-1.5required
Use this exact public model id.
Available options: grok-imagine-video-1.5
Example:"grok-imagine-video-1.5"
prompt
stringrequired
Video description: camera move first, then what the subject does and what you hear.
  • Up to 20,000 characters. Describe the camera move first, then what the subject does and what you hear.
  • With a first frame, skip what the image already shows and describe the motion.
Minimum length: 1
Maximum length: 20000
Example:"A paper boat drifting across a calm lake at sunrise"
aspect_ratio
enum<string>default:16:9
Ignored with a first frame: the video follows the image's shape.
Applies to text-to-video. With a first frame the video follows the image's shape and this field is ignored.
Available options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3
Example:"16:9"
resolution
enum<string>default:480p
1080p is only supported for text-to-video or a single image used as the first frame. Use 480p or 720p for first and last frames.
  • 480p is the default and the cheapest; 720p and 1080p cost more per second.
  • Each resolution has its own per-second price; see the model page.
Available options: 480p, 720p, 1080p
Example:"480p"
duration
integerdefault:8
Output length in seconds; OpenAI's seconds field is accepted instead.
  • Length of the output video in seconds: any integer from 1 to 15; 8 when omitted.
  • seconds (a string such as "10", as in the OpenAI video API) is accepted as an alias; send one of the two.
Range: 1 ≤ x ≤ 15
Example:8
generate_audio
booleandefault:true
Sound effects, ambience and dialogue are always generated with the picture; false is refused.
Always true: the model always generates sound. Omit the field or send true.
Available options: true
Example:true
first_image_url
string<uri>
First frame (image to video).
  • Used as the first frame of the video (image-to-video).
  • Public HTTPS URLs only; files and base64 are not accepted.
Example:"https://example.com/first-frame.png"
last_image_url
string<uri>
Last frame. Requires first_image_url and a resolution of 480p or 720p.
  • Used as the last frame of the video; the model fills in the motion between the two.
  • Public HTTPS URLs only; files and base64 are not accepted.
Example:"https://example.com/last-frame.png"
callback_url
string<uri>
Optional public HTTPS URL notified when the task finishes.
  • When the task finishes, APIKO POSTs the same JSON as GET /v1/tasks/{id} with header X-Apiko-Task-Id, retrying up to 3 times.
  • Callbacks are not signed: re-fetch the task to confirm the result.
Example:"https://your-domain.com/webhooks/apiko-task"

Response

200 - application/json

Charged when the request is accepted; a task that ends in failed is refunded in full.

id
string
Video task id. Query it with GET /v1/videos/{id} or GET /v1/tasks/{id}.
Example:"task_abc123"
status
enum<string>
Task status. Poll every 5–10 seconds until it is completed or failed.
Available options: queued, in_progress, completed, failed
progress
integer
Progress from 0 to 100.
video_url
string<uri>
Present on GET /v1/videos/{id} when the task is completed: an APIKO-signed link kept for 24 hours. GET /v1/tasks/{id} returns the same link as data[0].url.

Errors

application/json

Errors use the shape { "error": { "message", "type", "param", "code" } }; most messages end with a request id to quote when you contact support.

400
error
Invalid request. Fix the request instead of retrying it; it is not charged.
  • A field this page does not list, e.g. seed is not supported.
  • A value outside the listed options or range, e.g. duration must be an integer from ….
  • A missing or empty prompt (prompt is required).
  • A reference URL that is not public HTTPS (… must be a public HTTPS URL).
  • last_image_url without first_image_url (last_image_url requires first_image_url).
401
error
Missing or invalid API key (Invalid token).
403
error
Insufficient balance (code: "insufficient_user_quota"). Add credit in Console → Billing.
404
error
GET /v1/videos/{id} or GET /v1/tasks/{id} for a task that does not exist or belongs to another account (Task not found).
503
error
The model exists but none of its routes can take the request right now: No available channel for model … (code: "model_not_found"). Retry later with backoff, or pick another model. A missing or misspelled model returns 404 with the same message; check the id instead of retrying.