# Phase Router — one API for every model

OpenAI-compatible model router: one API key for hundreds of models, the price of every call in the answer, and a signed receipt for each call. Phase Router sends each request to the cheapest model that can do it well.

Website: https://router.phase.xyz
Short index for agents: https://router.phase.xyz/llms.txt
Part of Phase: https://phase.xyz/md/index.md

## For agents: connect in one step

- Base URL (OpenAI-compatible): `https://router.phase.xyz/v1`
- Authentication: API key in the `Authorization: Bearer` header; keys start with `phk_`. Create one at https://router.phase.xyz/dashboard
- Models: `GET https://router.phase.xyz/v1/models` lists every model id with its price.
- Let the router pick: model `auto` (or the classes `eco`, `premium`, `agentic`); any model id from the list calls that model.
- Remote MCP server: `https://mcp.ai.phase.xyz/mcp` with the same key (registry name `xyz.phase.ai/gateway`). Tools: `list_models`, `quote`, `chat`, `embed`, `receipt`, `key`, `session`.
- Examples, an agent skill and configs for Claude Code, Cursor, Cline, Hermes Agent, LiteLLM: https://github.com/devcells/phase-router-skills

```bash
curl https://router.phase.xyz/v1/chat/completions \
  -H "Authorization: Bearer $PHASE_API_KEY" -H "content-type: application/json" \
  -d '{"model": "auto", "messages": [{"role": "user", "content": "Hello"}]}'
```

The answer names the model that ran (`phase.routed_model`), what it cost (`usage.cost`) and the task id of its receipt.

Claude Code: `claude mcp add --transport http phase-router https://mcp.ai.phase.xyz/mcp --header "Authorization: Bearer phk_..."`

## What it is

- **One API for every model.** Open models (Llama, Qwen, DeepSeek, gpt-oss, Kimi, GLM and others) and closed ones (Claude, GPT, Gemini, Grok) behind one OpenAI-compatible endpoint.
- **Router.** `auto` picks the cheapest model that can do the task well; you can always name a model yourself.
- **Price in every answer.** `usage.cost` and the `phase` object say what the call cost; no subscription.
- **Receipts.** Every paid call has a signed receipt at `https://router.phase.xyz/receipts/<task_id>`; receipts roll into weekly epochs anchored on the Phase L1 blockchain: https://router.phase.xyz/epochs

## Pay

- **API key:** prepaid balance; you pay the token price of the model you call.
- **Your own provider key (BYOK):** Claude, GPT, Gemini, Grok with your key and a small fee: https://router.phase.xyz/models?access=byok
- **Wallet, no account (x402):** pay each call in USDT on Phase L1 mainnet after a price quote (the 402 answer); no account, no key. Paid endpoints: https://router.phase.xyz/.well-known/x402

## Pages

- [Models and prices](https://router.phase.xyz/models)
- [Docs](https://router.phase.xyz/docs): quickstart, SDKs, MCP, LiteLLM, payment batches
- [Chat](https://router.phase.xyz/chat)
- [Sign up and API keys](https://router.phase.xyz/dashboard)
- [Epochs and receipts](https://router.phase.xyz/epochs)
- [Health](https://router.phase.xyz/healthz)
- [Privacy Notice](https://router.phase.xyz/privacy)
- [Data Processing Addendum (draft) and sub-processors](https://router.phase.xyz/dpa)
