商业产业 Hacker News AI 2026-08-02T01:56 正文 ok 322 words

Show HN:CostPerPrompt——实时 AI API 定价与真实工作负载成本计算器

英文标题:🔶 Show HN: CostPerPrompt – Live AI API pricing and real-workload cost calculators

CostPerPrompt 汇总了 232 个 AI 模型的实时 API 定价,并自动刷新数据,最新更新时间为 2026-08-02。该工具不仅展示每 Token 价格,还提供 API、聊天机器人、Agent、RAG、语音 AI 等不同真实工作负载的成本计算器。其计算会纳入上下文重复发送、缓存 TTL、重试、批处理折扣等因素,旨在避免仅按价目表估算所造成的 2—3 倍成本偏差。对开发者而言,这有助于更准确地比较模型与供应商,并识别缓存、路由和批处理等降本空间。
打开原文相关 2 · 机会 4

中文

实时 AI API 定价

232 个模型 · 自动刷新 · 最后更新于 2026-08-02

每 Token 价格来自公开价目表,并提供可将其换算为月度账单的计算器。

计算器

基于实际工作负载,而非简单的价目表计算:这些工具会模拟重复发送的上下文、缓存 TTL 和重试。

API 成本计算器:比较任意工作负载在全部 232 个模型上的成本,并计入缓存和批处理折扣。

聊天机器人成本:模拟真实对话——不断增长的历史记录、重复发送的上下文,以及各供应商的缓存 TTL。

Agent 成本:多步骤循环、工具 Schema、重试——解释为何 Agent 的成本会比简单计算高出 10—30 倍。

RAG 成本:分别计算索引、检索和生成成本。Embedding 是成本较低的部分。

语音 AI 成本:按分钟、每通电话和每月计算 STT + LLM + TTS——完整的三部分账单。

GPU 租赁定价:比较 10 家供应商的 H100、A100、RTX 4090——同一款芯片的价格差距可达 5 倍。

图像 API 定价:每张图像 $0.003 至 $0.17——三档市场价格与批处理计算器。

Token 计数器:粘贴文本,即可获取任意模型的 Token 数和成本。完全在浏览器中运行。

降本指南:按效果排序的五大 LLM 账单降本杠杆——路由、缓存、批处理等,最高可降低 80% 成本。

AI API 定价如何运作——60 秒速览

所有主流 AI 供应商的计费方式都相同:按 Token 收费(大约相当于 ¾ 个单词),并对 输入(你发送的内容)和 输出(模型生成的回复)分别定价。输出通常比输入贵 3—5 倍。一款标价为每百万 Token 输入 $5 / 输出 $25 的模型,意味着你每发送 100 万 Token 支付 $5,每生成 100 万 Token 支付 $25。

两项折扣会显著改变成本计算:Prompt 缓存最多可将重复输入成本降低 90%(这对会重复发送对话历史的聊天机器人至关重要),而当你可以等待结果时,批处理可降低约 50% 的成本。我们的计算器将两者都纳入计算;大多数“这会花多少钱”的文章没有这样做,因此它们的估算往往会高出或低出 2—3 倍。

English / 原文

Live AI API pricing

232 models · refreshed automatically · last update 2026-08-02

Per-token prices pulled from public listings, and calculators that turn them into a monthly bill.

Calculators

Workload-based, not price-sheet math: they model resent context, cache TTLs and retries.

API Cost Calculator Any workload compared across all 232 models, with caching and batch discounts. Chatbot Cost Simulates real conversations — growing history, resent context, per-provider cache TTLs. Agent Cost Multi-step loops, tool schemas, retries — why agents cost 10–30× more than naive math says. RAG Cost Indexing, retrieval and generation priced separately. Embeddings are the cheap part. Voice AI Cost STT + LLM + TTS per minute, per call, per month — the full three-part bill. GPU Rental Pricing H100, A100, RTX 4090 across 10 providers — the same chip at a 5× price spread. Image API Pricing $0.003 to $0.17 per image — three market tiers and a batch calculator. Token Counter Paste text, get tokens and cost on any model. Runs entirely in your browser. Cost-Cutting Guides The five levers that cut an LLM bill 80% — routing, caching, batch and more, ranked.

How AI API pricing works — the 60-second version

Every major AI provider bills the same way: you pay per token (roughly ¾ of a word), with separate rates for input (what you send) and output (what the model writes back). Output is usually 3–5× more expensive than input. A model listed at $5 / $25 per million tokens costs $5 for every million tokens you send and $25 for every million it generates.

Two discounts change the math dramatically: prompt caching cuts repeated input costs by up to 90% (critical for chatbots that resend conversation history), and batch processing takes ~50% off when you can wait for results. Our calculators account for both — most "how much will this cost" articles don't, which is why their estimates run 2–3× too high or too low.