A valid request URL is required to generate request examples{
"id": "<string>",
"created": 123,
"model": "<string>",
"data": [
{
"id": "<string>",
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>",
"index": 123,
"detections": [
{
"x_min": 123,
"y_min": 123,
"x_max": 123,
"y_max": 123
}
]
}
],
"background": "<string>",
"output_format": "png",
"quality": "<string>",
"size": "256x256",
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"total_tokens": 123,
"output_tokens": 123,
"output_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
}
},
"extra_fields": {
"request_type": "<string>",
"provider": "openai",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"provider": "openai",
"model_requested": "<string>",
"request_type": "<string>"
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"provider": "openai",
"model_requested": "<string>",
"request_type": "<string>"
}
}Edit an image
Edits an image using a text prompt and optional mask. Accepts either application/json (sources
as URLs or base64 under images) or multipart/form-data (to upload the image as image or
image[]). Requires at least model, one image, and prompt - the latter except for the
operation types driven purely by the input image, e.g. background_removal. Only the JSON body
preserves the types of provider-native extra params; multipart carries every value as a string.
A valid request URL is required to generate request examples{
"id": "<string>",
"created": 123,
"model": "<string>",
"data": [
{
"id": "<string>",
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>",
"index": 123,
"detections": [
{
"x_min": 123,
"y_min": 123,
"x_max": 123,
"y_max": 123
}
]
}
],
"background": "<string>",
"output_format": "png",
"quality": "<string>",
"size": "256x256",
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"total_tokens": 123,
"output_tokens": 123,
"output_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
}
},
"extra_fields": {
"request_type": "<string>",
"provider": "openai",
"model_requested": "<string>",
"model_deployment": "<string>",
"latency": 123,
"chunk_index": 123,
"raw_request": {},
"raw_response": {},
"cache_debug": {
"cache_hit": true,
"cache_id": "<string>",
"hit_type": "<string>",
"requested_provider": "<string>",
"requested_model": "<string>",
"provider_used": "<string>",
"model_used": "<string>",
"input_tokens": 123,
"threshold": 123,
"similarity": 123
}
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"provider": "openai",
"model_requested": "<string>",
"request_type": "<string>"
}
}{
"event_id": "<string>",
"type": "<string>",
"is_bifrost_error": true,
"status_code": 123,
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"event_id": "<string>"
},
"extra_fields": {
"provider": "openai",
"model_requested": "<string>",
"request_type": "<string>"
}
}Authorizations
Bearer token authentication. Use your provider API key or Bifrost authentication token.
Virtual keys (prefixed with sk-bf-) can also be passed here.
Body
JSON encoding of an image edit. Sources are supplied as an images array, the same nested form
/v1/videos/edits uses for its source video. Unrecognised top-level fields are forwarded to the
provider as extra params with their JSON types intact, which is what a model's nested tuning
object needs (e.g. Runware's settings and providerSettings). To upload the image as a file,
post multipart/form-data instead - see ImageEditMultipartRequest.
Model identifier in format provider/model
Source images. Entries carrying neither a URL nor bytes are dropped; a request left with no usable image is rejected. Providers treat the first image as the primary one (Runware's seed image, Bedrock's style-transfer base), so the order is part of the contract. Only the reference-image models accept more than one; elsewhere images after the first are dropped.
One source image, either as a bare string - the form input_images takes on
/v1/images/generations - or as an object naming which arm it fills. Providers that cannot accept
a given form reject it.
Text prompt describing the edit. Required except for the operation types that are driven
purely by the input image: background_removal, erase_object, upscale, upscale_fast,
mask, segmentation, vectorize and controlnet_preprocess.
Optional base64-encoded mask image for inpainting (transparent areas indicate regions to edit). Dropped for models that declare no mask input.
Type of edit operation. Support varies by provider; unsupported values are dropped and the request runs as a standard edit.
inpainting, outpainting, background_removal, remove_background, remove_bg, erase_object, recolor, search_replace, control_sketch, control_structure, style_guide, style_transfer, upscale, upscale_fast, upscale_creative, upscale_conservative, mask, segmentation, vectorize, controlnet_preprocess, controlnet, preprocess Multiply each dimension by this factor. type: "upscale" only; mutually exclusive with
target_megapixels.
Target output size in megapixels. type: "upscale" only; mutually exclusive with
upscale_factor.
Number of images to generate
1 <= x <= 10Size of the output image
256x256, 512x512, 1024x1024, 1536x1024, 1024x1536, auto Format of the response. data_uri is supported by providers that return an inline
data URI (e.g. Runware).
url, b64_json, data_uri When true, stream the response via Server-Sent Events
Background type for the image
transparent, opaque, auto How closely to follow the original image
low, high Number of partial images to generate when streaming
0 <= x <= 3Quality of the output image
auto, high, medium, low, standard Output image format. svg applies to vectorize operations
png, webp, jpeg, tiff, svg Number of inference steps
Seed for reproducible editing
Compression level (0-100%)
0 <= x <= 100What to avoid in the edit
User identifier for tracking
Fallback models to try if primary model fails
Show child attributes
Show child attributes
Response
Successful response. Returns JSON for non-streaming requests, or Server-Sent Events (SSE) stream when stream=true.
When streaming, events are sent with the following event types:
image_edit.partial_image: Intermediate image chunks with base64-encoded image dataimage_edit.completed: Final event for each image with usage informationerror: Error events with error details
Unique identifier for the generation request
Unix timestamp when the image was created
Model used for generation
Array of generated images
Show child attributes
Show child attributes
Background type for the image
Output image format
png, webp, jpeg Quality of the generated image
Size of the generated image
256x256, 512x512, 1024x1024, 1792x1024, 1024x1792, 1536x1024, 1024x1536, auto Show child attributes
Show child attributes
Additional fields included in responses
Show child attributes
Show child attributes
Was this page helpful?

