# Recoup API - AI Image Generation

> Recoup API - AI Image Generation is a paid API for AI agents from recoup-api.vercel.app, paid per call via x402, $0.01111/call, status unknown (last checked 2026-09-15).

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

## Facts

- Endpoint: GET https://recoup-api.vercel.app/api/image/generate
- Price: $0.01111/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/recoup-api-ai-image-generation-8ac75108
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-k7mhMz98EwULbfuQkIYN

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 recoup-api-ai-image-generation-8ac75108
```

Example prompt: Generate an image of a golden retriever playing fetch on a sunny beach at sunset, with waves in the background.

## When to prefer this

Choose this endpoint when you need to programmatically generate images from text descriptions and require the result as a base64-encoded string (e.g., for embedding directly in applications). It is well-suited for agents that need on-demand image creation without managing separate storage, and that are integrated with x402 micropayment flows on Vercel-hosted infrastructure.

## Known failure modes

- Missing or empty prompt returns an error
- Prompt violates content policy and is rejected
- Payment not authorized or insufficient USDC balance (x402 payment required at $0.01111 per call)
- Model unavailable or upstream AI service error
- Malformed request schema results in 400 error
- Timeout if generation takes too long

## How this service works

Generate an image from a text prompt using AI

## Output

Returns a JSON object containing an array of generated images, each with a base64-encoded image string and its IANA media type, plus token usage metadata for the generation request.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "Text prompt describing the image to generate"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "output": {
  "type": "object",
  "properties": {
   "result": {
    "type": "object",
    "properties": {
     "usage": {
      "type": "object",
      "description": "Token usage information for the image generation"
     },
     "images": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "base64": {
         "type": "string",
         "description": "Image as base64 encoded string"
        },
        "mediaType": {
         "type": "string",
         "description": "IANA media type of the image"
        }
       },
       "description": "Generated image"
      },
      "description": "Array of all generated images"
     }
    },
    "description": "GenerateImageResult containing the generated images and metadata"
   }
  }
 }
}
```

## More

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