PHASE/SERVICES/PHASE ROUTER
THINK
LIVE

Phase Router

One endpoint connects AI agents to leading AI models, routing each request to the best balance of quality, speed and cost. No separate subscriptions, accounts, API keys or lock-in.

X402

What x402 is, in five lines

You call the OpenAI-compatible API without any key.

For a paid model the gateway answers 402 Payment Required with a quote: the price ceiling for this request, the price per 1M tokens and a task id.

Your wallet signs a one-time USDT authorization for that ceiling (EIP-712 typed data — no transaction, no gas on your side).

The request is retried with the signature in PAYMENT-SIGNATURE; the gateway runs it and streams the answer.

After the answer the gateway settles the actual amount (tokens used + the per-call fee, never above the ceiling); the phase object in the response carries the price, payment status and tx hash.

API

Call a model

The examples call a paid model through the Phase SDKs.

# A paid model answers 402 with the quote (ceiling, price per 1M, task id);
# sign it with an SDK below — or look at the quote first:
curl -s -i -X POST https://<gateway>/v1/chat/completions -H 'content-type: application/json' \
  -d '{"model":"gpt-oss-120b","messages":[{"role":"user","content":"hello world"}]}'

# The catalog with prices (no payment):
curl -s https://<gateway>/v1/models
SDK

SDKs

PYTHON

phase-x402

Python, transport for the official openai SDK and httpx.

TYPESCRIPT

@phase/x402-fetch

TypeScript, a paying fetch for the OpenAI Node SDK, LangChain or plain fetch.

GO

phasex402

Go: Client is an http.RoundTripper

MCP

MCP server

phase-mcp is a single Go binary that exposes the catalog to agents (Claude Code, Cursor, any MCP client) as tools and pays for each call from a wallet key. Tools: list_models, quote (the 402 ceiling without paying), chat, embed, session (create, read, list and delete saved sessions) and receipt (the public receipt of a paid request and its Merkle proof).

PHASE_WALLET_KEYwithout it only free models work
PHASE_MAX_USD_PER_CALLlargest quote it will sign, default 0.05
PHASE_MAX_USD_PER_SESSIONsum of ceilings signed by one process, default 5
{
  "mcpServers": {
    "phase-ai": {
      "command": "/path/to/phase-mcp",
      "env": { "PHASE_GATEWAY_URL": "https://<gateway>", "PHASE_WALLET_KEY": "0x…", "PHASE_MAX_USD_PER_CALL": "0.05" }
    }
  }
}