Pricing and Access Methods for Flagship LLMs: From Billing Models to Engineering Integration

    This article breaks down the three-tier token pricing model used by major LLM APIs—input, output, and cache-hit tokens—and explains why cache-hit rates often matter more than per-token prices for cost control. It also covers practical integration paths for both non-developers and developers, along with strategies for improving cache hit rates and estimating real-world costs.

    Why the Billing Structure Matters More Than the Unit Price

    When moving large language models into production, cost evaluation often enters the decision-making process earlier than model capability. A common mistake is focusing only on the price per million tokens while ignoring how different billing tiers affect total cost. In practice, the relative weight of input tokens, output tokens, and cache-hit tokens varies significantly across use cases such as long conversations, multi-turn dialogue, code completion, and knowledge-base Q&A.

    In most scenarios, input token volume is far higher than output token volume. In retrieval-augmented generation or long-document analysis tasks, a single request may contain tens of thousands or even hundreds of thousands of input tokens, while the output consists of only a few hundred to a few thousand tokens. As a result, even if the output unit price is high, its impact on total cost may be lower than that of the input unit price.

    Cache hits are another easily overlooked variable. When the system prompt or context prefix remains stable, the server can reuse previously computed state, significantly reducing the processing overhead of repeated inputs. Cache-hit pricing is usually much lower than standard input pricing—sometimes only a few percent of the regular input rate. For multi-turn conversations, fixed system prompts, and batch evaluation jobs, the cache-hit rate directly determines whether actual costs stay within budget.

    For these reasons, when evaluating LLM API pricing, it is better to examine the three tiers separately and estimate costs based on your own token distribution, rather than simply comparing a single headline price.

    What the Three Billing Tiers Mean

    Current mainstream LLM APIs typically use three billing categories:

    1. Input tokens: All tokens sent to the model in a request, including system prompts, conversation history, document fragments, and tool definitions.
    2. Output tokens: Tokens generated by the model, including visible text, code, structured data, and potentially reasoning traces.
    3. Cache-hit tokens: The portion of input tokens that duplicates recently cached content, billed at a lower rate.

    Take the current public pricing of one flagship model as an example: input costs 6 yuan per million tokens, output costs 18 yuan per million tokens, and cache hits cost 0.3 yuan per million tokens. The three tiers use the same token counting method, without discrepancies such as input being counted under one encoding and output under another. This consistency matters for cost estimation, because some services apply different counting methods across tiers, causing actual charges to deviate from expectations.

    In terms of ratios, the output price is three times the input price, while cache hits cost only 5% of the standard input rate. This structure is particularly favorable for reducing costs in long-context scenarios through caching. For example, a customer service system with a fixed system prompt plus a knowledge-base context can achieve significantly lower total costs if the cache-hit rate is high, compared with paying the standard input rate for every request.

    What to Watch When Comparing Costs Across Models

    In flagship model price comparisons, figures like “10 US dollars per million output tokens” are common. At typical exchange rates, 10 US dollars is roughly 70-plus yuan. If another model charges 18 yuan for output, the former is about four times more expensive. This gap widens further in output-intensive tasks.

    However, a meaningful comparison should also account for the following:

    • Input-to-output price ratio: Some models have very cheap input but expensive output, making them suitable for tasks with short outputs and long inputs, and vice versa.
    • Cache policy differences: Whether a cache-hit price is offered, how long cached content remains valid, and how strictly cache hits are determined.
    • Context window limits: Long-context models naturally consume more input tokens, so pricing must be evaluated together with the maximum context length.
    • Generation quality and inference speed: A cheaper model that produces lower-quality output may require additional rounds of completion and correction, potentially raising total token consumption.
    • Additional capabilities: Whether features such as tool calling, structured output, and web search are included in the same pricing framework.

    Therefore, comparing only the output price per million tokens can serve as an initial screening signal, but it should not be the sole basis for final model selection. A more reliable approach is to build a small benchmark set that simulates the input-output length distribution and cache-hit ratio of real requests, then calculate the total cost.

    The Simplest Integration Path for Non-Developers

    For users who do not want to deal with API details, the fastest way to get started is to use a desktop application or coding assistant that supports model switching. Many intelligent workstations and programming assistants now provide a unified model selection interface, where users simply choose the target model from a dropdown list.

    A typical workflow looks like this:

    1. Open the intelligent workstation or programming assistant client.
    2. Enter the chat or code editing interface.
    3. Select “Hy4” or the corresponding flagship model name in the model picker.
    4. Start asking questions or coding normally, with no additional key configuration or billing setup required.

    This approach suits product managers, technical writers, junior developers, and anyone who needs to quickly validate a model’s capabilities. Desktop clients usually handle token counting, context management, and billing display, allowing users to focus on the task itself.

    API Integration Considerations for Developers

    For developers who need to integrate a model into their own systems, API access generally follows these steps:

    1. Complete identity verification and create a project.
    2. Obtain an access credential.
    3. Construct the request structure, specifying the model name, message list, and generation parameters.
    4. Parse the response structure to extract generated text and usage information.
    5. Verify costs based on the returned token statistics.

    A sample request structure looks like this:

    1. {
    2. "model": "hy4",
    3. "messages": [
    4. {
    5. "role": "system",
    6. "content": "You are a code review assistant for enterprise applications."
    7. },
    8. {
    9. "role": "user",
    10. "content": "Please review the exception handling logic in the following function."
    11. }
    12. ],
    13. "temperature": 0.2,
    14. "max_tokens": 1024
    15. }

    The response typically includes the generated content and token usage. Developers can record the input, output, and cache-hit token counts for each call to build cost monitoring data.

    How to Effectively Improve Cache Hit Rates

    Cache hits are key to controlling long-context costs. The following are some general optimization strategies:

    • Keep system prompts fixed: Place stable instructions, role definitions, and output format requirements at the beginning, and avoid frequent changes.
    • Maintain stable prefix structure: For multi-turn conversations, keep the order and format of historical messages as consistent as possible, and avoid inserting or deleting content in the middle that could affect cache matching.
    • Batch similar requests: For batch document processing, place common document fragments near the beginning of each request so that different requests share the same prefix.
    • Avoid unnecessary variation: Put dynamic content such as timestamps and random numbers after the cached segment to avoid breaking prefix consistency.

    It is worth noting that cache hits are not directly specified by users. The server automatically determines them based on repeated prefixes in recent requests. Therefore, keeping request prefixes stable is the core requirement for achieving a high cache-hit rate.

    Cost Estimation Example

    Assume a knowledge-base Q&A system where a single request contains an average of 80,000 input tokens. Of these, 70,000 tokens are fixed knowledge-base context billed as cache hits, and the remaining 10,000 tokens are dynamic questions and conversation history billed as standard input. The average output per request is 2,000 tokens.

    Based on the current public pricing:

    • Standard input: 10,000 tokens × 6 yuan / 1 million = 0.06 yuan
    • Cache hits: 70,000 tokens × 0.3 yuan / 1 million = 0.021 yuan
    • Output: 2,000 tokens × 18 yuan / 1 million = 0.036 yuan
    • Total cost per request: approximately 0.117 yuan

    If caching were unavailable and all 70,000 tokens were billed as standard input, the input cost would rise to 0.42 yuan, and the total cost per request would be approximately 0.456 yuan—a difference of nearly four times. This illustrates how significantly cache hits affect the actual cost of high-frequency, long-context tasks.

    Summary

    The new generation of flagship LLMs adopts a relatively pragmatic pricing structure: output is priced at three times the input rate, while cache hits cost only 5% of the standard input rate. This design is well suited to long-context, multi-turn dialogue, and enterprise knowledge-base scenarios. Non-developers can quickly get started by switching models in an intelligent workstation or programming assistant. Developers should focus on token distribution and cache-hit rates during integration, and base model selection on real workload cost estimates rather than a single unit price.