---
name: private-media-generation
description: Buy private AI image and video generation and private LLM text as an agent. Text-to-image, image-to-image, text-to-video, image-to-video — including the private model line — plus OpenAI-compatible chat completions. Two ways to pay: per-call x402 (USDC on Base mainnet, no account) or an lp_ API key on an account's prepaid credits. Browse the catalog and quote prices for free.
license: MIT
compatibility: Any HTTP client. Payment is either an x402-capable wallet layer (@x402/fetch, thirdweb, or any client that answers HTTP 402 with PAYMENT-SIGNATURE) or a LivePair API key (lp_ prefix — created at https://livepairai.com/settings).
metadata:
  author: livepair
  version: "1.0"
---

# Private AI Media Generation API

Paid image and video generation for agents — including a private,
private i2v line. Pay per call in USDC on Base (x402, no account) or
with an `lp_` API key on a prepaid credit balance.

## TL;DR

- **Base URL:** `https://livepairai.com/v1/agent`
- **Auth:** two rails —
  - **x402:** no key — the wallet pays per call (USDC on Base `eip155:8453`,
    USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
  - **API key:** `x-api-key: lp_…` or `Authorization: Bearer lp_…` — bills
    the key owner's prepaid credits; create at
    `https://livepairai.com/settings` after signing up at
    `/auth/sign-up`
- **Never hardcode model IDs or prices.** Resolve both at runtime from
  `GET /v1/agent/models` — each entry carries its own USD price per option.
- **OpenAPI spec:** https://livepairai.com/v1/agent/openapi.json
- **Machine manifest:** https://livepairai.com/v1/agent/manifest.json
- **MCP server:** https://livepairai.com/mcp (streamable-http, no auth) —
  prompt library, prompt enhancement, model recommender, quoting, and job
  polling as tools.

## Endpoint map

| Surface | Endpoint |
| --- | --- |
| Catalog | `GET /v1/agent/models` — free; media models with USD prices + `private` flag, `textModels` with $/Mtok rates |
| Manifest | `GET /v1/agent/manifest.json` — pricing model, guarantees, limits |
| OpenAPI | `GET /v1/agent/openapi.json` — free |
| Generate | `POST /v1/agent/generate` — paid via x402 or `lp_` API key |
| Chat | `POST /v1/agent/chat` — paid via x402 or `lp_` API key; OpenAI-compatible `{model, messages, max_tokens}` → `{choices, usage}` |
| Job poll | `GET /v1/agent/jobs/{id}` — free |
| Balance | `GET /v1/agent/balance` — `lp_` key only; prepaid balance (USD + micro) and the 10 most recent ledger entries |

## Buy loop

```bash
curl -X POST https://livepairai.com/v1/agent/generate \
  -H "Content-Type: application/json" \
  -d '{"prompt":"rainy neon alley, cinematic","modelId":"wan-3.0-t2v","duration":5,"resolution":"720p"}'
# → HTTP 402 + PAYMENT-REQUIRED header with exact USDC requirements
# your x402 client settles the payment and retries with PAYMENT-SIGNATURE
# → {"status":"done","url":"https://..."} or {"jobId":"..."} to poll
```

Prices: images flat per model/size, video per-second × duration at the
chosen resolution. Settlement only happens on HTTP <400 — invalid input,
policy rejection, and provider failure are never charged (API-key calls
are debited upfront and auto-refunded on failure).

## API-key rail (account billing)

```bash
curl -X POST https://livepairai.com/v1/agent/generate \
  -H "Content-Type: application/json" \
  -H "x-api-key: lp_…" \
  -d '{"prompt":"rainy neon alley, cinematic","modelId":"wan-3.0-t2v","duration":5,"resolution":"720p"}'
# → {"status":"done","url":"https://…"} — no 402 round-trip
```

- Debits the key owner's prepaid credits at list price (wallet volume
  tiers are x402-only). Insufficient balance → 402 with a `topUp` URL;
  invalid/expired key → 401 with a `manageKeys` URL.
- The same key works on `POST /v1/chat/completions` (the session product's
  OpenAI-compatible chat).
- Keys are managed by the user at `/settings` — create, expiry
  (1–365 days or never), enable/disable, delete. Server stores only the
  SHA-256 hash; the plaintext shows once at creation.
- Check the prepaid balance programmatically:
  `GET /v1/agent/balance` with the key → `{balanceUsd, balanceMicro,
  recent, topUp}`.

## Text completions

`POST /v1/agent/chat` — OpenAI-compatible. Body: `{model, messages,
max_tokens}`; `model` from the `textModels` list in `/v1/agent/models`
(default `deepseek/deepseek-v4-flash`). The 402 quote = estimated input
tokens (chars ÷ 3.5) × input rate + `max_tokens` × output rate, marked up —
set `max_tokens` tight to bill tight (cap 8192; messages ≤ 50 items,
≤ 48k chars total; minimum charge $0.002). Streaming isn't supported. Anonymous — no account;
metering keeps token counts only.

```bash
curl -X POST https://livepairai.com/v1/agent/chat \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek/deepseek-v4-flash","messages":[{"role":"user","content":"Summarize this: …"}],"max_tokens":512}'
# → 402 → PAYMENT-SIGNATURE → {"choices":[{…}], "usage":{…}}
```

## Volume tiers + resale

Include `"payer": "0x…"` (your wallet) in the request body — the 402
quote applies your tier automatically: **5% at $100+, 10% at $500+, 15% at $2000+**
(cumulative settled USDC per wallet; the
declared `payer` must equal the signing wallet). Resale is welcome:
agents may sell generated media to their own users at their own pricing.

## Models

`GET /v1/agent/models` returns each model with `id`, `mode`
(t2i/i2i/t2v/i2v), `kind`, `private`, `approxSec`, `priceUsd`, and
priced `imageSizes`/`resolutions`/`durations`. Entries flagged
`"private": true` are the private AI line. `textModels` entries add
`contextTokens` and retail $/Mtok rates.

i2i/i2v `image` input: public https URL or `data:image` URI, ≤8MB. Source
images are vision-screened — use AI-generated or owned images only, never
real-person photos without consent.

## Connect the MCP server

`https://livepairai.com/mcp` — Streamable HTTP, no authentication.
Remote-server config differs per host; the URL is always the same:

| Host | Config |
| --- | --- |
| Claude Code | `claude mcp add --transport http livepair https://livepairai.com/mcp` or `{ "type": "http", "url": "…/mcp" }` in `.mcp.json` → `mcpServers` |
| Claude Desktop / claude.ai | Settings → Connectors → Add custom connector → the URL (file config is stdio-only) |
| Cursor | `{ "url": "…/mcp" }` in `~/.cursor/mcp.json` → `mcpServers` |
| VS Code | `{ "servers": { "livepair": { "type": "http", "url": "…/mcp" } } }` in `.vscode/mcp.json` |
| Windsurf | `{ "serverUrl": "…/mcp" }` in `mcp_config.json` → `mcpServers` |
| Gemini CLI | `{ "httpUrl": "…/mcp" }` in `settings.json` → `mcpServers` |
| Cline | `{ "type": "streamableHttp", "url": "…/mcp" }` |
| Stdio-only hosts | bridge: `npx -y mcp-remote https://livepairai.com/mcp` |

Human-readable setup guide: https://livepairai.com/docs/mcp

## MCP tools

| Tool | What it does |
| --- | --- |
| `search_prompts` | Keyword search over the community prompt library |
| `trending_prompts` | Trending/most-used/top prompts — never keyword-search for those |
| `get_prompt` | Full prompt card by id |
| `get_pack` | Themed prompt bundle |
| `list_models` | Live catalog with USD prices (media + `textModels`) |
| `recommend_model` | Model pick for a described job |
| `enhance_prompt` | Structure a rough idea into a generation prompt |
| `quote_price` | Exact USDC price for a planned call |
| `generate_image` | Paid image/video endpoint contract |
| `chat_text` | Paid LLM text endpoint contract |
| `get_job` | Poll a running job |

Recommended loop: `recommend_model` or `list_models` → `enhance_prompt` →
`quote_price` → `generate_image` (returns payment instructions) →
`get_job` until done.
