openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/cinematic-text-to-image-generator
info:
  title: Cinematic Text-to-Image Generator API (Wan 2.2)
  description: Generate stunning 2MP cinematic images from text prompts in 3-4
    secondsperfect for rapid prototyping and creative visuals.
  version: 16e15e913fcc71c1a5defb335ea84739f99731fa1ee17995117c7d9adc6d176c
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
      properties:
        seed:
          type: integer
          title: Seed
          x-order: 4
          description: Random seed. Set for reproducible generation
          example: 246764
        juiced:
          type: boolean
          title: Juiced
          default: false
          x-order: 1
          description: Faster inference with additional optimizations.
          example: false
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: Text prompt for image generation
          example: A cinematic, photorealistic medium shot capturing the nostalgic warmth
            of a mid-2000s indie film. The focus is a cat with a messy cool
            platinum white fur, looking directly and intently into the camera
            lens with a knowing smirk, its head is looking up slightly. The cat
            wears an oversized band t-shirt that says “Wan can do Images" in
            huge stylized text over a long-sleeved striped top and simple silver
            stud earrings. The lighting is soft, golden hour sunlight creating
            lens flare and illuminating dust motes in the air. The background
            shows a blurred outdoor urban setting with graffiti-covered walls
            (the graffiti says “WAN" in stylized graffiti lettering), rendered
            with a shallow depth of field. Natural film grain, a warm, slightly
            muted color palette, and sharp focus on its expressive eyes enhance
            the intimate, authentic feel
        megapixels:
          allOf:
            - $ref: "#/components/schemas/megapixels"
          default: 2
          x-order: 3
          description: Approximate number of megapixels for generated image
          example: 2
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          default: 16:9
          x-order: 2
          description: Aspect ratio for the generated image
          example: 4:3
        output_format:
          allOf:
            - $ref: "#/components/schemas/output_format"
          default: jpg
          x-order: 5
          description: Format of the output images
          example: jpg
        output_quality:
          type: integer
          title: Output Quality
          default: 80
          maximum: 100
          minimum: 1
          x-order: 6
          description: Quality when saving the output images, from 0 to 100. 100 is best
            quality, 0 is lowest quality. Not relevant for .png outputs
          example: 80
    Output:
      type: string
      title: Output
      format: uri
    Status:
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      type: string
      title: Status
      description: An enumeration.
    megapixels:
      enum:
        - 1
        - 2
      type: integer
      title: megapixels
      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
        - 21:9
      type: string
      title: aspect_ratio
      description: An enumeration.
    output_format:
      enum:
        - png
        - jpg
        - webp
      type: string
      title: output_format
      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"
        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
          additionalProperties: true
        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 prunaai/wan-2.2-image
      description: Run inference with the prunaai/wan-2.2-image model on API.market
      operationId: createWan_2.2_imagePrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 16e15e913fcc71c1a5defb335ea84739f99731fa1ee17995117c7d9adc6d176c
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 16e15e913fcc71c1a5defb335ea84739f99731fa1ee17995117c7d9adc6d176c
                  input:
                    seed: 246764
                    juiced: false
                    prompt: A cinematic, photorealistic medium shot capturing the nostalgic warmth
                      of a mid-2000s indie film. The focus is a cat with a messy
                      cool platinum white fur, looking directly and intently
                      into the camera lens with a knowing smirk, its head is
                      looking up slightly. The cat wears an oversized band
                      t-shirt that says “Wan can do Images" in huge stylized
                      text over a long-sleeved striped top and simple silver
                      stud earrings. The lighting is soft, golden hour sunlight
                      creating lens flare and illuminating dust motes in the
                      air. The background shows a blurred outdoor urban setting
                      with graffiti-covered walls (the graffiti says “WAN" in
                      stylized graffiti lettering), rendered with a shallow
                      depth of field. Natural film grain, a warm, slightly muted
                      color palette, and sharp focus on its expressive eyes
                      enhance the intimate, authentic feel
                    megapixels: 2
                    aspect_ratio: 4:3
                    output_format: jpg
                    output_quality: 80
      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: 16e15e913fcc71c1a5defb335ea84739f99731fa1ee17995117c7d9adc6d176c
                    status: starting
                    created_at: 2025-08-17T16:56:58.541Z
        "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 prunaai/wan-2.2-image prediction
        from API.market
      operationId: getWan_2.2_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/pKiB2pFgX7qgG1OxDHyMRzwvY2QPMPKPQeNqJGUAy1LrizjKA/output_246764_0.jpeg
                    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: text-to-image
    description: Operations related to text-to-image
  - name: media
    description: Operations related to media
