# GEDX402 Chat Completions (x402)

> GEDX402 Chat Completions (x402) is a paid API for AI agents from chat.gedx402.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Send a chat conversation to Cloudflare Workers AI models and receive an AI-generated assistant reply, paid per-call with USDC via the x402 protocol — no API key required.

## Facts

- Endpoint: GET https://chat.gedx402.com/v1/chat/completions
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gedx402-chat-completions-x402-28b93c20
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KNleeqrH0zTnrw9QlG2mO

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 gedx402-chat-completions-x402-28b93c20
```

Example prompt: Using the GEDX402 Workers AI endpoint — paying with USDC, no API key — send this conversation to the 'smart' tier model and get a reply with up to 512 tokens: system says 'You are a helpful assistant', user says 'Explain what x402 payment protocol is in two sentences'.

## When to prefer this

Choose this endpoint when you need LLM chat completions without managing API keys or subscriptions, and you can pay per-call in USDC via the x402 protocol. It is ideal for agents operating on-chain or in crypto-native environments, one-off inference tasks, or workflows where you want to avoid credential management. Prefer it over OpenAI or Anthropic direct APIs when the agent already holds USDC on Base, Polygon, Arbitrum, World, or Solana and needs a frictionless, keyless inference path backed by Cloudflare Workers AI.

## Known failure modes

- 402 Payment Required — USDC payment was not attached or was insufficient
- Invalid model ID — requested model or tier alias does not exist; use GET /v1/models to list valid options
- Malformed messages array — missing required role or content fields in one or more turns
- max_tokens out of range — value must be between 1 and 4096
- Payment network unsupported — submitted payment on a chain not accepted (Base, Polygon, Arbitrum, World, Solana only)
- Model timeout — Workers AI inference took too long; retry with a faster tier alias like 'fast' or 'micro'

## How this service works

Multi-model chat completions. POST messages[] and set model to any LLM id from GET /v1/models; dynamic USDC pricing scales with model and token usage. Hero: GET /heroes/chat-completions.

## Output

Returns an OpenAI-compatible chat completion JSON object containing the assistant's generated reply, the finish reason (e.g. 'stop'), and metadata such as a completion ID and choice index.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object"
   }
  },
  "max_tokens": {
   "type": "integer"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "chatcmpl-example",
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello!"
    },
    "finish_reason": "stop"
   }
  ]
 }
}
```

## More

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