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
Upload images and files for use with other API endpoints.
Direct Upload Workflow:
/api/media/initialize with file metadatauploadUrl (S3 presigned URL)/api/media/finalize with the mediaIdmediaId in other API callsInitializes a media upload and returns a presigned URL for direct upload to S3.
Workflow:
uploadUrl using a PUT request/api/media/finalize with the mediaId to complete the uploadExample upload to S3:
curl -X PUT -H "Content-Type: image/png" --data-binary @image.png "$uploadUrl"
| fileName required | string Name of the file |
| contentType required | string MIME type of the file |
| fileSize required | integer Size of the file in bytes |
| mediaId | string ID to use for finalization and in other API calls |
| uploadUrl | string Presigned URL for direct file upload |
{- "fileName": "my-image.png",
- "contentType": "image/png",
- "fileSize": 1024000
}{- "mediaId": "cm42ab3ou0008aggajj0jy5e2",
}Finalizes a media upload after the file has been uploaded to S3.
Call this after successfully uploading the file to the uploadUrl from /api/media/initialize.
| mediaId required | string The media ID from the initialize response |
| success | boolean |
{- "mediaId": "cm42ab3ou0008aggajj0jy5e2"
}{- "success": true
}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"
}Create product mockups and advertisement videos.
Workflow:
Generates a product mockup by compositing logos onto a product image.
Workflow:
| productMediaId required | string Media ID of the product image |
| logoMediaIds | Array of strings Array of media IDs for logo images to composite |
Array of objects (LayerPlacement) Placement data for each logo | |
| instruction required | string Instructions for mockup generation |
| result | string Value: "success" |
| jobId | string |
| imageUrl | string |
| mediaId | string |
{- "productMediaId": "cm42ab3ou0008aggajj0jy5e1",
- "logoMediaIds": [
- "cm42ab3ou0008aggajj0jy5e2"
], - "layers": [
- {
- "assetId": "string",
- "x": 50,
- "y": 30,
- "scale": 1,
- "rotation": 0
}
], - "instruction": "Place the logo on the front of the t-shirt"
}{- "result": "success",
- "jobId": "cm42ab3ou0008aggajj0jy5e2",
- "imageUrl": "/api/media/cm42ab3ou0008aggajj0jy5e3/view",
- "mediaId": "cm42ab3ou0008aggajj0jy5e3"
}Creates an 8-second product advertisement video from a saved mockup.
Animation Styles:
luxury_macro: Luxury macro studio filmneo_noir_night: Neo-noir night street setwarm_lifestyle_sunset: Golden-hour lifestyle cinematicfuturistic_clean_studio: Ultra-clean futuristic studiocyberpunk_showcase: Cyberpunk display pedestalfilm_35mm_editorial: 35mm film editorial lookhigh_fashion_runway: High-fashion spotlight stagenature_premium: Premium nature setcustom: Custom prompt onlyWorkflow:
/api/mockup/{jobId}/status to check progress/api/mockup/videos| mockupId required | string ID of the saved mockup |
| animationStyle required | string Enum: "luxury_macro" "neo_noir_night" "warm_lifestyle_sunset" "futuristic_clean_studio" "cyberpunk_showcase" "film_35mm_editorial" "high_fashion_runway" "nature_premium" "custom" Animation style preset |
| userPrompt | string Optional custom prompt (required if animationStyle is 'custom') |
| aspectRatio | string Default: "9:16" Enum: "16:9" "9:16" Video aspect ratio |
| result | string Value: "success" |
| jobId | string |
{- "mockupId": "cm42ab3ou0008aggajj0jy5e1",
- "animationStyle": "luxury_macro",
- "userPrompt": "Focus on the logo details",
- "aspectRatio": "16:9"
}{- "result": "failure",
- "error": "string"
}Generates a new logo or product image from a text prompt.
Workflow:
/api/mockup/{jobId}/status to check progress/api/mockup/assets| prompt required | string Description of the asset to generate |
| type required | string Enum: "logo" "product" Type of asset to generate |
| result | string Value: "success" |
| jobId | string |
{- "prompt": "minimalist tech company logo",
- "type": "logo"
}{- "result": "failure",
- "error": "string"
}Edits an existing image using AI based on a text prompt.
You can provide the image in three ways:
imageMediaId: Media ID of a previously uploaded imageimageBase64: Base64-encoded image dataimage: File upload (multipart/form-data)Workflow:
/api/mockup/{jobId}/status to check progress/api/mockup/assets| imageMediaId | string Media ID of the image to edit |
| imageBase64 | string Base64-encoded image data (alternative to imageMediaId) |
| prompt required | string Edit instructions |
| type required | string Enum: "logo" "product" Type of asset |
| result | string Value: "success" |
| jobId | string |
{- "imageMediaId": "cm42ab3ou0008aggajj0jy5e1",
- "imageBase64": "string",
- "prompt": "Remove the background",
- "type": "logo"
}{- "result": "failure",
- "error": "string"
}Lists all saved product mockups for the authenticated user.
| result | string Value: "success" |
Array of objects (MockupItem) |
{- "result": "success",
- "mockups": [
- {
- "id": "cm42ab3ou0008aggajj0jy5e2",
- "imageUrl": "/api/media/cm42ab3ou0008aggajj0jy5e3/view",
- "prompt": "Place logo on t-shirt",
- "createdAt": "2025-01-07T23:17:06.601Z"
}
]
}Lists all saved logo and product assets for the authenticated user.
| result | string Value: "success" |
Array of objects (AssetItem) |
{- "result": "success",
- "assets": [
- {
- "id": "cm42ab3ou0008aggajj0jy5e2",
- "type": "logo",
- "name": "AI Generated logo",
- "imageUrl": "/api/media/cm42ab3ou0008aggajj0jy5e3/view",
- "mediaId": "cm42ab3ou0008aggajj0jy5e3",
- "createdAt": "2025-01-07T23:17:06.601Z"
}
]
}Lists all generated product advertisement videos for the authenticated user.
| result | string Value: "success" |
Array of objects (MockupVideoItem) |
{- "result": "success",
- "videos": [
- {
- "id": "cm42ab3ou0008aggajj0jy5e2",
- "name": "Product Ad - luxury macro",
- "status": "completed",
- "mockupId": "cm42ab3ou0008aggajj0jy5e1",
- "mockupImageUrl": "/api/media/cm42ab3ou0008aggajj0jy5e3/view",
- "aspectRatio": "9:16",
- "createdAt": "2025-01-07T23:17:06.601Z",
- "progress": 75
}
]
}Checks the status of a mockup-related job (mockup generation, asset generation, or video generation).
| id required | string The job ID |
| result | string Value: "success" |
| status | string Enum: "waiting" "started" "completed" "failed" |
| progress | number |
| imageUrl | string Available when status is completed |
| mediaId | string Available when status is completed |
| reason | string Error reason when status is failed |
{- "result": "success",
- "status": "waiting",
- "progress": 45,
- "imageUrl": "string",
- "mediaId": "string",
- "reason": "string"
}Generate eye-catching YouTube thumbnails with AI.
Basic Workflow (text prompt only):
/api/thumbnail/generate with a prompt/api/thumbnail/{jobId} until completeWith Reference Images (e.g., from YouTube video):
/api/media/initialize + /api/media/finalize/api/thumbnail/generate with referenceImageMediaIds/api/thumbnail/{jobId} until completeUsing YouTube Video Thumbnail:
v=abc123)https://img.youtube.com/vi/{videoId}/maxresdefault.jpgGenerates a YouTube thumbnail from a text prompt, optionally using reference images.
Basic Workflow:
/api/thumbnail/{jobId} to check statusWith Reference Images:
/api/media/initialize and /api/media/finalizemediaId values in referenceImageMediaIds arrayUsing YouTube Video Thumbnails as Reference:
watch?v=abc123 → abc123)https://img.youtube.com/vi/{videoId}/maxresdefault.jpgmediaIdmediaId in referenceImageMediaIds to generate a similar thumbnail| prompt required | string Description of the thumbnail to generate |
| name required | string Name for the thumbnail |
| aspectRatio | string Default: "16:9" Enum: "16:9" "9:16" Aspect ratio (16:9 for standard, 9:16 for Shorts) |
| referenceImageMediaIds | Array of strings Optional media IDs of reference images |
| negativePrompt | string Elements to avoid |
| seed | integer Seed for reproducible results |
| result | string Value: "success" |
| jobId | string |
{- "prompt": "Epic gaming moment with explosion and character in action pose",
- "name": "Gaming Video Thumbnail",
- "aspectRatio": "16:9",
- "referenceImageMediaIds": [
- "string"
], - "negativePrompt": "blurry, low quality",
- "seed": 12345
}{- "result": "failure",
- "error": "string"
}Lists all generated YouTube thumbnails for the authenticated user.
| page | integer Default: 1 Page number for pagination |
| result | string Value: "success" |
Array of objects (ThumbnailItem) | |
| page | integer |
| totalPages | integer |
| totalCount | integer |
{- "result": "success",
- "thumbnails": [
- {
- "id": "cm42ab3ou0008aggajj0jy5e2",
- "name": "Gaming Video Thumbnail",
- "prompt": "Epic gaming moment",
- "imageUrl": "/api/media/cm42ab3ou0008aggajj0jy5e3/view",
- "mediaId": "cm42ab3ou0008aggajj0jy5e3",
- "aspectRatio": "16:9",
- "createdAt": "2025-01-07T23:17:06.601Z"
}
], - "page": 1,
- "totalPages": 5,
- "totalCount": 100
}Gets the status of a thumbnail generation job, or the thumbnail details if completed.
| id required | string The job ID |
| result | string Value: "success" |
| status | string Enum: "waiting" "started" |
| progress | number |
{- "result": "success",
- "status": "started",
- "progress": 45
}