{
  "openapi": "3.0.3",
  "info": {
    "title": "Bria Attribution Service API Reference",
    "version": "1.1.0",
    "description": "The Bria **Attribution Service** enables developers to integrate Bria’s patented attribution technology, ensuring transparent compensation to content owners for their contributions to AI-generated outputs. \n\nThis service supports both **Image** and **Video** assets via two integration architectures: \n\n**Attribution with No Compute Cost**, where assets are sent directly to Bria for processing.\n\n**Attribution with Full Data Privacy**, where the Attribution Model is hosted within your environment and only irreversible vectors (embeddings) are shared with Bria.\n"
  },
  "servers": [
    {
      "url": "https://engine.prod.bria-api.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/v2/image/attribution/by_image": {
      "post": {
        "tags": [
          "Image Attribution"
        ],
        "summary": "Attribution via Images API",
        "operationId": "postAttributionByImage",
        "x-codeSamples": [
          {
            "lang": "Python",
            "label": "Python (bria-client)",
            "source": "from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"image/attribution/by_image\",\n    payload={\n        \"image\": \"<image>\",\n        \"model_version\": \"2.3\",\n    },\n)\nresult = client.poll(job, interval=2, timeout=120)\nprint(result.result)\n"
          },
          {
            "lang": "JavaScript",
            "label": "TypeScript (@bria-ai/client)",
            "source": "import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"image/attribution/by_image\", {\n  image: \"<image>\",\n  model_version: \"2.3\",\n});\nconst result = await client.poll(job, { interval: 2, timeout: 120 });\nconsole.log(result.result);\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image",
                  "model_version"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "description": "Base64-encoded image"
                  },
                  "model_version": {
                    "type": "string",
                    "enum": [
                      "2.3",
                      "3.0",
                      "3.2",
                      "4.0"
                    ],
                    "description": "Version of the model to use"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncInitialResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/image/attribution/by_embedding": {
      "post": {
        "tags": [
          "Image Attribution"
        ],
        "summary": "Attribution By Embedding (irreversible vectors - self-hosted)",
        "description": "Integration for self-hosted image attribution models. See [Bria Attribution GitHub](https://github.com/Bria-AI/bria-attribution).\n",
        "operationId": "postAttributionByEmbedding",
        "x-codeSamples": [
          {
            "lang": "Python",
            "label": "Python (bria-client)",
            "source": "from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"image/attribution/by_embedding\",\n    payload={\n        \"embeddings_base64\": [\"<embeddings_base64>\"],\n        \"model_version\": \"2.3\",\n    },\n)\nresult = client.poll(job, interval=2, timeout=120)\nprint(result.result)\n"
          },
          {
            "lang": "JavaScript",
            "label": "TypeScript (@bria-ai/client)",
            "source": "import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"image/attribution/by_embedding\", {\n  embeddings_base64: [\"<embeddings_base64>\"],\n  model_version: \"2.3\",\n});\nconst result = await client.poll(job, { interval: 2, timeout: 120 });\nconsole.log(result.result);\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "embeddings_base64",
                  "model_version"
                ],
                "properties": {
                  "embeddings_base64": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of base64-encoded embeddings"
                  },
                  "model_version": {
                    "type": "string",
                    "enum": [
                      "2.3",
                      "3.0",
                      "3.2",
                      "4.0"
                    ]
                  },
                  "embeddings_uid": {
                    "type": "string"
                  },
                  "model_name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncInitialResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/video/attribution/by_video": {
      "post": {
        "tags": [
          "Video Attribution"
        ],
        "summary": "Attribution via URL",
        "operationId": "postAttributionByVideo",
        "x-codeSamples": [
          {
            "lang": "Python",
            "label": "Python (bria-client)",
            "source": "from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"video/attribution/by_video\",\n    payload={\n        \"video\": \"<video>\",\n        \"model\": \"video_generation:1\",\n    },\n)\nresult = client.poll(job, interval=5, timeout=600)\nprint(result.result)\n"
          },
          {
            "lang": "JavaScript",
            "label": "TypeScript (@bria-ai/client)",
            "source": "import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"video/attribution/by_video\", {\n  video: \"<video>\",\n  model: \"video_generation:1\",\n});\nconst result = await client.poll(job, { interval: 5, timeout: 600 });\nconsole.log(result.result);\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "video",
                  "model"
                ],
                "properties": {
                  "video": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the video to process"
                  },
                  "model": {
                    "$ref": "#/components/schemas/VideoModelVersion"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncInitialResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/video/attribution/by_embedding": {
      "post": {
        "tags": [
          "Video Attribution"
        ],
        "summary": "Attribution By Embedding (self-hosted)",
        "description": "Send irreversible video vectors (stills and motion) for attribution.\n",
        "operationId": "postAttributionByVideoEmbedding",
        "x-codeSamples": [
          {
            "lang": "Python",
            "label": "Python (bria-client)",
            "source": "from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"video/attribution/by_embedding\",\n    payload={\n        \"model\": \"video_generation:1\",\n        \"video_seconds\": 1,\n        \"stills_embedding_base64\": \"<stills_embedding_base64>\",\n        \"motion_embedding_base64\": \"<motion_embedding_base64>\",\n    },\n)\nresult = client.poll(job, interval=5, timeout=600)\nprint(result.result)\n"
          },
          {
            "lang": "JavaScript",
            "label": "TypeScript (@bria-ai/client)",
            "source": "import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"video/attribution/by_embedding\", {\n  model: \"video_generation:1\",\n  video_seconds: 1,\n  stills_embedding_base64: \"<stills_embedding_base64>\",\n  motion_embedding_base64: \"<motion_embedding_base64>\",\n});\nconst result = await client.poll(job, { interval: 5, timeout: 600 });\nconsole.log(result.result);\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "video_seconds",
                  "stills_embedding_base64",
                  "motion_embedding_base64"
                ],
                "properties": {
                  "model": {
                    "$ref": "#/components/schemas/VideoModelVersion"
                  },
                  "video_seconds": {
                    "type": "integer",
                    "description": "Total duration of the video in seconds"
                  },
                  "stills_embedding_base64": {
                    "type": "string",
                    "description": "Base64-encoded embedding for video stills"
                  },
                  "motion_embedding_base64": {
                    "type": "string",
                    "description": "Base64-encoded embedding for video motion"
                  },
                  "unique_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Optional unique hex identifier"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsyncInitialResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "VideoModelVersion": {
        "type": "string",
        "description": "The attribution model used. The value represents the **model name** followed by the **version** after the colon (e.g., `model_name:version`).\n",
        "enum": [
          "video_generation:1",
          "video_rmbg:1",
          "video_eraser:1",
          "video_mask:1",
          "video_increase_res:1"
        ]
      },
      "ErrorObject": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "example": 123
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "details"
        ]
      },
      "AsyncInitialResponse": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "status_url": {
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "status_url"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorObject"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "request_id"
        ]
      }
    }
  }
}