# Chat Completions API (Llama 3.1 8B, x402)

> Chat Completions API (Llama 3.1 8B, x402) is a paid API for AI agents from dominion-data.x402-evm-math.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-31).

OpenAI-compatible chat completions endpoint powered by Llama 3.1 8B, enabling LLM inference via pay-per-call USDC micropayment with no API key required.

## Facts

- Endpoint: POST https://dominion-data.x402-evm-math.workers.dev/v1/chat/completions?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chat-completions-api-llama-3-1-8b-x402-8e253670
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VLkZX5IAwVWzVuGaCuF87

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 chat-completions-api-llama-3-1-8b-x402-8e253670 -d '<json body>'
```

Example prompt: Ask the Llama 3.1 8B chat completions model: 'Explain the difference between impermanent loss and price impact in DeFi in two sentences.' — use the pay-per-call endpoint, no API key needed.

## When to prefer this

Choose this endpoint when you need cheap, keyless LLM inference in an agentic pipeline that already handles x402 USDC micropayments, and when Llama 3.1 8B quality is sufficient (classification, summarization, simple reasoning). Prefer it over OpenAI or Anthropic APIs when minimizing cost per call matters most, no API key provisioning is desired, and the OpenAI message format compatibility is a hard requirement. Not ideal for tasks requiring GPT-4-level reasoning, long context, streaming output, or multimodal inputs.

## Known failure modes

- Payment failure: x402 payment not completed or insufficient USDC balance returns a 402 error
- Malformed request body: missing or incorrectly typed fields return a 400 error
- Model overload or timeout: Cloudflare Worker timeout returns a 503 or 524 error
- Empty or null messages array causes an inference error
- Streaming not supported: requests with stream:true may be rejected or silently ignored

## How this service works

LLM inference API: OpenAI-compatible chat completions, send messages, get choices and usage. Cheap LLM inference for agents (Llama 3.1 8B), no key, no streaming.

## Output

Returns an OpenAI-compatible JSON response containing an array of completion choices (each with a message object holding the assistant's generated text), a usage object with prompt_tokens, completion_tokens, and total_tokens, a model identifier, and a unique completion ID.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chat-completions-api-llama-3-1-8b-x402-8e253670/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from dominion-data.x402-evm-math.workers.dev](https://www.zero.xyz/host/dominion-data.x402-evm-math.workers.dev/llms.txt)
