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 Required with an exact USDC quote; the caller pays on Base mainnet and retries with a PAYMENT-SIGNATURE header. 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

EndpointAuthCost
GET /v1/agent/modelsnonefree — media catalog + textModels with retail $/Mtok
GET /v1/agent/manifest.jsonnonefree — pricing model, guarantees, limits
GET /v1/agent/openapi.jsonnonefree — OpenAPI 3.1 for everything here
POST /v1/agent/generatex402 or keyper-call quote (media)
POST /v1/agent/chatx402 or keytoken-metered (text)
GET /v1/agent/jobs/{id}nonefree — poll for the result URL
GET /v1/agent/balancekey onlyfree — 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:

ModelInput $/MtokOutput $/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.

Loading interactive API reference…

Errors

StatusMeaning
400Bad request — unknown model, over a cap, or policy-blocked prompt. Never charged.
401Missing/invalid lp_ key (KEY_NOT_FOUND, KEY_EXPIRED, disabled, or banned account). Body links manageKeys.
402x402: payment requirements to settle. Key rail: insufficient balance — body links topUp.
404Unknown job id (/jobs/{id}).
429Rate limit — 6/min generate, 30/min chat, per payer or key.
502/503Payment 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.