MAGI-2 MCP & API

MAGI-2 MCP Server: Generate 30s Videos in Claude, Cursor & Codex

Connect your Magi2AI account to Claude and ask for a MAGI-2 video in plain words. Same credits, same My Videos.

  1. Step 1

    Create an API key

    Open your account page and create a key. It starts with m2k_ and is shown only once, so copy it right away.

    Create API key
  2. Step 2

    Add Magi2AI as a custom connector

    Open the pre-filled connector form, then add an Authorization header with your key under Advanced settings.

    Add to Claude(opens in a new tab)

    Header name

    Authorization

    Header value

    Bearer m2k_YOUR_API_KEY
  3. Step 3

    Ask for a video

    Try: “Make a 10-second 16:9 MAGI-2 video of a lighthouse in a storm, with thunder and waves.” The agent checks the price, submits and returns the video link when it is ready, usually in 3-10 minutes.

MCP server URL

https://magi2ai.video/api/mcp

What you can do with the MAGI-2 MCP

Everything the MAGI-2 generator on the website does, from inside your agent.

  • Text to video

    Describe a scene and pick a length from 4 to 30 seconds and one of six aspect ratios. MAGI-2 handles multi-shot stories, camera moves, dialogue and sound effects.

  • First and last frame

    Give a public image URL as the first frame, and optionally a last frame. The agent imports it and MAGI-2 animates between them.

  • Reference images and videos

    Pass up to 10 reference images, or up to 5 videos you already generated on Magi2AI, and refer to them in the prompt as image 1 or video 1.

  • Balance, price and history

    The agent checks your credits and the price before it submits, and can list your recent videos. Every video also shows up in My Videos on the website.

Use the MAGI-2 API from your own code

Prefer scripts or workflows? Call the same endpoints with your API key as a Bearer token: submit, poll, download.

curl

# 1. Submit (spends credits; reuse clientRequestId when retrying)
curl -s https://magi2ai.video/api/generation/video/generate \
  -H "Authorization: Bearer $MAGI2_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sandai/magi-2",
    "prompt": "A red fox runs through fresh snow at sunrise, slow motion",
    "duration": 4,
    "resolution": "1080P",
    "aspectRatio": "16:9",
    "generateAudio": true,
    "clientRequestId": "fox-001"
  }'
# => {"ok":true,"data":{"requestId":"...","cost":24}}

# 2. Poll until status is "completed" (usually 3-10 minutes)
curl -s https://magi2ai.video/api/generation/video/REQUEST_ID \
  -H "Authorization: Bearer $MAGI2_API_KEY"

# 3. Download data.outputs[0].url
curl -L -o fox.mp4 "VIDEO_URL_FROM_STEP_2"

MAGI-2 API pricing and limits

No separate API price: generations cost the same 6 credits per second as on the website.

  • 6 credits / second

    A 4-second video is 4 × 6 credits. Failed or timed-out videos are refunded automatically.

  • 6 per minute

    Up to 6 submissions per minute across all your keys.

  • 3 at once

    Up to 3 videos rendering at the same time per account.

  • Prepaid only

    Credits are prepaid, so there is no surprise bill. Up to 5 active keys per account.

MAGI-2 MCP tools

Seven tools your agent can call. Tool descriptions are written for the model, so you rarely need to call them by name.

  • magi2_account_status

    Email, subscription, credit balance, price per second and your API limits.

  • magi2_get_model

    MAGI-2 parameters: duration, aspect ratios, audio and the three input modes.

  • magi2_estimate_cost

    Price of a video of a given length, compared with your balance.

  • magi2_upload_image

    Import an image from a public https URL to use as a frame or reference.

  • magi2_generate_video

    Submit a MAGI-2 video. Spends credits; retries are safe with the same request ID.

  • magi2_get_generation

    Check a video and get its download URL when it is ready.

  • magi2_list_generations

    List your recent videos, for example after a timed-out submission.

MAGI-2 MCP FAQ

How is this different from using the website?
It is the same account, the same MAGI-2 model and the same credits. The only difference is where you type: your agent submits the generation for you, and the result still appears in My Videos.
How much does the MAGI-2 API cost?
6 credits per second of video, exactly like the website. There is no extra API fee. Buy credits or a plan on the pricing page.
Do I need a paid plan to use it?
No. Any account can create a key. Each generation needs enough credits; if your balance is too low, the agent tells you how many credits are needed and where to top up.
How long does a video take?
Usually 3 to 10 minutes. The agent polls for you, and you can close the chat and find the video in My Videos later.
What if my API key leaks?
Revoke it on your account page and it stops working immediately. Because credits are prepaid, a leaked key can never charge more than your balance. Keep an eye on the “last used” time of each key.
Does it work with ChatGPT or Claude.ai without a key?
Not yet. The server uses API keys sent as a Bearer token. Clients that only support OAuth sign-in, such as ChatGPT connectors, are not supported for now.
Can I use the videos commercially?
The same terms as videos made on the website apply. See the Terms of Service for details.
Are there content rules?
Yes. Prompts are moderated before they are sent, and rejected prompts are not charged. Only use photos of people who are you or who have agreed, and never photos of minors.

Start generating MAGI-2 videos from your agent

Create an API key, add the MCP server, and ask for your first video.