# Attribution by image embedding

Send the embedding of a generated image, computed in your environment by the Bria attribution model. Only the irreversible vector reaches Bria. See the [`bria-attribution` repository](https://github.com/Bria-AI/bria-attribution).
Send one request per image embedding.
**Legacy request format (deprecated):** requests that send `model_version` and a list of embeddings (`embeddings_base64` as an array, with optional `embeddings_uid` and `model_name`) are still accepted. Use `model` in new integrations.

Endpoint: POST /v2/image/attribution/by_embedding
Version: 1.2.0
Security: api_token

## Request fields (application/json):

  - `model` (string, required)
    The Bria image model that produced the image, as `model_name:version`.
| Value | Model |
|  --- | --- |
| `image_fibo:2` | Fibo 2 |
| `image_fibo_turbo:2` | Fibo 2 Turbo |
| `image_fibo:1` | Fibo 1 |
| `image_fibo_edit:1` | Fibo Edit |
| `image_eraser:1` | Eraser |
| `image_expansion:1` | Image expansion |
| `image_increase_res:1` | Increase resolution |
| `image_rmbg:1` | Remove background |
| `image_replace_bg:2` | Replace 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"

  - `embeddings_base64` (string, required)
    Base64-encoded embedding of the image, produced by the Bria attribution model in your environment.
    Example: <embeddings_base64>

  - `unique_id` (string)
    Optional. Your identifier for this embedding; use a new value per asset. Bria generates one if omitted.
    Example: 3f2b9c1e8a7d4f6b9e0c1a2b3c4d5e6f

  - `agent` (string)
    Optional. A name for the application, integration or end customer that produced the asset. Stored with the attribution record.
    Example: my-app

  - `sync` (boolean)
    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.
    Example: false

  - `webhook_url` (string)
    Optional URL for receiving the result via webhook when the async job completes. See [webhooks](/getting-started/async-requests#webhooks).
    Example: https://example.com/webhooks/bria

  - `model_version` (string, required)
    Deprecated. Use `model` instead.
    Enum: "2.3", "3.0", "3.2", "4.0", "remove-background-v2"

  - `embeddings_base64` (array, required)
    List of base64-encoded embeddings.

  - `embeddings_uid` (string)
    Optional identifier for this batch of embeddings. Bria generates one if omitted.
    Example: 9b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e

  - `model_name` (string)
    Optional model name.

## Response 200 fields (application/json):

  - `result` (object, required)

  - `result.content` (string, required)
    Example: Attribution triggered successfully

  - `request_id` (string, required)

## Response 202 fields (application/json):

  - `request_id` (string, required)

  - `status_url` (string, required)

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string, required)

  - `request_id` (string, required)

## Response 422 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string, required)

  - `request_id` (string, required)

## Response 429 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string, required)

  - `request_id` (string, required)

## Response 500 fields (application/json):

  - `error` (object, required)

  - `error.code` (integer, required)
    Example: 123

  - `error.message` (string, required)

  - `error.details` (string, required)

  - `request_id` (string, required)

