# AI Chat & Text – LLM Chat Completion

> AI Chat & Text – LLM Chat Completion is a paid API for AI agents from onchaincheck.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-17).

Send a prompt or OpenAI-style messages array to one of four LLMs and receive the generated reply text with token usage stats

## Facts

- Endpoint: POST https://onchaincheck.dev/ai/chat?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ai-chat-text-llm-chat-completion-b37bdedd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OwlMzL8Xq54JZA9l_T7PD

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 ai-chat-text-llm-chat-completion-b37bdedd -d '<json body>'
```

Example prompt: Using the gpt-oss-20b model, answer this question with a system instruction that says 'you are a concise assistant': 'What are the three main causes of the French Revolution?' — and give me the response as plain text.

## When to prefer this

Choose this endpoint when you need a flat-rate ($0.003/call), pay-per-use LLM completion without committing to an OpenAI or Anthropic subscription. It's especially useful for agents that need occasional LLM calls within an x402 micropayment flow, want to switch between multiple open-source models (Qwen3, Llama-4, GLM-4), require structured JSON output from an LLM, or are running on-chain or crypto-native pipelines where USDC payments are native.

## Known failure modes

- Prompt or system exceeds 16,000 character limit — request rejected
- max_tokens value exceeds 1024 — capped or error returned
- Invalid model name provided — falls back to default or returns error
- Payment not completed or insufficient USDC balance — 402 Payment Required
- Malformed messages array — parsing error returned
- Model temporarily unavailable — service error response
- JSON mode requested but model output is not valid JSON — may return raw text

## How this service works

LLM chat completion, flat $0.003 a call: send a prompt (plus optional system) or an OpenAI-style messages array and get the reply text with token usage. Models: gpt-oss-20b (default), qwen3-30b, glm-4.7-flash, llama-4-scout. Up to 16,000 characters in and 1,024 tokens out; json=true for JSON output.

## Output

Returns the generated text reply from the selected LLM along with token usage statistics (prompt tokens, completion tokens, total tokens). If json=true is set, the response will be a single structured JSON object instead of free-form text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "json": {
   "enum": [
    "true",
    "false"
   ],
   "type": "string",
   "description": "true asks for a single JSON object"
  },
  "model": {
   "enum": [
    "gpt-oss-20b",
    "gemma-4-26b",
    "glm-4.7-flash",
    "llama-4-scout"
   ],
   "type": "string",
   "description": "Model (default gpt-oss-20b)"
  },
  "prompt": {
   "type": "string",
   "pattern": "^[\\s\\S]+$",
   "maxLength": 16000,
   "description": "The user message (or send an OpenAI-style messages array instead)"
  },
  "system": {
   "type": "string",
   "pattern": "^[\\s\\S]*$",
   "maxLength": 16000,
   "description": "Optional system instructions"
  },
  "max_tokens": {
   "type": "string",
   "pattern": "^\\d{1,4}$",
   "description": "Most tokens to generate, up to 1024"
  },
  "temperature": {
   "type": "string",
   "pattern": "^\\d(\\.\\d+)?$",
   "description": "0 to 2 (default 0.6)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ai-chat-text-llm-chat-completion-b37bdedd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from onchaincheck.dev](https://www.zero.xyz/host/onchaincheck.dev/llms.txt)
