---
title: "Private LLM chat completion (x402 or API-key paid)"
method: POST
path: "/v1/agent/chat"
---

# Private LLM chat completion (x402 or API-key paid)

`POST /v1/agent/chat`

## 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/chat`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - none

OpenAI-compatible chat completion — pass an OpenAI-style {model, messages, max_tokens} body, receive the standard {choices, usage} response. Price is per call: ceil(total message chars / 3.5) estimated input tokens × the model's input rate + max_tokens × its output rate, marked up — set max_tokens tight for tighter billing. Anonymous — no account; metering keeps token counts only.

## Request body

- object
  - `model` string: Text model id — see textModels in GET /v1/agent/models (default: deepseek/deepseek-v4-flash)
  - `messages` object[], required: OpenAI chat messages — role system|user|assistant, string content, <=48000 chars total
    - `role` 'system' | 'user' | 'assistant', required
    - `content` string, required
  - `max_tokens` number: Output token cap — billed at this amount; set it tight to pay less
  - `temperature` number
  - `reasoning_effort` 'low' | 'medium' | 'high': OpenAI-style reasoning effort — passed through to reasoning-capable models
  - `payer` string: Your payer wallet — applies your volume-tier discount (5% at $100+, 10% at $500+, 15% at $2000+ lifetime paid). Must equal the wallet that signs the payment.

## Response `200`

OpenAI chat completion — {choices:[{message:{role,content}}], usage:{prompt_tokens,completion_tokens}}

- object
  - `choices` object[]
  - `usage` object

## 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)
