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.
$ set up https://magi2api.net/agent.mdThree Steps to Connect and Run
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.
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.
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.
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.
Complete Agent setup guide, auth flow, polling rules, and safety checklist.
Compact site index, supported modes, pricing, and public endpoints.
Full text reference with schema rules, benchmarks, and pricing comparison.
OpenAPI 3.1.0 spec for /v1/videos/tasks, /v1/tasks, /v1/files, and /v1/usage.