# LLM Gateway – OpenAI-Compatible Chat Completions

> LLM Gateway – OpenAI-Compatible Chat Completions is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.67584/call, status unknown (last checked 2026-10-02).

Runs non-streaming chat completions against any OpenRouter model via an OpenAI-compatible API, billed per-use via x402 micropayments at 1.10× upstream cost.

## Facts

- Endpoint: GET https://x402.agentindex.world/v1/chat/completions?utm_source=zero.xyz
- Price: $0.67584/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/llm-gateway-openai-compatible-chat-completions-3e30e897
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Zu-nRr-H2s3BcSv8VgXGl

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 llm-gateway-openai-compatible-chat-completions-3e30e897
```

Example prompt: Ask openai/gpt-4o-mini to summarize the following meeting notes in 3 bullet points, using up to 512 tokens: 'Team discussed Q3 roadmap, agreed on shipping feature X by end of August, and flagged a dependency on the design team.'

## When to prefer this

Choose this endpoint when you need pay-per-call LLM inference without committing to a subscription, want access to the full OpenRouter model catalog (including open-source and proprietary models), need OpenAI-compatible request/response format for easy drop-in use, or are building an agent that must pay for inference programmatically via x402 micropayments on Base.

## Known failure modes

- Invalid or unknown model ID returns a 400 error
- max_tokens exceeds 4096 cap — clamped or rejected
- Insufficient USDC balance causes x402 payment failure before inference runs
- Malformed messages array (missing role or content) causes validation error
- Upstream OpenRouter model unavailability causes 502/503 response
- x402 payment ceiling mismatch if max_tokens is too low for actual usage

## How this service works

OpenAI-compatible chat completions (non-streaming) for any OpenRouter model - GET /v1/models lists them free, with pricing (upstream cost x 1.10). Pay only for what you use: sign a ceiling based on your max_tokens, settle for real usage x 1.10 (min $0.001) once the call completes. Try GET /v1/chat/completions/sample.

## Output

Returns an OpenAI-format chat completion object with the model's generated message, finish reason, and token usage stats (prompt tokens, completion tokens, total tokens). Billed at actual token usage × 1.10× upstream model cost, minimum $0.001 per call.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string",
   "description": "OpenRouter model id from GET /v1/models, e.g. \"openai/gpt-4o-mini\"."
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object"
   },
   "minItems": 1,
   "description": "OpenAI-format chat messages: [{role, content}, ...]."
  },
  "max_tokens": {
   "type": "integer",
   "description": "Max completion tokens, capped at 4096 - also bounds the x402 upto price ceiling."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "gen-1790576252-UzfZJjqk0Ld9PGyd1ADA",
  "model": "openai/gpt-4o-mini",
  "usage": {
   "total_tokens": 12,
   "prompt_tokens": 10,
   "completion_tokens": 2
  },
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "OK."
    },
    "finish_reason": "stop"
   }
  ],
  "x402_receipt": {
   "upstream": "llm-gateway",
   "latency_ms": 612,
   "model_served": "openai/gpt-4o-mini",
   "price_paid_usdc": 0.001
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/llm-gateway-openai-compatible-chat-completions-3e30e897/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
