<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[星火AI 接入实践]]></title><description><![CDATA[星火AI 智能网关维护方的开发者专栏：OpenAI 兼容 API 配置、Token 与缓存计费、用量核对和常见报错。独立第三方服务，实际模型权限和价格以官网当前目录为准。]]></description><link>https://xinghuo-ai.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 11:30:06 GMT</lastBuildDate><atom:link href="https://xinghuo-ai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to verify AI API token charges: input, output, cache and multipliers]]></title><description><![CDATA[Reconcile AI API charges using input tokens, output tokens, cache fields and group multipliers. Includes a clearly hypothetical billing calculation.]]></description><link>https://xinghuo-ai.hashnode.dev/ai-api-token-billing-en</link><guid isPermaLink="true">https://xinghuo-ai.hashnode.dev/ai-api-token-billing-en</guid><category><![CDATA[api]]></category><dc:creator><![CDATA[AIFrontierNavigator]]></dc:creator><pubDate>Sun, 25 Oct 2026 10:29:29 GMT</pubDate><content:encoded><![CDATA[<p>This article was generated with AI from Xinghuo AI Gateway’s public billing guide. The publishing account is affiliated with the service operator. Xinghuo AI is an independent third-party service; current prices and permissions must be checked on its website.</p>
<p>A token total and a billed amount describe different parts of an AI API call. To reconcile them, identify the model and applicable price, separate the usage categories, and check whether any multiplier has already been applied.</p>
<h2>Start with the unit, not the total</h2>
<p>A price may be quoted per million tokens or with another unit. Input and output tokens can have different rates. Confirm the billing currency, price unit, selected model and account group before calculating an estimate.</p>
<p>For a simple request without special cache treatment, the estimate is input tokens divided by the price unit, multiplied by the input rate, plus the corresponding output calculation. Any additional rule has to come from the service’s current documentation.</p>
<h2>A hypothetical calculation</h2>
<p>Assume, purely for illustration, an input rate of CNY 10 per million tokens and an output rate of CNY 30 per million tokens. For 1,000 input tokens and 200 output tokens, the input estimate is CNY 0.010 and the output estimate is CNY 0.006, giving CNY 0.016 before any applicable additional rule.</p>
<p>These rates are invented teaching values, not a quotation or a current Xinghuo AI price. The example assumes no separate cache charges, no extra multiplier and no other adjustment. Always use the actual rates and rules for the request you are checking.</p>
<h2>Keep cache categories from overlapping</h2>
<p>Depending on the endpoint, usage can include cache reads, cache writes or other categories alongside input and output totals. Check whether a cache count is already included in another field. Adding all reported numbers together can count the same usage twice.</p>
<p>Do not assume that one provider’s usage structure or cache rate applies to every model exposed through a compatible API. A missing cache field also does not establish that caching occurred or that its price was zero.</p>
<h2>Apply a multiplier once</h2>
<p>An account group or channel may use a multiplier or other pricing adjustment. First determine whether the displayed unit price or charge already includes it. Multiplying a final billed amount again produces an incorrect comparison.</p>
<p>The account’s applicable configuration matters more than a historical screenshot. Keep the price and group information associated with the request time when investigating a discrepancy.</p>
<h2>Keep a reproducible worksheet record</h2>
<p>Our <a href="https://jiaye-apple.github.io/xinghuo-ai-examples/en/">free Token Cost Worksheet</a> separates uncached input, cached input and output, with explicit rate units and an account multiplier. Check whether cached tokens are included in the API input total, then enter mutually exclusive counts to avoid double counting. The worksheet calculates locally in your browser, requires no API key, makes no model request and exports a JSON record.</p>
<p>Amounts in the worksheet are labeled USD. Use rates and billing records in the same currency; the CNY teaching example above must not be copied as a USD quotation. Cache writes, other billable items and rounding rules still need separate verification against the current service rules. Example rates are hypothetical, not current Xinghuo prices. The calculator is free; API generation follows the account’s current billing rules.</p>
<h2>Reconcile records for the same request</h2>
<p>Use the request time, model ID and a redacted request identifier to find the matching usage record. Compare input, output, cache fields and the resulting charge within the same reporting window.</p>
<p>Streamed calls sometimes provide usage only in a final event. When usage is absent, record it as unavailable and consult the service record. Do not replace a missing value with zero merely to make the calculation complete.</p>
<h2>Handle a timeout before retrying</h2>
<p>A client timeout does not prove that the server stopped generating. Check whether usage or a completed result already exists before repeating a request. A second call can create another charge. Use documented idempotency features only where they are actually supported, and keep application retries bounded.</p>
<p>For the service-specific reference, see the <a href="https://ai.wfpromax.xyz/guides/en/token-billing.html?utm_source=hashnode&amp;utm_medium=referral&amp;utm_campaign=token_billing_en">English token billing guide</a> and <a href="https://ai.wfpromax.xyz/available-channels?utm_source=hashnode&amp;utm_medium=referral&amp;utm_campaign=token_billing_en">current model and channel catalog</a>. Public integration examples are available in the <a href="https://github.com/Jiaye-apple/xinghuo-ai-examples/blob/main/README.en.md">English GitHub README</a>.</p>
]]></content:encoded></item><item><title><![CDATA[AI API Token 计费怎么核对：输入、输出、缓存与分组倍率]]></title><description><![CDATA[用可复算的例子核对 AI API 输入、输出与缓存费用，区分模型单价、余额单位和分组倍率，再对照实际请求与账户扣费。星火AI 维护方发布。]]></description><link>https://xinghuo-ai.hashnode.dev/ai-api-token</link><guid isPermaLink="true">https://xinghuo-ai.hashnode.dev/ai-api-token</guid><category><![CDATA[api]]></category><dc:creator><![CDATA[AIFrontierNavigator]]></dc:creator><pubDate>Sun, 25 Oct 2026 09:26:47 GMT</pubDate><content:encoded><![CDATA[<p>比较 AI API 成本时，充值金额、模型单价和账户倍率应分开看。先确认同一模型、同一计费单位和同一类用量，再把估算值与请求记录核对，才能判断实际开销。</p>
<p>本文由星火AI 智能网关维护方发布，使用 AI 辅助撰写，介绍的是我们自己的独立第三方网关，不是独立测评，也不表示与模型厂商存在官方隶属关系。本文说明核对方法，实际价格以<a href="https://ai.wfpromax.xyz/available-channels?utm_source=hashnode&amp;utm_medium=referral&amp;utm_campaign=token_billing">当前模型目录</a>和账户配置为准。</p>
<h2>四类用量不要混在一起</h2>
<ul>
<li>输入 Token：提示词、系统说明、历史对话及工具结果等。</li>
<li>输出 Token：模型生成的内容，具体模型可能还有其他计费项目。</li>
<li>缓存读取：复用已缓存输入，是否命中要看实际返回与记录。</li>
<li>缓存写入：部分模型单列的缓存创建成本，与缓存读取不同。</li>
</ul>
<p>Token 不是固定数量的汉字。长对话会反复携带历史内容，工具结果过长也会继续增加输入量。一次回复很短，并不代表这次请求的输入成本很低。</p>
<h2>一个可以复算的例子</h2>
<p>以下是计算演示，不是星火AI 报价。假设输入单价为每百万 Token 10 元，输出单价为每百万 Token 30 元，一次请求有普通输入 1000 Token、输出 200 Token，没有缓存和其他计费项：</p>
<pre><code class="language-text">输入费 = 1000 ÷ 1000000 × 10 = 0.010 元
输出费 =  200 ÷ 1000000 × 30 = 0.006 元
合计   = 0.016 元
</code></pre>
<p>如果页面展示的是基础价，且规则还要求应用分组倍率，应按相应规则换算；如果显示的已经是最终价，就不要再乘一次。定价货币、余额显示单位和充值实付金额，也需要分别确认。</p>
<h2>缓存最容易重复计算</h2>
<p>某些接口的输入总量包含缓存读取量，另一些接口会把缓存单列。直接把全部输入按普通价计费，再叠加缓存价格，可能重复计算。应先查清字段定义，再对照网关请求明细里的分类用量和费用。</p>
<p>保存时间、准确模型 ID、账户分组和脱敏请求标识，通常比只保存一张余额截图更利于排查。接口返回的 usage 与最终账户扣费是两项需要核对的记录。</p>
<h2>用免费工具保留复算记录</h2>
<p>可以打开我们维护的<a href="https://jiaye-apple.github.io/xinghuo-ai-examples/">Token 费用复算工具</a>，分别填写互不重叠的非缓存输入、缓存输入和输出，再填写当前单价、计费单位与账户倍率。工具在页面本地运算，无需 API Key，不发送模型请求，支持导出 JSON 核对记录。</p>
<p>工具以 USD 标注金额，请使用相同币种的费率和账单记录核对；上文人民币教学例子不能直接当作美元报价。缓存写入、其他计费项及舍入规则仍应按当前服务规则单独核对。工具免费，API 生成服务另按当前账户规则计费。</p>
<h2>一次最小费用验收</h2>
<ol>
<li>记录调用前余额，确认密钥分组与模型。</li>
<li>暂停同一密钥的其他任务，发起一条输出受限的短请求。生成可能产生费用。</li>
<li>对照实际回答、结束原因、输入输出及缓存用量。</li>
<li>在账户记录或<a href="https://ai.wfpromax.xyz/key-usage">用量查询页</a>核对时间、模型与实际扣费。</li>
<li>发现差异时先保留脱敏记录，确认计费口径，再决定是否重试。</li>
</ol>
<p>网络超时不代表上游没有执行。超时后先查记录，避免连续重试放大开销。需要流式、工具调用或多模态时，还要按实际业务另做能力验收。</p>
<h2>把预算控制放进日常使用</h2>
<p>给不同应用分配独立密钥，设置合适的输出和并发上限，限制自动重试次数。比较服务时用相同模型和同一组任务，不用一个折扣标签替代实际费用核对。</p>
<p>完整原文：<a href="https://ai.wfpromax.xyz/guides/token-billing.html?utm_source=hashnode&amp;utm_medium=referral&amp;utm_campaign=token_billing">星火AI Token 计费说明</a>。接入前可阅读<a href="https://ai.wfpromax.xyz/guides/api-verification.html">调用验收指南</a>，客户端和插件见<a href="https://ai.wfpromax.xyz/downloads?utm_source=hashnode&amp;utm_medium=referral&amp;utm_campaign=token_billing">下载与接入</a>。公开反馈不要附 API Key、私人提示词或订单资料。</p>
]]></content:encoded></item></channel></rss>