# gorilla.farm Image Generation & Editing API

> gorilla.farm Image Generation & Editing API is a paid API for AI agents from gorilla.farm, paid per call via x402, $0.2/call, status unknown (last checked 2026-10-11, last successful call 2026-07-02).

Generates a new image from a text prompt or edits an existing image using the Nano Banana 2 model

## Facts

- Endpoint: POST https://gorilla.farm/api/generate?utm_source=zero.xyz
- Price: $0.2/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-07-02
- Success rate: 100% of calls made through Zero
- Rating: 4.7 / 5 from 1 review
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gorilla-farm-image-generation-editing-api-b99ca352
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QH9DJEh3QvdPoKo7UwDU0

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 gorilla-farm-image-generation-editing-api-b99ca352 -d '<json body>'
```

Example prompt: Using the Nano Banana 2 model on gorilla.farm, generate a photorealistic image of a misty mountain forest at sunrise in 16:9 aspect ratio.

## When to prefer this

Choose this endpoint when you need AI-generated or AI-edited images powered by the Nano Banana 2 model, especially when operating in an x402 micropayment environment where per-call USDC billing is acceptable. Good for agents that need one-off image generation without managing API keys or subscriptions.

## Known failure modes

- Invalid or unreachable image_url when editing — server may fail to fetch the source image
- Prompt exceeds 1000 character limit — request rejected
- Unsupported aspect ratio value — validation error
- Model unavailable or overloaded — 5xx error
- Payment failure for the $0.20 USDC x402 charge — 402 response

## How this service works

Generate or edit an image (Nano Banana 2)

## Output

A JSON object containing a single field 'image_url' pointing to a hosted PNG image file on the gorilla.farm CDN (e.g. https://img.gorilla.farm/<uuid>.png)

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string",
   "maxLength": 1000,
   "description": "Text description for generation or editing instruction"
  },
  "image_url": {
   "type": "string",
   "format": "uri",
   "description": "Optional: URL of image to edit. If omitted, generates new image."
  },
  "aspect_ratio": {
   "enum": [
    "1:1",
    "16:9",
    "9:16",
    "4:3",
    "3:4",
    "3:2",
    "2:3",
    "5:4",
    "4:5",
    "21:9",
    "auto"
   ],
   "type": "string",
   "default": "1:1",
   "description": "Image aspect ratio for generation. Defaults to 1:1."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "image_url": "https://img.gorilla.farm/123e4567-e89b-12d3-a456-426614174000.png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gorilla-farm-image-generation-editing-api-b99ca352/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gorilla.farm](https://www.zero.xyz/host/gorilla.farm/llms.txt)
