# llm402.ai Chat Completions

> llm402.ai Chat Completions is a paid API for AI agents from llm402.ai, paid per call via x402, $0.001/call, status down (last checked 2026-09-15).

Run LLM chat completions via an OpenAI-compatible API endpoint, paid per-call via x402 micropayment protocol

## Facts

- Endpoint: POST https://llm402.ai/v1/chat/completions
- Price: $0.001/call
- Payment: x402
- Status: down
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/llm402-ai-chat-completions-e1aae106
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zJat0ebrHoX1hMh6mryuA

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 llm402-ai-chat-completions-e1aae106 -d '<json body>'
```

Example prompt: Ask the LLM 'What are three creative uses for blockchain technology?' using the gpt-3.5-turbo model, with a max of 200 tokens and a temperature of 0.7.

## When to prefer this

Choose this endpoint when you need OpenAI-compatible LLM chat completions with pay-per-call micropayment billing via the x402 protocol, avoiding subscription commitments. Ideal for AI agents that need on-demand LLM inference without managing API keys or monthly plans, especially in agentic marketplaces where per-call USDC payments are native.

## Known failure modes

- Invalid or unsupported model name returns an error response
- Exceeding max_tokens silently truncates output with finish_reason 'length'
- Malformed messages array causes a 400-level error
- Payment failure via x402 protocol blocks the request
- Rate limits or upstream OpenAI API errors propagate as 5xx errors
- Missing required fields (model, messages) result in validation errors

## How this service works

LLM inference

## Output

Returns an OpenAI-compatible chat.completion object containing the assistant's generated message text, the model used, token usage breakdown (prompt, completion, total), a unique completion ID, finish reason, and creation timestamp.

## Example request

```json
{
 "model": "gpt-3.5-turbo",
 "messages": [
  {
   "role": "user",
   "content": "What is artificial intelligence?"
  }
 ],
 "max_tokens": 150,
 "temperature": 0.7
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string",
   "description": "Model ID or \"auto\" for autorouting across frontier LLMs."
  },
  "top_k": {
   "type": "integer",
   "minimum": 1
  },
  "top_p": {
   "type": "number",
   "maximum": 1,
   "minimum": 0
  },
  "stream": {
   "type": "boolean",
   "default": false
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant",
       "tool"
      ],
      "type": "string"
     },
     "content": {
      "type": "string"
     }
    }
   },
   "minItems": 1
  },
  "max_tokens": {
   "type": "integer",
   "minimum": 1,
   "description": "Cap on generated tokens. Price scales with this cap."
  },
  "temperature": {
   "type": "number",
   "maximum": 2,
   "minimum": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/llm402-ai-chat-completions-e1aae106/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from llm402.ai](https://www.zero.xyz/host/llm402.ai/llms.txt)
