openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/image
info:
  title: Various Image Processing APIs
  version: 1.1.2
  description: From Toonify to background remover, various Image Manipulation APIs.
paths:
  /toonify:
    post:
      summary: Toonify Image
      description: >
        This endpoint takes in a URL of an image and converts it into a cartoon
        version using AI models.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: uri
                  description: URL of the image to be cartoonified.
              required:
                - image
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: Unique identifier for the request.
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Description of the error.
      security:
        - apiKey: []
    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/{request_id}:
    get:
      summary: Get Toonified Image URL
      description: >
        This endpoint retrieves the URL of the toonified image for a given
        request ID.
      parameters:
        - name: request_id
          in: path
          required: true
          description: Unique identifier for the request.
          schema:
            type: string
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the prediction (e.g., "succeeded").
                  result:
                    type: string
                    format: uri
                    description: URL of the toonified image.
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Description of the error.
      security:
        - apiKey: []
    parameters:
      - *a1
  /remove-background:
    post:
      summary: Remove Background from Image
      description: >
        This endpoint takes in a URL of an image and removes the background
        using an AI model.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: uri
                  description: URL of the image to remove the background.
              required:
                - image
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: Unique identifier for the request.
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Description of the error.
      security:
        - apiKey: []
    parameters:
      - *a1
security: {}
tags:
  - name: image-restoration
    description: Operations related to image-restoration
  - name: face-tools
    description: Operations related to face-tools
  - name: background-removal
    description: Operations related to background-removal
