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
1curl -X POST https://apiin.one/api/v1/videos/generations \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "grok-imagine/text-to-video",
6 "prompt": "A cat walking across a piano keyboard, cinematic lighting"
7}'

API Endpoint

POST/api/v1/videos/generations

Send a POST request with your API key to generate content using Grok Video.

Headers

Body ParametersJSON
Authorization:string

Bearer YOUR_API_KEY

Content-Type:string

application/json

Body Parameters

Body ParametersJSON
model:string

Model identifier: grok-video

prompt:optional string

Text prompt for video generation (required for text-to-video, max 5000 chars)

model:optional string

Sub-model: grok-imagine/text-to-video or grok-imagine/image-to-video Defaults to grok-imagine/text-to-video.

image_urls:optional array

Image URLs for image-to-video mode

Example Request

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

Example Response

Successful task creation response.

1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "task_id": "n31xxxx_grokvid",
6 "status": "IN_PROGRESS"
7 }
8}

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
1curl https://apiin.one/api/v1/tasks/task_abc123 \
2 -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:

API プレイグラウンドPOST

Error Codes

1{
2 "error": {
3 "code": 400,
4 "message": "Invalid parameters",
5 "type": "invalid_request"
6 }
7}

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?

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

Ready to use Grok Video?

Get Your API Key →