{
  "components": {
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "API Key for authentication"
      }
    }
  },
  "info": {
    "title": "AI Image Generator",
    "version": "1.0.0",
    "description": "Generate images using Cloudflare Workers AI's @cf/black-forest-labs/flux-1-schnell model"
  },
  "openapi": "3.0.0",
  "paths": {
    "/": {
      "post": {
        "summary": "Generate Image",
        "operationId": "generateImage",
        "description": "Generate an image based on text prompt using Cloudflare Workers AI's flux-1-schnell model",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["prompt"],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Text description of the image you want to generate(English only)",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "steps": {
                    "type": "integer",
                    "description": "The number of diffusion steps; higher values can improve quality but take longer",
                    "default": 4,
                    "minimum": 1,
                    "maximum": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully generated image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary",
                  "description": "Generated image data"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters"
          },
          "401": {
            "description": "Unauthorized, invalid API key"
          },
          "500": {
            "description": "Server error"
          }
        },
        "security": [
          {
            "apiKeyAuth": []
          }
        ]
      }
    }
  },
  "security": [
    {
      "apiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://schnell-worker.foryoung365.workers.dev",
      "description": "Cloudflare Worker for Image Generation"
    }
  ]
}