Create image edit
Use POST /v1/images/edits in RunBridge AI to edit images with multipart uploads, masks, GPT image models, and encoded image output controls.
Use this route when
- You already have a source image and want a prompt-driven edit
- You may need a mask for targeted changes
- You can handle multipart file upload instead of a plain JSON request
Safe first request
- Start with one PNG or JPG file
- Skip the mask until the base edit flow works
- Use
model: "gpt-image-2"for GPT image edit requests on this route - Use one short instruction that asks for one visible change
- Read the edited result from
data[0].b64_json - Set
output_format: "jpeg"when you want a JPEG payload - Expect longer latency than plain image generation
Model behavior
- GPT image edit models on this route return inline base64 image data
output_formatcontrols the encoded image type insideb64_json
Authorizations
Bearer token authentication. Use your RunBridge AI key.
Body
Source image file. Start with one PNG or JPG input for the simplest flow.
Edit instruction describing the change you want.
"Add a small red bow tie on the cat"
The GPT image editing model ID. Find model IDs on the Models page.
Optional PNG mask. Transparent areas mark the regions to edit. The mask dimensions must match the source image exactly.
Number of edited images to return.
Quality setting for models that support it.
high, medium, low "low"
Encoded image type for GPT image edit results returned in data[].b64_json. For example, use jpeg for a JPEG payload.
Requested output size when supported by the selected model.
Response
Edited image result.
Background mode returned by models that expose it.
Encoded image type returned by GPT image models.
Quality level returned by models that expose it.
Output size returned by models that expose it.