# Grok Imagine Video - Core.Today AI API > Generate videos using xAI's Grok Imagine Video model. Supports text-to-video, image-to-video, and editing an existing short video clip. - **Provider**: xAI - **Model ID**: xai/grok-imagine-video - **Category**: Video Generation - **Credits**: 580 per 5s video (default) — billed per second (117/s, 1-15s) - **Speed**: Fast - **Quality**: High ## Features - Flat per-second pricing regardless of resolution or aspect ratio - Text-to-video and image-to-video generation - Video editing mode — modify an existing short clip (up to 8.7s) with a prompt - 480p or 720p output, up to 15 seconds - Auto aspect ratio detection from the input image ## Use Cases - Quick text-to-video clips for social content - Animating a still image into short motion - Editing an existing video clip with a text instruction - Iterating on video length up to 15 seconds at a flat rate - Vertical or square clips using explicit aspect ratios ## API Endpoint Base URL: https://api.core.today/v1 Create Prediction: POST /predictions Get Status: GET /predictions/{job_id} ## Authentication Header: X-API-Key: YOUR_API_KEY ## Input Parameters ### Required - **prompt**: string - Text prompt for video generation ### Optional - **image**: string - Input image to generate video from (image-to-video). Supports jpg, jpeg, png, webp - **video**: string - Input video to edit (video editing mode). Direct link, max 8.7 seconds. mp4, mov, webm - **duration**: integer (default: 5) - Duration of the video in seconds (1-15). Ignored when editing a video - **resolution**: string (default: 720p) - Resolution of the video. Ignored when editing a video Options: 720p, 480p - **aspect_ratio**: string (default: auto) - Aspect ratio. Defaults to 16:9 for text-to-video, or the input image's ratio for image-to-video. Ignored when editing a video Options: auto, 16:9, 4:3, 1:1, 9:16, 3:4, 3:2, 2:3 ## Examples ### Text-to-Video (720p) Generate a 5-second clip directly from a text prompt ```json { "model": "xai/grok-imagine-video", "input": { "prompt": "a penguin walks away from the camera, towards a large snowy mountaintop in the distance", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" } } ``` ### Longer Clip (15s) The maximum 15-second duration, still billed at the same flat per-second rate ```json { "model": "xai/grok-imagine-video", "input": { "prompt": "a lone astronaut walking across a red Martian desert as twin suns set on the horizon", "duration": 15, "resolution": "480p", "aspect_ratio": "21:9" } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending | processing | completed | failed", "result": "URL or data (when completed)" } ``` ## Usage Flow 1. POST /predictions with model and input -> receive job_id 2. GET /predictions/{job_id} -> poll until status is completed or failed 3. Result contains output URL(s) ## Tips - Pricing is a flat $0.05/sec regardless of resolution or aspect ratio — pick 720p unless file size matters - Duration ranges 1-15 seconds; longer clips cost proportionally more with no per-second discount - In video editing mode, duration and resolution inputs are ignored (the source clip's length is kept) - aspect_ratio: auto lets the model infer 16:9 for text prompts or match your input image automatically ## Documentation https://replicate.com/xai/grok-imagine-video