{
  "openapi": "3.0.1",
  "info": {
    "title": "FLUX.2 Klein Image Generator (Text-to-Image & Image-to-Image)",
    "description": "Fast, cheap AI image generator & editor powered by FLUX.2 Klein. Text-to-image and image-to-image in seconds, just $4/1000 images. No GPU or subscription — a pay-as-you-go Midjourney, DALL-E & Flux alternative.",
    "version": "0.1",
    "x-build-id": "A7dtX26zYXghRkeVn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/danitn11~flux2-klein-image-generator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-danitn11-flux2-klein-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/danitn11~flux2-klein-image-generator/runs": {
      "post": {
        "operationId": "runs-sync-danitn11-flux2-klein-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/danitn11~flux2-klein-image-generator/run-sync": {
      "post": {
        "operationId": "run-sync-danitn11-flux2-klein-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": [
          "prompt"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "text-to-image",
              "image-to-image"
            ],
            "type": "string",
            "description": "Choose Text to Image to generate from a prompt, or Image to Image to edit/transform an existing image. If you provide an Image URL, Image to Image is used automatically.",
            "default": "text-to-image"
          },
          "prompt": {
            "title": "Prompt",
            "type": "string",
            "description": "Describe the image you want. For Image to Image, describe the change or new look you want applied to the input image, e.g. \"make it a watercolor painting at sunset\".",
            "default": "A beautiful sunset over a calm ocean, cinematic, highly detailed"
          },
          "imageUrl": {
            "title": "Image URL (Image to Image only)",
            "type": "string",
            "description": "Publicly accessible URL of the source image to edit (JPG, PNG, or WebP). Required for Image to Image. Must be directly downloadable — no Google Drive share links, localhost, or auth-gated URLs. Example: https://cdn.doggi-dev.net/media-gen-gateway/req-b6f24df387a7461788b4bfafffe9c7e7_0.jpeg"
          },
          "imageUrls": {
            "title": "Additional image URLs (optional)",
            "type": "array",
            "description": "Optional extra reference images for multi-image editing/compositing. Used with Image to Image. The main Image URL is included automatically.",
            "items": {
              "type": "string"
            }
          },
          "aspectRatio": {
            "title": "Aspect ratio (Image to Image)",
            "enum": [
              "auto",
              "21:9",
              "16:9",
              "3:2",
              "4:3",
              "5:4",
              "1:1",
              "4:5",
              "3:4",
              "2:3",
              "9:16",
              "4:1",
              "1:4",
              "8:1",
              "1:8"
            ],
            "type": "string",
            "description": "Output aspect ratio for Image to Image. \"auto\" keeps the input image's ratio.",
            "default": "auto"
          },
          "strength": {
            "title": "Strength (Image to Image)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "How much to change the input image, 0–1. Lower keeps more of the original; higher follows the prompt more freely. Leave empty for the model default."
          },
          "imageSize": {
            "title": "Image size (Text to Image)",
            "enum": [
              "square_hd",
              "square",
              "portrait_4_3",
              "portrait_16_9",
              "landscape_4_3",
              "landscape_16_9",
              "auto"
            ],
            "type": "string",
            "description": "Output size/orientation for Text to Image.",
            "default": "landscape_4_3"
          },
          "negativePrompt": {
            "title": "Negative prompt (Text to Image)",
            "type": "string",
            "description": "What to avoid in the image, e.g. \"blurry, low quality, distorted, extra fingers\"."
          },
          "numImages": {
            "title": "Number of images",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "How many images to generate per run, 1–4. You are charged per output image.",
            "default": 1
          },
          "guidanceScale": {
            "title": "Guidance scale (CFG)",
            "minimum": 0,
            "maximum": 20,
            "type": "number",
            "description": "How strictly the model follows your prompt. FLUX.2 Klein is guidance-distilled — 1.0 is the recommended default for the best speed and quality. Higher values follow the prompt more literally but can reduce realism.",
            "default": 1
          },
          "outputFormat": {
            "title": "Output format",
            "enum": [
              "jpeg",
              "png",
              "webp"
            ],
            "type": "string",
            "description": "Image file format. JPEG is smallest/fastest; PNG is lossless; WebP balances both.",
            "default": "jpeg"
          },
          "seed": {
            "title": "Seed (optional)",
            "type": "integer",
            "description": "Set a seed for reproducible results. Leave empty for a random image each run."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}