images_generations
OpenAI-compatible image generation (FLUX.1 schnell) — Drop-in OpenAI Images API (POST /v1/images/generations): text-to-image with FLUX.1 [schnell] on Workers AI, 1024x1024 JPEG. Body JSON: prompt (required, up to 2000 chars), optional n (only 1), response_format b64_json (default) or url (returns a data: URL, nothing is hosted), steps (1-8, default 4; more steps = more detail). Prompts are screened by Llama Guard; flagged prompts get 400 content_policy_violation and are not charged. FLUX.1 [schnell] is Apache-2.0, so images can be used commercially. Price: $0.02 USDC (Base, via x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "images_generations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | A watercolor lighthouse on a rocky coast at sunset |