openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/anoor/toonzie
info:
  title: Toonzie AI Photo To Cartoon
  version: "1.0"
  description: "Toonzie AI - Photo to Cartoon and Artistic Style Conversion API:
    Transform photos into captivating cartoon art and various artistic styles
    instantly with Toonzi"
paths:
  /toonzy:
    post:
      summary: Converts a photo to a specified artistic style.
      description: Upload an image and choose a style to transform the photo. The API
        processes the image and returns a URL to the newly generated artistic
        image.
      operationId: toonzy
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - image
                - style
              properties:
                image:
                  type: string
                  format: binary
                  description: The image file to be transformed.
                style:
                  type: string
                  description: The artistic style to apply to the image.
                  enum:
                    - oil_painting
                    - watercolour
                    - pixel_art
                    - comic
                    - pencil_sketch
                    - cyberpunk
                    - anime
                    - cartoon
                    - low_poly
                    - cubism
                    - steampunk
                    - fantasy
                    - chibi
                    - ink_wash
                    - pastel
                    - graffiti
      responses:
        "200":
          description: Successful transformation. Returns the URL of the generated image.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  imageUrl:
                    type: string
                    format: uri
                    example: https://storage.googleapis.com/your-bucket/generated-images/some-uuid.jpg
        "400":
          description: Bad Request. This can be due to a missing 'style' or 'image' field,
            or an invalid 'style' value.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: "A valid 'style' field is required. Available: oil_painting,
                      watercolour, pixel_art, comic, pencil_sketch, cyberpunk,
                      anime, cartoon, low_poly, cubism, steampunk, fantasy,
                      chibi, ink_wash, pastel, graffiti"
        "403":
          description: Unauthorized. The API key is missing or invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized.
        "405":
          description: Method Not Allowed. The request was not a POST request.
        "500":
          description: Internal Server Error. An unexpected error occurred during
            processing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: An internal server error occurred.
                  details:
                    type: string
                    example: Error message from the server.
      security:
        - rapidApiKey: []
    parameters:
      - 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
components:
  securitySchemes: {}
security: {}
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: image
    description: Operations related to image
  - name: entertainment
    description: Operations related to entertainment
  - name: image-to-image
    description: Operations related to image-to-image
  - name: media
    description: Operations related to media
