Fermat

OpenAI-compatible LLM gateway: pay per request with an API key, signed receipt for each call.

我該用這個嗎

品質與安全性

A
說明品質
92%
結構描述完整度
90%
命名品質
82%
汙染風險
100%
權限相符程度
100%
協定合規性
100%

發現項目(3)

  • LOWTool 'docs' description lacks action verb在 docs 中
  • LOWTool 'key' description lacks action verb在 key 中
  • LOWTool 'route_explain' description lacks action verb在 route_explain 中

根據工具定義與協定合規性的自動化分析。

上下文成本

~3,342Token(工具定義)
~2.8 KB典型回應大小
顯著的注意力影響(128k 上下文的 2.61%)

這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。

安裝

一鍵安裝

將以下內容加入你的 `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
}

社群

為此伺服器評分

證據

近期觀測

已驗證未記錄版本11 個工具