{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Generator API: GPT Image 2 & Nano Banana Pro",
    "description": "AI image generator and text-to-image API: GPT Image 2, 2.5, 2.6 and Nano Banana Pro, up to 4K, with image editing from reference images. Real-time Standby API or bulk runs, from $0.06 per image at any size. No API key needed, failed images are free.",
    "version": "1.0",
    "x-build-id": "gzW4DzWir2hZheuCe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/newpo~ai-image-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-newpo-ai-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/newpo~ai-image-generator/runs": {
      "post": {
        "operationId": "runs-sync-newpo-ai-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/newpo~ai-image-generator/run-sync": {
      "post": {
        "operationId": "run-sync-newpo-ai-image-generator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "prompts"
        ],
        "properties": {
          "prompts": {
            "title": "Prompts",
            "type": "array",
            "description": "One prompt per line or item. Each prompt makes \"Images per prompt\" images. Up to 1,000 prompts per run (bulk). Describe the subject, style, lighting and any text to render, e.g. \"A watercolor painting of a red fox in a snowy birch forest at dawn\".",
            "items": {
              "type": "string"
            }
          },
          "tier": {
            "title": "Quality tier",
            "enum": [
              "standard",
              "premium",
              "pro"
            ],
            "type": "string",
            "description": "Picks the default model of the tier. Choose a specific model below to override it; the price follows the model's tier.",
            "default": "standard"
          },
          "model": {
            "title": "Model (optional)",
            "enum": [
              "auto",
              "gpt-image-2",
              "gpt-image-2.5-flare",
              "gpt-image-2.5-sunburst",
              "gpt-image-2.6-flare",
              "gpt-image-2.6-sunburst",
              "gemini-3-pro-image",
              "gemini-3.1-flash-image"
            ],
            "type": "string",
            "description": "Leave on Auto to use the tier's default. All models generate and edit (with reference images).",
            "default": "auto"
          },
          "size": {
            "title": "Size / aspect ratio",
            "enum": [
              "auto",
              "1024x1024",
              "1536x1024",
              "1024x1536",
              "1824x1024",
              "1024x1824",
              "2048x2048",
              "2560x1440",
              "1440x2560",
              "3840x2160",
              "2160x3840"
            ],
            "type": "string",
            "description": "Same price at every size. For another size use \"Custom size\".",
            "default": "1024x1024"
          },
          "customSize": {
            "title": "Custom size (optional)",
            "type": "string",
            "description": "WIDTHxHEIGHT, overrides Size. Both sides multiples of 16, long side at most 3840 px and at most 3× the short side, 655,360 to 8,294,400 pixels in total. Example: 1280x720 is too small; 1344x768 works."
          },
          "quality": {
            "title": "Quality (GPT Image 2 only)",
            "enum": [
              "auto",
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "description": "Rendering detail for GPT Image 2. Same price for every quality; higher takes longer. Other models ignore it.",
            "default": "auto"
          },
          "imagesPerPrompt": {
            "title": "Images per prompt",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "1 to 10 variations of each prompt. Each image is charged separately.",
            "default": 1
          },
          "referenceImageUrls": {
            "title": "Reference images for editing (optional)",
            "type": "array",
            "description": "Up to 16 public image URLs (PNG, JPEG or WebP, 50 MB total). With reference images, every prompt is an edit: say what to take from each, e.g. \"The mug from the first image on the wooden table from the second, morning light\". Same price as a generation.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "File format of the images. A 4K PNG is about 14 MB; JPEG and WebP are much smaller.",
            "default": "png"
          },
          "transparentBackground": {
            "title": "Transparent background",
            "type": "boolean",
            "description": "Ask for a transparent background (PNG or WebP), e.g. for product cut-outs, logos and stickers. Best with GPT Image 2.",
            "default": false
          },
          "keyValueStoreName": {
            "title": "Save images to a named store (optional)",
            "type": "string",
            "description": "Images go to the run's key-value store by default, which Apify deletes after your plan's data retention period. Give a name (e.g. \"my-product-shots\") to save them in a named key-value store that is kept until you delete it. Letters, digits and dashes only."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}