# Run402 AI Image Generation

> Run402 AI Image Generation is a paid API for AI agents from api.run402.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Generates an image from a text prompt using AI and returns it as a base64-encoded PNG

## Facts

- Endpoint: POST https://api.run402.com/generate-image/v1
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/run402-8e3000f7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0eis4YwsqUMaS3H35PuvG

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 run402-8e3000f7 -d '<json body>'
```

Example prompt: Generate an image of a golden retriever puppy playing in autumn leaves in a sunny park, and give me the PNG back.

## When to prefer this

Choose this endpoint when you need to programmatically generate an image from a text prompt and receive the result as a base64 PNG, especially in agentic workflows that support x402 micropayments. At $0.03 USDC per call it is cost-effective for single image generation tasks without a subscription.

## Known failure modes

- Invalid or empty prompt returns an error
- Content policy violation if prompt contains disallowed content
- Payment failure if USDC balance is insufficient (x402 payment required)
- Timeout if image generation takes too long
- Malformed request body returns 400 error

## How this service works

Generate an image from a text prompt using AI. Returns base64 PNG.

## Output

A base64-encoded PNG image file that the agent can decode and display, save, or pass to downstream processing steps.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "aspect": {
       "enum": [
        "square",
        "landscape",
        "portrait"
       ],
       "type": "string",
       "description": "Aspect ratio (default: square)"
      },
      "prompt": {
       "type": "string",
       "description": "Text prompt for image generation"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "image": "<base64 PNG data>",
  "aspect": "square",
  "content_type": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/run402-8e3000f7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.run402.com](https://www.zero.xyz/host/api.run402.com/llms.txt)
