openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/text-to-image-ai-generator
info:
  title: Next-Gen Text-to-Image Generator API (Qwen-Image 20B)
  description: Create vivid images from text prompts in seconds using a powerful
    20B MMDiT modelideal for fast, high-quality visual content generation.
  version: 6932d147993b2e4f84308b47f381c6a1565300aa4b5f1d58a01eb0b8cd9a969c
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
      properties:
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: Text prompt for image generation
          example: >-
            A photo of a stormy seascape, at the top is a title, "A Line-storm
            Song", it is bold and expressive. Written below it is the following
            poem in left aligned text:


            The line-storm clouds fly tattered and swift, 
              The road is forlorn all day, 
            Where a myriad snowy quartz stones lift, 
              And the hoof-prints vanish away. 
            The roadside flowers, too wet for the bee,
              Expend their bloom in vain. 
            Come over the hills and far with me, 
              And be my love in the rain. 
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          default: 1:1
          x-order: 1
          description: Aspect ratio of the output image.
          example: 1: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
        - 16:9
        - 9:16
        - 4:3
        - 3:4
      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
          nullable: true
        input:
          $ref: "#/components/schemas/Input"
          nullable: true
        context:
          type: object
          title: Context
          nullable: true
          additionalProperties:
            type: string
        webhook:
          type: string
          title: Webhook
          format: uri
          nullable: true
          maxLength: 65536
          minLength: 1
        created_at:
          type: string
          title: Created At
          format: date-time
          nullable: true
        output_file_prefix:
          type: string
          title: Output File Prefix
          nullable: true
        webhook_events_filter:
          type: array
          items:
            $ref: "#/components/schemas/WebhookEvent"
          default:
            - start
            - output
            - logs
            - completed
          nullable: true
    PredictionResponse:
      type: object
      title: PredictionResponse
      properties:
        id:
          type: string
          title: Id
          nullable: true
        logs:
          type: string
          title: Logs
          default: ""
        error:
          type: string
          title: Error
          nullable: true
        input:
          $ref: "#/components/schemas/Input"
          nullable: true
        output:
          $ref: "#/components/schemas/Output"
        status:
          $ref: "#/components/schemas/Status"
          nullable: true
        metrics:
          type: object
          title: Metrics
          nullable: true
          additionalProperties: true
        version:
          type: string
          title: Version
          nullable: true
        created_at:
          type: string
          title: Created At
          format: date-time
          nullable: true
        started_at:
          type: string
          title: Started At
          format: date-time
          nullable: true
        completed_at:
          type: string
          title: Completed At
          format: date-time
          nullable: true
    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 wavespeedai/qwen-image
      description: Run inference with the wavespeedai/qwen-image model on API.market
      operationId: createQwen_imagePrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 6932d147993b2e4f84308b47f381c6a1565300aa4b5f1d58a01eb0b8cd9a969c
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 6932d147993b2e4f84308b47f381c6a1565300aa4b5f1d58a01eb0b8cd9a969c
                  input:
                    prompt: >-
                      A photo of a stormy seascape, at the top is a title, "A
                      Line-storm Song", it is bold and expressive. Written below
                      it is the following poem in left aligned text:


                      The line-storm clouds fly tattered and swift, 
                        The road is forlorn all day, 
                      Where a myriad snowy quartz stones lift, 
                        And the hoof-prints vanish away. 
                      The roadside flowers, too wet for the bee,
                        Expend their bloom in vain. 
                      Come over the hills and far with me, 
                        And be my love in the rain. 
                    aspect_ratio: 1:1
      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: 6932d147993b2e4f84308b47f381c6a1565300aa4b5f1d58a01eb0b8cd9a969c
                    status: starting
                    created_at: 2025-08-17T17:19:37.389Z
        "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 wavespeedai/qwen-image prediction
        from API.market
      operationId: getQwen_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/YVRZWDZpKcreRC6nkFFUelHhRMIlfdDlvUJ65QHAM6xPITPqA/tmprxlz3_yd.jpg
                    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: text-to-image
    description: Operations related to text-to-image
  - name: image-to-image
    description: Operations related to image-to-image
  - name: style-transfer
    description: Operations related to style-transfer
