openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/magicapi/ai-image-editing-api-google-nano-banana
info:
  title: Ultra-Fast AI Image Editing API (Nano-Banana)
  description: Edit images seamlessly with Google's Nano-Banana AI, delivering
    high-speed, precise results.
  version: f0a9d34b12ad1c1cd76269a844b218ff4e64e128ddaba93e15891f47368958a0
components:
  schemas:
    Input:
      type: object
      title: Input
      required:
        - prompt
      properties:
        prompt:
          type: string
          title: Prompt
          x-order: 0
          description: A text description of the image you want to generate
          example: "Make the sheets in the style of the logo. Make the scene natural. "
        image_input:
          type: array
          items:
            type: string
            anyOf: []
            format: uri
          title: Image Input
          x-order: 1
          nullable: true
          description: Input images to transform or use as reference (supports multiple
            images)
          example: &a1
            - https://blog.api.market/wp-content/uploads/2025/12/google-nano-banana-api-market.png
            - https://blog.api.market/wp-content/uploads/2025/12/floral-design-api-market.jpg
        output_format:
          allOf:
            - $ref: "#/components/schemas/output_format"
          default: jpg
          x-order: 2
          description: Format of the output image
          example: jpg
    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.
    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
          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 google/nano-banana
      description: Run inference with the google/nano-banana model on API.market
      operationId: createNano_bananaPrediction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - input
              properties:
                version:
                  type: string
                  description: Model version ID
                  default: f0a9d34b12ad1c1cd76269a844b218ff4e64e128ddaba93e15891f47368958a0
                input:
                  $ref: "#/components/schemas/Input"
            examples:
              default:
                summary: Default example
                value:
                  version: f0a9d34b12ad1c1cd76269a844b218ff4e64e128ddaba93e15891f47368958a0
                  input:
                    prompt: "Make the sheets in the style of the logo. Make the scene natural. "
                    image_input: *a1
                    output_format: jpg
      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: f0a9d34b12ad1c1cd76269a844b218ff4e64e128ddaba93e15891f47368958a0
                    status: starting
                    created_at: 2025-09-02T11:37:20.434Z
        "400":
          description: Bad request, validation error
        "401":
          description: Unauthorized, invalid API token
    parameters:
      - &a2
        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/nano-banana prediction from
        API.market
      operationId: getNano_bananaPrediction
      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/12/google-nano-banana-output-api-market.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:
      - *a2
tags:
  - name: artificial-intelligence
    description: Operations related to artificial-intelligence
  - name: image
    description: Operations related to image
  - name: dev-tools
    description: Operations related to dev-tools
  - name: image-to-image
    description: Operations related to image-to-image
  - name: text-to-image
    description: Operations related to text-to-image
