Understanding LLM Web-Enabled Billing and Parameter Traps
This article breaks down how server-managed web capabilities in large language model APIs override client parameters, and why cost control depends on two separate billing lines: per-token charges with peak/off-peak and cache pricing, and per-call charges for search, crawling, parsing, OCR, and speech. It covers concurrency quotas, balance deduction order, and a practical checklist for designing request bodies, scheduling batch jobs, and keeping unit prices configurable.
1. Where the Problem Starts: Your Request Is Rewritten on the Server
Many teams hit the same confusion the first time they wire web-enabled question answering into their own application. The request body pins down the model name, states explicitly whether web access is on, and fixes the number of tool calls, yet the actual behavior does not match expectations. The real cause is usually not an API error. This class of service relies on a server-managed decision design: the model identifier submitted by the client is mapped to the version the server currently serves, and whether to go online, whether to fetch pages, and how many rounds to fetch are all decided by the server based on the semantics of the question. The official documentation states this directly: search and fetching happen on the server side, and the client does not execute any tools.
This leads to an engineering constraint that matters more than unit price: when server-managed capabilities are enabled, a batch of request parameters is taken over by the server, and the values passed by the client are ignored. That single fact determines how you should write the request body, which parameters you should not depend on, and which logic must live in your own application layer. A cost model built only around unit price often gets thrown back at you during integration testing by parameter overrides.
2. Splitting One Question’s Bill into Two Lines
To judge whether something is expensive, you have to split the bill into two billing lines that never merge.
The first is the token line. Take a lightweight model tier as an example: on the output side, roughly 4 CNY per million tokens off-peak and about 8 CNY per million tokens at peak; on the input side, cache misses cost about 1 CNY off-peak and 2 CNY at peak; with a cache hit, the price drops to about 0.02 CNY off-peak and 0.04 CNY at peak. The gap between a cache hit and a miss is on the order of a hundredfold, which means the stability of your prompt prefix is directly equivalent to cost.
The second is the per-call line. Search (text and images) and page fetching are billed per call, at a public price of roughly 5 CNY per thousand calls, which works out to 0.005 CNY per call. File parsing and OCR are billed per page, about 1.5 CNY per thousand pages. Speech synthesis is billed per character, about 3 CNY per ten thousand characters, dropping to 1.5 CNY during a limited-time discount period. Speech recognition is billed per hour of audio, about 0.78 CNY per hour, or roughly 0.39 CNY during the discount period. The key rule: whether the client calls the retrieval and fetching endpoints directly or the model triggers them through web tools, everything settles against the same per-call price list.
Put the two lines together for one deep-reasoning question. The web tool guide typically sets an upper bound along the lines of “the model may call tools about 20 times before answering.” If all 20 calls are used and all of them are search or fetch, the per-call cost tops out at about 0.10 CNY, with token charges counted separately. In other words, the per-call fee is a small, capped amount, while the token fee is the large part that grows linearly with context length.
3. Peak and Off-Peak Hours: The Half of the Cost That Gets Underrated
Peak hours are usually defined very rigidly, for example 9:00–12:00 and 14:00–18:00 Monday through Friday, excluding public holidays. All other times, including weekends and holidays all day, count as off-peak, and off-peak prices are roughly half of peak. This kind of peak/off-peak pricing often takes effect through a changelog entry rather than appearing on the first screen of the price list, so it is easy to miss.
There are two engineering implications. First, offline batch processing, log replay, and evaluation runs have no real-time requirement, so scheduling them into off-peak windows saves half of your token spend with no code changes. Second, per-call items currently have a single price with no peak/off-peak clause, so “shift work off-peak to save money” applies only to the token line. Do not extend it to search and fetching.
Peak: input cache miss 2 CNY/M + output 8 CNY/MOff-peak: input cache miss 1 CNY/M + output 4 CNY/MCache hit: off-peak 0.02 CNY/M, peak 0.04 CNY/MPer call: search/fetch 0.005 CNY/call (no peak/off-peak)
4. Ignored Parameters: How to Design the Request Body
Once the server takes over parameters, the client should reduce the request body to three parts: intent, constraints, and observability, instead of piling on switches that do nothing.
{"model": "client-side logical identifier (the server maps it to the actual version)","messages": [{"role": "system", "content": "Fixed prefix: role, output format, citation requirements (keep it stable to hit the cache)"},{"role": "user", "content": "The specific question"}],"stream": true,"metadata": {"trace_id": "used to tie per-call and token bills together"}}
Three practical principles. First, do not depend on a client-side web toggle; write “whether external information is needed” into the prompt and into post-processing validation. Second, treat the number of tool calls as an uncontrollable variable, and size the cost model against the upper bound rather than the average. Third, carry a tracking identifier in metadata or a custom field, otherwise the bill cannot be attributed to a specific business request.
5. Concurrency and Accounting: Two Hard Constraints for Batch Integration
Concurrency quotas are tiered. Lightweight tiers usually reach the 2,500 range, while higher tiers sit around 500. Batch jobs must apply token bucket or semaphore rate limiting and retry 429-type responses with exponential backoff, or they will easily congest themselves at peak times.
On the accounting side, two rules are easy to overlook. When a topped-up balance and a gifted balance both exist, the gifted balance is deducted first, which affects when budget alerts fire. The provider also reserves the right to adjust prices, so the cost model should keep unit prices as configuration rather than hard-coded in the code.
6. Implementation Checklist
- Estimate a per-request cap as “per-call cap × 20 + token cap,” then scale up for batches;
- Keep the prompt prefix stable and bring cache hit rate into your monitoring metrics;
- Schedule all non-real-time work into off-peak windows;
- Strip switches the server ignores from the request body and replace them with prompt constraints;
- Have rate limiting, backoff, and tracking identifiers all in place;
- Externalize unit prices and concurrency quotas as configuration so they can be hot-reloaded as prices and quotas change.
The conclusion: the cost controllability of this kind of service does not depend on whether the unit price is high or low, but on whether you understand two premises, that the server takes over parameters and that the two billing lines never merge. Write them into your design document, and both the bill and integration testing will go much more smoothly.
