rreAPI Docs
rreAPI Docs
HomeWelcome

Image

midjourney-v8flux-2z-imageqwen-image-2midjourney-v7wan-2-7-imagegpt-image-2gpt-image-2-officialgemini-2.5-flash-image-previewgemini-3-pro-image-previewgemini-3.1-flash-image-previewdoubao-seedream-5-0-liteimagen-4-0

Audio

Mureka V9 Song APIVocal Remover APIMusic Extractor APIVoice Cleaner APIMultistem Splitter APIVoice Changer API

Video

topaz-video-upscalerkling-3-0-turbokling-3-0music-video-1-0wan-2-7-videokling-motion-controlpixverse-v6Seedance 2.5doubao-seedance-2.0doubao-seedance-2.0-officialseedance-2-0-minihappyhorse-1-1happyhorse-1.0happyhorse-1.0-officialviduq3grok-imagine-video-1.5-betagrok-imagine-1.0-videoVeo 3.1gemini-omni

Chat

claude-fable-5minimax-m3deepseek-v4gpt-5.5gpt-5.4claude-opus-4-8claude-opus-4-7claude-sonnet-4-6

Text

ai-essay-writerhumanizeai-text-detector

Tools

enhance-video-1.0
X (Twitter)

grok-imagine-1.0-video

Grok Imagine 1.0 Video — async video generation with one endpoint that auto-routes text-to-video and image-to-video by `image_urls` count. 6 to 30 second outputs at 480p / 720p, five aspect ratios.

Grok Imagine 1.0 Video — async video generation. One model id (grok-imagine-1.0-video) covers both text-to-video and image-to-video. Mode is implicit: zero image_urls runs T2V; 1 to 7 reference images run I2V. 6 to 30 second outputs at 480p / 720p, five aspect ratios. See current pricing on the model page.

Quick example

curl https://reapi.ai/api/v1/videos/generations \
  -H "Authorization: Bearer rk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-1.0-video",
    "prompt": "A dog running on a sunlit beach, slow-motion",
    "size": "16:9",
    "duration": 6,
    "quality": "720p"
  }'
import requests

resp = requests.post(
    "https://reapi.ai/api/v1/videos/generations",
    headers={
        "Authorization": "Bearer rk_live_xxx",
        "Content-Type": "application/json",
    },
    json={
        "model": "grok-imagine-1.0-video",
        "prompt": "A dog running on a sunlit beach, slow-motion",
        "size": "16:9",
        "duration": 6,
        "quality": "720p",
    },
    timeout=30,
)
print(resp.json())
const r = await fetch("https://reapi.ai/api/v1/videos/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer rk_live_xxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "grok-imagine-1.0-video",
    prompt: "A dog running on a sunlit beach, slow-motion",
    size: "16:9",
    duration: 6,
    quality: "720p",
  }),
});
console.log(await r.json());
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io"
    "net/http"
)

func main() {
    body, _ := json.Marshal(map[string]any{
        "model":    "grok-imagine-1.0-video",
        "prompt":   "A dog running on a sunlit beach, slow-motion",
        "size":     "16:9",
        "duration": 6,
        "quality":  "720p",
    })
    req, _ := http.NewRequest("POST",
        "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body))
    req.Header.Set("Authorization", "Bearer rk_live_xxx")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    out, _ := io.ReadAll(resp.Body)
    fmt.Println(string(out))
}

Submit response

{
  "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e",
  "model": "grok-imagine-1.0-video",
  "status": "processing",
  "created_at": 1735000000
}

Poll GET /api/v1/tasks/{id} (see the Tasks reference) until status === "completed". The completed payload's output.video_urls holds the generated MP4 URL, valid for 7 days.


Authentication

Every call needs a Bearer token. Generate keys at reapi.ai/settings/apikeys.

Authorization: Bearer YOUR_API_KEY

Keys carry the active workspace's billing scope — there is no separate project header.


Endpoint

POST /api/v1/videos/generations
GET  /api/v1/tasks/{id}

Submission is async. The POST returns immediately with a task_id; the task endpoint returns the same envelope until completion. Polling does not consume credits.


Mode routing

grok-imagine-1.0-video picks its mode from the count of image_urls you send — there is no mode parameter:

image_urls countModeWhat it does
0 (or omitted)T2VGenerate from text. size controls output ratio.
1 – 7I2VUse the references as visual guidance. Output ratio follows ref.

Mutex rules.

  • In T2V (no image_urls), prompt is required.
  • When image_urls is set (1 to 7 entries), size is forwarded but ignored upstream — the source frame's ratio decides the output ratio.
  • More than 7 image_urls is rejected with 400 image_urls accepts at most 7 entries.

Request body

model — required

string. Must be "grok-imagine-1.0-video".

prompt — string, conditional

Up to 4,000 characters. Required in T2V (when image_urls is empty); optional in I2V when at least one image is provided.

Empty / whitespace-only prompts are treated as missing.

Failure modes.

  • Empty / missing in T2V → 400 prompt is required when image_urls is empty (text-to-video) (code 20002).
  • Longer than 4,000 chars → 400 prompt exceeds 4000 characters (got N) (code 20007).

size — string, default "16:9"

Output aspect ratio in T2V mode. One of:

ValueShape
16:9Landscape (default)
9:16Portrait
1:1Square
3:2Landscape
2:3Portrait

In I2V mode the upstream derives the ratio from the reference image, so this field is ignored.

duration — integer, default 6

Output length in seconds. Any integer in [6, 30]. Out-of-range → 400. Drives pricing linearly: ceil(per_second_usd × duration × 1000) credits (1 credit = $0.001).

Send a number, not a string. "duration": "6" is rejected with 400.

quality — string, default "480p"

480p (SD) or 720p (HD). Lowercase is canonical. Quality does not change the per-second rate.

image_urls — string[]

Array of public HTTP(S) URLs. 0 to 7 entries:

  • 0 entries — pure text-to-video.
  • 1 to 7 entries — image-to-video; references guide subject and style.

No data: URIs. reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL.


Response envelope

Submit and poll share the same shape — only status and output fill in over time.

{
  "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e",
  "model": "grok-imagine-1.0-video",
  "status": "completed",
  "created_at": 1735000000,
  "output": {
    "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"]
  },
  "error": null
}
FieldTypeNotes
idstringTask identifier — keep it for polling and audit
modelstringEcho of the submitted model
statusstringprocessing / completed / failed
created_atintegerSubmission unix timestamp
outputobject | nullnull until completion. output.video_urls holds MP4s
errorobject | nullPopulated on failed — { code, message }

output.video_urls URLs are valid for 7 days. Re-host to your own storage if you need them longer.


Validation errors

All cases below return HTTP 400 with code 20003 unless noted. Pattern-match on code, not message — message strings carry request-specific context (field names, observed values, etc.) and are not a stable contract.

TriggerCodeMessage (illustrative)
prompt missing in T2V20002grok-imagine: prompt is required when image_urls is empty (text-to-video)
prompt longer than 4,000 chars20007grok-imagine: prompt exceeds 4000 characters (got N)
image_urls length > 720003grok-imagine: image_urls accepts at most 7 entries, got N
duration outside [6, 30]20003grok-imagine: duration must be 6-30 seconds, got N
Unknown size20003grok-imagine: invalid size "X" (allowed: 16:9 / 9:16 / 1:1 / 3:2 / 2:3)
Unknown quality20003grok-imagine: invalid quality "X" (allowed: 480p / 720p)
image_urls carrying a data: URI or non-http(s)20003grok-imagine: image_urls entries must be public http(s) URLs

The full envelope is { "error": { "code", "message", "request_id" } } — see Errors catalog for the wire format and request_id correlation tips.


Recipes

T2V — minimum request

{
  "model": "grok-imagine-1.0-video",
  "prompt": "A little girl walking down a sunset coastal road"
}

T2V — full parameters

{
  "model": "grok-imagine-1.0-video",
  "prompt": "A dog running on a sunlit beach, slow-motion, cinematic warm tones",
  "size": "16:9",
  "duration": 10,
  "quality": "720p"
}

I2V — animate from references

{
  "model": "grok-imagine-1.0-video",
  "prompt": "Bring the scene to life with a gentle camera dolly forward",
  "image_urls": ["https://your-cdn.com/reference.jpg"],
  "duration": 8,
  "quality": "720p"
}

I2V — multi-reference

{
  "model": "grok-imagine-1.0-video",
  "prompt": "Smooth cinematic motion across the reference subjects",
  "image_urls": [
    "https://your-cdn.com/ref-1.jpg",
    "https://your-cdn.com/ref-2.jpg",
    "https://your-cdn.com/ref-3.jpg"
  ],
  "duration": 12
}

Polling pattern

The task endpoint behaves identically to other video tasks — the only difference is the completed output shape (video_urls instead of image_urls). A pragmatic schedule:

0–5 minutes:    poll every 5s
5 min – 1 h:    back off gradually toward 1 min
≥ 1 h:          cap at 3 min between polls

A typical task completes in a few minutes. The worker's wall-clock cap is 48 hours, comfortably above any realistic queue.


Pricing

Per-second rate. quality does not change the price, and the rate is flat across 480p and 720p. See current rate on the Grok Imagine model page.

Bill formula (1 credit = $0.001):

credits = ceil(per_second_usd × duration × 1000)

Failed jobs refund automatically.


Tips

  • Prompt motion, not just scene. "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen.
  • Sweet-spot duration: 6–10 seconds. Above 10s the upstream wall-time grows fast; the per-second price stays the same either way.
  • Reference-image quality matters. Subject centered, clear composition, no heavy filters — I2V output quality tracks input quality directly.
  • Send up to 7 references for richer guidance. A first frame plus several style boards usually outperforms a single reference.

Related

  • Errors catalog
  • Authentication
  • Quickstart

Table of Contents

Quick example
Submit response
Authentication
Endpoint
Mode routing
Request body
model — required
prompt — string, conditional
size — string, default "16:9"
duration — integer, default 6
quality — string, default "480p"
image_urls — string[]
Response envelope
Validation errors
Recipes
T2V — minimum request
T2V — full parameters
I2V — animate from references
I2V — multi-reference
Polling pattern
Pricing
Tips
Related