{
  "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 visual content. Standard and Clean return a hosted image URL synchronously. HD and Pro return a paid job ID plus a free status URL so long-running generation is not lost to an HTTP proxy timeout. 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 an AI image from a text prompt (text-to-image)",
        "description": "Standard text-to-image generation via FLUX Schnell. Give it a natural-language prompt and get back a hosted image URL \u2014 ideal for fast drafts, mockups, concept art, or a marketing image generated on the fly by an agent or automated pipeline. Supports 1:1, 16:9, 9:16, and 4:3 aspect ratios. Requires x402 payment of 0.25 USDC on Base; no API key or signup needed.",
        "x-guidance": "Use this route when an agent needs to create AI art via API from a text description \u2014 'generate an image of a red panda astronaut', 'create a marketing image for a product launch', 'text-to-image for an automated content pipeline'. Returns a hosted PNG URL plus the prompt and aspect ratio used. Fastest, lowest-cost tier (FLUX Schnell); use /generate/hd or /generate/pro for higher fidelity.",
        "tags": [
          "AI",
          "Image",
          "Generation"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.250000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "250000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.25 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "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 an AI image with background removed (transparent PNG)",
        "description": "Text-to-image generation (FLUX Schnell) with the background automatically stripped, returning a transparent PNG cutout instead of a full scene. Good for product photos, sticker designs, and logo marks that need to drop cleanly onto any background or e-commerce template. Requires x402 payment of 0.35 USDC on Base; no API key needed.",
        "x-guidance": "Use this route when an agent needs a subject on a transparent background rather than a full scene \u2014 'generate a product photo with no background', 'create a sticker design as a transparent PNG', 'make a logo mark I can place on any background'. Same FLUX Schnell model as /generate, plus automatic background removal.",
        "tags": [
          "AI",
          "Image",
          "Generation"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.350000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "350000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.35 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "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 a premium AI image, upscaled 4x to HD",
        "description": "High-resolution text-to-image generation via FLUX 1.1 Pro, upscaled 4x with Real-ESRGAN. Payment returns a job ID immediately; poll the free status_url until the image succeeds or fails. Use it for hero images, wallpapers, banner art, and large-format prints where resolution matters more than speed. Requires x402 payment of 0.50 USDC on Base; no API key or signup needed.",
        "x-guidance": "Use this route when an agent needs high-resolution AI art rather than a quick draft \u2014 'generate a 4K wallpaper from a text prompt', 'create a hero image for a landing page', 'I need a large-format print-quality AI image'. Higher fidelity and resolution than /generate, no background removal.",
        "tags": [
          "AI",
          "Image",
          "Generation"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.500000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "500000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.50 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "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": {
          "202": {
            "description": "Paid generation accepted; poll status_url for the result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "succeeded",
                        "failed"
                      ]
                    },
                    "tier": {
                      "type": "string",
                      "enum": [
                        "hd"
                      ]
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "job_id",
                    "status",
                    "tier",
                    "status_url"
                  ]
                }
              }
            }
          },
          "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 a top-tier AI image, background removed and upscaled 4x",
        "description": "Premium text-to-image generation via FLUX Kontext Max, with the background removed and the result upscaled 4x. Payment returns a job ID immediately; poll the free status_url until the image succeeds or fails. Use it for professional product renders and brand marks where both image quality and a clean background matter. Requires x402 payment of 0.75 USDC on Base; no API key needed.",
        "x-guidance": "Use this route for the highest-quality tier when an agent needs both resolution and a transparent background \u2014 'generate a premium product render with no background', 'create a professional brand mark at high resolution', 'I need a print-ready transparent logo'. Combines HD upscaling (like /generate/hd) with background removal (like /generate/clean).",
        "tags": [
          "AI",
          "Image",
          "Generation"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.750000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "750000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.75 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "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": {
          "202": {
            "description": "Paid generation accepted; poll status_url for the result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "succeeded",
                        "failed"
                      ]
                    },
                    "tier": {
                      "type": "string",
                      "enum": [
                        "pro"
                      ]
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "job_id",
                    "status",
                    "tier",
                    "status_url"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "502": {
            "description": "Image generation failed"
          },
          "503": {
            "description": "Temporary capacity limit."
          }
        }
      }
    },
    "/prompt-styles": {
      "get": {
        "operationId": "get-prompt-styles",
        "summary": "Prompt Styles \u2014 curated FLUX prompt recipes ($0.001)",
        "description": "Static curated cheat sheet: 12 proven style templates, aspect-ratio guide, and a tier picker for the paid generation endpoints. No parameters; answers from memory in milliseconds. Requires x402 payment ($0.001 USDC on Base).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Style recipe pack",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "styles": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "aspect_guide": {
                      "type": "object"
                    },
                    "tier_guide": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required (x402)"
          }
        },
        "x-guidance": "Call this first when an agent is about to generate an image and wants a proven prompt formula \u2014 12 curated style templates (product shot, flat icon, cinematic, sticker, and more), an aspect-ratio guide, and which paid tier fits the job. $0.001, static, instant.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.001000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "1000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.001 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "operationId": "getImageJob",
        "summary": "Check an HD or Pro image-generation job",
        "description": "Free status lookup for a previously paid HD or Pro generation job. Poll the unguessable status_url returned by the paid request; no second payment is required.",
        "tags": [
          "AI",
          "Image",
          "Jobs"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current job state and image URL when complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "succeeded",
                        "failed"
                      ]
                    },
                    "tier": {
                      "type": "string"
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "job_id",
                    "status",
                    "tier",
                    "status_url"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Job not found"
          }
        }
      }
    },
    "/presets": {
      "get": {
        "operationId": "listTransformPresets",
        "summary": "List the 58 identity-preserving transform presets for /transform",
        "description": "Static JSON listing every /transform preset: id, title, tagline, input_type (person or pet) and categories, plus usage notes, terms and an aspect guide. Answers in milliseconds. Requires x402 payment of 0.005 USDC on Base; no API key needed.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Preset list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "presets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "tagline": {
                            "type": "string"
                          },
                          "input_type": {
                            "type": "string",
                            "enum": [
                              "person",
                              "pet"
                            ]
                          },
                          "categories": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "usage": {
                      "type": "string"
                    },
                    "terms": {
                      "type": "string"
                    },
                    "aspect_guide": {
                      "type": "object"
                    },
                    "next": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "x-guidance": "Call this once before /transform to pick a preset id \u2014 'turn this photo into an action figure', 'make my dog a king', 'give me a CEO headshot', 'cartoon villain version of me'. Cheap and cacheable; the list changes rarely.",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "5000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.005 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "tags": [
          "AI",
          "Image",
          "Transform"
        ]
      }
    },
    "/transform": {
      "get": {
        "operationId": "transformImage",
        "summary": "Transform a photo with a named preset, identity preserved (async job)",
        "description": "Image-to-image transformation via FLUX Kontext Max. Pass a public https image URL and a preset id from /presets; the subject's face or pet is preserved while the scene, styling and framing change (action figure in a toy box, royal pet portrait, CEO portrait, cartoon villain, fantasy poster and 50 more). Payment returns a job ID immediately; poll the free status_url until the PNG succeeds or fails. The server never fetches image_url itself; it is handed to the model provider. Requires x402 payment of 0.75 USDC on Base; no API key needed.",
        "x-guidance": "Use this when an agent has a photo and wants a stylized version that still looks like the subject \u2014 'make an action figure of this person', 'turn my cat into royalty', 'professional headshot from this selfie', 'movie poster with me as the hero'. Pick the preset id from /presets first. Submit only images the caller has rights to; no minors; provider safety filters apply and a declined image still consumes the payment.",
        "tags": [
          "AI",
          "Image",
          "Transform"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.750000"
          },
          "protocols": [
            {
              "x402": {}
            },
            {
              "mpp": {}
            }
          ],
          "offers": [
            {
              "intent": "charge",
              "method": "evm",
              "amount": "750000",
              "currency": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "description": "$0.75 USDC on Base (chainId 8453), EIP-3009 authorization"
            }
          ]
        },
        "parameters": [
          {
            "name": "image_url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri",
              "maxLength": 2048
            },
            "description": "Public https URL of the source photo (JPEG, PNG or WebP). Defaults to the hosted sample portrait when omitted (verification probes)."
          },
          {
            "name": "preset",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Preset id from GET /presets (e.g. action-figure, pet-royal, ceo-portrait, cartoon-villain, fantasy-poster). Defaults to action-figure when omitted."
          },
          {
            "name": "aspect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "match_input_image",
                "1:1",
                "16:9",
                "9:16",
                "4:3",
                "3:4"
              ],
              "default": "match_input_image"
            },
            "description": "Output aspect ratio"
          }
        ],
        "responses": {
          "202": {
            "description": "Paid generation accepted; poll status_url for the result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "succeeded",
                        "failed"
                      ]
                    },
                    "tier": {
                      "type": "string",
                      "enum": [
                        "pro"
                      ]
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "preset": {
                      "type": "string"
                    },
                    "preset_title": {
                      "type": "string"
                    },
                    "input_type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "job_id",
                    "status",
                    "tier",
                    "status_url"
                  ]
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "502": {
            "description": "Image generation failed"
          },
          "503": {
            "description": "Temporary capacity limit."
          },
          "400": {
            "description": "Invalid image_url, unknown preset or invalid aspect (checked before payment)"
          }
        }
      }
    }
  }
}