# meld402 AI Image Generation

> meld402 AI Image Generation is a paid API for AI agents from meld402.vercel.app, paid per call via x402, $0.5/call, status unknown (last checked 2026-09-13).

Generates, transforms, or upscales images using Stability AI models (SD3.5, FLUX, SDXL) with a single USDC micropayment over x402

## Facts

- Endpoint: POST https://meld402.vercel.app/api/ai/image
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/meld402-ai-image-generation-57457d44
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gMOiwG2MTv3UBvmUO-_6J

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 meld402-ai-image-generation-57457d44 -d '<json body>'
```

Example prompt: Generate a cinematic 16:9 image of a lone astronaut standing on Mars at sunset, photographic style, using the sd3.5-large model — make it dramatic with deep orange skies and long shadows.

## When to prefer this

Choose this endpoint when you need image generation with a pay-per-call USDC micropayment model (no subscription required), want access to multiple Stability AI models (SD3.5 variants, FLUX, SDXL) through a single stable schema, or need text-to-image, image-to-image, and upscaling all from one API. Ideal for autonomous agents that need programmatic image creation without managing API keys for multiple providers.

## Known failure modes

- Invalid or missing prompt returns a validation error
- Unsupported model enum value causes a 400 error
- Missing image_base64 for image-to-image or upscale mode causes failure
- Seed value out of range (>4294967294) causes rejection
- Payment failure over x402/Base USDC results in 402 not authorized
- Generation timeout if model inference exceeds platform limits
- Base64 image malformed or too large may cause processing error

## How this service works

14 paid data endpoints for autonomous agents and developers. Covers crypto intelligence (token, chain, Solana, gas), markets (FX, market pulse), location (weather), and research (news, brief). Each route aggregates multiple public sources into one stable schema with a single USDC payment over x402 on Base.

## Output

Returns a JSON object containing the generated image as a base64-encoded string, the model used, generation time in milliseconds, cost in USD, finish reason, a seed for reproducibility, and attribution metadata listing Stability AI as the source.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "mode": {
   "enum": [
    "text-to-image",
    "image-to-image",
    "upscale"
   ],
   "type": "string",
   "default": "text-to-image"
  },
  "seed": {
   "type": "integer",
   "maximum": 4294967294,
   "minimum": 0,
   "description": "Random seed"
  },
  "model": {
   "enum": [
    "sd3.5-flash",
    "sd3.5-medium",
    "sd3.5-large",
    "sd3.5-large-turbo",
    "stable-image-ultra",
    "flux",
    "sdxl"
   ],
   "type": "string",
   "default": "sd3.5-large",
   "description": "Model to use"
  },
  "prompt": {
   "type": "string",
   "maxLength": 2000,
   "minLength": 1,
   "description": "Image generation prompt"
  },
  "strength": {
   "type": "number",
   "default": 0.5,
   "maximum": 1,
   "minimum": 0,
   "description": "Denoising strength for image-to-image"
  },
  "cfg_scale": {
   "type": "number",
   "default": 7,
   "maximum": 10,
   "minimum": 1
  },
  "creativity": {
   "type": "number",
   "default": 0.3,
   "maximum": 0.5,
   "minimum": 0.1,
   "description": "Creativity level for upscale"
  },
  "aspect_ratio": {
   "enum": [
    "1:1",
    "16:9",
    "21:9",
    "2:3",
    "3:2",
    "4:5",
    "5:4",
    "9:16",
    "9:21"
   ],
   "type": "string",
   "default": "1:1"
  },
  "image_base64": {
   "type": "string",
   "description": "Base64 encoded input image (for image-to-image/upscale)"
  },
  "style_preset": {
   "enum": [
    "photographic",
    "digital-art",
    "anime",
    "cinematic",
    "fantasy",
    "line-art",
    "3d-model",
    "origami",
    "pixel-art",
    "texture"
   ],
   "type": "string"
  },
  "output_format": {
   "enum": [
    "jpeg",
    "png",
    "webp"
   ],
   "type": "string",
   "default": "png"
  },
  "negative_prompt": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "mode": "text-to-image",
   "seed": 123456789,
   "model": "sd3.5-large",
   "cost_usd": 0.04,
   "image_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
   "finish_reason": "success",
   "generation_time_ms": 8500
  },
  "meta": {
   "as_of": "2026-08-24T00:00:00.000Z",
   "sources": [
    "stability"
   ],
   "degraded": [],
   "attribution": [
    "Image generation by Stability AI (stability.ai)"
   ]
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/meld402-ai-image-generation-57457d44/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from meld402.vercel.app](https://www.zero.xyz/host/meld402.vercel.app/llms.txt)
