Mira Image

Mira Image is our image generator and editor. Two modes share one endpoint: text-to-image (classic prompt-based generation) and image-to-image (edit an existing image or compose multiple reference inputs).

Capabilities

  • Text-to-imagegenerate from a text prompt in 50+ languages
  • Image-to-imageedit or extend an existing image passed as a reference input
  • Multi-referenceup to 4 reference images per request — transfer style, identity, product, background
  • Resolutionssquare (1024×1024), portrait (1024×1536) and landscape (1536×1024)
  • Qualitylow / medium / high / auto — pick the speed-vs-detail balance
  • Content moderationall requests pass a safety check before generation; disallowed prompts return 400

Text-to-image

cURL
curl https://api.vmira.ai/v1/images/generate \
  -H "Authorization: Bearer $MIRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A quiet lighthouse on a rocky shore at sunset, cinematic light",
    "size": "1024x1024",
    "n": 1,
    "quality": "high"
  }'

Python (OpenAI-compatible SDK)

Python
from openai import OpenAI

client = OpenAI(
    api_key="sk-mira-YOUR_API_KEY",
    base_url="https://api.vmira.ai/v1",
)

result = client.images.generate(
    prompt="Minimalist coffee-shop logo, flat vector",
    size="1024x1024",
    n=1,
)

print(result.data[0].url)

Image-to-image (with references)

Pass one or more image URLs or data-URIs in reference_images. The prompt describes what should change or how to combine the references.

cURL
curl https://api.vmira.ai/v1/images/generate \
  -H "Authorization: Bearer $MIRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Same product, but on a marble countertop with soft morning light",
    "size": "1024x1024",
    "n": 1,
    "reference_images": [
      "https://example.com/product.png"
    ]
  }'

Response shape

JSON
{
  "created": 1714000000,
  "data": [
    {
      "url": "https://cdn.vmira.ai/img/abc123.png",
      "revised_prompt": "Expanded prompt actually used for generation"
    }
  ]
}

Parameters

  • promptrequired, 1–4000 characters
  • size1024x1024 | 1024x1536 | 1536x1024 | auto
  • nnumber of images (1–4)
  • qualitylow | medium | high | auto
  • reference_imagesarray of URLs or data-URIs, up to 4 — enables image-to-image mode
Per-image cost depends on size and quality. See /pricing for current rates and /docs/api/reference for the full parameter list.