API Documentation (1.0)

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

List avatars

Lists the available avatars. These include stock avatars as well as avatars created by the account associated with the supplied API key.

Authorizations:
ApiKeyAuth

Responses

Response Schema: application/json
any

Response samples

Content type
application/json
{
  • "avatars": [
    • {
      }
    ]
}

List voices

Lists the available voices. These include stock voices as well as voices created by the account associated with the supplied API key.

Authorizations:
ApiKeyAuth

Responses

Response Schema: application/json
any

Response samples

Content type
application/json
{
  • "avatars": [
    • {
      }
    ]
}

List videos

Lists the videos that have completed generation.

Authorizations:
ApiKeyAuth

Responses

Response Schema: application/json
any

Response samples

Content type
application/json
{
  • "videos": [
    • {
      }
    ]
}

Fetch video metadata

Fetches metadata for a single completed video.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

The ID of the desired video

Responses

Response Schema: application/json
id
string
name
string
sourceAvatarId
string
createdAt
string <date>
downloadUrl
string <url>

Response samples

Content type
application/json
{}

Download video

Downloads a single completed video.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

The ID of the desired video

Responses

Response Schema: video/mp4
string <binary>

Check video generation status

Checks the status of a video generation job. The status will be one of:

  • "inference_started": Job has been queued
  • "inference_working": Job is in progress
  • "inference_complete": Video generation is complete
  • "inference_failed": Job failed
  • "inference_error": Unknown error occurred

Note: The ID parameter should be the jobId that was returned from the video creation endpoint.

Authorizations:
ApiKeyAuth
path Parameters
id
required
string

The Job ID returned from the video creation endpoint

Responses

Response Schema: application/json
One of
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

Response samples

Content type
application/json
Example
{
  • "result": "success",
  • "status": "inference_working",
  • "progress": "45%"
}

Create a new video

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.

Authorizations:
ApiKeyAuth
Request Body schema:
required
One of
avatarId
string
name
string
voiceId
string
text
string
im2vid_full
boolean

Responses

Response Schema: application/json
One of
result
string
Value: "success"
jobId
string

Request samples

Content type
Example
{
  • "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
}

Response samples

Content type
application/json
Example
{
  • "result": "success",
  • "jobId": "cm42ab3ou0008aggajj0jy5e2"
}

Create an image generation job

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:

  1. Call this endpoint to create a job. You'll receive a jobId in the response.
  2. Use the jobId with GET /api/image/{jobId} to check the job status.
  3. Poll the status endpoint until the job is complete (status: "inference_complete").
  4. When complete, the response will include a downloadUrl field containing the image URL.
Authorizations:
ApiKeyAuth
Request Body schema:
required
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

Responses

Response Schema: application/json
One of
result
string
Value: "success"
jobId
string

Request samples

Content type
{
  • "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
}

Response samples

Content type
application/json
Example
{
  • "result": "success",
  • "jobId": "cm42ab3ou0008aggajj0jy5e2"
}

Create an image editing job

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:

  1. Call this endpoint to create a job. You'll receive a jobId in the response.
  2. Use the jobId with GET /api/image/{jobId} to check the job status.
  3. Poll the status endpoint until the job is complete (status: "inference_complete").
  4. When complete, the response will include a downloadUrl field containing the image URL.
Authorizations:
ApiKeyAuth
Request Body schema:
required
One of
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

Responses

Response Schema: application/json
One of
result
string
Value: "success"
jobId
string

Request samples

Content type
Example
{
  • "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
}

Response samples

Content type
application/json
Example
{
  • "result": "success",
  • "jobId": "cm42ab3ou0008aggajj0jy5e2"
}

Create an inpainting job

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:

  1. Upload your original image
  2. Switch to Inpaint mode
  3. Draw mask areas with the blue brush
  4. Click "Download Mask" to download the black/white mask image
  5. Use the downloaded mask image in your API request

Workflow:

  1. Call this endpoint to create a job. You'll receive a jobId in the response.
  2. Use the jobId with GET /api/image/{jobId} to check the job status.
  3. Poll the status endpoint until the job is complete (status: "inference_complete").
  4. When complete, the response will include a downloadUrl field containing the image URL.
Authorizations:
ApiKeyAuth
Request Body schema:
required
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

Responses

Response Schema: application/json
One of
result
string
Value: "success"
jobId
string

Request samples

Content type
{
  • "originalImageMediaId": "cm42ab3ou0008aggajj0jy5e1",
  • "maskImageMediaId": "cm42ab3ou0008aggajj0jy5e2",
  • "prompt": "Change to blue",
  • "name": "My inpainting job",
  • "aspectRatio": "1:1",
  • "negativePrompt": "blurry, low quality",
  • "seed": 12345
}

Response samples

Content type
application/json
Example
{
  • "result": "success",
  • "jobId": "cm42ab3ou0008aggajj0jy5e2"
}

Get job status or result

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:

  • "inference_started": Job has been queued
  • "inference_working": Job is in progress (may include progress percentage)
  • "inference_failed": Job failed

When the job is completed:

  • For image jobs (GEMINI_IMAGE): Returns image metadata and download URL
  • For other job types: Returns completion status

Note: The jobId parameter should be the jobId that was returned from the job creation endpoint.

Authorizations:
ApiKeyAuth
path Parameters
jobId
required
string

The ID of the job

Responses

Response Schema: application/json
One of
id
string
name
string
prompt
string
createdAt
string <date-time>
downloadUrl
string <url>
mediaId
string

Response samples

Content type
application/json
Example
{}