Build with the xplaai AI Video API from text, images and references

The xplaai AI Video API accepts model-specific text and reference inputs through POST /v1/videos. It returns an asynchronous task that your application can poll before retrieving the completed video. Duration, resolution, aspect ratio and reference-media rules remain tied to the selected public model.

Create an API key or check the current video documentation.

Build several video workflows through one endpoint

The same video endpoint can support different creative jobs when you select the appropriate model and send that model's documented fields:

  • text-to-video for concept shots and motion experiments;
  • image-to-video for animating a product, character or scene reference;
  • vertical or horizontal creative for supported aspect ratios;
  • multi-reference generation where the selected model accepts several images;
  • reference-video editing when the selected editing model supports video input;
  • automated short-form workflows that combine generation with narration, subtitles or editing.

The endpoint is shared. The parameter contract is not. Duration, resolution, aspect ratio and accepted reference media vary by model.

Compare workflows before choosing a model

Model Useful when you need Verified contract highlights
veo-3.1-fast Text-to-video or image-guided generation with a fixed clip length 8 seconds; 720p or 1080p; 16:9 or 9:16; frame mode supports up to two references; ingredient mode supports up to three
omni / gemini-omni-flash A ten-second workflow with image or supported reference-video inputs Fixed 10 seconds; image references; reference videos through documented metadata
grok-imagine-video Several duration and aspect-ratio choices 6, 10 or 15 seconds; 720p; 16:9, 9:16, 1:1, 3:2 or 2:3
kling-video-3-0 Flexible clip length and standard or professional mode 3–15 seconds; standard mode 720p; professional mode 1080p; 16:9, 9:16 or 1:1; JPEG or PNG references
kling-video-3-0-edit Editing with a source video Requires documented reference-video metadata; accepts supported MP4, MOV or WebM input; the first source video sets duration

This table is a selection aid, not a substitute for the live documentation. Check the current model page before shipping a request.

The AI video API is asynchronous

Video renders take longer than a typical text response. Design the integration around three actions:

Create task → Poll task status → Retrieve completed content

1. Create the task

Send the generation request to:

POST https://xplaai.com/v1/videos

Example using veo-3.1-fast:

export XPLA_API_KEY="your_api_key"

curl --request POST \
  --url https://xplaai.com/v1/videos \
  --header "Authorization: Bearer $XPLA_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "veo-3.1-fast",
    "prompt": "animate this product reference image into a clean cinematic shot with subtle camera movement and realistic lighting",
    "seconds": "8",
    "images": ["https://example.com/reference.png"],
    "metadata": {
      "durationSeconds": 8,
      "resolution": "1080p",
      "aspectRatio": "16:9",
      "mode_image": "frame"
    }
  }'

Store the task ID returned by the API. Use a public, accessible reference URL only when the selected model accepts URL input, and never place a secret in the media URL.

2. Poll the task

Check the task by ID:

GET https://xplaai.com/v1/videos/{task_id}
Authorization: Bearer $XPLA_API_KEY

Your application should recognize pending, completed and failed states. Use a sensible polling interval and stop polling after a terminal state.

3. Retrieve the video

When the task is ready, retrieve its content:

GET https://xplaai.com/v1/videos/{task_id}/content
Authorization: Bearer $XPLA_API_KEY

Store the result according to your application's retention and access requirements. Do not assume that a temporary content URL is permanent storage.

Treat each model name as its own API contract

A unified endpoint should simplify routing without erasing differences between models. Build a small capability layer in your application:

{
  "veo-3.1-fast": {
    "durations": [8],
    "resolutions": ["720p", "1080p"],
    "aspectRatios": ["16:9", "9:16"]
  },
  "grok-imagine-video": {
    "durations": [6, 10, 15],
    "resolutions": ["720p"],
    "aspectRatios": ["16:9", "9:16", "1:1", "3:2", "2:3"]
  }
}

Use this kind of mapping to control your UI and request validation. Do not send a field simply because another model accepts it.

If the documentation provides a separate backup model name, select it explicitly. Do not design around an undocumented assumption that one public model will silently switch to another incompatible contract.

Production considerations beyond the first request

Validate media before submission

Check file type, dimensions, duration and remote accessibility before creating the task. For a reference-video editing model, validate the source-video rules separately from image-input rules.

Make task state visible

Persist the task ID and show a clear state in the user interface. A refresh should not lose track of an active render.

Separate retry from regeneration

Retrying a failed network request and intentionally creating a new generation are different actions. Use idempotency or application-level safeguards where appropriate.

Log the public model name

Record the model name and user-selected options with the task. This makes support and reproducibility easier without exposing internal provider details.

From one video call to a complete content workflow

The API is the right layer when you are building your own product. For repeatable commerce content, a packaged skill can coordinate more of the process.

For example, the Batch Commerce Video Skill is designed around product images, selling points or a TikTok product link and a set of vertical marketing-video outputs. The Pet Video Auto Edit Skill coordinates pet materials, narration, storyboard choices and finished-video assembly.

These workflows use several steps. They should not be confused with a claim that one video-generation request performs research, writing, narration and editing by itself.

Frequently asked questions

Is the xplaai AI Video API synchronous?

No. POST /v1/videos creates a task. Poll the task route and retrieve the content after the task completes.

Can I generate a video from an image?

Yes, when the selected model supports image references. The allowed number, file type and role of reference images depend on the model.

Which video model should I choose?

Start with your required input type, duration, resolution and aspect ratio. Then choose a model whose documented contract supports all four.

Can I create vertical video?

Supported models include vertical aspect-ratio options such as 9:16. Confirm the exact aspect ratios for your selected model in the current documentation.

How do I retrieve a completed result?

Poll GET /v1/videos/{task_id}. When the task is ready, request GET /v1/videos/{task_id}/content with the same Bearer authentication.

Can a Commerce Skill automate the rest of the workflow?

A Commerce Skill can package several steps such as planning, generation, narration, subtitles or editing. Choose the Codex or WorkBuddy package that matches your environment and follow its verified installation guide.

Create your first video task

Create an xplaai API key, choose a model based on its documented input contract, and submit a small test. For the broader platform, return to the unified AI API overview.