Miraflow
Create and manage AI-generated videos and images using Miraflow, including avatar videos, cinematic clips, image generation, editing, and media uploads.
Like a lobster shell, security has layers — review code before you run it.
License
SKILL.md
Miraflow
Miraflow is an AI video/image platform. The API is async — creation endpoints return a jobId, then you poll for completion.
Base URL: https://miraflow.ai/api
Auth: always include -H "x-api-key: $MIRAFLOW_API_KEY" on every call. Never hardcode the key.
Full API reference: See references/api.md for endpoint details, request/response schemas, and the media upload workflow.
Rules
- Never hardcode the API key. Always read from
$MIRAFLOW_API_KEY. - Always use
x-api-keyas the header name, notAuthorization. - After creating a video, always clearly state the
jobId— the user needs it to check status. - Do not auto-download a video without the user asking.
- Do not poll status in a loop. Check once, report the status, and tell the user to ask again if not ready.
- If an API call returns an error, show the status code and error message clearly.
- NEVER retry
POST /api/video/createorPOST /api/image/generate. These are expensive, non-idempotent operations. Call each creation endpoint exactly once per user request, even if the response is slow or unclear. If the call succeeds (any 2xx), stop — do not call again. - Always confirm before creating. Before calling any creation endpoint, summarize what will be created (avatar, voice, name, script) and wait for the user to confirm. Only proceed after explicit confirmation.
Core Workflows
List Avatars
GET /api/avatars
Present as a numbered list with avatar name and ID.
List Voices
GET /api/voices
Present as a numbered list with voice name and ID.
Create an Avatar Video (voice + script)
- If no
avatarIdgiven, list avatars and ask the user to pick one. - If no
voiceIdgiven, list voices and ask the user to pick one. - Ask for a video name if not provided.
- Before creating: Confirm with the user — show avatar name, voice name, video name, and script. Wait for explicit approval.
- Call
POST /api/video/createexactly once:
{
"avatarId": "<id>",
"voiceId": "<id>",
"name": "<name>",
"text": "<script>",
"im2vid_full": true
}
- Report the
jobIdclearly — the user needs it to check status later. - Do not call create again regardless of how long the response takes. If a timeout or error occurs, report it and let the user decide whether to retry.
Note: im2vid_full: true enables full-body animation on photo avatars. Omit for head-only.
Check Video Status
GET /api/video/{jobId}/status
Translate status for the user:
inference_started→ "Queued, not started yet"inference_working→ "In progress (X% complete)"inference_complete→ "Ready! Use the jobId to fetch the download link."inference_failed→ "Generation failed"inference_error→ "Unknown error occurred"
Fetch Video + Download Link
GET /api/video/{id}
Returns metadata including a signed downloadUrl (valid 24h). Share this directly with the user.
Download a Video
GET /api/video/{id}/download
Save the response (video/mp4) to the current directory as {video-name}.mp4. Confirm the file path when done.
Generate an AI Image
POST /api/image/generatewithprompt,name, optionalaspectRatio(1:1|16:9|9:16|4:3|3:4)- Poll
GET /api/image/{jobId}untilinference_complete→ includesdownloadUrl
Edit an Image
- Upload image via media upload workflow (see
references/api.md) POST /api/image/editwithreferenceImageMediaId,prompt,name- Poll until complete
Upload Media (audio or reference images)
See references/api.md → Media Upload Workflow (initialize → PUT to S3 → finalize)
Error Handling
400— bad request, invalid params, or insufficient credits401— missing/invalid API key (checkMIRAFLOW_API_KEY)404— resource not found
Always show the status code and full error message when an API call fails.
Credits
Created by Katie Min — designed and directed by Katie, built by Claude Code (AI coding agent by Anthropic), powered by OpenClaw.
Files
4 totalComments
Loading comments…
