Mage API · Video generation
The AI video generation API, from text or images
Text-to-video, image-to-video, first-and-last-frame, and reference-to-video from 15 models, led by Mage's flagship Cherry 2 Pro, with audio on many clips.
POST https://api.mage.space/v1/{model}/generateAt a glance
The Mage video generation API is a REST API at https://api.mage.space/v1 that runs 15 text-to-video and image-to-video models, including Cherry 2 Pro, Lemon, Plum, Melon, MiniMax-H3, Grok Video, and Wan. Submit a prompt and optional frames or references, poll the request, and download an MP4. Each clip is paid in Gems by model, resolution, and duration.
- 15video models
- $0.02Cheapest default, per clip
- 20Concurrent generations
- $0Monthly fee
Models
Every video model in the Mage API
Prices are per generation, in Gems. 1,000 Gems cost $1 on the standard pack, and larger packs add bonus Gems. The price depends on the model, resolution, and duration; the default-settings price is shown, and every response reports the exact charge in billing.gems_charged. A generation that fails is refunded; one Mage's content policy blocks is not.
| Model | Best for | model_id values | Default price |
|---|---|---|---|
| Berry | Video that stays true to your references | berry, berry-2 | 189 Gems ($0.189) |
| Blueberry | Pin the first and last frame | blueberry, blueberry-v2 | 360 Gems ($0.36) |
| Cherry | Our flagship video family | cherry-mini, cherry, cherry-pro, cherry-2-pro | 618 Gems ($0.618) |
| Grok Video | Grok Imagine, in motion | grok-imagine-video | 375 Gems ($0.375) |
| Kiwi | Everyday video, zero setup | kiwi | 270 Gems ($0.27) |
| Lemon | Every video feature, at a friendlier price | lemon | 245 Gems ($0.245) |
| LTX Video | Fast open-weights video for iteration | ltx-video-096-distilled, ltx-video-096-dev | 20 Gems ($0.02) |
| Magejutsu | Recast any video, keeping its motion | magejutsu, magejutsu-lite, magejutsu-feather | 1,856 Gems ($1.856) |
| Melon | Anime in motion, with optional audio | melon, melon-pro | 147 Gems ($0.147) |
| MiniMax-H3 | Fast open video with stereo sound | minimax-h3-turbo, pika-h3-flex, minimax-h3 | 45 Gems ($0.045) |
| Plum | Sound on every clip, up to 2K | plum, plum-max, plum-fast | 173 Gems ($0.173) |
| Raspberry | Characters brought to life from a first frame | raspberry | 360 Gems ($0.36) |
| Seedance | Seedance, with a strict filter | seedance-2.0-mini, seedance-2.0-fast, seedance-2.0, seedance-2.5 | 618 Gems ($0.618) |
| Wan 3.0 | Wan 3.0, with a strict filter | wan-3.0 | 245 Gems ($0.245) |
| Wan Video v2.2 | Open-weights video with a Lightning variant | wan22-video, wan22-video-lightning | 40 Gems ($0.04) |
Quick start
Generate a video with Berry 2
Set MAGE_API_KEY, submit the request, and poll until it completes. Swap berry in the URL for any model above.
cURL
STATUS_URL=$(curl --request POST 'https://api.mage.space/v1/berry/generate' \
--header "Authorization: Bearer $MAGE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"prompt": "A slow push-in on a lighthouse at dusk, waves breaking below",
"aspect_ratio": "16:9",
"duration": "3",
"model_id": "berry-2"
}' | jq -r '.status_url')
# Repeat until status is "completed"; result.url is the file
curl "$STATUS_URL" --header "Authorization: Bearer $MAGE_API_KEY"TypeScript
// npm install @mage-space/sdk
import Mage from '@mage-space/sdk';
const mage = new Mage(); // reads MAGE_API_KEY
const request = await mage.run('berry', {
prompt: 'A slow push-in on a lighthouse at dusk, waves breaking below',
aspect_ratio: '16:9',
duration: '3',
model_id: 'berry-2',
});
console.log(request.result.url);Python
# pip install mage-space
from mage_space import Mage
mage = Mage() # reads MAGE_API_KEY
request = mage.run("berry", {
"prompt": "A slow push-in on a lighthouse at dusk, waves breaking below",
"aspect_ratio": "16:9",
"duration": "3",
"model_id": "berry-2",
})
print(request["result"]["url"])How it works
From API key to finished media in three calls
Every model shares one authentication scheme, one asynchronous request lifecycle, and the same field names.
Create an API key
Sign in to Mage, open API → API Keys, and create a key. It starts with mage_sk_ and is shown once. An account can hold 10 active keys.
Submit a generation
POST a JSON body to https://api.mage.space/v1/{model}/generate with an Authorization: Bearer header. The response returns at once with a request_id, a status, and a status_url. Send an Idempotency-Key header so a retry never pays twice.
Poll and download
Poll status_url until the status is completed, failed, or cancelled. A completed request carries result.url with the image, video, or audio file, kept for 30 days.
Built for production
What every Mage API request gets
One key, every model
35 image, video, and audio models behind one REST API and one Gems balance. Switch models by changing the URL path.
Pay per generation
No subscription and no minimum spend. You buy Gems, and each request is charged its listed price. A generation that fails is refunded, unless Mage's content policy blocked it.
Safe retries
Idempotency keys make a retried submit return the original request without charging again.
Consistent characters
Save a character or reference once, then write @handle in any prompt to use it with every model that supports it.
Large inputs
Send image, video, and audio inputs as URLs or data URLs, or upload files up to 100 MB through a signed upload.
20 generations in flight
Each account can run 20 generations at once, and the limit can be raised for your use case. Refused requests are never charged.
Use cases
What developers build with the video API
Short-form and social video
Produce vertical clips for TikTok, Reels, and Shorts from a prompt or a product image.
Animate still images
Turn a first frame, or a first and last frame, into motion with image-to-video models such as Lemon and Kiwi.
Character-driven stories
Keep the same character across shots with reference-to-video models that take @handle characters.
Video with sound
Plum and other models generate speech, sound effects, and ambience with the picture, and take audio references for voices.
Ads and product demos
Generate many variants of a spot and pick the winner, with idempotent submits that never double-charge.
Edit existing clips
Berry, Plum, and Grok Video edit a source video you send; Lemon and MiniMax-H3 also take reference videos.
FAQ
Frequently asked questions
What is the best AI video generation API?
Does the video API support image-to-video?
How long can generated videos be?
How long does a video generation take?
How much does the Mage API cost?
Do I need a Mage membership to use the API?
Can I use API outputs commercially?
What are the rate limits?
Can my AI agent use the Mage API?
Is there an SDK for the Mage API?
I already use another generation API. What do I have to change?
Start building with Mage
One account, one Gems balance, every model. Pay only for what you generate.