BRIA AI API
The Bria API enables developers and enterprises to generate and edit high-quality visual content at scale with predictable, consistent, and compliant results, offering enterprise-grade tools built for commercial use.
With Bria, you can:
Generate Images Using Bria Models: Utilize pre-trained Bria models to generate high-quality images based on text prompts.
Train Your Own Tailored Models and Generate visuals: Create models that preserve and faithfully reproduce your visual IP, ensuring consistency across all generated outputs.
Generate Advertising Campaigns: Utilize Bria's Campaign Generation APIs to automate the creation of advertising campaigns at scale, ensuring brand consistency and efficiency.
Edit Product Imagery: Use specialized features to create professional product shots, packshots, and lifestyle images.
Edit and Transform Images: Bring your own images and edit them using various routes to suit your needs.
Edit Videos (New!): Transform video content with advanced AI capabilities, starting with Background Removal, and more features coming soon.
This document provides an overview of the API's capabilities and guides users on how to effectively implement them.
API Access
You can register and access the API Token through Bria's platform by clicking here.
Authentication
The Bria API consists of a number of methods for uploading and creating new visual assets. The REST (representational state transfer) API methods can be called directly from within your own custom code.
curl --location --request POST 'https://engine.prod.bria-api.com/v1' \
--header: 'api_token: <...>' \
Preparing Images for API Requests
Bria's API supports images in two formats:
- Image URLs – Provide a publicly accessible URL to the image.
- Base64-encoded images – Convert an image to a Base64 string and send it in the request.
Converting an Image to Base64 in Python:
import base64
def image_to_base64(image_path):
with open(image_path, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
return encoded_string
# Example usage
base64_string = image_to_base64("example.jpg")
print(base64_string) # Use this string in the API request
Note: ensure that you do not include the Base64 headers (e.g.,
data:image/png;base64,
), as the API expects only the raw encoded string.
Contact
If you have any questions, feel free to contact us: support@bria.ai