# OpenRouter Multi-Model Chat Completion Gateway

> OpenRouter Multi-Model Chat Completion Gateway is a paid API for AI agents from openrouter.withzero.xyz, paid per call via MPP, $0.005444/call, status unknown (last checked 2026-09-15).

Routes OpenAI-compatible chat completion requests to any of 700+ OpenRouter models, billed at cost per token with no markup

## Facts

- Endpoint: POST https://openrouter.withzero.xyz/api/v1/chat/completions
- Price: $0.005444/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 3
- Provider: openrouter.withzero.xyz
- Website: https://openrouter.withzero.xyz
- Canonical page: https://www.zero.xyz/c/openrouter-withzero-xyz-openrouter-multi-model-chat-completion-gateway-afc45be7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_zljDFvkGDRNSJzPvrtiS0

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-multi-model-chat-completion-gateway-afc45be7 -d '<json body>'
```

Example prompt: Using the OpenRouter gateway, send this conversation to anthropic/claude-haiku-4.5 with a max_tokens limit of 512 and temperature 0.7: system message 'You are a helpful assistant', user message 'Summarize the water cycle in 3 bullet points.'

## When to prefer this

Choose this endpoint when you need to access multiple LLM providers (OpenAI, Anthropic, Google, Meta, Mistral, etc.) through a single OpenAI-compatible interface without managing separate API keys or subscriptions. Especially useful when you want transparent, at-cost token billing via crypto micropayments, need fallback model routing, or want to switch between model providers without changing your integration code.

## Known failure modes

- Model ID not found on OpenRouter — returns error if model string is invalid or unavailable
- Insufficient USDC balance to cover estimated cost — call rejected before execution
- max_tokens set too low — completion truncated at finish_reason='length'
- messages array empty or malformed — schema validation error
- stream:true submitted — rejected because only stream:false is supported
- Network timeout to upstream OpenRouter — propagated as gateway error
- Rate limiting from upstream provider for selected model

## How this service works

OpenAI-compatible chat completion via any OpenRouter model, paid in one shot: price = estimated input tokens x input rate + max_tokens x output rate, resolved before the call and capped per model (from $0.10 for cheap models up to $5 for premium models like anthropic/claude-fable-5). For longer generations use POST /api/v1/chat/completions/metered. 📖 Full guide: https://openrouter.withzero.xyz/llms.txt

## Output

Returns an OpenAI-compatible chat completion object containing: the generated message text, role, optional tool_call arrays, finish_reason, token usage counts (prompt, completion, total), and a billing object showing promptTokens, completionTokens, and settledUsdcMicro (the actual USDC cost charged for the request).

## 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-multi-model-chat-completion-gateway-afc45be7/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)
