{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Image Generator API — Batch Text to Image, Pay per Image",
    "description": "Generate images from one or many text prompts with FLUX (text to image) and get, for each image, a dataset item with the image URL, width, height and seed. Batch input, up to 4 variations per prompt, no API key, pay per image.",
    "version": "0.1",
    "x-build-id": "sQ9rU7aJhpoczRA2w"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sherwood~image-generator-batch/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sherwood-image-generator-batch",
        "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/sherwood~image-generator-batch/runs": {
      "post": {
        "operationId": "runs-sync-sherwood-image-generator-batch",
        "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/sherwood~image-generator-batch/run-sync": {
      "post": {
        "operationId": "run-sync-sherwood-image-generator-batch",
        "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",
        "properties": {
          "prompts": {
            "title": "Prompts",
            "type": "array",
            "description": "Text descriptions of the images to generate, as a list, in English for best results. One dataset item is returned per generated image, with an index matching the prompt order. For a single prompt, or several prompts in one newline-separated string, use prompt instead. Aliases merged into this list: prompt, texts, queries.",
            "default": [
              "A ceramic coffee mug on a wooden table, soft morning light, product photography, plain white background",
              "Minimal flat illustration of a paper plane flying over mountains, pastel colors"
            ],
            "items": {
              "type": "string"
            }
          },
          "prompt": {
            "title": "Single prompt (alias)",
            "type": "string",
            "description": "A single prompt, or several prompts in one newline-separated string (one prompt per line). Merged with prompts."
          },
          "texts": {
            "title": "texts (alias)",
            "type": "array",
            "description": "Alias of prompts.",
            "items": {
              "type": "string"
            }
          },
          "queries": {
            "title": "queries (alias)",
            "type": "array",
            "description": "Alias of prompts.",
            "items": {
              "type": "string"
            }
          },
          "imageSize": {
            "title": "Image size",
            "enum": [
              "square_hd",
              "landscape_4_3",
              "landscape_16_9",
              "portrait_4_3",
              "portrait_16_9",
              "square"
            ],
            "type": "string",
            "description": "Aspect ratio preset. square_hd is 1024×1024, landscape_4_3 is 1024×768, landscape_16_9 is 1024×576, portrait presets are the same sizes rotated, square is 512×512. For exact pixels use width and height instead.",
            "default": "square_hd"
          },
          "width": {
            "title": "Width (px, optional)",
            "minimum": 256,
            "maximum": 2048,
            "type": "integer",
            "description": "Exact output width in pixels, 256 to 2048. Overrides imageSize when both width and height are given. Output is charged per started megapixel above 1 MP."
          },
          "height": {
            "title": "Height (px, optional)",
            "minimum": 256,
            "maximum": 2048,
            "type": "integer",
            "description": "Exact output height in pixels, 256 to 2048. Overrides imageSize when both width and height are given."
          },
          "quality": {
            "title": "Model",
            "enum": [
              "standard",
              "fast"
            ],
            "type": "string",
            "description": "standard uses FLUX.2 Klein 9B (sharper detail, better text rendering). fast uses FLUX Schnell (about twice as fast, cheaper, good for drafts and thumbnails).",
            "default": "standard"
          },
          "imagesPerPrompt": {
            "title": "Images per prompt",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Generate 1 to 4 variations per prompt. Each image is charged.",
            "default": 1
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "png",
              "jpeg",
              "webp"
            ],
            "type": "string",
            "description": "File format of the generated image.",
            "default": "png"
          },
          "seed": {
            "title": "Seed (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Fix the seed to make a prompt reproducible. Leave empty for a random image each run."
          },
          "maxPrompts": {
            "title": "Max prompts per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many prompts. Protects against oversized lists. Default 100.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}