Download OpenAPI specification:Download
Miraflow provides a suite of APIs for managing your avatars, video and media as well as generating new videos.
These endpoints require authorization. Include your API key in the request by replacing API_KEY:
curl -H "x-api-key: API_KEY" https://miraflow.ai/api/avatars
Lists the available avatars. These include stock avatars as well as avatars created by the account associated with the supplied API key.
{- "avatars": [
- {
- "id": "cm2yaz9j10008l0qg9npyjgs3",
- "name": "Aerin",
- "createdAt": "2024-11-01T05:37:46.194Z",
- "voiceId": "cm1lgilny0005m2lnvv3vgtgv",
- "isPhoto": true
}
]
}Lists the available voices. These include stock voices as well as voices created by the account associated with the supplied API key.
{- "avatars": [
- {
- "id": "cm5n372yq0003vow86ukx8zfe",
- "name": "Belinda - Curious and Soft",
- "createdAt": "2025-01-07T23:13:33.103Z"
}
]
}Lists the videos that have completed generation.
{- "videos": [
- {
- "id": "cm5n3bnpa000avow8t6p5yc4l",
- "name": "Test video",
- "sourceAvatarId": "cm2yaz9j10008l0qg9npyjgs3",
- "createdAt": "2025-01-07T23:17:06.601Z"
}
]
}Fetches metadata for a single completed video.
| id required | string The ID of the desired video |
| id | string |
| name | string |
| sourceAvatarId | string |
| createdAt | string <date> |
| downloadUrl | string <url> |
{- "id": "cm5n3bnpa000avow8t6p5yc4l",
- "name": "Test video",
- "sourceAvatarId": "cm2yaz9j10008l0qg9npyjgs3",
- "createdAt": "2025-01-07T23:17:06.601Z",
}Checks the status of a video generation job. The status will be one of:
Note: The ID parameter should be the jobId that was returned from the video creation endpoint.
| id required | string The Job ID returned from the video creation endpoint |
| result | string Value: "success" |
| status | string Enum: "inference_started" "inference_working" "inference_complete" "inference_failed" "inference_error" |
| progress | string Progress percentage when status is inference_working |
{- "result": "success",
- "status": "inference_working",
- "progress": "45%"
}Starts a new video creation job. The specified avatar will be used, and either a speech can be created using a specified voice and script, or an uploaded audio track can be used.
| avatarId | string |
| name | string |
| voiceId | string |
| text | string |
| im2vid_full | boolean |
| result | string Value: "success" |
| jobId | string |
{- "avatarId": "cm2yaz9j10008l0qg9npyjgs3",
- "name": "My new video",
- "voiceId": "cm1lgilny0005m2lnvv3vgtgv",
- "text": "This is the text of the script to be generated in the specified voice.",
- "im2vid_full": true
}{- "result": "success",
- "jobId": "cm42ab3ou0008aggajj0jy5e2"
}Starts a new text-to-image generation job. Provide a text prompt describing the image you want to generate.
This endpoint generates images from text descriptions without requiring any reference images.
Workflow:
jobId in the response.jobId with GET /api/image/{jobId} to check the job status.downloadUrl field containing the image URL.| prompt required | string Text description of the image to generate |
| name required | string Name for the image generation job |
| aspectRatio | string Enum: "1:1" "16:9" "9:16" "4:3" "3:4" Aspect ratio for the output image |
| negativePrompt | string Optional negative prompt to exclude certain elements |
| seed | integer Optional seed for reproducible results |
| result | string Value: "success" |
| jobId | string |
{- "prompt": "A photorealistic portrait of an adult person with natural lighting",
- "name": "My generated image",
- "aspectRatio": "1:1",
- "negativePrompt": "blurry, low quality, distorted",
- "seed": 12345
}{- "result": "success",
- "jobId": "cm42ab3ou0008aggajj0jy5e2"
}Starts a new image-to-image editing job. Upload one or more reference images and provide a prompt describing how you want to edit them. The AI will transform the images based on your prompt.
You can either upload files directly (multipart/form-data) or provide media IDs of previously uploaded images (application/json). You can provide a single image or multiple images.
Workflow:
jobId in the response.jobId with GET /api/image/{jobId} to check the job status.downloadUrl field containing the image URL.| referenceImageMediaId required | string Media ID of the previously uploaded reference image |
| prompt required | string Description of how to edit the image |
| name required | string Name for the image editing job |
| aspectRatio | string Enum: "1:1" "16:9" "9:16" "4:3" "3:4" Aspect ratio for the output image |
| negativePrompt | string Optional negative prompt to exclude certain elements |
| seed | integer Optional seed for reproducible results |
| result | string Value: "success" |
| jobId | string |
{- "referenceImageMediaId": "cm42ab3ou0008aggajj0jy5e1",
- "prompt": "Turn this photo into a professional business headshot",
- "name": "My image editing job",
- "aspectRatio": "1:1",
- "negativePrompt": "blurry, low quality",
- "seed": 12345
}{- "result": "success",
- "jobId": "cm42ab3ou0008aggajj0jy5e2"
}Starts a new image inpainting job. Upload an original image and a mask image (black and white), then specify what you want to replace in the masked areas. The mask should have white areas indicating what to replace and black areas indicating what to keep.
You can either upload files directly (multipart/form-data) or provide media IDs of previously uploaded images (application/json).
To create a mask image, you can use the frontend interface at /create-ai-image:
Workflow:
jobId in the response.jobId with GET /api/image/{jobId} to check the job status.downloadUrl field containing the image URL.| originalImageMediaId required | string Media ID of the previously uploaded original image |
| maskImageMediaId required | string Media ID of the previously uploaded mask image |
| prompt required | string Description of what to replace the masked areas with |
| name required | string Name for the inpainting job |
| aspectRatio | string Enum: "1:1" "16:9" "9:16" "4:3" "3:4" Aspect ratio for the output image |
| negativePrompt | string Optional negative prompt to exclude certain elements |
| seed | integer Optional seed for reproducible results |
| result | string Value: "success" |
| jobId | string |
{- "originalImageMediaId": "cm42ab3ou0008aggajj0jy5e1",
- "maskImageMediaId": "cm42ab3ou0008aggajj0jy5e2",
- "prompt": "Change to blue",
- "name": "My inpainting job",
- "aspectRatio": "1:1",
- "negativePrompt": "blurry, low quality",
- "seed": 12345
}{- "result": "success",
- "jobId": "cm42ab3ou0008aggajj0jy5e2"
}Gets the status or result of any job. This is the general entry point for job status management.
When the job is in progress or failed, returns status information:
When the job is completed:
Note: The jobId parameter should be the jobId that was returned from the job creation endpoint.
| jobId required | string The ID of the job |
| id | string |
| name | string |
| prompt | string |
| createdAt | string <date-time> |
| downloadUrl | string <url> |
| mediaId | string |
{- "id": "cm42ab3ou0008aggajj0jy5e2",
- "name": "My inpainting job",
- "prompt": "Change to blue",
- "createdAt": "2025-01-07T23:17:06.601Z",
- "mediaId": "cm42ab3ou0008aggajj0jy5e3"
}