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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>"
},
"name": "chat"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | model id from list_models, or a class: auto | eco | premium | agentic | |
| prompt | No | single user message (use messages for multi-turn) | |
| system | No | optional system prompt | |
| session | No | saved session id (from the session tool or a /s/<id> link): the gateway prepends its history and appends this turn | |
| messages | No | full conversation; overrides prompt/system | |
| max_tokens | No | output cap; also bounds the price ceiling | |
| temperature | No | sampling temperature 0–2 (Claude ignores it) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| batch | No | payment batch this call was charged to (settled with one transaction later) | |
| level | No | ||
| model | Yes | ||
| usage | Yes | ||
| payment | Yes | ||
| session | No | ||
| task_id | Yes | ||
| tx_hash | No | ||
| provider | Yes | ||
| price_usd | Yes | ||
| elapsed_ms | Yes | ||
| ceiling_usd | No | ||
| receipt_url | No | ||
| session_url | No | ||
| routed_model | No |