openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/high-res-artistic-ai-image-generator
info:
  title: Ultra-Fast High-Res AI Image Generator API (Sana)
  description: Generate breathtaking images up to 4096x4096px in secondsperfect
    for creative, high-resolution projects with wide artistic flexibility.
  version: c6b5d2b7459910fec94432e9e1203c3cdce92d6db20f714f1355747990b52fa6
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            properties:
              loc:
                items:
                  anyOf:
                    - type: string
                    - type: integer
                title: Location
                type: array
              msg:
                title: Message
                type: string
              type:
                title: Error Type
                type: string
            required:
              - loc
              - msg
              - type
            title: ValidationError
            type: object
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    Input:
      properties:
        guidance_scale:
          default: 5
          description: Classifier-free guidance scale
          maximum: 20
          minimum: 1
          title: Guidance Scale
          type: number
          x-order: 6
          example: 5
        height:
          default: 1024
          description: Height of output image
          title: Height
          type: integer
          x-order: 4
          example: 1024
        model_variant:
          default: 1600M-1024px
          description: Model variant. 1600M variants are slower but produce higher quality
            than 600M, 1024px variants are optimized for 1024x1024px images,
            512px variants are optimized for 512x512px images, 'multilang'
            variants can be prompted in both English and Chinese
          enum:
            - 1600M-1024px
            - 1600M-1024px-multilang
            - 1600M-512px
            - 600M-1024px-multilang
            - 600M-512px-multilang
          title: model_variant
          type: string
          x-order: 2
          example: example
        negative_prompt:
          default: ""
          description: Specify things to not see in the output
          title: Negative Prompt
          type: string
          x-order: 1
          example: ""
        num_inference_steps:
          default: 18
          description: Number of denoising steps
          minimum: 1
          title: Num Inference Steps
          type: integer
          x-order: 5
          example: 18
        pag_guidance_scale:
          default: 2
          description: PAG Guidance scale
          maximum: 20
          minimum: 1
          title: Pag Guidance Scale
          type: number
          x-order: 7
          example: 2
        prompt:
          default: a cyberpunk cat with a neon sign that says "Sana"
          description: Input prompt
          title: Prompt
          type: string
          x-order: 0
          example: a cyberpunk cat with a neon sign that says "Sana"
        seed:
          description: Random seed. Leave blank to randomize the seed
          title: Seed
          type: integer
          x-order: 8
          example: 1
        width:
          default: 1024
          description: Width of output image
          title: Width
          type: integer
          x-order: 3
          example: 1024
      title: Input
      type: object
    Output:
      format: uri
      title: Output
      type: string
    PredictionRequest:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            guidance_scale:
              default: 5
              description: Classifier-free guidance scale
              maximum: 20
              minimum: 1
              title: Guidance Scale
              type: number
              x-order: 6
            height:
              default: 1024
              description: Height of output image
              title: Height
              type: integer
              x-order: 4
            model_variant:
              default: 1600M-1024px
              description: Model variant. 1600M variants are slower but produce higher quality
                than 600M, 1024px variants are optimized for 1024x1024px images,
                512px variants are optimized for 512x512px images, 'multilang'
                variants can be prompted in both English and Chinese
              enum:
                - 1600M-1024px
                - 1600M-1024px-multilang
                - 1600M-512px
                - 600M-1024px-multilang
                - 600M-512px-multilang
              title: model_variant
              type: string
              x-order: 2
            negative_prompt:
              default: ""
              description: Specify things to not see in the output
              title: Negative Prompt
              type: string
              x-order: 1
            num_inference_steps:
              default: 18
              description: Number of denoising steps
              minimum: 1
              title: Num Inference Steps
              type: integer
              x-order: 5
            pag_guidance_scale:
              default: 2
              description: PAG Guidance scale
              maximum: 20
              minimum: 1
              title: Pag Guidance Scale
              type: number
              x-order: 7
            prompt:
              default: a cyberpunk cat with a neon sign that says "Sana"
              description: Input prompt
              title: Prompt
              type: string
              x-order: 0
            seed:
              description: Random seed. Leave blank to randomize the seed
              title: Seed
              type: integer
              x-order: 8
            width:
              default: 1024
              description: Width of output image
              title: Width
              type: integer
              x-order: 3
          title: Input
          type: object
        output_file_prefix:
          title: Output File Prefix
          type: string
        webhook:
          format: uri
          maxLength: 65536
          minLength: 1
          title: Webhook
          type: string
        webhook_events_filter:
          default:
            - start
            - output
            - logs
            - completed
          items:
            description: An enumeration.
            enum:
              - start
              - output
              - logs
              - completed
            title: WebhookEvent
            type: string
          type: array
      title: PredictionRequest
      type: object
    PredictionResponse:
      properties:
        completed_at:
          format: date-time
          title: Completed At
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        error:
          title: Error
          type: string
        id:
          title: Id
          type: string
        input:
          properties:
            guidance_scale:
              default: 5
              description: Classifier-free guidance scale
              maximum: 20
              minimum: 1
              title: Guidance Scale
              type: number
              x-order: 6
            height:
              default: 1024
              description: Height of output image
              title: Height
              type: integer
              x-order: 4
            model_variant:
              default: 1600M-1024px
              description: Model variant. 1600M variants are slower but produce higher quality
                than 600M, 1024px variants are optimized for 1024x1024px images,
                512px variants are optimized for 512x512px images, 'multilang'
                variants can be prompted in both English and Chinese
              enum:
                - 1600M-1024px
                - 1600M-1024px-multilang
                - 1600M-512px
                - 600M-1024px-multilang
                - 600M-512px-multilang
              title: model_variant
              type: string
              x-order: 2
            negative_prompt:
              default: ""
              description: Specify things to not see in the output
              title: Negative Prompt
              type: string
              x-order: 1
            num_inference_steps:
              default: 18
              description: Number of denoising steps
              minimum: 1
              title: Num Inference Steps
              type: integer
              x-order: 5
            pag_guidance_scale:
              default: 2
              description: PAG Guidance scale
              maximum: 20
              minimum: 1
              title: Pag Guidance Scale
              type: number
              x-order: 7
            prompt:
              default: a cyberpunk cat with a neon sign that says "Sana"
              description: Input prompt
              title: Prompt
              type: string
              x-order: 0
            seed:
              description: Random seed. Leave blank to randomize the seed
              title: Seed
              type: integer
              x-order: 8
            width:
              default: 1024
              description: Width of output image
              title: Width
              type: integer
              x-order: 3
          title: Input
          type: object
        logs:
          default: ""
          title: Logs
          type: string
        metrics:
          title: Metrics
          type: object
        output:
          format: uri
          title: Output
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        status:
          description: An enumeration.
          enum:
            - starting
            - processing
            - succeeded
            - canceled
            - failed
          title: Status
          type: string
        version:
          title: Version
          type: string
      title: PredictionResponse
      type: object
    Status:
      description: An enumeration.
      enum:
        - starting
        - processing
        - succeeded
        - canceled
        - failed
      title: Status
      type: string
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    WebhookEvent:
      description: An enumeration.
      enum:
        - start
        - output
        - logs
        - completed
      title: WebhookEvent
      type: string
    model_variant:
      description: An enumeration.
      enum:
        - 1600M-1024px
        - 1600M-1024px-multilang
        - 1600M-512px
        - 600M-1024px-multilang
        - 600M-512px-multilang
      title: model_variant
      type: string
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with nvidia/sana
      description: Run inference with the nvidia/sana model on API.market
      operationId: createSanaPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: c6b5d2b7459910fec94432e9e1203c3cdce92d6db20f714f1355747990b52fa6
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: c6b5d2b7459910fec94432e9e1203c3cdce92d6db20f714f1355747990b52fa6
                  input:
                    width: 1024
                    height: 1024
                    prompt: a cyberpunk cat with a neon sign that says "Sana"
                    guidance_scale: 5
                    negative_prompt: ""
                    pag_guidance_scale: 2
                    num_inference_steps: 18
      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: c6b5d2b7459910fec94432e9e1203c3cdce92d6db20f714f1355747990b52fa6
                    status: starting
                    created_at: 2025-04-22T22:38:41.857Z
        "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 nvidia/sana prediction from API.market
      operationId: getSanaPrediction
      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://blog.api.market/wp-content/uploads/2026/04/high-res-image-gen.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:
      - *a1
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: image
    description: Operations related to image
  - name: visual-recognition
    description: Operations related to visual-recognition
  - name: text-to-image
    description: Operations related to text-to-image
