openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ultra-high-quality-text-to-image-api
info:
  title: Ultra-Quality Text-to-Image Generator API (Imagen 4 Ultra)
  description: Generate hyper-detailed, photorealistic images from text prompts
    with unmatched fidelity and premium qualityideal when results matter most.
  version: 6fd21fa98bbcc95e9749ed9800daabc3e1e88d9e5ca85025f33dc0be3322570b
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: 'The photo: Create a cinematic, photorealistic medium shot capturing
            the nostalgic warmth of a mid-2000s indie film. The focus is a young
            woman with a sleek, straight bob haircut in cool platinum white with
            freckled skin, looking directly and intently into the camera lens
            with a knowing smirk, her head is looking up slightly. She wears an
            oversized band t-shirt that says "Imagen 4 Ultra on API.market" 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 "ultra" in stylized graffiti lettering), rendered
            with a shallow depth of field. Natural film grain, a warm, slightly
            muted color palette, and sharp focus on her expressive eyes enhance
            the intimate, authentic feel'
        aspect_ratio:
          allOf:
            - $ref: "#/components/schemas/aspect_ratio"
          default: 1:1
          x-order: 1
          description: Aspect ratio of the generated image
          example: 16:9
        output_format:
          allOf:
            - $ref: "#/components/schemas/output_format"
          default: jpg
          x-order: 3
          description: Format of the output image
          example: jpg
        safety_filter_level:
          allOf:
            - $ref: "#/components/schemas/safety_filter_level"
          default: block_only_high
          x-order: 2
          description: block_low_and_above is strictest, block_medium_and_above blocks
            some prompts, block_only_high is most permissive but some prompts
            will still be blocked
          example: block_only_high
    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
        - 9:16
        - 16:9
        - 3:4
        - 4:3
      type: string
      title: aspect_ratio
      description: An enumeration.
    output_format:
      enum:
        - jpg
        - png
      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"
        context:
          type: object
          title: Context
          additionalProperties:
            type: string
        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
        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
    safety_filter_level:
      enum:
        - block_low_and_above
        - block_medium_and_above
        - block_only_high
      type: string
      title: safety_filter_level
      description: An enumeration.
  securitySchemes: {}
security: {}
paths:
  /predictions:
    post:
      summary: Create a prediction with google/imagen-4-ultra
      description: Run inference with the google/imagen-4-ultra model on API.market
      operationId: createImagen_4_ultraPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: 6fd21fa98bbcc95e9749ed9800daabc3e1e88d9e5ca85025f33dc0be3322570b
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: 6fd21fa98bbcc95e9749ed9800daabc3e1e88d9e5ca85025f33dc0be3322570b
                  input:
                    prompt: 'The photo: Create a cinematic, photorealistic medium shot capturing the
                      nostalgic warmth of a mid-2000s indie film. The focus is a
                      young woman with a sleek, straight bob haircut in cool
                      platinum white with freckled skin, looking directly and
                      intently into the camera lens with a knowing smirk, her
                      head is looking up slightly. She wears an oversized band
                      t-shirt that says "Imagen 4 Ultra on API.market" 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
                      "ultra" in stylized graffiti lettering), rendered with a
                      shallow depth of field. Natural film grain, a warm,
                      slightly muted color palette, and sharp focus on her
                      expressive eyes enhance the intimate, authentic feel'
                    aspect_ratio: 16:9
                    output_format: jpg
                    safety_filter_level: block_only_high
      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: 6fd21fa98bbcc95e9749ed9800daabc3e1e88d9e5ca85025f33dc0be3322570b
                    status: starting
                    created_at: 2025-07-11T10:08:50.900Z
        "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 google/imagen-4-ultra prediction
        from API.market
      operationId: getImagen_4_ultraPrediction
      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/2025/07/apI_market_imagen_4.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: 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
  - name: media
    description: Operations related to media
