# Fretchen AI Image Generation & NFT Minting Service

> Fretchen AI Image Generation & NFT Minting Service is a paid API for AI agents from imagegen-agent.fretchen.eu, paid per call via x402, $0.07/call, status unknown (last checked 2026-09-15).

Generates AI images from text prompts (or edits existing images) and mints them as NFTs on Optimism/Base, paid via x402 USDC.

## Facts

- Endpoint: POST https://imagegen-agent.fretchen.eu/
- Price: $0.07/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fretchen-ai-image-generation-nft-minting-service-ad15a515
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vpb9PWq9o-h7l93JcEd9H

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 fretchen-ai-image-generation-nft-minting-service-ad15a515 -d '<json body>'
```

Example prompt: Generate a new AI image of 'a cyberpunk fox under neon lights at night' in 1024x1024 size and mint it as NFT token ID 42 on Fretchen.

## When to prefer this

Choose this endpoint when you need to both generate an AI image AND mint it as an NFT on Optimism or Base in a single call, especially in Web3 or blockchain-native agent workflows where payment via x402 USDC is already supported. It is uniquely suited for scenarios requiring on-chain provenance of AI-generated art, NFT collection management, or automated minting pipelines. If you only need image generation without NFT minting, a standard image generation API would be simpler and cheaper.

## Known failure modes

- Invalid or missing prompt — returns error indicating prompt is required
- Missing tokenId — returns validation error as tokenId is required
- Insufficient USDC payment via x402 — payment not accepted, request rejected
- Edit mode requested without referenceImage — returns error that base64 reference image is required
- Invalid base64 referenceImage — image decoding failure
- Unsupported size parameter — may return error or default to a supported dimension
- On-chain transaction failure — mint may fail due to network congestion or contract error, no transaction_hash returned
- Rate limiting or service unavailability — HTTP 429 or 503

## How this service works

AI-powered image generation with NFT minting on Optimism/Base, paid via x402 USDC.

## Output

Returns a JSON object containing a URL to the generated image, a URL to the NFT metadata JSON, and the on-chain transaction hash confirming the mint on Optimism/Base.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "prompt",
  "tokenId"
 ],
 "properties": {
  "mode": {
   "enum": [
    "generate",
    "edit"
   ],
   "type": "string",
   "description": "generate: create new image, edit: modify existing image"
  },
  "size": {
   "enum": [
    "1024x1024",
    "1792x1024"
   ],
   "type": "string",
   "description": "Output image dimensions"
  },
  "prompt": {
   "type": "string",
   "description": "The text prompt for AI image generation"
  },
  "tokenId": {
   "type": "integer",
   "description": "The NFT token ID to update"
  },
  "referenceImage": {
   "type": "string",
   "description": "Base64-encoded reference image (required for edit mode)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "image_url": {
   "type": "string",
   "format": "uri",
   "description": "URL to the generated image"
  },
  "metadata_url": {
   "type": "string",
   "format": "uri",
   "description": "URL to the NFT metadata JSON"
  },
  "transaction_hash": {
   "type": "string",
   "description": "Mint transaction hash on-chain"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fretchen-ai-image-generation-nft-minting-service-ad15a515/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from imagegen-agent.fretchen.eu](https://www.zero.xyz/host/imagegen-agent.fretchen.eu/llms.txt)
