Skip to content

Images

Text-to-image. Synchronous by default with a 30-second budget; add ?async=true for the async path (no time budget, precise failure codes).

OpenAI-standard fields plus Meshive extensions:

FieldTypeDefaultNotes
modelstringrequiredThe deployment’s model id
promptstringrequired
nint1Images per request
sizestring"1024x1024"Must be one of the model’s supported sizes — else 422 listing them
response_formatstring"url""url" | "b64_json"
negative_promptstringMeshive extension
seedintMeshive extension
stepsintmodel defaultMeshive extension — inference steps
guidance_scalefloatmodel defaultMeshive extension
storage_credential_idintMeshive extension — output bucket override (storage)
webhook_urlstringMeshive extension — HTTPS callback on completion (webhooks)

Unknown OpenAI fields (style, quality, user, …) are ignored without error.

?async=trueQueue instead of waiting — returns 202 with a request id
Idempotency-Key headerDedupes async submissions on retries (semantics)
{
"created": 1780000000,
"data": [
{ "url": "https://...presigned..." }
]
}

Link and storage behavior depends on the output destination:

Destinationresponse_format=urlresponse_format=b64_json
Managed (default)Link valid ~1 hour; the underlying object is removed shortly after — download promptlyImage returned inline; nothing stored
Your bucket (request override or deployment default)Stored permanently; link signed ~7 daysReturned inline and stored in your bucket
{
"id": "req_9f8e7d6c5b4a3210",
"object": "inference.request",
"status": "queued",
"modality": "image",
"estimated_seconds": 30
}

Track it via GET /v1/requests/{id}, a webhook, or the console. Full guide: Async image generation.

Status · codeMeaning
404 model_not_foundUnknown model id
400 wrong_modalityThe model isn’t an image model
422 size_not_supportedsize not in the model’s list — message includes the supported sizes
422 invalid_webhook_urlwebhook_url failed validation (must be public HTTPS)
422 (storage codes)storage_credential_id unknown or not verified
429 replica_saturatedAll replicas at concurrency limit — retry after Retry-After, or go async
503 no_pod_availableNo replica ready (starting up, paused, or scaled away)
504 image_generation_timeoutSync budget exceeded — use async
5xx upstream_errorGPU worker failed; most often memory. Async reports the exact cause
502 storage_upload_failedCouldn’t write to your output bucket — check the credential

Image-to-image editing, OpenAI-compatible (client.images.edit(...)). Multipart form:

FieldTypeDefaultNotes
imagefilerequiredThe input image
promptstringrequired
modelstringrequiredMust be an image model that accepts image input (I2I)
maskfileSync only — with ?async=true it returns 400 async_mask_unsupported
nint1
sizestring"1024x1024"Validated against supported sizes
response_formatstring"url"
webhook_urlstringMeshive extension
storage_credential_idintMeshive extension

?async=true and Idempotency-Key work exactly as on generations; sync timeout returns 504 image_edit_timeout. Response shape, storage behavior, and the rest of the error table match generations (a model that doesn’t accept image input fails validate with 400).

Terminal window
curl https://<your-deployment>.inference.meshive.ai/v1/images/edits \
-H "Authorization: Bearer $MESHIVE_API_KEY" \
-F image=@input.png \
-F prompt="Make the sky a sunset" \
-F model="<model-id>" \
-F size="1024x1024"