---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://www.getmaxim.ai/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
description: Chain of thought prompting improves LLM reasoning but multiplies output tokens and latency. See the math, plus budgets, caching, and routing to control it.
title: "Chain of Thought Prompting: Managing Token Costs and Latency"
image: https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/12/chain-of-thought-prompting-managing-token-costs-and-latency-bifrost-1920x1080.png
---

![](https://www.getmaxim.ai/bifrost/marketing/aOhxVLsIL8ZR051adYarj9eFkpg.png)

[Try Bifrost Enterprise free for 14 days.](https://www.getmaxim.ai/#enterprise-trial)Try Bifrost Enterprise free for 14 days.

[Request access](https://www.getmaxim.ai/#enterprise-trial)

**TL;DR**

- Chain of thought prompting asks an LLM to write intermediate reasoning steps before its final answer, which improves accuracy on multi-step reasoning tasks.
- Every reasoning step is an output token, so in the illustrative example below zero-shot CoT costs 3x a direct answer and five-sample self-consistency costs over 23x.
- Reasoning models generate their chain of thought internally and bill those hidden tokens as output, even when the response shows only a summary.
- Bifrost caps the spend at the gateway with hierarchical budgets and token rate limits, semantic caching, and routers that send simple requests to cheaper models.

Chain of thought prompting raises LLM accuracy on multi-step problems by making the model write out its reasoning, and every reasoning token is billed and generated in sequence. [Bifrost](https://www.getmaxim.ai), the [open-source AI gateway](https://github.com/maximhq/bifrost) built by Maxim AI, sits between applications and model providers, which makes it the layer where that spend can be measured, capped, cached, and routed. This guide explains the technique, its variants, how reasoning models changed the token bill, and how to control cost and latency in production.

## What Is Chain of Thought Prompting?

Chain of thought prompting is a prompt engineering technique that instructs a large language model to produce intermediate reasoning steps before its final answer. Instead of mapping a question straight to an answer, the model writes out the steps, and the answer is conditioned on that reasoning.

[Wei et al. (2022)](https://arxiv.org/abs/2201.11903) introduced the technique and showed that prompting a 540B-parameter model with eight chain of thought exemplars reached state-of-the-art accuracy on the GSM8K math benchmark, surpassing a fine-tuned GPT-3 with a verifier. The gains appeared in sufficiently large models.

![Two request lanes: a standard prompt goes straight to a short answer, while a chain of thought prompt produces billed reasoning steps before the final answer](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/chain-of-thought-prompting-token-costs/chain-of-thought-prompting-token-costs-token-path.png)

Two request lanes: a standard prompt goes straight to a short answer, while a chain of thought prompt produces billed reasoning steps before the final answer

*Figure 1: Chain of thought prompting moves most of the cost to the output side, where every token is generated one at a time.*

As Figure 1 shows, the input grows only slightly while the output grows by the length of the reasoning. For teams working through [strategies for reducing LLM token usage](https://www.getmaxim.ai/articles/top-5-strategies-to-reduce-llm-token-usage-and-costs/), chain of thought can become the largest source of output tokens in a workload.

## Chain of Thought Prompting Examples: Zero-Shot, Few-Shot, and Self-Consistency

The three common chain of thought variants differ in where the extra tokens appear. Zero-shot CoT adds one instruction. Few-shot CoT adds worked examples to every input. Self-consistency samples several reasoning paths and votes on the answer, multiplying tokens by the number of samples.

**Zero-shot chain of thought.** [Kojima et al. (2022)](https://arxiv.org/abs/2205.11916) showed that adding "Let's think step by step" with no examples raised GSM8K accuracy from 10.4% to 40.7% and MultiArith from 17.7% to 78.7% on text-davinci-002:

```
Q: A warehouse ships 340 orders on Monday and 15% more on Tuesday.
How many orders ship across both days?
A: Let's think step by step.
```

**Few-shot chain of thought.** The original Wei et al. setup sends several solved examples, each with its reasoning, before the new question. The exemplars ride along on every request, but as a stable prefix they suit [provider-side prompt caching](https://www.getmaxim.ai/articles/prompt-caching/).

**Self-consistency.** Wang et al. (2022) replaced greedy decoding with sampling several reasoning paths and choosing the most consistent answer. Each extra path is a full generation.

| Variant | Prompt change | Extra input tokens | Extra output tokens | Calls per answer |
| --- | --- | --- | --- | --- |
| Zero-shot CoT | One instruction | A few | Full reasoning chain | 1 |
| Few-shot CoT | Worked examples with reasoning | All exemplars | Full reasoning chain | 1 |
| Self-consistency | CoT prompt sampled N times | Prompt x N as separate calls | Reasoning x N | N |
| Reasoning model | Effort or token budget parameter | None | Hidden reasoning, often thousands | 1 |

## How Reasoning Models Changed Chain of Thought

Reasoning models generate a chain of thought internally by default, so request parameters such as reasoning effort and thinking budgets, not prompt wording, set how much reasoning happens. The reasoning is hidden or summarized in the response, yet it is billed as output tokens and adds generation time.

OpenAI's [reasoning guide](https://developers.openai.com/api/docs/guides/reasoning) states that reasoning tokens are not visible through the API, occupy context window space, are billed as output tokens, and can range from a few hundred to tens of thousands per request. Anthropic's [thinking cost guidance](https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost) states that billed output tokens do not match visible tokens, because billing covers the full internal thinking rather than the returned summary.

![A request enters a reasoning model, which generates hidden reasoning tokens and a visible answer; both are billed as output and reported in the usage object](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/chain-of-thought-prompting-token-costs/chain-of-thought-prompting-token-costs-hidden-reasoning.png)

A request enters a reasoning model, which generates hidden reasoning tokens and a visible answer; both are billed as output and reported in the usage object

*Figure 2: With reasoning models, the chain of thought is generated by default and billed as output even when the response returns only a summary.*

The usage object on each response is the only reliable record of reasoning spend. Bifrost records token counts, cost, and latency per request in its [built-in request logs](https://docs.getbifrost.ai/features/observability/default), the basis for [tracking token usage across providers and teams](https://www.getmaxim.ai/articles/tracking-llm-token-usage-across-providers-teams-and-workloads/).

## The Token Cost of Chain of Thought Reasoning: A Worked Example

Chain of thought reasoning multiplies cost mainly through output tokens. At illustrative rates, zero-shot CoT costs 3x a direct answer, few-shot CoT 4.7x, a reasoning model with 2,000 hidden tokens 12.4x, and five-sample self-consistency 23.6x. Latency grows with output length the same way.

**Illustrative assumptions, not any vendor's prices:** $1.00 per million input tokens and $4.00 per million output tokens for every row; a 500-token prompt and 50-token answer; zero-shot CoT adds 10 input and 350 reasoning tokens; few-shot CoT adds eight 150-token exemplars; self-consistency runs the few-shot prompt five times; the reasoning model generates 2,000 hidden tokens; generation runs at 100 tokens per second after 0.4 seconds to first token. Real rates differ by model.

| Approach | Input | Output | Cost per 1M requests | vs. direct | Latency |
| --- | --- | --- | --- | --- | --- |
| Direct answer | 500 | 50 | $700 | 1.0x | 0.9 s |
| Zero-shot CoT | 510 | 400 | $2,110 | 3.0x | 4.4 s |
| Few-shot CoT | 1,700 | 400 | $3,300 | 4.7x | 4.4 s |
| Self-consistency (5) | 8,500 | 2,000 | $16,500 | 23.6x | 4.4 s parallel, 21.6 s serial |
| Reasoning model | 500 | 2,050 | $8,700 | 12.4x | 20.9 s |

Cost per request is (input tokens x input rate + output tokens x output rate) / 1,000,000; latency is time to first token plus output tokens divided by generation speed. The "think step by step" instruction itself costs almost nothing; the reasoning it causes is the expense. Self-consistency can run in parallel to hold latency flat, but its token cost scales with every sample. To repeat the math with real rates, the [Bifrost LLM cost calculator](https://www.getmaxim.ai/bifrost/llm-cost-calculator) lists per-provider pricing.

## When Chain of Thought Is Worth the Tokens

Chain of thought pays for itself on tasks with several dependent steps, such as math, multi-hop questions, planning, and multi-file code changes. It adds cost with little benefit on classification, extraction, short rewrites, and lookups, where a direct answer from a smaller model is usually enough.

- **Direct answer:** intent classification, entity extraction, formatting, short factual replies.
- **Zero-shot CoT or low reasoning effort:** moderate multi-step questions with tight latency budgets.
- **Self-consistency or high effort:** high-value requests where a wrong answer costs more than the tokens.

Enforcing this across many applications is a routing problem, not a prompting problem, and [model routing by request complexity](https://www.getmaxim.ai/articles/what-is-an-llm-router-how-model-routing-works/) is one of the [main ways to cut LLM token costs](https://www.getmaxim.ai/articles/top-5-strategies-to-reduce-llm-token-usage-and-costs/) without rewriting prompts.

## Budgets and Rate Limits for Reasoning Traffic

[The Bifrost AI gateway](https://www.getmaxim.ai) provides hierarchical budget allocation through virtual keys, teams, and customers, with optional budgets on each provider config inside a virtual key. Each applicable budget is checked independently, all must pass for a request to proceed, and the request's cost is deducted from every level.

[Virtual keys](https://docs.getbifrost.ai/features/governance/virtual-keys) travel in the `x-bf-vk` header, so every reasoning request is attributed to its key, and to the team and customer above it where attached, before reaching a provider.

![A request carrying a virtual key is checked against provider config, virtual key, team, and customer budgets and token rate limits in Bifrost before reaching the provider](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/chain-of-thought-prompting-token-costs/chain-of-thought-prompting-token-costs-budget-hierarchy.png)

A request carrying a virtual key is checked against provider config, virtual key, team, and customer budgets and token rate limits in Bifrost before reaching the provider

*Figure 3: Every applicable budget must pass and the cost is deducted at each level, so a reasoning-heavy key cannot overspend its team or customer.*

Two controls in [Bifrost budgets and limits](https://docs.getbifrost.ai/features/governance/budget-and-limits) map to chain of thought costs:

- **Budgets** cap dollar spend per level, with reset durations from `1m` to `1Y` ( `1Q` for budgets only) and optional calendar alignment in UTC.
- **Token rate limits** cap prompt plus completion tokens per window at the provider config, virtual key, team, and customer levels. Reasoning tokens are output tokens, so a token limit bounds reasoning volume directly.

Budgets are checked before a request and deducted after it, so one long reasoning response can overshoot a limit and block the next request; a token rate limit narrows that overshoot. [Routing rules](https://docs.getbifrost.ai/providers/routing-rules) can read `budget_used` as a percentage, so `budget_used > 90` can shift traffic to a cheaper provider first. See the [governance resource guide](https://www.getmaxim.ai/resources/governance) and [hierarchical spend controls with virtual keys](https://www.getmaxim.ai/articles/llm-budget-management-virtual-keys-and-hierarchical-spend-controls/) for setup.

## Semantic Caching for Repeated Reasoning Requests

Semantic caching removes the reasoning cost of repeated questions: when Bifrost serves a cached response, the provider is never called, so no reasoning tokens are generated or billed. It suits support and FAQ traffic, where many users ask the same multi-step question in different words.

Bifrost [semantic caching](https://docs.getbifrost.ai/features/semantic-caching) runs an exact hash match first, then an optional similarity search (default threshold 0.8). It covers chat completions, text completions, the Responses API, embeddings, transcriptions, speech, and image generation, including streaming. Defaults that matter for reasoning workloads:

- **A cache key is required**, via the `x-bf-cache-key` header or a configured default.
- **Conversations longer than three messages are skipped** by default, so single-turn questions benefit most.
- **Tool-call responses are not cached** by default, and entries are scoped to the identity that wrote them.
- **A semantic miss adds an embedding call** on top of the full LLM call.

Reasoning responses are among the most expensive responses to regenerate, which makes them strong cache candidates; [how semantic caching cuts token spend](https://www.getmaxim.ai/articles/semantic-caching-for-llms-how-to-cut-token-spend-with-ai-gateways/) covers threshold tuning.

## Model Routing: Sending Simple Requests to Cheaper Models

Model routing cuts chain of thought cost by sending only hard requests to reasoning models. Routers in [the open-source Bifrost gateway](https://www.getmaxim.ai) classify each request as Simple, Medium, or Complex and send each tier to its own model, so classification traffic reaches a low-cost model while planning requests reach a reasoning model.

A Bifrost [router](https://docs.getbifrost.ai/features/routers) pairs a classifier with a model per tier and a scope (global, team, customer, or virtual key; individual users on Enterprise). Routers replace the deprecated Complexity Router in v3.0.0. Classifier options trade accuracy against added latency: a decision model (Typesafe Jev typically answers in 600 to 800 ms), a semantic classifier using 150 shipped reference phrases (usually much faster), or an LLM classifier (slowest).

![Requests enter a Bifrost router whose classifier assigns Simple, Medium, or Complex tiers, sending each tier to a low-cost model, a mid-tier model, or a reasoning model](https://articles-images-cdn.t3.tigrisfiles.io/diagrams/chain-of-thought-prompting-token-costs/chain-of-thought-prompting-token-costs-router-tiers.png)

Requests enter a Bifrost router whose classifier assigns Simple, Medium, or Complex tiers, sending each tier to a low-cost model, a mid-tier model, or a reasoning model

*Figure 4: Only requests classified as Complex pay for extended reasoning; the rest go to models that generate far fewer output tokens.*

In the worked example, every Simple request answered directly costs $700 per million instead of $8,700 on a reasoning model.

Reasoning effort can be tiered the same way. Bifrost accepts one OpenAI-compatible `reasoning` object with `effort` and `max_tokens` and [converts it per provider](https://docs.getbifrost.ai/providers/reasoning), for example to Anthropic's `thinking.budget_tokens` (minimum 1,024), so Medium can run at low effort and Complex at high effort across [10,000+ models from 35+ providers](https://docs.getbifrost.ai/providers/supported-providers/overview).

Gateway overhead is under 200 microseconds per request at 5,000 RPS in the published [Bifrost benchmarks](https://www.getmaxim.ai/resources/benchmarks), negligible next to multi-second reasoning. The [LLM router resource page](https://www.getmaxim.ai/resources/llm-router) and the [complexity router benchmark post](https://www.getmaxim.ai/bifrost/blog/benchmarking-bifrosts-upgraded-complexity-router) cover setup and accuracy.

## Frequently Asked Questions

### What is chain of thought prompting?

Chain of thought prompting asks a large language model to write intermediate reasoning steps before its final answer. Introduced by Wei et al. in 2022, it improves accuracy on arithmetic, commonsense, and symbolic reasoning. The trade-off is cost and latency, because every reasoning step is generated and billed as output tokens.

### What is zero-shot chain of thought?

Zero-shot chain of thought adds an instruction such as "Let's think step by step" to a prompt without worked examples. Kojima et al. showed it raised GSM8K accuracy from 10.4% to 40.7% on text-davinci-002. It adds only a few input tokens, but the reasoning it triggers adds hundreds of output tokens.

### What is self-consistency prompting?

Self-consistency prompting samples several chain of thought reasoning paths for one question and returns the answer that appears most often. It improves accuracy over a single chain, but each path is a full generation, so token cost scales linearly with the number of samples, making it the most expensive common variant.

### What is reasoning effort?

Reasoning effort is a request parameter that sets how much hidden chain of thought a reasoning model generates, usually as levels such as low, medium, and high. Some providers use a thinking token budget instead. Bifrost accepts both in one `reasoning` object and maps them to each provider's native field.

### Why does chain of thought increase latency?

Models generate output tokens one at a time, so response time grows with output length. Chain of thought adds hundreds or thousands of reasoning tokens before the answer, and with reasoning models those tokens come before the first visible token, increasing the wait a user sees even for short answers.

### How can teams reduce the cost of chain of thought reasoning?

Teams reduce chain of thought costs by reserving reasoning for complex requests, capping effort and thinking budgets, caching repeated questions, and enforcing budgets and token rate limits. Bifrost applies all four at the gateway, alongside the [cost controls in Bifrost AI governance](https://www.getmaxim.ai/ai-governance).

## Getting Started with Bifrost

Chain of thought prompting and reasoning models trade tokens and time for accuracy, and the trade pays off only when reasoning goes to requests that need it. Bifrost gives platform teams one place to enforce that with hierarchical budgets, token rate limits, semantic caching, and complexity routers across every [LLM gateway](https://www.getmaxim.ai/llm-gateway) route. To see these controls on your workloads, [book a demo](https://www.getmaxim.ai/book-a-demo) with the Bifrost team.

## Read next

[![Fine-Tuning vs Prompt Engineering: When to Fine-Tune an LLM](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/12/fine-tuning-vs-prompt-engineering-when-to-fine-tune-an-llm-bifrost-1920x1080.png) Fine-tuning vs prompt engineering is a choice between changing a model's weights and changing what each request sends. This guide compares cost and benefit with a decision table, current vendor pricing, break-even math, and a method for measuring ROI at the gateway.](https://www.getmaxim.ai/articles/fine-tuning-vs-prompt-engineering/)

[![What Is Meta-Prompting? A Guide for AI Platform Engineers](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/12/what-is-meta-prompting-a-guide-for-ai-platform-engineers-bifrost-1920x1080.png) Meta-prompting is a technique where language models write, structure, or coordinate prompts for other model calls. This guide covers the three research definitions, how failure rates compound across long chains, and the retries, fallbacks, and prompt versioning that keep them running.](https://www.getmaxim.ai/articles/meta-prompting-2/)

[![Kubernetes Ingress for AI Gateways: Best Practices](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/12/kubernetes-ingress-for-ai-gateways-best-practices-bifrost-1920x1080.png) Kubernetes Ingress exposes HTTP and HTTPS routes from outside a cluster to Services inside it. This guide covers the ingress definition, Ingress vs Gateway API after the ingress-nginx retirement, and how to configure streaming, timeouts, and rate limits for a self-hosted AI gateway.](https://www.getmaxim.ai/articles/kubernetes-ingress-ai-gateway/)

## More in AI Gateway

[![What Is Meta-Prompting? A Guide for AI Platform Engineers](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/12/what-is-meta-prompting-a-guide-for-ai-platform-engineers-bifrost-1920x1080.png) Meta-prompting is a technique where language models write, structure, or coordinate prompts for other model calls. This guide covers the three research definitions, how failure rates compound across long chains, and the retries, fallbacks, and prompt versioning that keep them running.](https://www.getmaxim.ai/articles/meta-prompting-2/)

[![Fine-Tuning vs Prompt Engineering: When to Fine-Tune an LLM](https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w720/2026/12/fine-tuning-vs-prompt-engineering-when-to-fine-tune-an-llm-bifrost-1920x1080.png) Fine-tuning vs prompt engineering is a choice between changing a model's weights and changing what each request sends. This guide compares cost and benefit with a decision table, current vendor pricing, break-even math, and a method for measuring ROI at the gateway.](https://www.getmaxim.ai/articles/fine-tuning-vs-prompt-engineering/)

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "publisher": {
        "@type": "Organization",
        "name": "Maxim Articles",
        "url": "https://www.getmaxim.ai/articles/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png",
            "width": 60,
            "height": 60
        }
    },
    "author": {
        "@type": "Person",
        "name": "Kuldeep Paul",
        "image": {
            "@type": "ImageObject",
            "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/2025/08/1727978381919.jpeg",
            "width": 800,
            "height": 800
        },
        "url": "https://www.getmaxim.ai/articles/author/kuldeep/",
        "sameAs": [
            "https://www.linkedin.com/in/kuldeep-paul"
        ]
    },
    "headline": "Chain of Thought Prompting: Managing Token Costs and Latency",
    "url": "https://www.getmaxim.ai/articles/chain-of-thought-prompting-managing-token-costs-and-latency/",
    "datePublished": "2026-12-03T06:14:00.000Z",
    "dateModified": "2026-12-05T06:40:24.000Z",
    "image": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w1200/2026/12/chain-of-thought-prompting-managing-token-costs-and-latency-bifrost-1920x1080.png",
        "width": 1200,
        "height": 675
    },
    "keywords": "AI Gateway",
    "description": "Chain of thought prompting asks a model to write intermediate reasoning steps before its answer, which improves accuracy and raises output tokens. This guide covers zero-shot, few-shot, and self-consistency variants, how reasoning models bill hidden thinking, and how to cap the cost at the gateway.",
    "mainEntityOfPage": "https://www.getmaxim.ai/articles/chain-of-thought-prompting-managing-token-costs-and-latency/"
}
{
    "@context": "https://schema.org",
    "@type": "Organization",
    "@id": "https://www.getmaxim.ai/articles/#organization",
    "name": "Maxim Articles",
    "url": "https://www.getmaxim.ai/articles/",
    "logo": {
        "@type": "ImageObject",
        "url": "https://storage.ghost.io/c/84/03/8403f2f6-141c-411a-8f55-a32d4291533e/content/images/size/w256h256/2025/08/thumbnail.png"
    },
    "sameAs": [
        "https://www.linkedin.com/company/maxim-ai",
        "https://github.com/maximhq",
        "https://x.com/getbifrost",
        "https://www.youtube.com/@getmaximai"
    ]
}
```
