openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/high-res-image-segmentation-api
info:
  title: High-Res Image Segmentation API (BirefNet)
  description: Achieve precise, dichotomous image segmentation with
    high-resolution outputs in secondsideal for complex vision tasks and content
    analysis.
  version: f74986db0355b58403ed20963af156525e2891ea3c2d499bfbfb2a28cd87c5d7
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            properties:
              loc:
                items:
                  anyOf:
                    - type: string
                    - type: integer
                title: Location
                type: array
              msg:
                title: Message
                type: string
              type:
                title: Error Type
                type: string
            required:
              - loc
              - msg
              - type
            title: ValidationError
            type: object
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Input:
      properties:
        image:
          description: Input image
          format: uri
          title: Image
          type: string
          x-order: 0
          example: https://blog.api.market/wp-content/uploads/2026/04/high-res-image-segmentation-scaled.jpg
        resolution:
          default: ""
          description: Resolution in WxH format, e.g., '1024x1024'
          title: Resolution
          type: string
          x-order: 1
          example: example
      required:
        - image
      title: Input
      type: object
    Output:
      format: uri
      title: Output
      type: string
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            image:
              description: Input image
              format: uri
              title: Image
              type: string
              x-order: 0
            resolution:
              default: ""
              description: Resolution in WxH format, e.g., '1024x1024'
              title: Resolution
              type: string
              x-order: 1
          required:
            - image
          title: Input
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: PredictionRequest
      type: object
    PredictionResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            image:
              description: Input image
              format: uri
              title: Image
              type: string
              x-order: 0
            resolution:
              default: ""
              description: Resolution in WxH format, e.g., '1024x1024'
              title: Resolution
              type: string
              x-order: 1
          required:
            - image
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          format: uri
          title: Output
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: PredictionResponse
      type: object
    Status:
      description: An enumeration.
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      title: Status
      type: string
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebhookEvent:
      description: An enumeration.
      enum:
        - start
        - output
        - logs
        - completed
      title: WebhookEvent
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with men1scus/birefnet
      description: Run inference with the men1scus/birefnet model on API.market
      operationId: createBirefnetPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: f74986db0355b58403ed20963af156525e2891ea3c2d499bfbfb2a28cd87c5d7
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: f74986db0355b58403ed20963af156525e2891ea3c2d499bfbfb2a28cd87c5d7
                  input:
                    image: https://blog.api.market/wp-content/uploads/2026/04/high-res-image-segmentation-scaled.jpg
      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: f74986db0355b58403ed20963af156525e2891ea3c2d499bfbfb2a28cd87c5d7
                    status: starting
                    created_at: 2025-05-18T08:20:57.980Z
        "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 men1scus/birefnet prediction from
        API.market
      operationId: getBirefnetPrediction
      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://blog.api.market/wp-content/uploads/2026/04/output-dog-scaled.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: image
    description: Operations related to image
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: visual-recognition
    description: Operations related to visual-recognition
  - name: image-to-image
    description: Operations related to image-to-image
