Agent Cost Log

Cost per run, tool, model and day for AI agents, from one call or an OpenTelemetry export.

我該用這個嗎

品質與安全性

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

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

上下文成本

~697Token(工具定義)
~1.1 KB典型回應大小
中等的注意力影響(128k 上下文的 0.54%)

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

安裝

一鍵安裝

將以下內容加入你的 `claude_desktop_config.json` 檔案:

{
  "mcpServers": {
    "costlog": {
      "url": "https://costlog.cloudforbots.com/mcp"
    }
  }
}

遠端端點

https://costlog.cloudforbots.com/mcpstreamable-http

它能做什麼

工具清單

工具(4)

🟢 唯讀🟡 寫入🔴 刪除⚪ 未知
🟢log_costs(run_id, events, otel, price_in_per_m, price_out_per_m, ...)

Log what your agent's model and tool calls cost, then get the running total for the run and for today. Pass events (one per call, up to 500) or an OpenTelemetry OTLP/JSON trace export as otel (gen_ai.usage.input_tokens / output_tokens / gen_ai.request.model are read; trace id becomes run_id). Give cost_usd per call, or tokens plus your own per-million prices; nothing is guessed. Optional caps: run_cap_usd and daily_cap_usd. Free watch-only returns would_alert when a cap is crossed; Pro posts one alert per day to alert_webhook. Never blocks or changes your agent.

輸入結構描述

{
  "type": "object",
  "properties": {
    "run_id": {
      "type": "string",
      "description": "Stable id for this run (default \"default\")."
    },
    "events": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "tool": {
            "type": "string",
            "description": "Tool or step name, e.g. \"web_search\"."
          },
          "model": {
            "type": "string",
            "description": "Model name as your provider bills it."
          },
          "agent": {
            "type": "string"
          },
          "input_tokens": {
            "type": "integer"
          },
          "output_tokens": {
            "type": "integer"
          },
          "cost_usd": {
            "type": "number",
            "description": "What the call cost, if your provider returns it. Otherwise pass tokens plus price_in_per_m / price_out_per_m."
          },
          "price_in_per_m": {
            "type": "number",
            "description": "Your input price in USD per 1M tokens (from your provider's price page)."
          },
          "price_out_per_m": {
            "type": "number",
            "description": "Your output price in USD per 1M tokens."
          },
          "run_id": {
            "type": "string"
          },
          "at": {
            "type": "string",
            "description": "ISO time of the call (default now; at most 30 days back)."
          }
        }
      }
    },
    "otel": {
      "type": "object",
      "description": "OTLP/JSON export: { resourceSpans: [...] }."
    },
    "price_in_per_m": {
      "type": "number",
      "description": "Default input USD per 1M tokens for events without cost_usd."
    },
    "price_out_per_m": {
      "type": "number",
      "description": "Default output USD per 1M tokens."
    },
    "run_cap_usd": {
      "type": "number"
    },
    "daily_cap_usd": {
      "type": "number"
    },
    "alert_webhook": {
      "type": "string",
      "description": "https URL Pro posts the cap alert to."
    }
  }
}
⚪cost_report(run_id, days)

Cost per run, per tool, per model and per day. Without an API key pass run_id (one run). With a key: everything on that key. Free shows 7 days, Pro 30.

輸入結構描述

{
  "type": "object",
  "properties": {
    "run_id": {
      "type": "string"
    },
    "days": {
      "type": "integer",
      "description": "1-30 (free max 7)."
    }
  }
}
🟢weekly_report

Plain-English summary of the last 7 days of spend: total, top runs, top tools, top models, busiest day. Read-only; sends nothing. Needs a free API key.

輸入結構描述

{
  "type": "object",
  "properties": {}
}
🟢usage_and_upgrade

Show today's usage for your key or IP and the $9/month upgrade link. Free tier: 500 calls/day. Not metered.

輸入結構描述

{
  "type": "object",
  "properties": {}
}

社群

為此伺服器評分

證據

近期觀測

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