openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ultra-fast-reference-image-generator-api
info:
  title: Ultra-Fast Reference Image Generator API (Gen-4 Turbo)
  description: Generate custom images from text and up to 3 references2.5x faster,
    cheaper, and captures every angle with Gen-4 Image Turbo.
  version: e724bfa0ed4865c0d543acfe5abdfbeeffa6743769504e9e23d0e309b3a68174
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
      properties:
        seed:
          type: integer
          title: Seed
          x-order: 1
          nullable: true
          description: Random seed. Set for reproducible generation
          example: 1
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: Text prompt for image generation
          example: a close up portrait of @woman and @man driving fast in a red 1980s
            sports car
        resolution:
          allOf:
            - $ref: "#/components/schemas/resolution"
          default: 1080p
          x-order: 3
          description: Image resolution
          example: 1080p
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          default: 16:9
          x-order: 2
          description: Image aspect ratio
          example: 4:3
        reference_tags:
          type: array
          items:
            type: string
          title: Reference Tags
          default: []
          x-order: 5
          description: An optional tag for each of your reference images. Tags must be
            alphanumeric and start with a letter. You can reference them in your
            prompt using @tag_name. Tags must be between 3 and 15 characters.
          example: &a1
            - woman
            - man
        reference_images:
          type: array
          items:
            type: string
            format: uri
          title: Reference Images
          default: []
          x-order: 4
          description: You must give at least one reference image. Up to 3 reference
            images are supported. Images must be between 0.5 and 2 aspect ratio.
          example: &a2
            - https://replicate.delivery/pbxt/NW3jTsbeAGmmIdOvQ5Ks2Dh6wAWAwBj9FLup7GmkmKZIzVp7/w99em95b01rmc0cqrny8chf49w-1.jpg
            - https://replicate.delivery/pbxt/NW3jTS88toyUUsCurdKfDgWVfXLXWmBsGbbG6jipbMFgpyT2/psjdbkzgm1rmc0cqrnysbg93cm.jpg
    Output:
      type: string
      title: Output
      format: uri
    Status:
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      type: string
      title: Status
      description: An enumeration.
    resolution:
      enum:
        - 720p
        - 1080p
      type: string
      title: resolution
      description: An enumeration.
    WebhookEvent:
      enum:
        - start
        - output
        - logs
        - completed
      type: string
      title: WebhookEvent
      description: An enumeration.
    aspect_ratio:
      enum:
        - 16:9
        - 9:16
        - 4:3
        - 3:4
        - 1:1
        - 21:9
      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 runwayml/gen4-image-turbo
      description: Run inference with the runwayml/gen4-image-turbo model on API.market
      operationId: createGen4_image_turboPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: e724bfa0ed4865c0d543acfe5abdfbeeffa6743769504e9e23d0e309b3a68174
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: e724bfa0ed4865c0d543acfe5abdfbeeffa6743769504e9e23d0e309b3a68174
                  input:
                    prompt: a close up portrait of @woman and @man driving fast in a red 1980s
                      sports car
                    resolution: 1080p
                    aspect_ratio: 4:3
                    reference_tags: *a1
                    reference_images: *a2
      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: e724bfa0ed4865c0d543acfe5abdfbeeffa6743769504e9e23d0e309b3a68174
                    status: starting
                    created_at: 2025-08-17T18:09:43.034Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a3
        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 runwayml/gen4-image-turbo
        prediction from API.market
      operationId: getGen4_image_turboPrediction
      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/mV82397wvrIxDlCV0AMe3v6MSoRh4xEa8a0eSDr7ipH0q3JVA/tmpuwbggnyb.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:
      - *a3
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: text-to-image
    description: Operations related to text-to-image
  - name: image
    description: Operations related to image
