---
title: "Generate an image or video (x402 or API-key paid)"
method: POST
path: "/v1/agent/generate"
---

# Generate an image or video (x402 or API-key paid)

`POST /v1/agent/generate`

## Request

- Base URL: `https://livepairai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://livepairai.com/v1/agent/generate`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - none

## Request body

- object
  - `prompt` string, required
  - `modelId` string: model id from /v1/agent/models
  - `image` string: Source image for i2i/i2v models — public http(s) URL or data:image URI (<=8MB). Use AI-generated or owned images only, never real-person photos without consent. Screened by the same policy check as the studio.
  - `image2` string: Face/subject reference image for swap models — same rules as `image`.
  - `video` string: Source clip for motion-control / video-input models — https URL or data:video URI (<=40MB).
  - `useReferences` boolean: Embed the prompt and attach top matches from your reference library (POST /v1/agent/references) to the model's empty media inputs — lp_ key or SIWX wallet required.
  - `referenceIds` string[]: Pin exact reference ids to the model's empty media inputs (image→image/image2, video→video).
  - `imageSize` string
  - `aspectRatio` string
  - `duration` number: Video length in seconds — billed per second at the model's per-resolution rate
  - `resolution` string
  - `audio` boolean: Audio track on audio-capable video models (default on)
  - `payer` string: Your payer wallet — applies your volume-tier discount to the 402 quote (5% at $100+, 10% at $500+, 15% at $2000+ lifetime paid). Must equal the wallet that signs the payment.

## Response `200`

{status:'done',url} or {status:'running',jobId,poll} — payment settles on submit

- object
  - `status` 'done' | 'running', required
  - `url` string
  - `jobId` string
  - `poll` string

## Other responses

- `402`: Payment Required — PAYMENT-REQUIRED header carries accepts[] requirements (USDC on Base eip155:8453)

---

[API](https://skmtc.dev/livepairai/apis/private-ai-media-generation-api.md) · [All operations](https://skmtc.dev/livepairai/apis/private-ai-media-generation-api/llms.txt) · [OpenAPI document](https://skmtc.dev/livepairai/apis/private-ai-media-generation-api/revisions/84e74cdf1dbd?raw)
