Fermat
OpenAI-compatible LLM gateway: pay per request with an API key, signed receipt for each call.
사용해야 할까요
품질 및 안전성
발견 사항 (3)
- LOWdocs에서
- LOWkey에서
- LOWroute_explain에서
도구 정의와 프로토콜 준수에 대한 자동 분석을 기반으로 합니다.
컨텍스트 비용
이는 서버의 도구가 모델의 컨텍스트에 로드될 때마다 소비되는 대략적인 토큰 수입니다. 수치가 높을수록 다른 작업에 사용할 수 있는 주의가 줄어듭니다.
설치
원클릭 설치
`claude_desktop_config.json` 파일에 다음을 추가하세요:
{
"mcpServers": {
"gateway": {
"url": "https://mcp.fermat.ai.phase.xyz/mcp"
}
}
}원격 엔드포인트
https://mcp.fermat.ai.phase.xyz/mcpstreamable-http할 수 있는 일
도구 목록
도구 (11)
🔴chat(model, prompt, system, messages, max_tokens, ...)
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.
입력 스키마
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "model id from list_models, or a class: auto | eco | premium | agentic"
},
"prompt": {
"type": "string",
"description": "single user message (use messages for multi-turn)"
},
"system": {
"type": "string",
"description": "optional system prompt"
},
"messages": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "system | user | assistant"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"content"
],
"additionalProperties": false
},
"description": "full conversation; overrides prompt/system"
},
"max_tokens": {
"type": "integer",
"description": "output cap; also bounds the price ceiling"
},
"temperature": {
"type": [
"null",
"number"
],
"description": "sampling temperature 0–2 (Claude ignores it)"
},
"session": {
"type": "string",
"description": "saved session id (from the session tool or a /s/<id> link): the gateway prepends its history and appends this turn"
}
},
"required": [
"model"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"text": {
"type": "string"
},
"model": {
"type": "string"
},
"routed_model": {
"type": "string"
},
"level": {
"type": "string"
},
"provider": {
"type": "string"
},
"price_usd": {
"type": "string"
},
"ceiling_usd": {
"type": "string"
},
"payment": {
"type": "string"
},
"tx_hash": {
"type": "string"
},
"task_id": {
"type": "string"
},
"batch": {
"type": "string",
"description": "payment batch this call was charged to (settled with one transaction later)"
},
"session": {
"type": "string"
},
"session_url": {
"type": "string"
},
"receipt_url": {
"type": "string"
},
"elapsed_ms": {
"type": "integer"
},
"usage": {
"type": "object",
"properties": {
"prompt_tokens": {
"type": "integer"
},
"completion_tokens": {
"type": "integer"
}
},
"required": [
"prompt_tokens",
"completion_tokens"
],
"additionalProperties": false
}
},
"required": [
"text",
"model",
"provider",
"price_usd",
"payment",
"task_id",
"elapsed_ms",
"usage"
],
"additionalProperties": false
}🔴compare(prompt, system, messages, models, max_tokens)
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.
입력 스키마
{
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "single user message (use messages for multi-turn)"
},
"system": {
"type": "string",
"description": "optional system prompt"
},
"messages": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "system | user | assistant"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"content"
],
"additionalProperties": false
},
"description": "full conversation; overrides prompt/system"
},
"models": {
"type": [
"null",
"array"
],
"items": {
"type": "string"
},
"description": "2 to 4 model ids or classes; default: the cheapest paid chat model, auto, and the most expensive open chat model"
},
"max_tokens": {
"type": "integer",
"description": "output cap for every model (default: none)"
}
},
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"results": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"model": {
"type": "string"
},
"text": {
"type": "string"
},
"truncated": {
"type": "boolean",
"description": "true when text was cut to 2,000 characters"
},
"routed_model": {
"type": "string"
},
"level": {
"type": "string"
},
"provider": {
"type": "string"
},
"price_usd": {
"type": "string"
},
"tokens": {
"type": "object",
"properties": {
"prompt": {
"type": "integer"
},
"completion": {
"type": "integer"
}
},
"required": [
"prompt",
"completion"
],
"additionalProperties": false
},
"elapsed_ms": {
"type": "integer"
},
"task_id": {
"type": "string"
},
"receipt_url": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": [
"model",
"tokens",
"elapsed_ms"
],
"additionalProperties": false
}
},
"cheapest": {
"type": "string",
"description": "model with the lowest price among the answers"
},
"most_expensive": {
"type": "string",
"description": "model with the highest price among the answers"
},
"ratio": {
"type": "number",
"description": "most expensive price divided by the cheapest, one decimal"
}
},
"required": [
"results"
],
"additionalProperties": false
}🟢docs(topic)
Fermat documentation in short: connect, pricing (with the live price table), savings, mcp, byok, data, receipts, limits.
입력 스키마
{
"type": "object",
"properties": {
"topic": {
"description": "what to explain",
"enum": [
"connect",
"pricing",
"savings",
"mcp",
"byok",
"data",
"receipts",
"limits"
],
"type": "string"
}
},
"required": [
"topic"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"topic": {
"type": "string"
},
"text": {
"type": "string"
}
},
"required": [
"topic",
"text"
],
"additionalProperties": false
}🔴embed(model, input)
Compute embeddings on the Fermat gateway (paid from the Phase API key or the wallet).
입력 스키마
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "embeddings model id"
},
"input": {
"type": [
"null",
"array"
],
"items": {
"type": "string"
}
}
},
"required": [
"model",
"input"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"vectors": {
"type": [
"null",
"array"
],
"items": {
"type": [
"null",
"array"
],
"items": {
"type": "number"
}
}
},
"price_usd": {
"type": "string"
},
"payment": {
"type": "string"
}
},
"required": [
"vectors",
"price_usd",
"payment"
],
"additionalProperties": false
}🟢key
Balance, daily cap and spend of the Phase API key this server pays with (key mode).
입력 스키마
{
"type": "object",
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"key": {
"type": "object",
"additionalProperties": true
}
},
"additionalProperties": false
}🟢list_models(layer)
List models of the Fermat gateway with prices (USD per 1M tokens, fee per call) and layer (flagship | open | class | free).
입력 스키마
{
"type": "object",
"properties": {
"layer": {
"type": "string",
"description": "optional filter: flagship | open | class | free"
}
},
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"gateway": {
"type": "string"
},
"wallet": {
"type": "string"
},
"models": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"layer": {
"type": "string"
},
"kind": {
"type": "string"
},
"context_window": {
"type": "integer"
},
"input_usd_per_1m": {
"type": "string"
},
"output_usd_per_1m": {
"type": "string"
},
"per_call_usd": {
"type": "string"
},
"free": {
"type": "boolean"
}
},
"required": [
"id",
"layer",
"kind",
"context_window",
"input_usd_per_1m",
"output_usd_per_1m",
"per_call_usd",
"free"
],
"additionalProperties": false
}
}
},
"required": [
"gateway",
"models"
],
"additionalProperties": false
}🟢quote(model, prompt, system, messages, max_tokens, ...)
Get the price ceiling for a chat request without paying (the gateway's 402 quote).
입력 스키마
{
"type": "object",
"properties": {
"model": {
"type": "string",
"description": "model id from list_models, or a class: auto | eco | premium | agentic"
},
"prompt": {
"type": "string",
"description": "single user message (use messages for multi-turn)"
},
"system": {
"type": "string",
"description": "optional system prompt"
},
"messages": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"properties": {
"role": {
"type": "string",
"description": "system | user | assistant"
},
"content": {
"type": "string"
}
},
"required": [
"role",
"content"
],
"additionalProperties": false
},
"description": "full conversation; overrides prompt/system"
},
"max_tokens": {
"type": "integer",
"description": "output cap; also bounds the price ceiling"
},
"temperature": {
"type": [
"null",
"number"
],
"description": "sampling temperature 0–2 (Claude ignores it)"
},
"session": {
"type": "string",
"description": "saved session id (from the session tool or a /s/<id> link): the gateway prepends its history and appends this turn"
}
},
"required": [
"model"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"model": {
"type": "string"
},
"ceiling_usd": {
"type": "string"
},
"per_call_usd": {
"type": "string"
},
"input_tokens_estimate": {
"type": "integer"
},
"max_output_tokens_priced": {
"type": "integer"
},
"input_usd_per_1m": {
"type": "string"
},
"output_usd_per_1m": {
"type": "string"
},
"network": {
"type": "string"
},
"free": {
"type": "boolean"
},
"wallet_can_pay": {
"type": "boolean"
},
"paid_by_key": {
"type": "boolean",
"description": "true when a Phase API key pays: its balance and daily cap apply, max_usd_per_call does not"
},
"max_usd_per_call": {
"type": "string",
"description": "largest quote the wallet will sign (wallet mode only)"
}
},
"required": [
"model",
"ceiling_usd",
"per_call_usd",
"input_tokens_estimate",
"max_output_tokens_priced",
"input_usd_per_1m",
"output_usd_per_1m",
"network",
"free",
"wallet_can_pay"
],
"additionalProperties": false
}🟢receipt(task_id)
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.
입력 스키마
{
"type": "object",
"properties": {
"task_id": {
"type": "string",
"description": "task id from chat / embed (0x…)"
}
},
"required": [
"task_id"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"receipt": {
"type": "object",
"additionalProperties": true
},
"proof": {
"type": "object",
"additionalProperties": true
},
"epoch_state": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": [
"receipt",
"epoch_state",
"url"
],
"additionalProperties": false
}🟢route_explain(task_id)
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.
입력 스키마
{
"type": "object",
"properties": {
"task_id": {
"type": "string",
"description": "task id from chat / embed (0x…)"
}
},
"required": [
"task_id"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"task_id": {
"type": "string"
},
"requested": {
"type": "string",
"description": "model or class the request named"
},
"is_class": {
"type": "boolean"
},
"level": {
"type": "string",
"description": "complexity level the classifier gave the request"
},
"routed_model": {
"type": "string"
},
"provider": {
"type": "string"
},
"price_usd": {
"type": "string"
},
"baseline_usd": {
"type": "string",
"description": "price of the same usage on the class baseline model"
},
"saved_usd": {
"type": "string"
},
"saving_percent": {
"type": "number"
},
"attempts": {
"type": "integer",
"description": "providers tried, the one that served included"
},
"failed_attempts": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"additionalProperties": true
}
},
"explanation": {
"type": "string"
},
"receipt_url": {
"type": "string"
}
},
"required": [
"task_id",
"requested",
"is_class",
"routed_model",
"provider",
"price_usd",
"explanation",
"receipt_url"
],
"additionalProperties": false
}🔴session(action, id, model, system, title)
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.
입력 스키마
{
"type": "object",
"properties": {
"action": {
"type": "string",
"description": "create | get | list | delete"
},
"id": {
"type": "string",
"description": "session id (get, delete)"
},
"model": {
"type": "string",
"description": "create: model the session starts with (informational; each chat names its own)"
},
"system": {
"type": "string",
"description": "create: system prompt kept for every turn"
},
"title": {
"type": "string",
"description": "create: title (defaults to the first message)"
}
},
"required": [
"action"
],
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
},
"model": {
"type": "string"
},
"title": {
"type": "string"
},
"system": {
"type": "string"
},
"messages": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"additionalProperties": true
}
},
"requests": {
"type": "integer"
},
"spent_usd": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"deleted": {
"type": "boolean"
},
"sessions": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"required": [
"id",
"url",
"messages",
"requests",
"spent_usd",
"expires_at"
],
"additionalProperties": false
}🟢usage(days)
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.
입력 스키마
{
"type": "object",
"properties": {
"days": {
"type": "integer",
"description": "period in days, 1 to 90 (default 7)"
}
},
"additionalProperties": false
}출력 스키마
{
"type": "object",
"properties": {
"source": {
"type": "string",
"description": "usage: per-day history from /v1/key/usage; key: totals only from /v1/key"
},
"days": {
"type": "integer"
},
"requests": {
"type": "integer"
},
"spent_usd": {
"type": "string"
},
"saved_usd": {
"type": "string"
},
"spent_today_usd": {
"type": "string"
},
"available_usd": {
"type": "string"
},
"daily_cap_usd": {
"type": "string"
},
"per_day": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"additionalProperties": true
}
},
"per_model": {
"type": [
"null",
"array"
],
"items": {
"type": "object",
"additionalProperties": true
}
}
},
"required": [
"source",
"days",
"requests",
"spent_usd"
],
"additionalProperties": false
}커뮤니티
증거