# OpenRouter Metered Chat Completion (OpenAI-compatible)

> OpenRouter Metered Chat Completion (OpenAI-compatible) is a paid API for AI agents from openrouter.withzero.xyz, paid per call via MPP, $0.001/call, status healthy (last checked 2026-10-11, last successful call 2026-09-30).

Sends a chat completion request to any OpenRouter model with metered at-cost billing — escrows up to 5 USDC and refunds the unused portion after the call settles actual token usage.

## Facts

- Endpoint: POST https://openrouter.withzero.xyz/api/v1/chat/completions/metered?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: healthy
- Last checked: 2026-10-11
- Last successful call: 2026-09-30
- Success rate: 99% of calls made through Zero
- Rating: 3.7 / 5 from 2 reviews
- Activations on Zero: 330
- Provider: openrouter.withzero.xyz
- Website: https://openrouter.withzero.xyz
- Canonical page: https://www.zero.xyz/c/openrouter-withzero-xyz-openrouter-metered-chat-completion-openai-7c1ab996
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ObSx7etHdQufdb0Vt5gJP

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 openrouter-withzero-xyz-openrouter-metered-chat-completion-openai-7c1ab996 -d '<json body>'
```

Example prompt: Use the metered OpenRouter route to send this 10,000-token conversation to anthropic/claude-opus-4-5 with a max of 4096 output tokens and streaming off — I only want to pay for the tokens actually used, not a fixed worst-case amount.

## When to prefer this

Prefer this metered endpoint over the fixed-price route when calling reasoning models, sending large contexts, or expecting long completions where the fixed route's lower cap would be insufficient. It is also ideal when cost predictability via pay-for-actual-usage matters more than the simplicity of a one-shot fixed charge. Use the fixed route for short, predictable completions where the overhead of escrow-and-settle is unnecessary.

## Known failure modes

- 402 Payment Required if insufficient USDC balance to cover the worst-case reservation
- 400 Bad Request if model ID is invalid or messages array is malformed
- 400 if stream is set to true (streaming not supported on this route)
- 503 or 500 if the upstream OpenRouter model is unavailable
- timeout for very long reasoning model generations
- model not found if the specified OpenRouter model ID does not exist
- reservation ceiling exceeded if estimated cost exceeds the 5 USDC maximum escrow limit

## How this service works

OpenAI-compatible chat completion via any OpenRouter model with metered at-cost billing: escrow a worst-case reservation (up to 5 USDC), pay only actual token usage — the difference is refunded after the call. Use this route for long generations, big contexts, and reasoning models; the fixed route caps out much lower. 📖 Full guide: https://openrouter.withzero.xyz/llms.txt

## Output

Returns an OpenAI-compatible chat completion response including the generated message content, finish reason, token usage counts (prompt + completion), and a billing object detailing the reserved micro-USDC, settled micro-USDC (actual usage), actual cost, and the cost basis source (OpenRouter accounting, cached rates, or estimate). The difference between the escrowed reservation and actual cost is automatically refunded.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "example": {
  "model": "openai/gpt-4o-mini",
  "messages": [
   {
    "role": "user",
    "content": "Say hello in one sentence."
   }
  ],
  "max_tokens": 64
 },
 "required": [
  "model",
  "messages",
  "max_tokens",
  "stream"
 ],
 "properties": {
  "seed": {
   "type": "integer",
   "maximum": 9007199254740991,
   "minimum": -9007199254740991,
   "description": "Random seed for deterministic outputs (support varies by model)."
  },
  "stop": {
   "anyOf": [
    {
     "type": "string"
    },
    {
     "type": "array",
     "items": {
      "type": "string"
     }
    }
   ],
   "description": "Stop sequence(s): generation halts when any is produced."
  },
  "model": {
   "type": "string",
   "minLength": 1,
   "description": "OpenRouter model ID, e.g. \"openai/gpt-4o-mini\", \"anthropic/claude-haiku-4-5\", \"google/gemini-flash-1.5\". Use GET /api/v1/models to list all available models with pricing."
  },
  "route": {
   "type": "string",
   "description": "OpenRouter routing strategy, e.g. \"fallback\". Requires an explicit `models` list so every candidate model can be priced."
  },
  "tools": {
   "type": "array",
   "items": {},
   "description": "OpenAI-format tool definitions for function calling."
  },
  "top_k": {
   "type": "integer",
   "maximum": 9007199254740991,
   "minimum": 0,
   "description": "Top-k sampling: limit to the k most likely next tokens."
  },
  "top_p": {
   "type": "number",
   "maximum": 1,
   "minimum": 0,
   "description": "Nucleus sampling probability mass 0–1. Alternative to temperature."
  },
  "models": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "Fallback model list for OpenRouter auto-routing. Tried in order if the primary model is unavailable. The price reservation is taken at the most expensive rates across model + models, since any of them may serve the call; the difference is refunded on the metered route."
  },
  "stream": {
   "type": "boolean",
   "const": false,
   "default": false,
   "description": "Must be false — streaming is not supported in v1."
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "name": {
      "type": "string",
      "description": "Optional display name for the message author"
     },
     "role": {
      "enum": [
       "system",
       "user",
       "assista
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "id",
  "object",
  "created",
  "model",
  "choices",
  "billing"
 ],
 "properties": {
  "id": {
   "type": "string"
  },
  "model": {
   "type": "string"
  },
  "usage": {
   "type": "object",
   "required": [
    "prompt_tokens",
    "completion_tokens",
    "total_tokens"
   ],
   "properties": {
    "cost": {
     "type": "number"
    },
    "total_tokens": {
     "type": "number"
    },
    "prompt_tokens": {
     "type": "number"
    },
    "completion_tokens": {
     "type": "number"
    }
   },
   "additionalProperties": false
  },
  "object": {
   "type": "string"
  },
  "billing": {
   "type": "object",
   "required": [
    "promptTokens",
    "completionTokens",
    "reservedUsdcMicro",
    "settledUsdcMicro",
    "actualUsdcMicro",
    "costBasis"
   ],
   "properties": {
    "costBasis": {
     "enum": [
      "openrouter",
      "rates",
      "estimated"
     ],
     "type": "string",
     "description": "Where actualUsdcMicro came from: OpenRouter usage accounting > cached per-token rates > character estimate"
    },
    "promptTokens": {
     "type": "number",
     "description": "Actual input tokens consumed"
    },
    "actualUsdcMicro": {
     "type": "string",
     "description": "Best-known actual cost of the call in micro-USDC. On the fixed route this is informational — the charge is settledUsdcMicro."
    },
    "completionTokens": {
     "type": "number",
     "description": "Actual output tokens generated"
    },
    "settledUsdcMicro": {
     "type": "string",
     "description": "Micro-USDC actually charged to the buyer. Fixed route: the up-front worst-case estimate (= reservedUsdcMicro). Metered route: actual usage (= actualUsdcMicro)."
    },
    "reservedUsdcMicro": {
     "type": "string",
     "description": "Worst-case micro-USDC committed before the call"
    }
   },
   "additionalProperties": false
  },
  "choices": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "index",
     "message",
     "finish_reason"
    ],
    "properties": {
     "index": {
      "type": "number"
     },
     "message": {
      "type": "object",
      "required": [
       "role",
       "content"
      ],
      "properties": {
       "role": {
        "type": "string"
       },
       "content": {
        "anyOf": [
         {
          "type": "string"
         },
         {
          "type": "null"
         }
   
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/openrouter-withzero-xyz-openrouter-metered-chat-completion-openai-7c1ab996/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from openrouter.withzero.xyz](https://www.zero.xyz/host/openrouter.withzero.xyz/llms.txt)
