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-image — generate from a text prompt in 50+ languages
- Image-to-image — edit or extend an existing image passed as a reference input
- Multi-reference — up to 4 reference images per request — transfer style, identity, product, background
- Resolutions — square (1024×1024), portrait (1024×1536) and landscape (1536×1024)
- Quality — low / medium / high / auto — pick the speed-vs-detail balance
- Content moderation — all 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
- prompt — required, 1–4000 characters
- size — 1024x1024 | 1024x1536 | 1536x1024 | auto
- n — number of images (1–4)
- quality — low | medium | high | auto
- reference_images — array 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.