Million-Token Context LLMs: Selection Criteria and Low-Cost API Usage

    This article explains what long-context models can and cannot solve in knowledge base Q&A, long-document parsing, batch data processing, and long sessions. It then outlines key selection dimensions—context window and maximum output, multimodal support, caching and pricing structure, and stability/engineering friendliness—and provides a cost-estimation formula with a worked example.

    1. What Long Context Can and Cannot Solve

    Knowledge base Q&A, long-document parsing, batch data processing, and long sessions all run into context window limits. As the window grows, an entire book, a hundreds-of-page contract, or a long conversation can be sent to the model in one request, and cross-chapter relationships are easier to preserve.

    But engineering work cannot be skipped because of this. First, a model being able to receive more content does not mean it will use that content evenly. Many models make weaker use of information in the middle of long inputs, and key clauses may be overlooked. This phenomenon is often called attention dilution. Second, output length has its own independent limit; no matter how long the input is, a single answer may still be truncated. Third, the longer the input, the higher the cost and latency of each call.

    Therefore, long context can reduce simple chunking and concatenation code, but retrieval filtering, summary compression, result validation, and cost control are still necessary.

    2. Core Evaluation Dimensions for Model Selection

    1. Context Window and Maximum Output

    Window size only indicates how much content a model can read. During selection, you also need to confirm the maximum output length. If the window is very large but the output limit is only a few thousand tokens, generating a 10,000-word report still requires segmented generation and concatenation.

    Some models and providers offer longer output, such as 128K to 1M input with an output limit around 128K. However, these configurations vary by model version and provider and should not be treated as universal specifications. To verify them, check the official documentation for the corresponding version and then test with a real long document. If the returned finish_reason is stop, the output ended completely; if it is length, the output was truncated.

    2. Multimodal Support

    Many documents contain images, screenshots, scanned pages, or even video. If a model supports both text and image input, it can understand mixed text-and-image content in a single call, reducing additional OCR and vision-model pipelines.

    During selection, test whether long context and multimodality can take effect at the same time. The test set can include a 200-page scanned contract and several pages of charts, and you can observe whether the model can answer questions across pages. Token pricing for multimodal content is usually different from that for plain text, and image resolution affects billing, so verify it using bills or the usage field.

    3. Caching Mechanisms and Pricing Structure

    The cost of long-context calls is often concentrated on the input side. A typical pattern is prefix content—such as system prompts, knowledge base background, and long document bodies—remaining unchanged across multiple requests while only the user question changes. Caching mechanisms are designed for this situation.

    Billing usually includes four items: regular input, output, cache creation, and cache hits. The first time a prefix is written, a cache creation fee is charged; when subsequent requests reuse the prefix, a cache hit fee is charged. The hit unit price is usually much lower than the regular input unit price.

    Cache hits require several conditions and are not guaranteed every time:

    • The prefix content must be byte-for-byte identical; an extra space will cause a miss.
    • The cache has a time-to-live (TTL); after it expires, the cache must be created again.
    • The prefix length must reach the provider’s minimum token count.
    • Caches may not be shared across different regions, accounts, or concurrent requests.
    • Some providers require explicit cache declaration, while others handle it automatically.

    Savings increase roughly with the share of the repeated prefix and the discount rate; they do not grow exponentially. You can use the following formula for estimation:

    1. Monthly cost ≈ total non-repeated input × input unit price
    2. + total cache hits × cache hit unit price
    3. + total cache creation × cache creation unit price
    4. + total output × output unit price

    For example, assume 3,000 calls per month, with 150K input tokens per call. Of these, 140K are a repeated prefix and 10K are new questions, and each call produces 2K output tokens. The prefix is recreated once per day, for 30 creations in the month. The following prices are fictional, in CNY per million tokens: input CNY 1, cache hit CNY 0.1, cache creation CNY 1.25, and output CNY 4.

    • Non-repeated input: 10K × 3,000 = 30M, totaling CNY 30
    • Cache hits: 140K × 3,000 = 420M, totaling CNY 42
    • Cache creation: 140K × 30 = 4.2M, totaling CNY 5.25
    • Output: 2K × 3,000 = 6M, totaling CNY 24

    The total is approximately CNY 101.25. Without caching, all 450M input tokens would be billed at CNY 1, for an input cost of CNY 450, plus CNY 24 for output, for a total of CNY 474. In this example, the repeated prefix accounts for more than 90%, so the savings are significant. If the repeated prefix accounts for only 20%, the savings will be much smaller. During actual selection, replace these numbers with the provider’s real unit prices.

    4. Stability and Engineering Friendliness

    • Native API compatibility: