# Treza Labs Image Generation API

> Treza Labs Image Generation API is a paid API for AI agents from www.trezalabs.com, paid per call via x402, $0.06/call, status unknown (last checked 2026-10-01).

Generates a single image from a text prompt using one of 7 AI models, returning the image directly in the response with no account required.

## Facts

- Endpoint: POST https://www.trezalabs.com/api/x402/image?utm_source=zero.xyz
- Price: $0.06/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/treza-labs-image-generation-api-0e72a535
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hqD5IKOR23fD0jGQJ24ZN

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 treza-labs-image-generation-api-0e72a535 -d '<json body>'
```

Example prompt: Generate a 16:9 image of a misty mountain forest at sunrise with golden light filtering through the trees, using the nano-banana-pro model at 2K resolution.

## When to prefer this

Choose this endpoint when you need a single image generated from a text prompt with no account setup, paying per image via USDC x402. It's ideal for agents that need image generation without managing API keys, want to choose from 7 distinct models (Google, OpenAI, FLUX, Seedream, Recraft) at varying price/quality tiers, or need non-standard aspect ratios up to 21:9 and resolutions up to 4K.

## Known failure modes

- Invalid or unsupported aspect ratio for the chosen model — returns error indicating the combination is unsupported
- Prompt exceeds 2000 character limit — returns validation error
- Payment insufficient for the selected model/quality/resolution tier — payment rejected before processing
- Model name not recognized — enum validation error
- Async mode returns 202 with statusUrl; agent must poll that URL separately

## How this service works

Image generation: a prompt in, one image back in the same response. 7 models including Google Nano Banana and Nano Banana Pro, OpenAI GPT Image 2, Seedream 5.0 Pro and FLUX.2 Pro, square to 21:9, up to 4K, from $0.02. GET this URL for every model and price. No account or API key: the payment is the only credential.

## Output

A binary image file returned directly in the HTTP response body (same request, no polling needed for sync calls). The image matches the requested aspect ratio, resolution, and model. Optionally returns a 202 with a statusUrl for async mode.

## 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": {
      "async": {
       "type": "boolean",
       "default": false,
       "description": "true: answer 202 with a statusUrl at once."
      },
      "model": {
       "enum": [
        "nano-banana",
        "nano-banana-2",
        "nano-banana-pro",
        "gpt-image-2",
        "seedream-5-pro",
        "flux-2-pro",
        "recraft-v4.1"
       ],
       "type": "string",
       "default": "nano-banana",
       "description": "Prices: nano-banana $0.06; nano-banana-2 1K $0.10, 512 $0.07, 2K $0.15, 4K $0.22; nano-banana-pro 1K $0.20, 2K $0.20, 4K $0.35; gpt-image-2 medium $0.10, low $0.02, high $0.36; seedream-5-pro 2K $0.13, 1K $0.07; flux-2-pro $0.05 (1:1) to $0.09; recraft-v4.1 $0.05."
      },
      "prompt": {
       "type": "string",
       "maxLength": 2000,
       "description": "What the image should show."
      },
      "quality": {
       "enum": [
        "low",
        "medium",
        "high"
       ],
       "type": "string",
       "description": "gpt-image-2."
      },
      "resolution": {
       "enum": [
        "512",
        "1K",
        "2K",
        "4K"
       ],
       "type": "string",
       "description": "nano-banana-2, nano-banana-pro, seedream-5-pro."
      },
      "aspectRatio": {
       "enum": [
        "1:1",
        "16:9",
        "9:16",
        "4:3",
        "3:4",
        "3:2",
        "2:3",
        "4:5",
        "5:4",
        "21:9"
       ],
       "type": "string",
       "default": "1:1",
       "description": "Each model sells its own; GET this URL."
      }
     },
     "additionalProperties": false
    },
    "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": "https://www.trezalabs.com/api/media/generated/x402_image/1a2b3c4d.png?s=...&c=...",
  "model": "nano-banana",
  "runId": "2026-09-23T18:04:11.000Z#1a2b3c4d",
  "status": "success",
  "paidUsd": 0.06,
  "statusUrl": "https://www.trezalabs.com/api/x402/image?runId=...&token=...",
  "aspectRatio": "1:1",
  "transaction": "0x..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/treza-labs-image-generation-api-0e72a535/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.trezalabs.com](https://www.zero.xyz/host/www.trezalabs.com/llms.txt)
