Overview

For access to the AI Search API (excluding the 'Caption' endpoint), please Contact Us

Bria's AI Search API equips builders with advanced visual search capabilities that go beyond traditional label or keyword matching.

The API enables searching through registered images using either text queries or image references, with results sorted by match scores.

Developers can leverage features including image captioning, similarity search, and search refinements through style, atmosphere, and camera angle filters.

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

Endpoints

Operations

Get Caption

Request

Description

The Caption Route is used to get a caption that describes the given image.

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.

curl -i -X POST \
  https://engine.prod.bria-api.com/v1/caption \
  -H 'Content-Type: application/json' \
  -H 'api_token: string' \
  -d '{
    "image_url": "string",
    "file": "string"
  }'

Responses

Successful operation.

Bodyapplication/json
resultsArray of objects
results[].​captionstring
Example: "woman walking on a bridge in the jungle"
Response
application/json
{ "results": [ { "caption": "woman walking on a bridge in the jungle" } ] }

Search by text

Request

Description

By using the Search Route, you can utilize Bria's generative search capabilities, which don't require labels or keywords. The user can send any text query and receive relevant images that match the query.

The Search Route returns the images, sorted by the match score, from highest match to lowest match. The images are returned in batches, and you can specify how many images to receive in one batch, and which batch to receive in each call.

Search will only work on images that have been onboarded using the register endpoint. Note: To use this endpoint, please Contact Us.

Query
querystring

the text query for which the user is looking for matching images.

Example: query=woman traveling in the world
num_results_per_pageinteger

how many images you would like to receive from the gallery search. The default value is 50. The maximum value is 500. No need to use this parameter when gallery_search=false.

Example: num_results_per_page=1
pageinteger

which batch of images you would like to receive in the current call. Synthetic results will only be included in page no. 1. The default value is 1. For each query, we support 800 results, so if you set num_results_per_page=50, you will have 16 pages of results.

Example: page=1
gallery_idstring

Bria will provide you with this parameter which represents your account's image gallery. You must include this parameter.

Example: gallery_id=425
stylestring

Which style you would like to see in your results, this parameter is optional.

Enum"stock photography""photo realistic""fashion""retro""sports""still life""hyper realistic""travel""artistic""3d render"
Example: style=photo realistic
atmospherestring

Which atmosphere you would like to get in your results, this parameter is optional.

Enum"dramatic""vivid""warm""cool"
Example: atmosphere=dramatic
camerastring

Which camera angle you would like to see in your results, this parameter is optional.

Enum"portrait""close up""aerial""landscape"
Example: camera=portrait
mediumstring

Which medium should be included in your results, this parameter is optional.

Enum"photography""art"
Example: medium=photography
Headers
api_tokenstringrequired
curl -i -X GET \
  'https://engine.prod.bria-api.com/v1/search?atmosphere=dramatic&camera=portrait&gallery_id=425&medium=photography&num_results_per_page=1&page=1&query=woman%20traveling%20in%20the%20world&style=photo%20realistic' \
  -H 'api_token: string'

Responses

Successful operation.

Bodyapplication/json
resultsArray of objects

there are multiple objects in this array (based on the amount specified in num_results_per_page) and each object represents a single image. The images in the array are sorted by the similarity score, from the highest to the lowest. If the specified batch (=page) is empty, the results array will be empty.

results[].​visual_idstring

visual id of the image, documented in Bria.

Example: "a169a6862f24de75"
results[].​org_image_keystring

It will be returned if the image was registered using an org_image_key.

Example: "None"
results[].​source_urlstring

It will be returned if the image was registered using a URL.

Example: "None"
Response
application/json
{ "results": [ { "visual_id": "a169a6862f24de75", "org_image_key": "None", "source_url": "None" } ] }

Search by Image

Request

Description

By using the Search Route, you can utilize Bria's generative search capabilities, which don't require labels or keywords. The user can send any text query and receive relevant images that match the query.

The Search Route returns the images, sorted by the match score, from highest match to lowest match. The images are returned in batches, and you can specify how many images to receive in one batch, and which batch to receive in each call.

Search will only work on images that have been onboarded using the register endpoint.

Note: To use this endpoint, please Contact Us.

Query
vhashstring

the visual id of the image for which the user is looking for similar images.

Example: vhash=e01592ef1188df76
num_results_per_pageinteger

how many images you would like to receive in the current call. The default value is 50. The maximum value is 500.

Example: num_results_per_page=1
pageinteger

which batch of images you would like to receive in the current call. The default value is 1. For each query, we support 800 results, so if you set num_results_per_page=50, you will have 16 pages of results.

Example: page=1
gallery_idstring

Bria will provide you with this parameter which represents your account's image gallery. You must include this parameter.

Example: gallery_id=425
urlstring

URL of an image, for which you would like to find similar images. When you want to search based on modified images, or images that have not been uploaded or registered to Bria, you can use this parameter. When this parameter is provided, the visual_id parameter can be None. The supported file types are jpg, jpeg and png, up to 12 mb.

Example: url=If you are using the vhash paramater, there is no need to use this parameter
Headers
api_tokenstringrequired
curl -i -X GET \
  'https://engine.prod.bria-api.com/v1/search_similar_images?gallery_id=425&num_results_per_page=1&page=1&url=If%20you%20are%20using%20the%20vhash%20paramater%2C%20there%20is%20no%20need%20to%20use%20this%20parameter&vhash=e01592ef1188df76' \
  -H 'api_token: string'

Responses

Successful operation.

Bodyapplication/json
resultsArray of objects

there are multiple objects in this array (based on the amount specified in num_results_per_page) and each object represents a single image. The images in the array are sorted by the similarity score, from the highest to the lowest. If the specified batch (=page) is empty, the results array will be empty.

results[].​visual_idstring

visual id of the image, documented in Bria.

Example: "a169a6862f24de75"
results[].​org_image_keystring

It will be returned if the image was registered using an org_image_key.

Example: "None"
results[].​source_urlstring

It will be returned if the image was registered using a URL.

Example: "None"
Response
application/json
{ "results": [ { "visual_id": "a169a6862f24de75", "org_image_key": "None", "source_url": "None" } ] }