Skip to content

Attribution by image

Request

Send a generated image. Bria computes its embedding and attributes it.

Set model to the Bria image model that produced the image.

Legacy request format (deprecated): requests that send model_version (2.3, 3.0, 3.2, 4.0, remove-background-v2) instead of model are still accepted. Use model in new integrations.

Security
api_token
Bodyapplication/jsonrequired
One of:
imagestringrequired

The image, as a publicly accessible URL or a base64-encoded string.

Example:"https://labs-assets.bria.ai/sandbox-example-inputs/eraser_image_example.jpg"
modelstring(ImageAttributionModel)required

The Bria image model that produced the image, as model_name:version.

ValueModel
image_fibo:2Fibo 2
image_fibo_turbo:2Fibo 2 Turbo
image_fibo:1Fibo 1
image_fibo_edit:1Fibo Edit
image_eraser:1Eraser
image_expansion:1Image expansion
image_increase_res:1Increase resolution
image_rmbg:1Remove background
image_replace_bg:2Replace background 2
Enum:"image_fibo:2""image_fibo_turbo:2""image_fibo:1""image_fibo_edit:1""image_eraser:1""image_expansion:1""image_increase_res:1""image_rmbg:1""image_replace_bg:2"
Example:"image_fibo:2"
agentstring(Agent)

Optional. A name for the application, integration or end customer that produced the asset. Stored with the attribution record.

Example:"my-app"
syncboolean(Sync)

Specifies the response mode. Optional.

  • When false (default), the API returns 202 with a request_id and status_url right away.
  • When true, the API returns 200 with the outcome once the attribution request is queued.
Default:false
Example:false
webhook_urlstring, (uri)(WebhookUrl)

Optional URL for receiving the result via webhook when the async job completes. See webhooks.

Example:"https://example.com/webhooks/bria"
POST
/v2/image/attribution/by_image
from bria_client import BriaSyncClient

client = BriaSyncClient()  # reads BRIA_API_TOKEN

job = client.submit(
    endpoint="image/attribution/by_image",
    payload={
        "image": "https://labs-assets.bria.ai/sandbox-example-inputs/eraser_image_example.jpg",
        "model": "image_fibo:2",
        "agent": "my-app",
    },
)
result = client.poll(job, interval=2, timeout=120)
print(result.result)

Responses

Attribution triggered (returned when sync is true).

Bodyapplication/json
resultobjectrequired
request_idstringrequired
Response
{ "result": { "content": "Attribution triggered successfully" }, "request_id": "string" }