Grok Video - video generation API

Grok Video API

active

xAI's Grok Video — AI video generation powered by Grok Imagine. Supports text-to-video and image-to-video.

xAIvideo24 credits/call
Provider
xAI
Pricing
~$0.048 per video (24 credits)
Speed
30–60 seconds
Output
video

Quick Start

Send a request to the Grok Video API:

bash
curl -X POST https://apiin.one/api/v1/videos/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine/text-to-video",
  "prompt": "A cat walking across a piano keyboard, cinematic lighting"
}'

API Endpoint

POST/api/v1/videos/generations
Send a POST request with your API key to generate content using Grok Video.

Headers

HeaderТипОбязательноОписание
AuthorizationstringОбязательноBearer YOUR_API_KEY
Content-TypestringОбязательноapplication/json

Body Parameters

ПараметрТипОбязательноОписание
modelstringОбязательноModel identifier: "grok-video"
promptstringНеобязательноText prompt for video generation (required for text-to-video, max 5000 chars)
modelstringНеобязательноSub-model: "grok-imagine/text-to-video" or "grok-imagine/image-to-video" (По умолчанию: grok-imagine/text-to-video)
image_urlsarrayНеобязательноImage URLs for image-to-video mode

Example Request

json
{
  "model": "grok-imagine/text-to-video",
  "prompt": "A cat walking across a piano keyboard, cinematic lighting"
}

Example Response

Successful task creation response.

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n31xxxx_grokvid",
    "status": "IN_PROGRESS"
  }
}

Check Task Status

For asynchronous tasks, poll the status endpoint to check when your task is complete:

GET/api/v1/tasks/{task_id}
Returns the current status of a generation task. Poll until status is 'completed' or 'failed'.
bash
curl https://apiin.one/api/v1/tasks/task_abc123 \
  -H "Authorization: Bearer aio_your_key"

Use Cases

  • Generate short videos from text descriptions
  • Animate images into video clips
  • Create social media video content
  • Build AI video features into apps

API Tester

Test the Grok Video API directly from your browser:

Песочница APIPOST

Error Codes

{
  "error": {
    "code": 400,
    "message": "Invalid parameters",
    "type": "invalid_request"
  }
}

Frequently Asked Questions

How much does Grok Video cost?

Each video costs 24 credits (~$0.048) for both text-to-video and image-to-video.

Does Grok Video support image-to-video?

Yes. Provide image URLs via the "image_urls" parameter to animate images into video.

Do I need a Twitter/X Premium subscription?

No. API in One provides direct API access without any X/Twitter subscription.

Why Use Grok Video Through API in One?

1No X/Twitter Premium subscription needed
2Both text-to-video and image-to-video
3Direct API access to xAI's Grok
4Same backend as Grok Imagine for consistent quality

Ready to use Grok Video?

Get Your API Key →