# OpenAI Image Generation via mm.family (x402)

> OpenAI Image Generation via mm.family (x402) is a paid API for AI agents from openai.mm.family, paid per call via x402, $0.003473/call, status unknown (last checked 2026-10-02).

Generates images from text prompts using OpenAI image models (gpt-image-1, gpt-image-2, gpt-image-2.5, etc.), paid per call in USDC via x402 protocol, returning base64-encoded PNG/JPEG/WebP.

## Facts

- Endpoint: POST https://openai.mm.family/x402/v1/images/generations?utm_source=zero.xyz
- Price: $0.003473/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openai-image-generation-via-mm-family-x402-375bc3fb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8jOPfuQqU3uOpeWKtE2Nd

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 openai-image-generation-via-mm-family-x402-375bc3fb -d '<json body>'
```

Example prompt: Generate a photorealistic image of a golden retriever sitting in a sunlit meadow — use gpt-image-2, 1024x1024, medium quality, and return it as a PNG.

## When to prefer this

Choose this endpoint when you need OpenAI-quality text-to-image generation (gpt-image-1, gpt-image-2, gpt-image-2.5 family) and want to pay per call in USDC via the x402 protocol without managing OpenAI API keys directly. It is especially useful for autonomous agents that need crypto-native micropayments for image generation, or when you want access to multiple OpenAI image model variants (including mini and latest aliases) through a single proxy with transparent per-call pricing.

## Known failure modes

- Invalid or missing 'quality' parameter (auto is refused — must specify low, medium, high, xhigh, or max)
- Unsupported model key returns 404 or validation error
- Payment failure or insufficient USDC balance blocks request with 402
- Prompt violates content moderation policy, returning a refusal or error
- Invalid size string format causes a schema validation error
- Requesting 'n' greater than supported count for the chosen model

## How this service works

OpenAI image generation (gpt-image-2.5, gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, chatgpt-image-latest), paid per call in USDC. OpenAI list rates per 1M image tokens (1024x1024 low = 196 tokens on gpt-image-2), plus $0.0005 (Base) or $0.0005 (Solana) per call. Send size and quality (auto is refused); omitted means 1024x1024 medium. Returns b64_json. One endpoint per model: /x402/v1/models/<key>/images/generations. Rates: https://openai.mm.family/x402/pricing

## Output

A JSON object containing a data array with one or more base64-encoded images (b64_json), along with metadata including the image size, quality setting, output format, token usage (input, output, total tokens), and a creation timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "n": {
   "type": "integer"
  },
  "size": {
   "type": "string"
  },
  "model": {
   "enum": [
    "chatgpt-image-latest",
    "gpt-image-1",
    "gpt-image-1-mini",
    "gpt-image-1.5",
    "gpt-image-2",
    "gpt-image-2.5-flare",
    "gpt-image-2.5-sunburst"
   ],
   "type": "string"
  },
  "prompt": {
   "type": "string"
  },
  "quality": {
   "enum": [
    "low",
    "medium",
    "high",
    "xhigh",
    "max"
   ],
   "type": "string"
  },
  "background": {
   "type": "string"
  },
  "moderation": {
   "enum": [
    "auto"
   ],
   "type": "string"
  },
  "output_format": {
   "enum": [
    "png",
    "jpeg",
    "webp"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": [
   {
    "b64_json": "<base64 png>"
   }
  ],
  "size": "1024x1024",
  "usage": {
   "input_tokens": 12,
   "total_tokens": 208,
   "output_tokens": 196
  },
  "created": 1,
  "quality": "low",
  "output_format": "png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openai-image-generation-via-mm-family-x402-375bc3fb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from openai.mm.family](https://www.zero.xyz/host/openai.mm.family/llms.txt)
