Agent

Connect Your Coding Agent to MAGI-2 API

Send the setup instruction below to Claude Code, Codex, Cursor, or OpenClaw, configure your API key privately, and verify before running paid video renders.

Send this to your Agent
$ set up https://magi2api.net/agent.md
Claude CodeCodexCursorOpenClawManusAntigravity

Three Steps to Connect and Run

01

1. Create an API key privately

Create a key in your console and store it in your Agent host's credential manager or MAGI2_API_KEY env var. Never paste keys into chat or commit them to source files.

02

2. Send the setup instruction

Paste "set up https://magi2api.net/agent.md" into your Agent chat. It reads the public spec, modes, and 1080p constraints automatically.

03

3. Verify first, then generate

Run a read-only check first to confirm your key and endpoint wiring. Always review the duration and $0.088/s cost before starting a paid video task.

The /agent.md guide is public, while your API key is private. Reading /agent.md alone does not grant access until MAGI2_API_KEY is configured in your environment.

Ready-to-Send Prompts for Your Agent

Pick a task below, copy it into your Agent chat, and let it prepare or run the API call for you.

Copy a task for Claude Code / Codex / Cursor / OpenClaw
Use MAGI-2 API (https://api.beatapi.io) with MAGI2_API_KEY from environment variables to generate an 8-second 1080p clip with sound:
1. Show me the exact JSON payload (model="magi-2", duration=8, aspect_ratio="16:9", resolution="1080p", generate_audio=true) and estimated cost ($0.704) and wait for my confirmation.
2. After I confirm, call POST /v1/videos/tasks with an Idempotency-Key header.
3. Poll GET /v1/tasks/{id} every 8 seconds until succeeded, then download the MP4 to ./output/magi2-demo.mp4 before the 72h link expires.

Machine-Readable Specs for Agents

Your Agent reads these plain UTF-8 endpoints directly so it never guesses field names or outdated 720p presets.