Image to Image API documentation
Transform one or more input images guided by a text prompt.
Endpoints
| Contract item | Value |
|---|---|
| Capability | image-to-image |
| Submit | POST https://vidmage.ai/api/v1/image-to-image/submit |
| Query | POST https://vidmage.ai/api/v1/image-to-image/query |
| Task identifier | taskId |
| Result field | imageUrl |
Authenticate with Authorization: Bearer YOUR_API_KEY. Save the task identifier and query the same capability. Use a stable Idempotency-Key for submission retries.
Product guide: AI Image to Image API for Prompted Edits
Parameters and input rules
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
imageUrls | string[] | Yes | Not specified | Input image URLs (at least one). Minimum items: 1 |
prompt | string | Yes | Not specified | Text instruction describing the desired transformation. |
aspectRatio | string | No | "9:16" | Preferred output aspect ratio. Values: "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "21:9", "1:4", "4:1", "1:8", "8:1" |
resolution | string | No | "2k" | Output resolution tier. Exact pixel dimensions depend on the chosen aspect ratio. Values: "1k", "2k", "4k" |
width | string | No | "1080" | Legacy width hint used with height to infer aspect ratio when aspectRatio is omitted. It does not guarantee exact output pixels. |
height | string | No | "1920" | Legacy height hint used with width to infer aspect ratio when aspectRatio is omitted. It does not guarantee exact output pixels. |
Example request
{
"imageUrls": [
"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp"
],
"prompt": "Transform the uploaded portrait into a refined watercolor illustration while preserving the face and pose",
"aspectRatio": "9:16",
"resolution": "2k",
"width": "1080",
"height": "1920"
}# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/image-to-image/submit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: ${VIDMAGE_IDEMPOTENCY_KEY}" \
-H "Content-Type: application/json" \
-d '{"imageUrls":["https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp"],"prompt":"Transform the uploaded portrait into a refined watercolor illustration while preserving the face and pose","aspectRatio":"9:16","resolution":"2k","width":"1080","height":"1920"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Task results and recovery
URL of the generated image. Read imageUrl from the completed query response. Preserve taskId while the task is running.
curl -X POST "https://vidmage.ai/api/v1/image-to-image/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "taskId": "TASK_ID_FROM_SUBMIT" }'
# -> { "success": true, "data": { "status": "...", "imageUrl": "https://..." } }Submission and task queries report the available task and usage information. A timeout is not a confirmed failure. Recover the existing task instead of resubmitting.
For face selection and error recovery, follow Task lifecycle. MCP uses the normalized taskId argument in get_task_result, including capabilities whose REST identifier is requestId.
Credits
| Component / option | Rate | Minimum |
|---|---|---|
| Per request | 5 credits / image | — |
A fixed credit charge applies to this API request.
Use the Playground or the MCP credit estimator for your exact inputs. Credits and billing.
