chat
Run a chat completion on the Fermat 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.
Input Schema
TableJSON 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
TableJSON 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 |