openapi: 3.0.3
info:
  title: Overview
  version: ''
  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. 


    This service can be integrated by one of two integration architectures to
    fit different business and technical needs: 


    **Attribution with No Compute Cost**, where images are sent directly to Bria
    for processing.


    **Attribution with Full Data Privacy**, where the Attribution Model is
    hosted within your environment and only irreversible vectors are shared with
    Bria.


    Both approaches guarantee fair revenue sharing, royalties distribution, and
    legal protection for the commercial use of generated content. 
servers:
  - url: https://engine.prod.bria-api.com
    description: Production
security:
  - BearerAuth: []
paths:
  /v2/image/attribution/by_image:
    post:
      summary: Attribution via Images API (model hosted by Bria)
      operationId: postAttributionByImage
      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'
                  description: Version of the model to use
            examples:
              base64:
                summary: Base64 image payload
                value:
                  image: iVBORw0KGgoAAAANSUhEUgAA... (truncated)
                  model_version: '2.3'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncInitialResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found. Image could not be found at the provided URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported media type.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: By Image
          source: >
            curl -X POST
            "https://engine.prod.bria-api.com/v2/image/attribution/by_image" \
              -H "Authorization: Bearer $BRIA_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "image": "iVBORw0KGgoAAAANSUhEUgAA... (truncated)",
                "model_version": "2.3",
                "agent": "my-service@1.4.0"
              }'
  /v2/image/attribution/by_embedding:
    post:
      summary: Attribution By Embedding (irreversible vectors - self-hosted)
      description: >
        This API integration should take place after completing the installation
        of the attribution model, according to this reposetory: [Bria
        Attribution GitHub](https://github.com/Bria-AI/bria-attribution).
      operationId: postAttributionByEmbedding
      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'
                  description: Version of the model to use
                embeddings_uid:
                  type: string
                  description: Optional unique identifier for embeddings
                model_name:
                  type: string
                  description: Optional model name
            examples:
              emb:
                summary: Embeddings payload
                value:
                  embeddings_base64:
                    - AAABAC8vLwAA... (truncated)
                  model_version: '3.2'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncInitialResponse'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: By Embedding
          source: >
            curl -X POST
            https://engine.prod.bria-api.com/v2/image/attribution/by_embedding"
            \
              -H "Authorization: Bearer $BRIA_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "embeddings_base64": "AAABAC8vLwAA... (truncated)",
                "embeddings_uid": "vec_01HZY7E8X9QZ6M",
                "model_name": "attribution",
                "model_version": "2.3"
              }'
components:
  schemas:
    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
