Skip to main content
Back to API Platform

GPT Image 2 Edit API

OpenAI GPT Image 2 image editing — supply 1-8 reference images plus an edit instruction. Optional mask for inpainting. 4K-capable; pricing varies by quality + size. Integrate this model via REST with endpoint docs, parameters, and code examples.

Image Generation
Img2Img
Editing
Credit Cost
5 credits
Type
Image

API Endpoint

POST
/api/v1/models/gpt-image-2-edit/run

Test This Model

Run a real request through the API pipeline and inspect the exact input and output your integration will handle. Uses your credits like any API call; failed runs are refunded automatically.

Parameters

Input parameters accepted by this model

ParameterTypeDefault
prompt
required
string
-
image_urls
required
array
-
mask_url
string
-
image_size
enum
auto
quality
enum
high
num_images
integer
1
output_format
enum
png

See also

Related endpoints on this model — you may need a different apiId for a different operation (e.g. image edit vs generation).

Example Outputs

Real outputs generated by this model

her hair is blue
View Details

her hair is blue

5 credits
166.8s

Code Examples

Edit one image — copy and paste to get started

bash
curl -X POST "https://pixeldojo.ai/api/v1/models/gpt-image-2-edit/run" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "give the subject a vintage film grain",
    "image_urls": [
      "https://..."
    ],
    "quality": "high"
  }'

Response Format

Submit Response (202 Accepted)

json
{
  "jobId": "job_abc123...",
  "status": "pending",
  "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123...",
  "creditCost": 5,
  "creditsRemaining": 95,
  "expiresAt": "2026-07-15T01:55:02Z"
}

Completed Response

json
{
  "jobId": "job_abc123...",
  "status": "completed",
  "output": {
    "images": [
      "https://temp.pixeldojo.ai/pixeldojotemp/1705930123-456789.png"
    ]
  },
  "creditCost": 5,
  "expiresAt": "2026-07-15T01:55:02Z"
}