# Phase Router

> OpenAI-compatible LLM gateway: pay per request with an API key, signed receipt for each call.

- name: xyz.phase.ai/gateway
- version: 0.5.1
- connection class: R1 (autonomous)
- trust: 83/100 flags: no-repository
- quality: 89/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/xyz.phase.ai%2Fgateway
- tools: https://api.protogrid.dev/v1/servers/xyz.phase.ai%2Fgateway/tools

**An agent can connect on its own if it already holds `GATEWAY_TOKEN`, `X_PHASE_BYOK_ANTHROPIC`, `X_PHASE_BYOK_OPENAI`.** Remote endpoint behind a static API key or header. The registry never sees the value; the agent fills the placeholder.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "gateway": {
      "type": "http",
      "url": "https://mcp.ai.phase.xyz/mcp",
      "headers": {
        "Authorization": "Bearer ${GATEWAY_TOKEN}",
        "X-Phase-BYOK-Anthropic": "${X_PHASE_BYOK_ANTHROPIC}",
        "X-Phase-BYOK-OpenAI": "${X_PHASE_BYOK_OPENAI}"
      }
    }
  }
}
```

Placeholders to fill: `${GATEWAY_TOKEN}`, `${X_PHASE_BYOK_ANTHROPIC}`, `${X_PHASE_BYOK_OPENAI}`.

## Trust

- hygiene: 80
- liveness: 100
- freshness: 100
- provenance: 55
- drivers: +dns-namespace +website +reachable +uptime-100% +updated-4d-ago -no-repository
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 89/100 (good)

### protocol: 88 (weight 25)

- pass `protocol.modern`: supports 2026-07-28 (server/discover)
- pass `protocol.stateless`: answers without a session
- pass `protocol.transport`: streamable HTTP
- warn `protocol.list_ttl`: tools/list declares ttlMs 0, so clients re-fetch it on every use

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 94 (weight 30)

- pass `tools.descriptions`: every tool has a description
- pass `tools.description_length`: descriptions are concise
- pass `tools.schemas`: every tool has an object input schema
- pass `tools.annotations`: 7 of 7 tools declare readOnlyHint or destructiveHint
- warn `tools.directory_hints`: 3 of 7 tools declare all four hints; missing: list_models (destructiveHint); quote (destructiveHint); receipt (destructiveHint); …
- pass `tools.token_cost`: about 1,241 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump
- pass `tools.hidden_text`: no hidden text in tool names, descriptions, schemas or annotations

### stability: 83 (weight 15)

- warn `stability.changes`: 27 tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name
- pass `stability.new_links`: no tool change named a new site

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 7, about 1,241 tokens to load them all
- tool set hash: 22769e82507f236406dcfdfa6c74897e
- tools last changed: 2026-11-11T14:54:12.783Z
- badge: [![protogrid quality](https://protogrid.dev/badge/xyz.phase.ai/gateway.svg)](https://protogrid.dev/servers/xyz.phase.ai/gateway)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

- 2026-11-11 `session` changed (description)
  - before: Saved chat sessions on the Phase AI gateway: create one (returns an id and a shareable /s/<id> link), read its thread, list the wallet's sessions (wallet mode only: signed with the wallet key, no transaction), or delete one. Pass the id as `session` to chat and the gateway carries the context between turns and visits.
  - after: Saved chat sessions on Phase Router: create one (returns an id and a shareable /s/<id> link), read its thread, list the wallet's sessions (wallet mode only: signed with the wallet key, no transaction), or delete one. Pass the id as `session` to chat and the gateway carries the context between turns and visits.
- 2026-11-11 `list_models` changed (description)
  - before: List models of the Phase AI gateway with prices (USD per 1M tokens, fee per call) and layer (flagship | open | class | free).
  - after: List models of Phase Router with prices (USD per 1M tokens, fee per call) and layer (flagship | open | class | free).
- 2026-11-11 `embed` changed (description)
  - before: Compute embeddings on the Phase AI gateway (paid from the Phase API key or the wallet).
  - after: Compute embeddings on Phase Router (paid from the Phase API key or the wallet).
- 2026-11-11 `chat` changed (description)
  - before: Run a chat completion on the Phase AI gateway, paid from the Phase API key or the wallet this server uses (free models cost nothing). Returns the answer, actual price, task id for the receipt and usage.
  - after: Run a chat completion on Phase Router, paid from the Phase API key or the wallet this server uses (free models cost nothing). Returns the answer, actual price, task id for the receipt and usage.
- 2026-11-10 `list_models` changed (outputSchema)
- 2026-10-26 `usage` removed
  - Spend and savings of the Fermat API key over the last N days (1 to 90, default 7): totals, per day and per model when the gateway has the history (source usage), otherwise the key's totals (source key). Key mode only.
- 2026-10-26 `route_explain` removed
  - Explain one Fermat request from its public receipt: the model or class it named, the complexity level, the model and provider that served it, the price, the price of the class baseline model and the saving in percent, and the providers tried.
- 2026-10-26 `compare` removed
  - Run one prompt on 2 to 4 Fermat models or classes at once and compare answer, price, tokens and speed; returns the cheapest, the most expensive and how many times more the expensive one cost. Spends credit for each model. Default models: the cheapest paid chat model, auto, and the most expensive open chat model.
- 2026-10-26 `docs` removed
  - Fermat documentation in short: connect, pricing (with the live price table), savings, mcp, byok, data, receipts, limits.
- 2026-10-26 `session` changed (description)
  - before: Saved chat sessions on the Fermat gateway: create one (returns an id and a shareable /s/<id> link), read its thread, list the wallet's sessions (wallet mode only: signed with the wallet key, no transaction), or delete one. Pass the id as `session` to chat and the gateway carries the context between turns and visits.
  - after: Saved chat sessions on the Phase AI gateway: create one (returns an id and a shareable /s/<id> link), read its thread, list the wallet's sessions (wallet mode only: signed with the wallet key, no transaction), or delete one. Pass the id as `session` to chat and the gateway carries the context between turns and visits.

Full history: https://api.protogrid.dev/v1/servers/xyz.phase.ai%2Fgateway/changes

## Remotes

- https://mcp.ai.phase.xyz/mcp (streamable-http, auth api_key ${GATEWAY_TOKEN}, reachable true, uptime30d 1)

## Packages

_none_

## Tools (7)

- `chat`: Run a chat completion on Phase Router, paid from the Phase API key or the wallet this server uses (free models cost nothing). Returns the answer, actual price, task id for the receipt and usage.
- `embed`: Compute embeddings on Phase Router (paid from the Phase API key or the wallet).
- `key`: Balance, daily cap and spend of the Phase API key this server pays with (key mode).
- `list_models`: List models of Phase Router with prices (USD per 1M tokens, fee per call) and layer (flagship | open | class | free).
- `quote`: Get the price ceiling for a chat request without paying (the gateway's 402 quote).
- `receipt`: Fetch the public receipt of a paid request by task id (model, provider, tokens, price, settlement tx, request/response hashes, signatures) and its Merkle proof once the weekly epoch is closed.
- `session`: Saved chat sessions on Phase Router: create one (returns an id and a shareable /s/<id> link), read its thread, list the wallet's sessions (wallet mode only: signed with the wallet key, no transaction), or delete one. Pass the id as `session` to chat and the gateway carries the context between turns and visits.
