# OpenRelay Text Completions

> OpenRelay Text Completions is a paid API for AI agents from openrelay.hggfffdfy687.workers.dev, paid per call via x402, $0.0005/call, status unknown (last checked 2026-09-16).

Pay-per-request LLM text completion via OpenAI-compatible /v1/completions endpoint, billed in USDC per call with no API key required

## Facts

- Endpoint: POST https://openrelay.hggfffdfy687.workers.dev/v1/completions
- Price: $0.0005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/openrelay-text-completions-4289527a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sXHNAD_y69emPimj1Jfzc

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 openrelay-text-completions-4289527a -d '<json body>'
```

Example prompt: Using DeepSeek V4 Flash with a 400k context window, generate a response to this conversation — system: 'You are a helpful assistant', user: 'Summarize the key points of transformer architecture' — limit the output to 512 tokens and pay per request in USDC with no API key.

## When to prefer this

Choose this endpoint when your AI agent needs to call an LLM without managing API keys or subscriptions, and can pay per request in USDC on Solana or Base. It is ideal for autonomous agents operating on-chain, cost-sensitive workloads needing pay-as-you-go pricing ($0.10/1M tokens), or pipelines requiring very large context windows (up to 400k tokens). Prefer this over OpenAI direct when you need keyless, wallet-funded inference or x402 protocol compatibility.

## Known failure modes

- Insufficient USDC balance — payment via x402 fails and request is rejected before inference
- Invalid model ID — returns error if model string doesn't match available models (call GET /v1/models to list valid IDs)
- max_tokens exceeds model limit — request rejected if value exceeds 16384
- Malformed messages array — missing required 'role' or 'content' fields causes validation error
- Worker downtime — Cloudflare Workers cold-start or upstream model provider outage returns 5xx
- Temperature out of range — values outside 0-2 are rejected

## How this service works

OpenRelay is a pay-per-request LLM inference relay. Autonomous AI agents call our OpenAI-compatible endpoints and pay in USDC via x402 — no API keys, no signup, no subscriptions. Backed by DeepSeek V4 Flash (400k ctx), Kimi K2.6 (240k ctx), and MiniMax M2.7 (180k ctx). Price: $0.10 per 1M tokens (input + max_tokens). USDC on Solana or Base. Facilitator: PayAI (gasless).

## Output

Returns an OpenAI-compatible chat.completion JSON object with the generated assistant message, finish reason (e.g. 'stop'), token usage breakdown (prompt_tokens, completion_tokens, total_tokens), model name, and a unique completion ID.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string",
   "description": "Model id. Call GET /v1/models for list. Default: deepseek-ai/DeepSeek-V4-Flash-0731."
  },
  "stream": {
   "type": "boolean",
   "default": false
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant"
      ]
     },
     "content": {
      "type": "string"
     }
    }
   }
  },
  "max_tokens": {
   "type": "integer",
   "default": 512,
   "maximum": 16384,
   "minimum": 1
  },
  "temperature": {
   "type": "number",
   "default": 1,
   "maximum": 2,
   "minimum": 0
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "chatcmpl-openrelay-abc123",
  "model": "deepseek-ai/DeepSeek-V4-Flash-0731",
  "usage": {
   "total_tokens": 15,
   "prompt_tokens": 12,
   "completion_tokens": 3
  },
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "Hello!"
    },
    "finish_reason": "stop"
   }
  ],
  "created": 1787532386
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openrelay-text-completions-4289527a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from openrelay.hggfffdfy687.workers.dev](https://www.zero.xyz/host/openrelay.hggfffdfy687.workers.dev/llms.txt)
