API reference
The Agent API exposes image generation, video generation, and LLM chat completions to scripts and autonomous agents. Every paid call settles one of two ways — pick per call:
-
x402 — no account, no key. The call returns
402 Payment Requiredwith an exact USDC quote; the caller pays on Base mainnet and retries with aPAYMENT-SIGNATUREheader. Built for agents holding a wallet. -
lp_API key — sign up, top up credits at /billing, create a key in Settings, and send it on every call. The same prepaid balance powers the studio and agent chat. See API keys. -
Base URL:
https://livepairai.com/v1/agent -
OpenAPI 3.1:
/v1/agent/openapi.json -
Product manifest:
/v1/agent/manifest.json -
Machine guide:
/SKILL.md· MCP:https://livepairai.com/mcp(guide)
Charges apply only when a call succeeds: 4xx/5xx responses are never settled on x402, and on the key rail a provider-side failure auto-refunds the debit.
Quick start
With an API key (credits)
curl https://livepairai.com/v1/agent/chat \
-H "Authorization: Bearer lp_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "{DEFAULT_TEXT_MODEL}",
"messages": [{"role": "user", "content": "Say hi in one sentence."}],
"max_tokens": 64
}'
With x402 (no account)
# 1. First call returns 402 with exact USDC requirements
curl -X POST https://livepairai.com/v1/agent/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "a lighthouse at dawn, film still"}'
# 2. Pay the quoted amount on Base (USDC), then retry with the proof
curl -X POST https://livepairai.com/v1/agent/generate \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <settlement payload>" \
-d '{"prompt": "a lighthouse at dawn, film still"}'
# → { "jobId": "…" } — poll GET /v1/agent/jobs/{jobId} for the result URL
Volume tiers apply wallet-keyed on the x402 rail — 5% at $100+, 10% at $500+, 15% at $2000+. Keys bill list price.
Endpoints
| Endpoint | Auth | Cost |
|---|---|---|
GET /v1/agent/models | none | free — media catalog + textModels with retail $/Mtok |
GET /v1/agent/manifest.json | none | free — pricing model, guarantees, limits |
GET /v1/agent/openapi.json | none | free — OpenAPI 3.1 for everything here |
POST /v1/agent/generate | x402 or key | per-call quote (media) |
POST /v1/agent/chat | x402 or key | token-metered (text) |
GET /v1/agent/jobs/{id} | none | free — poll for the result URL |
GET /v1/agent/balance | key only | free — prepaid balance + last 10 ledger entries |
Text models and pricing
GET /v1/agent/models returns textModels with these retail rates —
this table renders from the same catalog, so the numbers can't drift:
| Model | Input $/Mtok | Output $/Mtok |
|---|---|---|
deepseek/deepseek-v4-flash — DeepSeek V4 Flash — cheapest | $0.22 | $0.43 |
openai/gpt-6-luna — GPT-6 Luna | $0.15 | $0.77 |
z-ai/glm-5.3-flash — GLM 5.3 Flash | $0.23 | $0.77 |
qwen/qwen-plus — Qwen Plus | $0.40 | $1.20 |
google/gemini-3.5-flash-lite — Gemini 3.5 Flash Lite | $0.46 | $3.85 |
meta-llama/llama-3.3-70b-instruct — Llama 3.3 70B — open weights | $1.11 | $1.11 |
moonshotai/kimi-k2.6 — Kimi K2.6 | $1.46 | $6.15 |
x-ai/grok-4.7 — Grok 4.7 | $3.08 | $9.23 |
anthropic/claude-sonnet-5.5 — Claude Sonnet 5.5 — frontier | $3.08 | $15.38 |
deepseek/deepseek-v4.1-flash — DeepSeek 4.1 Flash | $0.23 | $0.92 |
qwen/qwen3.7-plus — Qwen3.7 Plus | $0.49 | $1.97 |
moonshotai/kimi-k3 — Kimi K3 | $4.62 | $23.08 |
x-ai/grok-4.20 — Grok 4.20 | $1.92 | $3.85 |
Chat price is computed per call from the body: estimated input tokens
(ceil(totalChars / 3.5)) at the input rate plus max_tokens at the
output rate, with a $0.002 floor. Bill
tighter by setting max_tokens tight — you pay for the cap, not the
actual completion length. Default model: {DEFAULT_TEXT_MODEL}.
Interactive reference
Rendered live from /v1/agent/openapi.json —
request/response schemas, auth, and per-endpoint notes always match the
running API. Try calls directly from the console below.
Errors
| Status | Meaning |
|---|---|
400 | Bad request — unknown model, over a cap, or policy-blocked prompt. Never charged. |
401 | Missing/invalid lp_ key (KEY_NOT_FOUND, KEY_EXPIRED, disabled, or banned account). Body links manageKeys. |
402 | x402: payment requirements to settle. Key rail: insufficient balance — body links topUp. |
404 | Unknown job id (/jobs/{id}). |
429 | Rate limit — 6/min generate, 30/min chat, per payer or key. |
502/503 | Payment verification or provider temporarily unavailable — never settled / auto-refunded. |
Guarantees and limits
- Failed calls don't charge. x402 settles only on success status; key debits auto-refund on provider failure.
- Resale permitted — outputs may be resold.
- Geo: generation is unavailable in sanctioned regions; the catalog
marks the private model line with
"private": true. - Key safety: keys spend your balance — server-side only, never in a browser bundle or repo. Manage at Settings → API keys.