# Haven Image Generate

> Haven Image Generate is a paid API for AI agents from api.havenagent.ai, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Generates an AI image from a text prompt at a specified resolution, returning a job ID and polling URL for async result retrieval

## Facts

- Endpoint: POST https://api.havenagent.ai/x402/api/v1/image/generate
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/haven-image-generate-b567124c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hzZdFGNjSJvrytBtuAGd2

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 haven-image-generate-b567124c -d '<json body>'
```

Example prompt: Generate a cozy living room with warm lighting and a fireplace, make it 1280 wide and 768 tall.

## When to prefer this

Choose this endpoint when you need to generate a custom image from a text prompt with control over output dimensions (256–1536px), and you're operating in an x402 micropayment environment (paying $0.05 USDC per call). It is an async batch endpoint best suited for workflows that can tolerate ~2-minute generation times and poll for results. Prefer it over synchronous image APIs when you need the async job-polling pattern or are already integrated with the Haven ecosystem.

## Known failure modes

- Prompt too long (exceeds 2000 characters) — validation error
- Width or height out of range (below 256 or above 1536) — validation error
- Payment failure (insufficient USDC balance or x402 protocol error) — payment rejected
- Job stuck in queued status beyond pollBudgetSeconds — timeout
- Result URL unavailable after job completion — resource not found error
- Empty or missing prompt field — validation error

## How this service works

Haven is a private AI agent for your home. Join the waitlist for h1 speaker updates and early app access.

## Output

Returns a JSON object with a job ID (UUID), initial status ('queued'), a result URL to fetch the finished image, a status URL for polling job progress, an estimated completion time in seconds (etaSeconds), and a maximum polling budget in seconds (pollBudgetSeconds). The agent must poll the statusUrl until the job completes, then fetch the image from resultUrl.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "width": {
   "type": "number",
   "default": 1024,
   "maximum": 1536,
   "minimum": 256
  },
  "height": {
   "type": "number",
   "default": 1024,
   "maximum": 1536,
   "minimum": 256
  },
  "prompt": {
   "type": "string",
   "maxLength": 2000,
   "minLength": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "kind": "image_generate",
  "jobId": "00000000-0000-0000-0000-000000000000",
  "status": "queued",
  "resultUrl": "https://api.havenagent.ai/x402/api/v1/image/generate/jobs/00000000-0000-0000-0000-000000000000/result",
  "statusUrl": "https://api.havenagent.ai/x402/api/v1/image/generate/jobs/00000000-0000-0000-0000-000000000000",
  "etaSeconds": 120,
  "pollBudgetSeconds": 900
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/haven-image-generate-b567124c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.havenagent.ai](https://www.zero.xyz/host/api.havenagent.ai/llms.txt)
