Skip to content

Overview

Bria's Image Editing API equips builders with a comprehensive suite of tools for manipulating and enhancing images.

The API provides advanced capabilities including background operations (removal, replacement, blur), content manipulation (eraser, generative fill), image transformation (expansion, resolution increase), automatic cropping, 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.

Advanced Customization and Access:
As part of Bria’s Source Code & Weights product, developers seeking deeper customization can access Bria’s source-available GenAI models via Hugging Face.
This allows full control over fine-tuning, pipeline creation, and integration into proprietary workflows—empowering AI teams to develop and optimize their own generative AI solutions.

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

v1 endpoints

Endpoints that are part of BRIA API version 1.

Operations

Request

Description

Note: This API route requires the image to be registered via the /register route. It will be replaced soon with isolated version, that doesn't require image registration.

The Image to PSD Route is used to create a layered PSD file from any image.

The image is divided into different layers (depending on the image): a background layer with all identified objects removed, a foreground layer without the background, and a layer for each object.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

Path
visual_idstringrequired

visual id of the image, for which the user would like to create a layered PSD file

Example: 8487fb411f3c6716
Query
sidstring

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to apply on the result of that route, please provide this information. This parameter is optional.

Example: sid=Remove this parameter if the image has not been modified using Bria.
Headers
api_tokenstringrequired
curl -i -X POST \
  'https://engine.prod.bria-api.com/v1/8487fb411f3c6716/image_to_psd?sid=Remove+this+parameter+if+the+image+has+not+been+modified+using+Bria.' \
  -H 'api_token: string'

Responses

Successful operation.

Bodyapplication/json
image_resstring

URL that represents the updated visual created in the request. It is a temporary URL that will expire

Example: "https://bria-temp.s3.amazonaws.com/engine_no_bg/727b73c6-b723-11ec-947a-c28fc8b4a55b.psd?AWSAccessKeyId=ASIAUL5JH7ABNOAGDDHM&Signature=IIZp7MtiAoY32wIq%2BAVoUd7U3XY%3D&x-amz-security-token=FwoGZXIvYXdzEEwaDJNBqgbCH8ZLEjbtwCKYBByHo1V0nSnkoDy3kvaujvGHcNdmw0pYIwWYuvYdnKYv5zmzE4k%2FcgcB8YfY8DXKBOZR9DB%2FpzwoMPYf%2FxDMy4NenzSXw4VymF3j97bTEy6M00j%2BVO3K5fJOpN7iWlrxTaFHQICUW7%2FHE4CvaQ%2FB%2BWoCakNiEESUQxGglIygfJpviyexXNsxNGpeq7BPSSrTdsuD6R27pKmdFgdkL3xzUgMQMKzSeTJL4hUVGVldOp5sI4Qlvwnb8L%2FW7ciHHjUCf8WuHtDjDSdBIAqNci6wtXL6SQwLG%2Fo3oryPr0tNOMsbnrIIoFP5ZnH3VQISPCITBkWuUu9bdXkBm2R7rJyfPPOusFLuom2GDyVEHJfA%2FUtwGELxtv7Co29Tujd2N%2BHRhcdyrNsngwYwU2AiLyopMglYIDNQpv9%2FIKnH9ikuki%2F%2FWQ2PnzepcttQuXzlsqlUJRg%2Fcqhqis%2BxwJXZL1vpPJb%2BJz22oMp%2FJqZw%2BOIBWdxiL0pRq%2FF6EmyQz8iuhVBkr%2BnN5eWWxOrizMLFoVRTP34NPOWvWLwZJlrHzryCY8wZ01u2OLu3jxMcBhwypIp4pCzwx%2BAo39AXU1iMHJq36S6Bl5uptEr1NONKQvvz%2BpndF5t1dnoK7lfD9XExjk16shJXIImqiN7kxP2RTIrKsvm8wJY6iPxE35%2Bn0Cw8BS1eRmXFIOdEcfzbJVq80SQRIMko4CePyoOiKPCRwJIGMipiGM2hMspLQDThPJdlIiCOIh670Q2pu95y27iI3i87WQB55KJ9JNTL39I%3D&Expires=1650276342"
Response
application/json
{ "image_res": "https://bria-temp.s3.amazonaws.com/engine_no_bg/727b73c6-b723-11ec-947a-c28fc8b4a55b.psd?AWSAccessKeyId=ASIAUL5JH7ABNOAGDDHM&Signature=IIZp7MtiAoY32wIq%2BAVoUd7U3XY%3D&x-amz-security-token=FwoGZXIvYXdzEEwaDJNBqgbCH8ZLEjbtwCKYBByHo1V0nSnkoDy3kvaujvGHcNdmw0pYIwWYuvYdnKYv5zmzE4k%2FcgcB8YfY8DXKBOZR9DB%2FpzwoMPYf%2FxDMy4NenzSXw4VymF3j97bTEy6M00j%2BVO3K5fJOpN7iWlrxTaFHQICUW7%2FHE4CvaQ%2FB%2BWoCakNiEESUQxGglIygfJpviyexXNsxNGpeq7BPSSrTdsuD6R27pKmdFgdkL3xzUgMQMKzSeTJL4hUVGVldOp5sI4Qlvwnb8L%2FW7ciHHjUCf8WuHtDjDSdBIAqNci6wtXL6SQwLG%2Fo3oryPr0tNOMsbnrIIoFP5ZnH3VQISPCITBkWuUu9bdXkBm2R7rJyfPPOusFLuom2GDyVEHJfA%2FUtwGELxtv7Co29Tujd2N%2BHRhcdyrNsngwYwU2AiLyopMglYIDNQpv9%2FIKnH9ikuki%2F%2FWQ2PnzepcttQuXzlsqlUJRg%2Fcqhqis%2BxwJXZL1vpPJb%2BJz22oMp%2FJqZw%2BOIBWdxiL0pRq%2FF6EmyQz8iuhVBkr%2BnN5eWWxOrizMLFoVRTP34NPOWvWLwZJlrHzryCY8wZ01u2OLu3jxMcBhwypIp4pCzwx%2BAo39AXU1iMHJq36S6Bl5uptEr1NONKQvvz%2BpndF5t1dnoK7lfD9XExjk16shJXIImqiN7kxP2RTIrKsvm8wJY6iPxE35%2Bn0Cw8BS1eRmXFIOdEcfzbJVq80SQRIMko4CePyoOiKPCRwJIGMipiGM2hMspLQDThPJdlIiCOIh670Q2pu95y27iI3i87WQB55KJ9JNTL39I%3D&Expires=1650276342" }

Request

Description

Note: This API route requires the image to be registered via the /register route.

The Objects/Mask Generator Route is used to generate all possible masks for an image, creating a full segmentation of the image.

The response contains a zip file named as the visual_id of the provided image.

There are k mask files in the zip, each named with the visual_id and mask_id.

The zip file contains an additional file whose name ends with "panoptic". It's not an image, it's a panoptic map. It can be transformed into a regular matrix.

Each point in the image (x,y) is mapped to the mask that applies to that point. In the panoptic map, each pixel's grayscale value includes the mask_id.

You can display those masks to the user, let them pick one or more masks, and use objects/remove route to remove the masked area.

In order to use the objects/remove route on the mask the user selected, you should provide the mask_id, and use the parameter mask_source=generated.

You can see below an example of the content of the zip:

92bf8ce17584de82_panoptic.png

92bf8ce17584de82_1.png

92bf8ce17584de82_2.png

92bf8ce17584de82_3.png

...

92bf8ce17584de82_86.png

You can access the SDK that demonstrates how to use this endpoint in a UI in the following link. This API endpoint supports content moderation via an optional parameter that can prevent processing if input images contain inappropriate content - the first blocked input image will fail the entire request.

Headers
api_tokenstringrequired
Bodyapplication/json
image_urlstring

The URL of the input image. If both image_url and image_file are provided, image_url will be used. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

filestring

The file of the input image, in base64 format. Used if image_url is not provided. Accepted formats are jpeg, jpg, png, webp. Maximum file size 12MB.

syncboolean

Determines the response mode. When true, responses are synchronous. With false, responses are asynchronous, immediately providing URLs for images that are generated in the background. Use polling for the URLs to retrieve images once ready.

Default true
content_moderationboolean

When enabled, applies content moderation to input visuals.

For input images:

  • Processing stops at the first image that fails moderation
  • Returns a 422 error with details about which parameter failed
Default false
curl -i -X POST \
  https://engine.prod.bria-api.com/v1/objects/mask_generator \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image_url": "URL"
  }'

Responses

Successful operation.

Bodyapplication/json
objects_masksstring
Example: "https://bria-image-repository.s3.amazonaws.com/mask2click/masks/92bf8ce17584de82.zip?AWSAccessKeyId=AKIAUL5JH7ABJXXBAV6D&Signature=vCX%2BHEAnGmUolwLxKfPBBKPUZaM%3D&Expires=1690732111"
Response
application/json
{ "objects_masks": "https://bria-image-repository.s3.amazonaws.com/mask2click/masks/92bf8ce17584de82.zip?AWSAccessKeyId=AKIAUL5JH7ABJXXBAV6D&Signature=vCX%2BHEAnGmUolwLxKfPBBKPUZaM%3D&Expires=1690732111" }

Request

Description

Note: This API route requires the image to be registered via the /register route.

The Person/Info Route is used to retrieve useful information on the people in a specific visual that was previously uploaded to the database.

Additionally, it provides a description of each person within the scene along with its available changes, which are supported by the Bria API.

This route should be used instead of the main /info route when you are only interested in information and available actions for the people in the image. With this route, you will save time by only obtaining information that is relevant to your needs.

Path
visual_idstringrequired

visual id of the image, received after using the /upload or register route.

Example: f49943971e3039c7
Headers
api_tokenstringrequired
curl -i -X GET \
  https://engine.prod.bria-api.com/v1/f49943971e3039c7/person/info \
  -H 'api_token: string'

Responses

Successful operation.

Bodyapplication/jsonArray [
actionsobject

The available API actions for this specific person.

idstring

The id of the person

labelsArray of arrays

The known information about the person, such as age range and gender

oracleobject

The predicted quality of the available actions for this specific person

rectobject

The location of the face inside the image. x and y represent the upper left corner of the face, and by using the w (width) and h (height) you can create a rectangle around the face.

typestring

In this route it will allways be 'person'

]
Response
application/json
[ { "actions": { "age": [ "mid-20", "mid-40", "mid-60" ], "Beard": [ "shaved", "medium", "full" ], "diversity": [ "original", "africa", "korea", "india", "japan", "sweden", "germany", "russia", "mexico", "brazil", "england", "spain", "france", "unsplash" ], "expression": [ "happy", "surprised", "dreaming", "angry", "fear", "contempt", "disgusted", "sad", "smile" ], "gender": [ "femininity", "masculinity" ], "glasses": [ "light", "none", "heavy" ], "hair_line": [ "high", "low" ], "haircolor": [ "black", "brown", "red", "blond", "gray" ], "makeup": [ "light", "heavy", "none" ] }, "id:"c6bbe1cd719300c11e5c581889e9383245a0c1d923f210a3445e8ea5a25500e0"": null, "labels": [ "age_14-26", "glasses", "Female" ], "oracle": { "age": { "age": "low" }, "Beard": { "Beard": "low" }, "diversity": { "africa": "low", "brazil": "low", "england": "low", "france": "low", "germany": "low", "india": "low", "japan": "low", "korea": "low", "mexico": "low", "russia": "low", "spain": "low", "sweden": "low" }, "expression": { "angry": "high", "calm": "high", "contempt": "high", "disgusted": "high", "dreaming": "high", "fear": "high", "happy": "high", "surprised": "high" }, "gender": { "gender": "low" }, "glasses": { "glasses": "low" }, "hair_line": { "hair_line": "low" }, "haircolor": { "haircolor": "low" } }, "rect": { "h": 375.98625326156616, "w": 280.4049072265625, "x": 1134.1341552734375, "y": 290.6307406425476 }, "type:"person"": null }, { "actions": { "age": [ "mid-20", "mid-40", "mid-60" ], "Beard": [ "shaved", "medium", "full" ], "diversity": [ "original", "africa", "korea", "india", "japan", "sweden", "germany", "russia", "mexico", "brazil", "england", "spain", "france", "unsplash" ], "expression": [ "happy", "surprised", "dreaming", "angry", "fear", "contempt", "disgusted", "sad", "smile" ], "gender": [ "femininity", "masculinity" ], "glasses": [ "light", "none", "heavy" ], "hair_line": [ "high", "low" ], "haircolor": [ "black", "brown", "red", "blond", "gray" ], "makeup": [ "light", "heavy", "none" ] }, "id:"d74da71f722b45de5f18f93e9dd7fc64a50a5a5dda001985ab9c2374807182b8"": null, "labels": [ "age_26-42", "happy", "Female" ], "oracle": { "age": { "age": "high" }, "Beard": { "Beard": "high" }, "diversity": { "africa": "high", "brazil": "high", "england": "high", "france": "high", "germany": "high", "india": "high", "japan": "high", "korea": "high", "mexico": "high", "russia": "high", "spain": "high", "sweden": "high" }, "expression": { "angry": "high", "calm": "high", "contempt": "high", "disgusted": "high", "dreaming": "high", "fear": "high", "happy": "high", "surprised": "high" }, "gender": { "gender": "high" }, "glasses": { "glasses": "high" }, "hair_line": { "hair_line": "high" }, "haircolor": { "haircolor": "high" } }, "rect": { "h": 354.8530983924866, "w": 282.885498046875, "x": 555.80419921875, "y": 486.4655692577362 }, "type:"person"": null } ]

Request

Description

Note: This API route requires the image to be registered via the /register route.

The Create Route is used to create a new visual, based on the changes requested by the user for a previously uploaded visual.

You can also use this route on a modified image by providing the sid from the response of the previously used route.

This route returns both the URL and the sid associated with the updated image.

Before making any modifications, please call the /info or person/info route to obtain information on the available presenters in the image, the available modifications, and their oracle values.

You should always include all the required changes in the request if you want to use multiple changes on a single person. It is not supported to make one request on a person with one change, take the SId from the result, and then use it in another request with a different change.

When you want to make changes on multiple people, you can make one request with all the desired changes on all the relevant people or make one request with all the desired changes on one person and then use the sid from the response in the request on the other person.

Path
visual_idstringrequired

visual id of the image the user wants to create a new visual from.

Example: 8487fb411f3c6716
Headers
api_tokenstringrequired
Bodyapplication/json
sidstring

This session id was obtained from the response of a route that had been applied to this visual id. If you have used another route on the provided visual before, and you would like the current route to modify the result of that route, please provide this information. This parameter is optional.

desired_resolutionstring

The desired resolution of the updated image. This parameter is optional.

Enum"original""nhd""svga""xga""had""wuxga""uwfhd""wqxga""uwqhd""uhd"
changesArray of objects

The requested changes to the original visual.

changes[].​idstring

Id of the selected object in the image, to which the user would like to make changes.

changes[].​actionsobject

The changes the user wishes to perform for this object in the image. Each action the user chooses to use must be included in the info route response for this object and image. This is essential for the /create request to be successful.

changes[].​actions.​agestring

Changing the age of a selected person. It is possible to use one of the enum values or to provide a value between -10 and 10. Decimal values are acceptable.

Enum"mid-20""mid-40""mid-60"
changes[].​actions.​diversitystring

Changing the diversity of a selected person. It is possible to use one of the enum values or to provide in addition to the enum a value between 0 and 1.

Enum"africa""korea""india""japan""sweden""germany""russia""mexico""brazil""england"
changes[].​actions.​expressionstring

Changing the expression of a selected person. It is possible to use one of the enum values or to provide in addition to the enum a value between 0 and 1.5.

Enum"happy""surprised""dreaming""angry""fear""contempt""disgusted""sad"
changes[].​actions.​glassesstring

Changing the glasses of a selected person. It is possible to use one of the enum values or to provide a value between 0 and 6. Only integer values are acceptable.

Enum"light""heavy""none"
changes[].​actions.​haircolorstring

Changing the hair color of a selected person. It is possible to use one of the enum values or to provide a value between 0 and 4. Only integer values are acceptable.

Enum"black""brown""red""blond""gray"
changes[].​actions.​genderstring

Changing the gender of a selected person. It is possible to use one of the enum values or to provide a value between -10 and 10. Decimal values are acceptable.

Enum"femininity""masculinity"
changes[].​actions.​makeupstring

Changing the makeup of a selected person. It is possible to use one of the enum values or to provide a value between -10 and 10. Decimal values are acceptable.

Enum"light""heavy""none"
changes[].​actions.​hair_linestring

Changing the hair line of a selected person. It is possible to use one of the enum values or to provide a value between -20 and 20. Decimal values are acceptable.

Enum"high""low"
changes[].​actions.​Beardstring

Changing the facial hair of a selected person. It is possible to use one of the enum values or to provide a value between -2 and 2. Decimal values are acceptable.

Enum"shaved""medium""full"
curl -i -X POST \
  https://engine.prod.bria-api.com/v1/8487fb411f3c6716/create \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "changes": [
      {
        "id": "c6bbe1cd719300c11e5c581889e9383245a0c1d923f210a3445e8ea5a25500e0",
        "actions": {
          "age": "mid-60",
          "diversity": "france",
          "expression": "happy"
        }
      }
    ]
  }'

Responses

Successful operation.

Bodyapplication/json
image_resstring

URL that represents the new visual created in the request. It is a temporary URL that will expire

Example: "https://d1uzvjowrxhw13.cloudfront.net/api/create_results/8487fb411f3c6716_05e8a8dc-b723-11ec-be15-c28fc8b4a55b.JPEG?AWSAccessKeyId=ASIAUL5JH7ABM5GPF244&Signature=OaE%2BTJW%2FBJFDB2xGXpy%2F%2F8TYkAE%3D&x-amz-security-token=FwoGZXIvYXdzEEsaDHAX5TxTwymFAQYSwSKYBK3lKAwEipl9tjg1QQwWMdQDqS%2B0rYkexasgxxW78Vz4DvJUVPISpnTOZk4h%2Fy6%2BikLC5%2FYGY86SL8980ZHZzRgqcodDJ0n6ljB7SgbkfJnSpgx%2F8iCHzoDH%2BS7YrUjnR7e%2FUz%2B4sIbV%2BSHGn36EXTNnrm%2FOgCsiL9vqLSGFEo5R1pLYIbezxWCEWMLcDO5x9WsVoPRYW7c%2B5B%2B1Ku3qybQEBFRex4BVisJU4NTXbwQKFWMbkTjHg5vK%2FEdQn7OzmCA7SfCSHe%2FqDZIBQG0ki%2BHt%2Fs4bAYYTZpl%2FjoUJTldlltdWH2uitj%2BBeyQKcUnHrPjTY1CsAOEC6OV%2FKlZfOjbNJTvlmHc7%2BKP3iICKlCVJwvRK6%2FnmU7mUVOb%2FmgD2kIvBq5G6fNxXQlKfFGZE2lSs8HR83sp44Qz8hm60DPfK45hE0XdVnIS2jY%2F1a%2BYBmijCr4HDTgv52D53CdnOiQ%2BQ8Yld0bBZRC4aDBATcvcsDcnO4BBMY0NS1c%2BSJ6b4IMxDK2OKdanf9EYiDgzr3ebsS1m7j4NX3pEvNC99YF%2B5PQwDYhbMwlMCAG9AMs9%2FF86Al3czOJFOxV1ClBEoUKy2TgntGraCp76UoLmRrHuRq7WKQUvIj2HAXsIlyNkBg3z498M1Gh7vyD%2F7xQgA0Ny6zYeC1gBH4HmYtFlBS%2BJimmxFlCoCuyFhBmUXp7p6oBI3APuSyQYLKLmQwJIGMioiS3mUno68q7GAsD%2FPmSCM8xMeEWF8IegvlU4XWAQuNnQJLVtqwkZb1Qo%3D&Expires=1650276159"
sidstring

This session id represents the result of the current route request. If you wish to use this result in other routes, please provide this sid in their input.

Example: "aaeec35e-9904-21ed-a479-964fdf514767.JPEG"
Response
application/json
{ "image_res": "https://d1uzvjowrxhw13.cloudfront.net/api/create_results/8487fb411f3c6716_05e8a8dc-b723-11ec-be15-c28fc8b4a55b.JPEG?AWSAccessKeyId=ASIAUL5JH7ABM5GPF244&Signature=OaE%2BTJW%2FBJFDB2xGXpy%2F%2F8TYkAE%3D&x-amz-security-token=FwoGZXIvYXdzEEsaDHAX5TxTwymFAQYSwSKYBK3lKAwEipl9tjg1QQwWMdQDqS%2B0rYkexasgxxW78Vz4DvJUVPISpnTOZk4h%2Fy6%2BikLC5%2FYGY86SL8980ZHZzRgqcodDJ0n6ljB7SgbkfJnSpgx%2F8iCHzoDH%2BS7YrUjnR7e%2FUz%2B4sIbV%2BSHGn36EXTNnrm%2FOgCsiL9vqLSGFEo5R1pLYIbezxWCEWMLcDO5x9WsVoPRYW7c%2B5B%2B1Ku3qybQEBFRex4BVisJU4NTXbwQKFWMbkTjHg5vK%2FEdQn7OzmCA7SfCSHe%2FqDZIBQG0ki%2BHt%2Fs4bAYYTZpl%2FjoUJTldlltdWH2uitj%2BBeyQKcUnHrPjTY1CsAOEC6OV%2FKlZfOjbNJTvlmHc7%2BKP3iICKlCVJwvRK6%2FnmU7mUVOb%2FmgD2kIvBq5G6fNxXQlKfFGZE2lSs8HR83sp44Qz8hm60DPfK45hE0XdVnIS2jY%2F1a%2BYBmijCr4HDTgv52D53CdnOiQ%2BQ8Yld0bBZRC4aDBATcvcsDcnO4BBMY0NS1c%2BSJ6b4IMxDK2OKdanf9EYiDgzr3ebsS1m7j4NX3pEvNC99YF%2B5PQwDYhbMwlMCAG9AMs9%2FF86Al3czOJFOxV1ClBEoUKy2TgntGraCp76UoLmRrHuRq7WKQUvIj2HAXsIlyNkBg3z498M1Gh7vyD%2F7xQgA0Ny6zYeC1gBH4HmYtFlBS%2BJimmxFlCoCuyFhBmUXp7p6oBI3APuSyQYLKLmQwJIGMioiS3mUno68q7GAsD%2FPmSCM8xMeEWF8IegvlU4XWAQuNnQJLVtqwkZb1Qo%3D&Expires=1650276159", "sid": "aaeec35e-9904-21ed-a479-964fdf514767.JPEG" }