Skip to content

Overview

Bria's Image Editing API equips builders with a comprehensive suite of tools for manipulating and enhancing images, ranging from open-ended textual edits to specialized, task-specific operations.

General Image Editing (FIBO Edit)

Powered by the FIBO models family, our newest endpoints enable open-ended editing using natural language instructions. This allows for:

  • Global Edits: Modify the style, lighting, or atmosphere of an entire image via text prompts.
  • Localized Edits: Use native masking support to precisely alter specific regions while preserving the rest of the image.
  • Structured Control: Convert text instructions into structured JSON for deterministic and auditable results.

Specialized Capabilities

For focused, high-volume tasks, the API provides optimized endpoints for specific editing capabilities:

  • Background Operations: Removal, replacement, and blur.
  • Content Manipulation: Eraser (object removal) and generative fill.
  • Image Transformation: Expansion (outpainting), resolution increase (upscaling), and automatic cropping.
  • Object & Person Tools: Person modification and automatic mask generation.

Asynchronous Requests and the Status Service Bria API v2 endpoints process requests asynchronously by default. When you make an asynchronous request, the API immediately returns a request_id and a status_url instead of the final result. Use the Status Service to track the request's progress until it reaches a completed state.

See the full guide at Status Service Documentation for complete details and usage examples.

Download OpenAPI description
Languages
Servers
https://engine.prod.bria-api.com/v2/image/edit
https://engine.prod.bria-api.com/v1

v2 endpoints

Endpoints that are part of BRIA API version 2.

Operations

Relight Image

Request

Description

Modify the lighting setup (direction and atmosphere) of an image.

Example:

  • Light Type: "spotlight on subject, keep background settings"
Input ImageOutput Image
Headers
api_tokenstringrequired
Bodyapplication/json
imagestringrequired

The source image to be handled by the API.
Supported input types:

  • Base64-encoded string - URL pointing to an image file that is publicly accessible and available at the time of processing.

Accepted formats: JPEG, JPG, PNG, WEBP.

light_directionstring

Direction (e.g., "front", "side", "top-down").

Enum"front""side""bottom""top-down"
light_typestringrequired

Type (e.g., "sunset", "studio", "neon").

Enum"midday""blue hour light""low-angle sunlight""sunrise light""spotlight on subject, keep background settings""overcast light""soft overcast daylight lighting""cloud-filtered lighting""fog-diffused lighting""moonlight lighting"
curl -i -X POST \
  https://engine.prod.bria-api.com/v2/image/edit/relight \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image": "string",
    "light_direction": "front",
    "light_type": "midday"
  }'

Responses

Successful operation (Synchronous Success)

Bodyapplication/json
resultobjectrequired
result.​image_urlstringrequired
result.​seedintegerrequired
result.​structured_instructionstringrequired
request_idstringrequired
warningstring

Returned only when ip_signal = true and the instruction field included IP content.

Response
application/json
{ "result": { "image_url": "string", "seed": 0, "structured_instruction": "string" }, "request_id": "string", "warning": "string" }

Eraser

Request

Description

The Eraser Route enables the removal of elements or specific areas from a given image.

You can define the area to be removed by providing a mask that outlines the region to be erased. There are two main ways recommended to generate these masks:

  1. Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following link.

  2. By using the /objects/mask_generator route, which will generate all the possible masks for an image.

Output Characteristics

  • The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling.
  • All areas outside the provided mask remain completely unchanged, ensuring pixel-perfect preservation of unedited regions.
Headers
api_tokenstringrequired
Bodyapplication/json
imagestringrequired

The source image to be handled by the API.
Supported input types:

  • Base64-encoded string
  • URL pointing to an image file that is publicly accessible and available at the time of processing.

Accepted formats: JPEG, JPG, PNG, WEBP.

maskstringrequired

The binary mask image that defines the region where object generation will occur.

Mask Requirements

  • The region to generate content must have a pixel value of 255 (white).
  • All other areas must have a pixel value of 0 (black).
  • The mask must have the same aspect ratio as the input image.

Supported Input Types

  • Base64-encoded string – provide the mask data directly in the request.
  • URL – provide a publicly accessible URL to the mask image.

Accepted formats: JPEG, JPG, PNG, WEBP.

Ensure that any provided URL is publicly accessible at the time of the request.

mask_typestring

Specifies how the input mask was created.

  • manual (default) – Use when the mask was generated by a user, for example, using a brush tool.
  • automatic – Use when the mask was generated by an algorithm, such as SAM or other automated segmentation methods.
Default "manual"
Enum"manual""automatic"
preserve_alphaboolean

Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.

  • When true: The output image maintains the original transparency of fully and partially transparent pixels.
  • When false: The output image is fully opaque.
  • Has no effect if the input image does not include an alpha channel.
Default true
syncboolean

Specifies the response mode.

  • When false (default), the request is processed asynchronously: the API immediately returns a status URL to track progress.
  • When true, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
Default false
visual_input_content_moderationboolean

When enabled, applies content moderation to input visual.

Expected behavior:

  • Processing stops if the image fails moderation.
  • Returns a 422 error with details about which parameter failed.
Default false
visual_output_content_moderationboolean

When enabled, applies content moderation to result visual.

Expected behavior:

  • If the modified image fails moderation, returns a 422 error.
Default false
curl -i -X POST \
  https://engine.prod.bria-api.com/v2/image/edit/erase \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image": "example",
    "mask": "example"
  }'

Responses

Successful operation (Synchronous Success)

Bodyapplication/json
resultobjectrequired
result.​image_urlstringrequired
request_idstringrequired
Response
application/json
{ "result": { "image_url": "string" }, "request_id": "string" }

Generative Fill

Request

Description

The GenFill Route enables the generation of objects by prompt in a specific region of an image.

You can define the area for object generation by using a mask that outlines the region where the object will be created. Our model is optimized to work seamlessly with blob-shaped masks.

Masks can be created by allowing users to draw directly on the image with a brush, for example. To access the SDK that demonstrates how to implement a brush feature in your interface, please refer to the following link.

Output Characteristics

  • The modified image is returned at the original resolution, preserving full visual quality without any automatic resizing or downscaling.
  • All areas outside the provided mask remain completely unchanged, ensuring pixel-perfect preservation of unedited regions.
  • If the input includes an alpha channel and preserve_alpha=true, the original transparency values (both full and partial) are maintained in the output.

Content Moderation

This endpoint includes granular content moderation controls to ensure safe usage across all stages of processing:

  • Prompt Moderation – Validates the provided prompt and rejects requests containing unsafe or prohibited terms before processing starts.
  • Input Image Moderation – Scans the uploaded image and stops processing if inappropriate or restricted content is detected.
  • Output Image Moderation – Evaluates the generated image and blocks the response if it violates safety guidelines.
Headers
api_tokenstringrequired

API token associated with the organization.

Bodyapplication/json
imagestringrequired

The source image to be handled by the API.
Supported input types:

  • Base64-encoded string
  • URL pointing to an image file that is publicly accessible and available at the time of processing.

Accepted formats: JPEG, JPG, PNG, WEBP.

maskstringrequired

The binary mask image that defines the region where object generation will occur.

Mask Requirements

  • The region to generate content must have a pixel value of 255 (white).
  • All other areas must have a pixel value of 0 (black).
  • The mask must have the same aspect ratio as the input image.

Supported Input Types

  • Base64-encoded string – provide the mask data directly in the request.
  • URL – provide a publicly accessible URL to the mask image.

Accepted formats: JPEG, JPG, PNG, WEBP.

Ensure that any provided URL is publicly accessible at the time of the request.

promptstringrequired

The prompt you would like to use to generate the object within the masked region.

Prompt Length Limits: ~90-110 words

refine_promptboolean

Controls the automatic prompt refinement feature.

  • true (default): The provided prompt is automatically adjusted for optimal results. The adjusted prompt is then returned in the response payload as refined_prompt.
  • false: The original prompt is used as-is, without modification.
Default true
prompt_content_moderationboolean

When enabled (default: true), the input prompt is moderated before processing.

Expected Behavior

  • The prompt is scanned for NSFW content and terms that violate Bria’s ethical guidelines.
  • If the prompt fails moderation, the request is blocked and the API responds with a 422 error.
Default true
negative_promptstring

The prompt you would like to use to specify details or attributes to avoid in the object generated within the masked region.

preserve_alphaboolean

Controls whether the alpha channel values from the input image are retained in the output, if the input includes an alpha channel.

  • When true: The output image maintains the original transparency of fully and partially transparent pixels.
  • When false: The output image is fully opaque.
  • Has no effect if the input image does not include an alpha channel.
Default true
syncboolean

Specifies the response mode.

  • When false (default), the request is processed asynchronously: the API immediately returns a status URL to track progress.
  • When true, the request is processed synchronously: the API hold the connection open until the proccess is complete and then returns the final image URL in the response.
Default false
seedinteger

You can choose whether you want your generated results to be random or predictable. You can recreate the same result in the future by using the seed value of a result from a response. You can exclude this parameter if you are not interested in recreating your results. This parameter is optional.

visual_input_content_moderationboolean

When enabled, applies content moderation to input visual.

Expected behavior:

  • Processing stops if the image fails moderation.
  • Returns a 422 error with details about which parameter failed.
Default false
visual_output_content_moderationboolean

When enabled, applies content moderation to result visual.

Expected behavior:

  • If the modified image fails moderation, returns a 422 error.
Default false
mask_typestring

Specifies how the input mask was created. Note: This parameter is only relevant when using version: 1.

  • manual (default) – Use when the mask was generated by a user, for example, using a brush tool.
  • automatic – Use when the mask was generated by an algorithm, such as SAM or other automated segmentation methods.
Default "manual"
Enum"manual""automatic"
curl -i -X POST \
  https://engine.prod.bria-api.com/v2/image/edit/gen_fill \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image": "url",
    "mask": "url",
    "prompt": "textual description"
  }'

Responses

Successful operation (Synchronous Success)

Bodyapplication/json
resultobjectrequired
result.​image_urlstringrequired
request_idstringrequired
Response
application/json
{ "result": { "image_url": "string" }, "request_id": "string" }

v1 endpoints

Endpoints that are part of BRIA API version 1.

Operations