GPT Image 2 Image to Image API documentation
Edit one or two images with GPT Image 2 using a text instruction.
Endpoints
| Contract item | Value |
|---|---|
| Capability | gpt-image-2-image-to-image |
| Submit | POST https://vidmage.ai/api/v1/gpt-image-2-image-to-image/submit |
| Query | POST https://vidmage.ai/api/v1/gpt-image-2-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: GPT Image API
Parameters and input rules
| Field | Type | Required | Default | Meaning and limits |
|---|---|---|---|---|
imageUrls | string[] | Yes | Not specified | One or two source image URLs. Minimum items: 1Maximum items: 2 |
prompt | string | Yes | Not specified | Image editing instruction (5-800 characters). Minimum characters: 5Maximum characters: 800 |
aspectRatio | string | No | "1:1" | Output aspect ratio. Values: "3:2", "1:1", "2:3" |
Example request
{
"imageUrls": [
"https://vidmage.ai/assets/images/samples/blue-eyed-woman-sunlight.webp"
],
"prompt": "Turn the scene into a polished winter evening while preserving the main subject and composition",
"aspectRatio": "1:1"
}# Set VIDMAGE_IDEMPOTENCY_KEY to a unique value for this task; preserve it for transport retries.
curl -X POST "https://vidmage.ai/api/v1/gpt-image-2-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":"Turn the scene into a polished winter evening while preserving the main subject and composition","aspectRatio":"1:1"}'
# -> { "success": true, "taskId": "...", "creditsConsumed": ... }Task results and recovery
URL of the edited image. Read imageUrl from the completed query response. Preserve taskId while the task is running.
curl -X POST "https://vidmage.ai/api/v1/gpt-image-2-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.
