# CivicMerge x402 LLM Chat Completions

> CivicMerge x402 LLM Chat Completions is a paid API for AI agents from x402-ai-api.civicmerge.workers.dev, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-22, last successful call 2026-07-17).

Pay-per-call LLM inference endpoint supporting multiple open-source models via an OpenAI-compatible chat completions API, billed at $0.03 USDC per request using the x402 payment protocol.

## Facts

- Endpoint: POST https://x402-ai-api.civicmerge.workers.dev/v1/chat/completions?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Last successful call: 2026-07-17
- Success rate: 60% of calls made through Zero
- Rating: 1.2 / 5 from 2 reviews
- Activations on Zero: 10
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-ai-api-civicmerge-workers-dev-076d3aee
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Eb-B43x7Bj2H3x4G7gwTl

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-ai-api-civicmerge-workers-dev-076d3aee -d '<json body>'
```

Example prompt: Ask the llama-3.3-70b model: 'What are the three most important factors in building a reliable distributed system?' and limit the response to 300 tokens.

## When to prefer this

Choose this endpoint when you need pay-per-call LLM inference without a subscription, want access to a variety of open-weight models (Llama, Qwen, Gemma, Granite, Kimi) via a familiar OpenAI-compatible interface, and are operating in an x402-enabled agentic payment environment where micropayments per call are acceptable.

## Known failure modes

- Payment not included or invalid x402 payment header — 402 Payment Required
- Unknown or unsupported model name passed in the enum — 400 Bad Request
- Messages array malformed or missing required role/content fields — 400 validation error
- Max tokens exceeded for model context window — error or truncated response
- Cloudflare Worker timeout for very long completions — 524 timeout
- Insufficient USDC balance for x402 payment — payment failure

## How this service works

LLM inference

## Output

An OpenAI-compatible chat completion object containing the assistant's generated reply, finish reason, token usage statistics, and model metadata.

## Example request

```json
{
 "model": "llama-3.1-8b",
 "messages": [
  {
   "role": "user",
   "content": "Explain the concept of machine learning in simple terms."
  }
 ],
 "max_tokens": 250
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "enum": [
    "llama-3.1-8b",
    "granite-4.0",
    "gpt-oss-20b",
    "gemma-4-26b",
    "qwen3-30b",
    "kimi-k2.6",
    "llama-3.3-70b",
    "llama-4-scout",
    "qwen-coder-32b",
    "kimi-k2.5",
    "qwq-32b",
    "llama-3.2-11b-vision"
   ],
   "type": "string"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "role": {
      "type": "string"
     },
     "content": {
      "type": "string"
     }
    }
   }
  },
  "max_tokens": {
   "type": "integer",
   "default": 500
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-ai-api-civicmerge-workers-dev-076d3aee/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-ai-api.civicmerge.workers.dev](https://www.zero.xyz/host/x402-ai-api.civicmerge.workers.dev/llms.txt)
