New Magi-2 API

Magi-2 API for Video Generation

One REST call starts a Magi-2 clip of 4 to 30 seconds in 1080p with sound. Pay per second of video from a prepaid balance, and use the same key for Seedance, Kling, Veo, Wan and the image models.

Pay per second

Magi-2 costs $0.09 per second of 1080p video, sound included. There is no monthly fee and no seat limit.

Prepaid balance

Add funds from $50 in US dollars. Requests are charged from the balance, and failed requests go back to it.

Magi-2 at full quality

Text, first and last frame and reference modes, 1080p at 25 fps, native audio and clips up to 30 seconds.

Every model, one format

The same request works for Magi-2, Seedance, Kling, Veo, Wan and every image model on the site.

Magi-2 API pricing

You pay per second of video. Magi-2 costs $0.09 per second at 1080p, and the same price applies to every clip length from 4 to 30 seconds.

Magi-2 at 1080p

$0.09 per second

Sound is included in every Magi-2 price. Turning it off does not change the price.

Other models: price per second or per image

Video models: price per second
ModelResolutionYou pay
Seedance 2.5720p$0.226 per second
Seedance 2.5 Flash720p$0.1519 per second
Seedance 2.0720p$0.152 per second
Kling v4720p$0.15 per second
Kling v4 Flash720p$0.0957 per second
Veo 3.1 Fast720p$0.085 per second
Gemini Omni 1.2 Flash720p$0.07 per second
Gemini Omni 1.1 Flash720p$0.098 per second
Wan 3.0720p$0.0758 per second
Wan 3.0 Prime720p$0.1129 per second
MiniMax H3768p$0.0671 per second
MiniMax H3 Max768p$0.0671 per second
PixVerse v6 Max720p$0.0633 per second
Vidu Q4 Preview720p$0.1012 per second
Zoe720p$0.1936 per second
Muse Video720p$0.0124 per second
Image models: price per image
ModelResolutionYou pay
GPT Image 2.51K$0.0185 per image
GPT Image 2.61K$0.0185 per image
Nano Banana Pro1K$0.03 per image
Nano Banana 21K$0.022 per image
Nano Banana 2.11K$0.022 per image
Seedream 5.51K$0.026 per image
Seedream 5.0 Flash1.5K$0.0244 per image
FLUX.31K$0.0484 per image
FLUX.3 Klein1K$0.0172 per image
Qwen Image 3.01K$0.0306 per image
Kling v4 Image2K$0.0671 per image
Kling v4 Long Image1K$0.51 per image
MAI Image 2.71K$0.0408 per image
MAI Image 2.7 Flash1K$0.0197 per image
MAI Image 2.61K$0.0452 per image
MAI Image 2.6 Flash1K$0.0276 per image
MiniMax H3 Image1K$0.0359 per image
MiniMax H3 Image Highspeed1K$0.0532 per image
HY Image 3.51K$0.0292 per image
Muse ImageStandard$0.0148 per image

Prices are in US dollars. Video models are priced per second and image models per image. GET /v1/models returns the live price of every model and resolution, and POST /v1/quote prices a request before you send it.

Prepaid balance: add funds from $50

The API runs on its own balance in US dollars, separate from website credits. Top up by card through Stripe with any amount from $50 up to $10,000. Funds stay in the balance until your requests use them, and every top-up and charge appears in your dashboard.

Common top-ups

$50$100$250$500$1,000
Add funds in the dashboard

Magi-2 API quick start

You need an account, a key and some balance. Then one request is enough.

  1. 1

    Create a key

    Sign in, open the API tab of your dashboard and create a key. The full key is shown once, so store it safely.

  2. 2

    Add funds

    Top up the API balance. The minimum top-up is $50, and the balance is ready as soon as the payment clears.

  3. 3

    Send a request

    Post to /v1/generations with your key. Poll the generation until it is completed, then download the result.

cURL
curl https://magi2ai.ai/v1/generations \
  -H "Authorization: Bearer $MAGI2_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-1001" \
  -d '{
    "model": "magi-2",
    "prompt": "A lighthouse at dusk, waves, gulls and a low foghorn",
    "duration": 5,
    "aspect_ratio": "16:9",
    "audio": true
  }'

A finished generation

The first response returns the generation with status queued or processing. Poll GET /v1/generations/{id} every few seconds. When the status is completed, outputs holds the result links.

JSON
{
  "id": "api_5f0c2a9e41d84f6aa1c3b7d2e8f90a14",
  "object": "generation",
  "model": "magi-2",
  "type": "video",
  "status": "completed",
  "progress": 100,
  "outputs": [{ "type": "video", "url": "https://..." }],
  "error": null,
  "price_usd": 0.45,
  "refunded": false,
  "created_at": "2026-11-26T08:00:00.000Z"
}

Magi-2 API endpoints

Send your key as a Bearer token. Requests and responses are JSON, and every response uses the same error format.

MethodPathWhat it does
GET/v1/modelsLists every model with its limits and prices.
POST/v1/quotePrices a request without sending it.
POST/v1/generationsStarts a video or image generation.
GET/v1/generations/{id}Returns the status and the result links.
GET/v1/generationsLists your recent API generations.
GET/v1/balanceReturns the prepaid balance.

Magi-2 API request parameters

These fields go in the JSON body of POST /v1/generations and POST /v1/quote. The API refuses values a model does not support instead of replacing them.

FieldDescription
modelRequired. A model id from GET /v1/models, for example magi-2.
promptThe scene to create, up to 15,000 characters. Required for text mode and for image models.
modeVideo only: text, frames for a first and last frame, or reference for image, video and audio references.
durationVideo length in whole seconds. Magi-2 accepts 4 to 30.
resolutionOne of the resolutions the model lists. Magi-2 renders 1080p.
aspect_ratioOne of the ratios the model lists, such as 16:9, 9:16 or 1:1.
audioVideo only: true or false. Models that always include sound ignore false.
image_urls, video_urls, audio_urlsPublic https links used as frames or references. Magi-2 takes up to 10 images, 5 videos and 5 audio clips.
seedOptional whole number for repeatable results on models that support it.

Queue, retries and refunds

Status

A generation moves from queued to processing and ends as completed or failed. Result links can expire, so download the files you want to keep.

Magi-2 queue

Magi-2 renders one clip at a time. Extra requests wait in a short queue and start in order. If the queue is full you get a 429 answer and are not charged.

Retries

Send an Idempotency-Key header with each request. Sending the same key again returns the same generation and never charges twice.

Refunds

If a generation fails, its price returns to your balance automatically, once. Requests that fail validation or moderation are never charged.

Limits

One key can start 60 generations a minute, and an account can have 10 in progress. Each account can hold up to 5 active keys.

Content rules

The same acceptable-use rules apply as on the website. Prompts are screened, and blocked requests return an error without a charge.

Magi-2 API errors

Errors return a JSON body with a code and a message. The code is stable, so build your handling on it.

StatusCodeMeaning
400invalid_requestA field is missing or not supported by the model. The message says which.
400content_not_allowedThe prompt breaks the content rules. Nothing is charged.
401invalid_api_keyThe key is missing, wrong or revoked.
402insufficient_balanceThe balance is lower than the price. The response shows both amounts.
429rate_limitedToo many requests. Wait and retry.
429queue_fullThe Magi-2 queue is full. Retry after the time in the Retry-After header.
502provider_errorThe generation could not be started. You are not charged.

Magi-2 API FAQ

What is the Magi-2 API?

It is a REST API for Magi-2, the Sand.ai video model, and for the other video and image models on Magi-2 AI Video Generator. You send a prompt and settings, and you get links to the finished video or image. It does not need a subscription.

How much does the Magi-2 API cost?

Magi-2 costs $0.09 per second at 1080p, so 5 seconds cost $0.45 and 30 seconds cost $2.70. Other video models are priced per second and image models per image, and GET /v1/models lists every price.

What is the minimum top-up for the Magi-2 API?

The balance is prepaid and the minimum top-up is $50. You can add any amount from $50 to $10,000 in one payment, in US dollars, through Stripe.

What happens when a Magi-2 API request fails?

The price of the request returns to your balance automatically. Requests that fail validation or moderation are not charged.

Is the API balance the same as website credits?

No. The prepaid API balance is in US dollars and is separate from the credits of a subscription. One account can use both.

How many Magi-2 API requests can I send at once?

Magi-2 renders one clip at a time, so extra requests wait in a short queue and start in order. One key can start 60 generations a minute, with up to 10 in progress per account.

Which models does the API support?

Every video and image model on Magi-2 AI Video Generator, from Magi-2, Seedance, Kling, Veo and Wan to GPT Image, Nano Banana, Seedream and FLUX. Call GET /v1/models for the live list with prices.

Where do I get a Magi-2 API key?

Sign in, open your dashboard and choose the API tab. You can hold up to 5 keys and revoke any of them at any time. A key is shown once, when you create it.

Start building with the Magi-2 API

Create a key, add funds from $50 and send your first request in minutes.

Get an API key