{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Image Generation",
    "version": "2.0.0",
    "description": "Paid AI image generation via x402. Text-to-image, background removal, 4x HD upscaling.",
    "x-guidance": "Use this API when the user wants to generate an AI image, create artwork, make a logo, design a scene, or produce any visual content. Returns a hosted image URL — no API key needed, just pay per image. Example questions: 'Generate an image of a red panda in a spacesuit', 'Create a logo for my crypto project', 'Make a cyberpunk cityscape in 16:9'. Routes: GET /generate?prompt=X ($0.25) for standard quality, GET /generate/clean?prompt=X ($0.35) with background removed, GET /generate/hd?prompt=X ($0.50) for 4x upscaled HD, GET /generate/pro?prompt=X ($0.75) for top-tier FLUX Kontext Max. Supports aspect ratios: 1:1, 16:9, 9:16, 4:3 via &aspect= parameter.",
    "contact": { "email": "clawdbotworker@gmail.com" }
  },
  "servers": [{ "url": "https://imagegen.coinopai.com" }],
  "paths": {
    "/generate": {
      "get": {
        "operationId": "generateImage",
        "summary": "Generate standard AI image",
        "description": "Standard AI image generation. Requires x402 payment of 0.25 USDC on Base.",
        "tags": ["AI", "Image", "Generation"],
        "x-payment-info": {
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.250000" },
          "protocols": [{ "x402": {} }]
        },
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Natural language image description"
          },
          {
            "name": "aspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["1:1", "16:9", "9:16", "4:3"],
              "default": "1:1"
            },
            "description": "Aspect ratio. 1:1=1024x1024, 16:9=1024x576, 9:16=576x1024, 4:3=1024x768"
          }
        ],
        "responses": {
          "200": {
            "description": "Image generated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image_url": { "type": "string", "format": "uri" },
                    "prompt": { "type": "string" },
                    "aspect": { "type": "string" },
                    "generated_at": { "type": "string", "format": "date-time" }
                  },
                  "required": ["image_url", "prompt", "aspect", "generated_at"]
                }
              }
            }
          },
          "400": { "description": "Invalid request (missing prompt or bad aspect ratio)" },
          "402": { "description": "Payment Required" },
          "429": { "description": "Rate limit exceeded. Max 10 requests per minute." },
          "502": { "description": "Image generation failed" },
          "503": { "description": "Temporary capacity limit. Retry shortly." }
        }
      }
    },
    "/generate/clean": {
      "get": {
        "operationId": "generateCleanImage",
        "summary": "Generate AI image with background removed",
        "description": "AI image generation with background removal. Requires x402 payment of 0.35 USDC on Base.",
        "tags": ["AI", "Image", "Generation"],
        "x-payment-info": {
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.350000" },
          "protocols": [{ "x402": {} }]
        },
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Natural language image description"
          },
          {
            "name": "aspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["1:1", "16:9", "9:16", "4:3"],
              "default": "1:1"
            },
            "description": "Aspect ratio"
          }
        ],
        "responses": {
          "200": {
            "description": "Image generated and background removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image_url": { "type": "string", "format": "uri" },
                    "prompt": { "type": "string" },
                    "aspect": { "type": "string" },
                    "generated_at": { "type": "string", "format": "date-time" }
                  },
                  "required": ["image_url", "prompt", "aspect", "generated_at"]
                }
              }
            }
          },
          "402": { "description": "Payment Required" },
          "429": { "description": "Rate limit exceeded." },
          "502": { "description": "Image generation failed" },
          "503": { "description": "Temporary capacity limit." }
        }
      }
    },
    "/generate/hd": {
      "get": {
        "operationId": "generateHdImage",
        "summary": "Generate premium AI image + 4x upscale",
        "description": "Premium AI image generation with 4x HD upscale. Requires x402 payment of 0.50 USDC on Base.",
        "tags": ["AI", "Image", "Generation"],
        "x-payment-info": {
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.500000" },
          "protocols": [{ "x402": {} }]
        },
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Natural language image description"
          },
          {
            "name": "aspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["1:1", "16:9", "9:16", "4:3"],
              "default": "1:1"
            },
            "description": "Aspect ratio"
          }
        ],
        "responses": {
          "200": {
            "description": "Image generated and upscaled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image_url": { "type": "string", "format": "uri" },
                    "prompt": { "type": "string" },
                    "aspect": { "type": "string" },
                    "generated_at": { "type": "string", "format": "date-time" }
                  },
                  "required": ["image_url", "prompt", "aspect", "generated_at"]
                }
              }
            }
          },
          "402": { "description": "Payment Required" },
          "429": { "description": "Rate limit exceeded." },
          "502": { "description": "Image generation failed" },
          "503": { "description": "Temporary capacity limit." }
        }
      }
    },
    "/generate/pro": {
      "get": {
        "operationId": "generateProImage",
        "summary": "Generate top-tier AI image + bg removal + 4x upscale",
        "description": "Top-tier AI image generation with background removal and 4x HD upscale. Requires x402 payment of 0.75 USDC on Base.",
        "tags": ["AI", "Image", "Generation"],
        "x-payment-info": {
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.750000" },
          "protocols": [{ "x402": {} }]
        },
        "parameters": [
          {
            "name": "prompt",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Natural language image description"
          },
          {
            "name": "aspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["1:1", "16:9", "9:16", "4:3"],
              "default": "1:1"
            },
            "description": "Aspect ratio"
          }
        ],
        "responses": {
          "200": {
            "description": "Image generated, background removed, and upscaled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image_url": { "type": "string", "format": "uri" },
                    "prompt": { "type": "string" },
                    "aspect": { "type": "string" },
                    "generated_at": { "type": "string", "format": "date-time" }
                  },
                  "required": ["image_url", "prompt", "aspect", "generated_at"]
                }
              }
            }
          },
          "402": { "description": "Payment Required" },
          "429": { "description": "Rate limit exceeded." },
          "502": { "description": "Image generation failed" },
          "503": { "description": "Temporary capacity limit." }
        }
      }
    }
  }
}
