如何使用 AI 成本计算器 API — 免费 REST API + MCP 服务器

📄 中文摘要

AI 成本计算器 API 提供了一种简单的 REST API,用于计算 GPT-4、Claude 和 Gemini 的令牌成本。该 API 还可以作为 AI 编程助手(如 Claude 和 Cursor)的 MCP 服务器。用户只需通过简单的 curl 命令即可快速启动,无需 API 密钥,适合免费使用。API 的响应为 JSON 格式,具有低延迟和高可用性,适合生产环境使用。

📄 English Summary

How to Use the AI Cost Calculator API — Free REST + MCP Server

The AI Cost Calculator API offers a straightforward REST API for calculating token costs associated with GPT-4, Claude, and Gemini. Additionally, it functions as an MCP server for AI coding assistants like Claude and Cursor. Users can quickly get started with a simple curl command, and there is no API key required for the free tier. The API provides JSON responses, ensuring low latency and high availability, making it suitable for production environments.

Powered by Cloudflare Workers + Payload CMS + Claude 3.5

数据源: OpenAI, Google AI, DeepMind, AWS ML Blog, HuggingFace 等