openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ai-image-expansion-api
info:
  title: High-Quality Image Expansion API (Bria Expand)
  description: Expand images beyond their borders in high resolutiongenerate new
    pixels for flawless, seamless resizing in seconds with licensed
    commercial-safe AI.
  version: 21c18eeabca7af7fa8b9ef466e55f6afd3f728a7855de684d5b7c6fac9b732f5
components:
  schemas:
    Input:
      type: object
      title: Input
      properties:
        seed:
          type: integer
          title: Seed
          x-order: 8
          nullable: true
          description: Random seed. Set for reproducible generation
          example: 1
        sync:
          type: boolean
          title: Sync
          default: true
          x-order: 10
          description: Synchronous response mode
          example: true
        image:
          type: string
          title: Image
          format: uri
          x-order: 0
          nullable: true
          description: Image file
          example: https://replicate.delivery/pbxt/NI9s6hh8B1W9wGDho5nrKNO6Hwj2KTyuGWN92EAYRFWbGsZD/caeaa19524d69ad6.jpg
        prompt:
          type: string
          title: Prompt
          x-order: 6
          nullable: true
          description: Text prompt for image generation
          example: A beautiful landscape with mountains
        image_url:
          type: string
          title: Image Url
          x-order: 1
          nullable: true
          description: Image URL
          example: https://example.com/image.jpg
        canvas_size:
          type: array
          items:
            type: integer
            example: 1
          title: Canvas Size
          x-order: 3
          nullable: true
          description: Desired output canvas dimensions [width, height]. Default [1000,
            1000]
          example:
            - 1
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          x-order: 2
          description: Aspect ratio for expansion.
          example: 16:9
        preserve_alpha:
          type: boolean
          title: Preserve Alpha
          default: true
          x-order: 9
          description: Preserve alpha channel in output
          example: true
        negative_prompt:
          type: string
          title: Negative Prompt
          x-order: 7
          nullable: true
          description: Negative prompt for image generation
          example: A beautiful landscape with mountains
        content_moderation:
          type: boolean
          title: Content Moderation
          default: false
          x-order: 11
          description: Enable content moderation
          example: false
        original_image_size:
          type: array
          items:
            type: integer
            example: 1
          title: Original Image Size
          x-order: 4
          nullable: true
          description: Size of original image in canvas [width, height]
          example:
            - 1
        original_image_location:
          type: array
          items:
            type: integer
            example: 1
          title: Original Image Location
          x-order: 5
          nullable: true
          description: Position of original image in canvas [x, y]
          example:
            - 1
    Output:
      type: string
      title: Output
      format: uri
    Status:
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      type: string
      title: Status
      description: An enumeration.
    WebhookEvent:
      enum:
        - start
        - output
        - logs
        - completed
      type: string
      title: WebhookEvent
      description: An enumeration.
    aspect_ratio:
      enum:
        - 1:1
        - 2:3
        - 3:2
        - 3:4
        - 4:3
        - 4:5
        - 5:4
        - 9:16
        - 16:9
      type: string
      title: aspect_ratio
      description: An enumeration.
    ValidationError:
      type: object
      title: ValidationError
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
    PredictionRequest:
      type: object
      title: PredictionRequest
      properties:
        id:
          type: string
          title: Id
        input:
          $ref: "#/components/schemas/Input"
        context:
          type: object
          title: Context
          additionalProperties:
            type: string
        webhook:
          type: string
          title: Webhook
          format: uri
          maxLength: 65536
          minLength: 1
        created_at:
          type: string
          title: Created At
          format: date-time
        output_file_prefix:
          type: string
          title: Output File Prefix
        webhook_events_filter:
          type: array
          items:
            $ref: "#/components/schemas/WebhookEvent"
          default:
            - start
            - output
            - logs
            - completed
    PredictionResponse:
      type: object
      title: PredictionResponse
      properties:
        id:
          type: string
          title: Id
        logs:
          type: string
          title: Logs
          default: ""
        error:
          type: string
          title: Error
        input:
          $ref: "#/components/schemas/Input"
        output:
          $ref: "#/components/schemas/Output"
        status:
          $ref: "#/components/schemas/Status"
        metrics:
          type: object
          title: Metrics
        version:
          type: string
          title: Version
        created_at:
          type: string
          title: Created At
          format: date-time
        started_at:
          type: string
          title: Started At
          format: date-time
        completed_at:
          type: string
          title: Completed At
          format: date-time
    HTTPValidationError:
      type: object
      title: HTTPValidationError
      properties:
        detail:
          type: array
          items:
            $ref: "#/components/schemas/ValidationError"
          title: Detail
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with bria/expand-image
      description: Run inference with the bria/expand-image model on API.market
      operationId: createExpand_imagePrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 21c18eeabca7af7fa8b9ef466e55f6afd3f728a7855de684d5b7c6fac9b732f5
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 21c18eeabca7af7fa8b9ef466e55f6afd3f728a7855de684d5b7c6fac9b732f5
                  input:
                    sync: true
                    image: https://replicate.delivery/pbxt/NI9s6hh8B1W9wGDho5nrKNO6Hwj2KTyuGWN92EAYRFWbGsZD/caeaa19524d69ad6.jpg
                    aspect_ratio: 16:9
                    preserve_alpha: true
                    content_moderation: false
      responses:
        "201":
          description: Prediction created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  version:
                    type: string
                    description: Model version used for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
              examples:
                success:
                  summary: Successful prediction creation
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    version: 21c18eeabca7af7fa8b9ef466e55f6afd3f728a7855de684d5b7c6fac9b732f5
                    status: starting
                    created_at: 2025-07-11T07:19:35.844Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /predictions/{id}:
    get:
      summary: Get prediction status and results
      description: Get the status and results of a bria/expand-image prediction from
        API.market
      operationId: getExpand_imagePrediction
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The prediction ID
      responses:
        "200":
          description: Prediction details
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the prediction
                  status:
                    type: string
                    enum:
                      - starting
                      - processing
                      - succeeded
                      - failed
                      - canceled
                    description: Current status of the prediction
                  output:
                    $ref: "#/components/schemas/Output"
                  error:
                    type: string
                    description: Error message if the prediction failed
                  created_at:
                    type: string
                    format: date-time
                    description: When the prediction was created
                  started_at:
                    type: string
                    format: date-time
                    description: When the prediction started processing
                  completed_at:
                    type: string
                    format: date-time
                    description: When the prediction completed
              examples:
                succeeded:
                  summary: Successful prediction result
                  value:
                    id: ufawqhfynnddngldkgtslldrkq
                    status: succeeded
                    output: https://replicate.delivery/xezq/GfhDrzdyZqXeTUawFaWmVWcXUfapg0tOxY4tfg9OSC4NU0zTB/tmpaga9ulnt.png
                    created_at: 2023-01-01T12:00:00.000Z
                    started_at: 2023-01-01T12:00:05.000Z
                    completed_at: 2023-01-01T12:01:00.000Z
        "401":
          description: Unauthorized, invalid API token
        "404":
          description: Prediction not found
    parameters:
      - *a1
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: image
    description: Operations related to image
  - name: image-to-image
    description: Operations related to image-to-image
