# AI Image Generator (Cloudflare Workers AI / FLUX.1)

> AI Image Generator (Cloudflare Workers AI / FLUX.1) is a paid API for AI agents from ai-policy-kit.moneymaker-ai.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-28).

Generates a 1024×1024 AI image from a text prompt using FLUX.1 [schnell] via Cloudflare Workers AI, with optional style selection and prompt enhancement.

## Facts

- Endpoint: GET https://ai-policy-kit.moneymaker-ai.workers.dev/api/ai/image?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ai-image-generator-cloudflare-workers-ai-flux-1-494f77cf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e1Iw2v9QhWupJL-8WW49d

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ai-image-generator-cloudflare-workers-ai-flux-1-494f77cf
```

Example prompt: Can you generate a pencil sketch of an old bicycle leaning against a brick wall — use the pencil_sketch style and let it enhance the prompt automatically?

## When to prefer this

Choose this endpoint when you need a quick, low-cost ($0.01) text-to-image generation with automatic style detection and prompt enhancement, especially if you want named artistic styles like pencil_sketch, anime, watercolor, or flat_vector. It runs on Cloudflare's edge via FLUX.1 [schnell] (Apache-2.0), making it fast and serverless. Prefer alternatives if you need very high photorealism, video, audio, or multi-image batch generation.

## Known failure modes

- Prompt fails keyword safety screen — returns error before generation begins
- Prompt is too long (over 600 characters) — validation error
- Invalid style enum value — rejected by schema validation
- steps parameter out of range (must be 1–8) — validation error
- Cloudflare Workers AI upstream timeout — may return 500 or empty response
- Payment of 0.01 USDC not fulfilled via x402 — 402 Payment Required response

## How this service works

Generate an AI_POLICY.md and a pull request template with an AI-disclosure section for your open-source repo. Free, runs in your browser.

## Output

A JSON object containing the generated image as a base64-encoded JPEG string (~400KB typical), along with the image dimensions (1024×1024), the style applied, number of diffusion steps used, the final enhanced prompt, the AI engine name, approximate byte size, and a safety screening report indicating whether keyword and LLM screens passed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "steps": {
       "type": "string",
       "description": "1-8, default 6"
      },
      "style": {
       "enum": [
        "auto",
        "photo",
        "illustration",
        "flat_vector",
        "logo_icon",
        "watercolor",
        "oil_painting",
        "pencil_sketch",
        "ink_drawing",
        "anime",
        "comic",
        "pixel_art",
        "3d_render",
        "digital_painting"
       ],
       "type": "string",
       "description": "optional override; default auto (detected from prompt, photo if none)"
      },
      "prompt": {
       "type": "string",
       "description": "what to make, max 600 chars"
      },
      "enhance": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "default true; false = use the prompt as given"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mime": "image/jpeg",
  "note": "AI-generated image. Prompts are screened before generation; the image itself is not classified, so review it before publishing. You are responsible for how you use it.",
  "steps": 6,
  "style": "pencil_sketch",
  "width": 1024,
  "engine": "@cf/black-forest-labs/flux-1-schnell on Cloudflare Workers AI (FLUX.1 [schnell], Apache-2.0)",
  "height": 1024,
  "safety": {
   "keyword_screen": "passed",
   "output_checked": false,
   "llm_screen_final": "passed",
   "llm_screen_original": "passed"
  },
  "enhanced": true,
  "enhancement": "@cf/ibm-granite/granite-4.0-h-micro rewrite + rules",
  "bytes_approx": 398091,
  "final_prompt": "A graphite pencil sketch of an old bicycle leaning on a wall. Monochrome hand-drawn graphite on off-white sketchbook paper, confident pencil lines, cross-hatching and soft smudged shading for form, visible pencil strokes and paper texture, light construction lines, flat two-dimensional drawing.",
  "image_base64": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEB…(truncated)",
  "style_source": "rules",
  "original_prompt": "can you make me a pencil sketch of an old bicycle leaning on a wall"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ai-image-generator-cloudflare-workers-ai-flux-1-494f77cf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ai-policy-kit.moneymaker-ai.workers.dev](https://www.zero.xyz/host/ai-policy-kit.moneymaker-ai.workers.dev/llms.txt)
