# 给 Agent 用：API Pricing

> 让 Agent 直接读取 6 个平台的 AI API 价格。全部只读、免费、无需登录。https://apipricing.codertony.com

## 一句话让 Agent 自己装好

把这句话粘贴给 Claude Code、Codex、Cursor 或任何编程 Agent。它会读安装说明，为自己所在的客户端加上 MCP 服务器，调用一次确认能用，再告诉你还剩什么要做。

```text
Read https://apipricing.codertony.com/setup.md and add the API Pricing MCP server
```

## MCP 服务器

在 Claude Code、Codex、Cursor 或任何 MCP 客户端里加一个网址，就能直接问：“图生视频哪个平台最便宜？”。Streamable HTTP，无需登录。各客户端的配置写法略有不同，按你用的那个来。

```bash
# Claude Code
claude mcp add --transport http --scope user apipricing https://apipricing.codertony.com/mcp

# Codex
codex mcp add apipricing --url https://apipricing.codertony.com/mcp

# Cursor (~/.cursor/mcp.json)
{
  "mcpServers": {
    "apipricing": { "url": "https://apipricing.codertony.com/mcp" }
  }
}

# VS Code
code --add-mcp '{"name":"apipricing","type":"http","url":"https://apipricing.codertony.com/mcp"}'

# Gemini CLI
gemini mcp add --transport http apipricing https://apipricing.codertony.com/mcp -s user

# Claude.ai / Claude Desktop
Connectors → Add custom connector. Paste the MCP URL and choose no sign-in.

# ChatGPT
Add a custom MCP server with the MCP URL and no authentication. Whether your plan allows it is up to OpenAI.
```

- `search_prices`: 按模型、平台、规格里的词搜索全部当前价格。
- `get_model_prices`: 某个平台上某个模型的全部价格，以及其他平台上的同系列价格。
- `cheapest`: 某个任务（如 video/image-to-video）或模型系列（如 video/kling）的最低确切价。
- `compare_family`: 一个模型系列在各平台的对比：每个平台的最低价和明细。

## 一键复制给 Agent

每个模型页、模型系列页、任务页和分类页都有“复制给 Agent”按钮，会把这一页复制成精简的 Markdown：API 模型名、按规格列出的全部价格、其他平台上的同款、读取时间和来源。粘贴到任何对话里即可。下拉菜单还能直接在 ChatGPT 或 Claude 里打开。

## 每个页面都有 Markdown 版

任何页面网址后加 .md，或请求时带 Accept: text/markdown，就返回纯 Markdown：没有导航和脚本，token 只有 HTML 的十分之一左右。中文版在 /zh 下。

```bash
curl https://apipricing.codertony.com/video/image-to-video.md
curl https://apipricing.codertony.com/prices/replicate/google/veo-3.1.md
curl -H "Accept: text/markdown" https://apipricing.codertony.com/image/flux
```

## llms.txt

给大模型看的网站目录：网站覆盖什么，以及每个分类、任务、模型系列的 Markdown 链接和当前起价。

```bash
curl https://apipricing.codertony.com/llms.txt
```

## JSON 接口

只读、无需密钥、允许跨域、缓存 10 分钟。价格为美元/单位；每行包含 API 模型名、规格、平台原文和页面链接。

```bash
# Search
curl "https://apipricing.codertony.com/api/v1/search?q=kling%202.6&category=video&limit=10"

# Cheapest for a task or a model family
curl "https://apipricing.codertony.com/api/v1/cheapest?task=video/image-to-video&limit=10"
curl "https://apipricing.codertony.com/api/v1/cheapest?family=image/nano-banana"

# One model on one platform
curl "https://apipricing.codertony.com/api/v1/models/replicate/google/veo-3.1"
```
