# OpenAI-Compatible Chat Completions via x402 (UnyKorn Local GPU)

> OpenAI-Compatible Chat Completions via x402 (UnyKorn Local GPU) is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Runs OpenAI-compatible chat completions on local GPU models via the x402 micropayment protocol, requiring no API key.

## Facts

- Endpoint: POST https://twin.unykorn.org/v1/chat/completions?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openai-compatible-chat-completions-via-x402-unykorn-local-gpu-7dc1b3ac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e0uF6n5T56Y_Tj8IMOokJ

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 openai-compatible-chat-completions-via-x402-unykorn-local-gpu-7dc1b3ac -d '<json body>'
```

Example prompt: Using the local GPU model 'mistral-7b', send a user message asking 'What are the key differences between TCP and UDP?' with a max of 512 tokens and temperature 0.7, and return the assistant's reply.

## When to prefer this

Choose this endpoint when you need OpenAI-compatible chat completions without a subscription or API key, want per-call USDC micropayment pricing, or are building autonomous agents that pay only for what they use. It is ideal for cost-sensitive, high-volume, or decentralized AI workflows where vendor lock-in or monthly billing is undesirable. Prefer it over OpenAI or Anthropic direct APIs when x402 payment support is already in your stack and you want local GPU inference without centralized rate limits.

## Known failure modes

- Payment not fulfilled — x402 payment handshake fails, returning 402 Payment Required
- Model name not found or unsupported — returns an error indicating unknown model
- max_tokens exceeds allowed maximum of 1024 — request rejected with validation error
- Malformed messages array (missing role or content) — returns 400 Bad Request
- GPU resource unavailable or overloaded — may return 503 or timeout
- Temperature value out of range [0, 2] — validation error

## How this service works

OpenAI-compatible chat completions over x402 (local GPU models, no API key) — Genesis402 / UnyKorn Operator Network

## Output

Returns an OpenAI-format chat completion object containing the assistant's generated message content, model used, finish reason, and token usage statistics (prompt tokens, completion tokens, total tokens).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string"
  },
  "prompt": {
   "type": "string"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant"
      ],
      "type": "string"
     },
     "content": {
      "type": "string"
     }
    }
   }
  },
  "max_tokens": {
   "type": "integer",
   "maximum": 1024,
   "minimum": 1
  },
  "temperature": {
   "type": "number",
   "maximum": 2,
   "minimum": 0
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "model": "qwen2.5:7b",
  "usage": {
   "total_tokens": 44,
   "prompt_tokens": 14,
   "completion_tokens": 30
  },
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "<text>"
    },
    "finish_reason": "stop"
   }
  ],
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.005,
   "receipt_id": "g402-<16hex>"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openai-compatible-chat-completions-via-x402-unykorn-local-gpu-7dc1b3ac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
