# GEDX402 Chat Completions (x402)

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

Sends a chat completion request to Cloudflare Workers AI, billed per-call via USDC micropayment on supported blockchains — no API key required.

## Facts

- Endpoint: GET https://gateway.gedx402.com/v1/chat/completions
- Price: $1.852/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gedx402-chat-completions-x402-9ba73ea7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_L8oQvE5AN1S5ss7OCOpus

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-9ba73ea7
```

Example prompt: Using the GEDX402 gateway — which accepts USDC payment instead of API keys — send this conversation to the @cf/meta/llama-3-8b-instruct model and get a reply: system says 'You are a helpful assistant', user asks 'What are the main advantages of Cloudflare Workers?', with a max of 512 tokens.

## When to prefer this

Choose this endpoint when you need LLM chat completions without registering for an API key, want to pay per-call in USDC on chains like Base, Polygon, Arbitrum, World, or Solana, or are building an agent workflow that uses the x402 micropayment protocol for permissionless AI access.

## Known failure modes

- Payment not received or insufficient USDC — 402 Payment Required
- Unsupported blockchain network specified — payment rejected
- Invalid model identifier — model not available on Cloudflare Workers AI
- Malformed messages array — 400 Bad Request
- max_tokens exceeds model context limit — truncation or error
- Network timeout on Cloudflare Workers edge — 503 or timeout error

## How this service works

x402 metrics and paid tools

## Output

Returns an OpenAI-compatible chat completion JSON object with a unique completion ID, the assistant's reply message, finish reason, and usage metadata — structured identically to the OpenAI chat/completions response format.

## 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-9ba73ea7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.gedx402.com](https://www.zero.xyz/host/gateway.gedx402.com/llms.txt)
