Skip to contentমূল লেখায় যান

Topic 05 · AI conceptsটপিক 05 · AI concepts

Inference Economics

A taxi meter counts each kilometre, but you care about the price of the whole trip. A model API bills each token, but your team cares about the price of each finished task. This page shows how the bill is made, which levers cut it, and how a tester measures it.

9 min read9 মিনিটে পড়া যায় · 8 sections8টি সেকশন · 10 sources10টি সোর্স · updated Nov 2026আপডেট: Nov 2026

One night of triage, pricedএক রাতের triage, দাম ধরে

Stack caching and batch discounts on 200 calls and watch the bill shrink. Then stretch the gap and watch it grow.200টা call-এ ক্যাশ আর batch ছাড় একসাথে দিন, বিল কমতে দেখুন। তারপর ফাঁক বাড়ান, বিল বাড়তে দেখুন।

3 min3 মিনিট8 steps8টি ধাপ
  • Per callপ্রতি কল$0.056
  • Totalমোট$0.056
  • Callsকল1
$0.056 / call$0.056/কলNightly runরাতের রানModelমডেলfull rateপুরো রেট$0.056 · 1 call$0.056 · 1টি callCacheক্যাশprefix · 20,000prefix · 20,000log · 3,000লগ · 3,000output · 1,000আউটপুট · 1,000No cacheক্যাশ ছাড়া$0.056Batch onlyশুধু batchCache onlyশুধু ক্যাশCache + batchক্যাশ + batchCache, 6 min gapক্যাশ, 6 min ফাঁকbars: the price of one callবার: একটা call-এর দাম

You’ll learnআপনি শিখবেন

  • How a call is priced: tokens times ratecall-এর দাম কীভাবে হয়: token গুণ রেট✓
  • Why call 1 costs more but calls 2-200 cost lessকেন call 1 বেশি কিন্তু call 2-200 কম লাগে
  • That batch and cache prices stackbatch আর ক্যাশের দাম একসাথে কমে
  • Why a gap over 5 minutes loses the saving5 মিনিটের বেশি ফাঁকে কেন সাশ্রয় হারায়

In plain words

Inference is one run of a trained model: you send a prompt, and the model sends back an answer. A model API bills inference by tokens, the small pieces of text that the model reads and writes. Prices are given per million tokens (MTok) Source 1সোর্স 1.

The bill has a few parts:

  • Input tokens: the prompt, the system prompt, tool definitions, and the history that you send.
  • Output tokens: the answer, the tool calls, and the thinking. Thinking tokens are billed as output tokens Source 5সোর্স 5.
  • Cache tokens: input that the provider stored from an earlier request and reads again at a lower price Source 1সোর্স 1.

For the two list prices below, an output token costs 5 times an input token. Claude Sonnet 5.5 costs $2 per MTok for input and $10 per MTok for output Source 1সোর্স 1. OpenAI's gpt-6.1-sol has the same list price: $2.00 and $10.00 per 1M tokens for short prompts (272K input tokens or fewer). Above that, it is $4.00 and $15.00 Source 6সোর্স 6. These ratios belong to one provider, one model, and one date (2026-10-28). Check the current price page before you plan a budget.

One call is not the unit that matters. An agent can make many calls, retry, and still fail. So the useful number is the cost per finished task: the total spend divided by the number of tasks that really succeeded. This metric is the tutorial's own framing, not a vendor term.

সহজ English

Inference is one run of a trained model. You send a prompt, and the model sends back an answer. A model API bills inference by tokens. Tokens are small pieces of text that the model reads and writes. Prices are given per million tokens (MTok) Source 1সোর্স 1.

The bill has a few parts:

  • Input tokens: everything you send. That is the prompt, the system prompt, the tool definitions, and the history.
  • Output tokens: everything the model makes. That is the answer, the tool calls, and the thinking. Thinking is billed as output Source 5সোর্স 5.
  • Cache tokens: input that the provider kept from an earlier request. It reads them again at a lower price Source 1সোর্স 1.

For the two list prices below, one output token costs 5 times one input token. Claude Sonnet 5.5 costs $2 per MTok for input and $10 per MTok for output Source 1সোর্স 1. OpenAI's gpt-6.1-sol has the same list price for short prompts Source 6সোর্স 6. These numbers are true for one provider, one model, and one date (2026-10-28). Check the price page again before you plan a budget.

One call is not what matters. An agent can make many calls, try again, and still fail. So count the cost per finished task: all the money spent, divided by the tasks that really worked. This idea is the tutorial's own, not a vendor term.

বাংলা ব্যাখ্যা

Inference মানে একটা ট্রেইন করা মডেলের একবার চলা। আপনি একটা prompt পাঠান, মডেল একটা উত্তর ফেরত দেয়। মডেল API এই inference-এর বিল করে token দিয়ে। Token হলো লেখার ছোট ছোট টুকরো, যা মডেল পড়ে আর লেখে। দাম দেওয়া থাকে প্রতি মিলিয়ন token (MTok) হিসেবে Source 1সোর্স 1।

বিলের কয়েকটা অংশ আছে:

  • Input token: আপনি যা পাঠান। যেমন prompt, system prompt, tool definition, আর আগের কথোপকথন।
  • Output token: মডেল যা বানায়। যেমন উত্তর, tool call, আর thinking। Thinking token-এর বিল হয় output token হিসেবে Source 5সোর্স 5।
  • Cache token: আগের রিকুয়েস্ট থেকে প্রোভাইডার যে input রেখে দিয়েছে। সেটা আবার পড়লে দাম কম পড়ে Source 1সোর্স 1।

নিচের দুটো লিস্ট প্রাইসে একটা output token-এর দাম একটা input token-এর ৫ গুণ। Claude Sonnet 5.5-এ input প্রতি MTok $2, output প্রতি MTok $10 Source 1সোর্স 1। OpenAI-এর gpt-6.1-sol-এর ছোট prompt-এর লিস্ট প্রাইসও একই Source 6সোর্স 6। এই হিসাব একটা প্রোভাইডার, একটা মডেল আর একটা তারিখের (2026-10-28)। বাজেট করার আগে আপনি বর্তমান দামের পেজ আবার দেখে নিন।

একটা call আসল হিসাব নয়। একটা agent অনেক call করতে পারে, আবার চেষ্টা করতে পারে, তবুও ফেল করতে পারে। তাই আপনি গুনুন cost per finished task: মোট খরচকে সত্যিই সফল task-এর সংখ্যা দিয়ে ভাগ করুন। এই ধারণাটা টিউটোরিয়ালের নিজের, কোনো vendor-এর শব্দ নয়।

How it works

Each request goes through the same meter. The provider counts the tokens of each kind and multiplies each count by its own price.

request
  |-- shared prefix (system prompt, tools, docs)
  |       cache hit?  yes -> cache read price (cheap)
  |                   no  -> cache write price (a bit more than input)
  |-- new input (this test's log)        -> input price
  '-- output (thinking + text + tool calls) -> output price (highest)
                                             |
                                    sum of all parts = cost of the call

Prompt caching. The provider stores a prompt prefix and reuses it when the next request starts with the same prefix Source 2সোর্স 2. On the Claude API, a 5-minute cache write costs 1.25x the base input price, and a 1-hour write costs 2x. A cache read costs 0.1x on most models Source 1সোর্স 1. It costs 0.05x on Claude Opus 5.5 and Sonnet 5.5, and 0.025x on Claude Fable 5.2, Mythos 5.2, Fable 5.1 and Mythos 5.1 Source 1সোর্স 1. The default lifetime is 5 minutes, and each use refreshes it at no cost Source 2সোর্স 2. The response reports cache_creation_input_tokens, cache_read_input_tokens, and input_tokens. Their sum is the total input Source 2সোর্স 2. OpenAI turns caching on by default and gives cached input a discount of up to 95%. Its response reports usage.input_tokens_details.cached_tokens Source 7সোর্স 7.

সহজ English

Each request goes through the same meter. The provider counts each kind of token. Then it multiplies each count by its own price and adds them up.

The parts are these. A shared start of the prompt (the system prompt, the tools, the docs) is cheap if the cache has it. The new input (for example, the log of one test) costs the input price. The output (thinking, text, and tool calls) costs the most.

Prompt caching. The provider keeps the start of a prompt, the prefix. It reuses the prefix when the next request starts the same way Source 2সোর্স 2. On the Claude API, writing to the 5-minute cache costs 1.25 times the normal input price. Writing to the 1-hour cache costs 2 times. Reading from the cache costs 0.1 times on most models. It costs 0.05 times on Claude Opus 5.5 and Sonnet 5.5, and 0.025 times on Claude Fable 5.2, Mythos 5.2, Fable 5.1 and Mythos 5.1 Source 1সোর্স 1. The cache lives for 5 minutes by default. Each use starts the clock again for free Source 2সোর্স 2. The response tells you how many tokens were written to the cache, read from it, or not cached Source 2সোর্স 2. OpenAI turns caching on by default. It takes up to 95% off cached input and reports cached_tokens Source 7সোর্স 7.

বাংলা ব্যাখ্যা

প্রতিটা রিকুয়েস্ট একই মিটারের মধ্য দিয়ে যায়। প্রোভাইডার প্রতিটা ধরনের token গোনে। তারপর প্রতিটা সংখ্যাকে তার নিজের দাম দিয়ে গুণ করে যোগ করে।

অংশগুলো এই রকম। Prompt-এর শেয়ার করা শুরুর অংশ (system prompt, tool, ডকুমেন্ট) cache-এ থাকলে সস্তা পড়ে। নতুন input (যেমন একটা টেস্টের log) input-এর দামে যায়। Output (thinking, লেখা, tool call)-এর দাম সবচেয়ে বেশি।

Prompt caching. প্রোভাইডার prompt-এর শুরুর অংশ, মানে prefix, রেখে দেয়। পরের রিকুয়েস্ট একইভাবে শুরু হলে সে prefix আবার ব্যবহার করে Source 2সোর্স 2। Claude API-তে 5 মিনিটের cache-এ লিখতে সাধারণ input দামের 1.25 গুণ লাগে। 1 ঘণ্টার cache-এ লিখতে লাগে 2 গুণ। বেশিরভাগ মডেলে cache থেকে পড়তে লাগে 0.1 গুণ। Claude Opus 5.5 আর Sonnet 5.5-এ লাগে 0.05 গুণ, আর Claude Fable 5.2, Mythos 5.2, Fable 5.1 ও Mythos 5.1-এ 0.025 গুণ Source 1সোর্স 1। ডিফল্টভাবে cache 5 মিনিট থাকে। প্রতিবার ব্যবহারে ঘড়ি বিনা খরচে আবার শুরু হয় Source 2সোর্স 2। Response আপনাকে বলে কতগুলো token cache-এ লেখা হলো, cache থেকে পড়া হলো, আর কতগুলো cache হয়নি Source 2সোর্স 2। OpenAI ডিফল্টভাবে caching চালু রাখে। Cached input-এ সর্বোচ্চ 95% ছাড় দেয় আর cached_tokens রিপোর্ট করে Source 7সোর্স 7।

Batching and Effort

Batching. A batch API runs many requests later, not now. The Claude Message Batches API gives 50% off input and output tokens Source 1সোর্স 1. Most batches finish within 1 hour Source 3সোর্স 3. A batch expires if it does not finish within 24 hours Source 3সোর্স 3. OpenAI's Batch API also gives a 50% discount, with a 24-hour completion window Source 8সোর্স 8. On the Claude API, the cache multipliers stack with the batch discount Source 1সোর্স 1.

Effort. The Claude effort setting changes how many tokens the model spends. It affects all output tokens: text, tool calls, and thinking Source 4সোর্স 4. It is a signal, not a strict budget Source 4সোর্স 4. Most Claude models default to high Source 4সোর্স 4. Claude Opus 5.5 and Haiku 5.5 default to medium Source 4সোর্স 4. The hard limit on output is max_tokens, which covers thinking and text together Source 5সোর্স 5.

সহজ English

Batching. A batch API runs many requests later, not right now. The Claude batch API takes 50% off input and output Source 1সোর্স 1. Most batches finish within 1 hour. A batch that does not finish in 24 hours expires Source 3সোর্স 3. OpenAI's batch API also takes 50% off and has a 24-hour window Source 8সোর্স 8. On the Claude API, you can get the cache price and the batch discount together Source 1সোর্স 1.

Effort. The Claude effort setting changes how many tokens the model spends. It changes all output: text, tool calls, and thinking Source 4সোর্স 4. It is a hint, not a strict limit Source 4সোর্স 4. Most Claude models start at high. Claude Opus 5.5 and Haiku 5.5 start at medium Source 4সোর্স 4. The real hard limit is max_tokens. It covers thinking and text together Source 5সোর্স 5.

বাংলা ব্যাখ্যা

Batching. Batch API অনেক রিকুয়েস্ট এখনই নয়, পরে চালায়। Claude-এর batch API input আর output-এ 50% ছাড় দেয় Source 1সোর্স 1। বেশিরভাগ batch 1 ঘণ্টার মধ্যে শেষ হয়। 24 ঘণ্টায় শেষ না হলে batch expire হয়ে যায় Source 3সোর্স 3। OpenAI-এর batch API-ও 50% ছাড় দেয়, আর তার সময়সীমা 24 ঘণ্টা Source 8সোর্স 8। Claude API-তে cache-এর দাম আর batch-এর ছাড় একসাথে পাওয়া যায় Source 1সোর্স 1।

Effort. Claude-এর effort সেটিং ঠিক করে মডেল কত token খরচ করবে। এটা সব output-এ প্রভাব ফেলে: লেখা, tool call আর thinking Source 4সোর্স 4। এটা একটা ইঙ্গিত, কড়া সীমা নয় Source 4সোর্স 4। বেশিরভাগ Claude মডেল high দিয়ে শুরু করে। Claude Opus 5.5 আর Haiku 5.5 শুরু করে medium দিয়ে Source 4সোর্স 4। আসল কড়া সীমা হলো max_tokens। এটা thinking আর লেখা দুটো মিলিয়ে গোনে Source 5সোর্স 5।

Trade-offs

Each lever saves money and costs something else.

LeverSavesCosts
Prompt cacheCheap reads of a repeated prefix Source 1সোর্স 1A write costs more than plain input (1.25x or 2x on Claude) Source 1সোর্স 1. Prompts below a minimum length are not cached, and the API returns no error Source 2সোর্স 2.
Batch API50% on input and output Source 1সোর্স 1Results can take up to 24 hours Source 3সোর্স 3. Not for a user who waits.
Lower effortFewer output tokens Source 4সোর্স 4Some loss of capability Source 4সোর্স 4. Changing the top-level output_config.effort between requests can invalidate the cache. On models with per-message effort, send the change in a system message instead and the cache stays intact Source 2সোর্স 2.
Smaller modelLower price per token (Claude Haiku 5.5 is $0.10 / $0.50 per MTok for prompts up to 100K tokens, Opus 5.5 is $4 / $20) Source 1সোর্স 1It can fail more tasks.

The 5-minute cache pays off after one read, and the 1-hour cache after two reads Source 1সোর্স 1. So caching helps only when the same prefix comes back soon.

The last two rows show the main trap. A cheaper call that fails more often can make the finished task more expensive. You find out only when you measure success and cost together.

সহজ English

Each way to save money has a price of its own.

The 5-minute cache pays for itself after one read. The 1-hour cache pays for itself after two reads Source 1সোর্স 1. So caching helps only when the same start comes back soon.

The last two points show the main trap. A cheaper call that fails more often can make each finished task cost more. You see this only when you measure success and cost together.

বাংলা ব্যাখ্যা

খরচ কমানোর প্রতিটা উপায়ের নিজস্ব একটা দাম আছে।

  • Prompt cache. বারবার আসা শুরুর অংশ পড়া সস্তা Source 1সোর্স 1। কিন্তু cache-এ লেখা সাধারণ input-এর চেয়ে দামি: Claude-এ 1.25 বা 2 গুণ Source 1সোর্স 1। খুব ছোট prompt cache হয় না, আর API কোনো error দেখায় না Source 2সোর্স 2।
  • Batch API. Input আর output-এ 50% বাঁচে Source 1সোর্স 1। কিন্তু ফল আসতে 24 ঘণ্টা পর্যন্ত লাগতে পারে Source 3সোর্স 3। যে ইউজার অপেক্ষা করছেন, তাঁর জন্য এটা ঠিক নয়।
  • কম effort. মডেল কম output token লেখে Source 4সোর্স 4। কিন্তু কাজের মান একটু কমতে পারে Source 4সোর্স 4। রিকুয়েস্টের মাঝে top-level output_config.effort বদলালে cache বাতিল হয়ে যেতে পারে। যেসব মডেলে per-message effort আছে, সেখানে বদলটা system message-এ পাঠালে cache অক্ষত থাকে Source 2সোর্স 2।
  • ছোট মডেল. প্রতিটা token সস্তা। Claude Haiku 5.5 প্রতি MTok $0.10 / $0.50 (100K token পর্যন্ত prompt-এ), আর Opus 5.5 $4 / $20 Source 1সোর্স 1। কিন্তু এটা বেশি task-এ ফেল করতে পারে।

5 মিনিটের cache একবার পড়লেই খরচ উঠে আসে। 1 ঘণ্টার cache-এ উঠে আসে দুবার পড়লে Source 1সোর্স 1। তাই একই শুরুর অংশ তাড়াতাড়ি ফিরে এলে তবেই caching কাজে লাগে।

শেষের দুটো পয়েন্টই আসল ফাঁদ দেখায়। সস্তা call যদি বেশি ফেল করে, তাহলে প্রতিটা finished task-এর খরচ বেড়ে যেতে পারে। সাফল্য আর খরচ একসাথে মাপলে তবেই আপনি এটা দেখতে পাবেন।

A real-life example

This is an invented example. The prices are the Claude Sonnet 5.5 list prices on 2026-10-28: input $2, 5-minute cache write $2.50, cache read $0.10, and output $10 per MTok Source 1সোর্স 1. A batch would halve input and output Source 1সোর্স 1.

A test-triage agent reads each failing test of a nightly run and labels it "product bug", "test bug", or "flaky". One night has 200 failures. Each call sends a 20,000-token shared prefix (instructions, tool definitions, a project guide), 3,000 tokens of the failure log, and gets 1,000 output tokens back, thinking included.

No cache:     per call = 23,000 x $2/M + 1,000 x $10/M
                       = $0.046 + $0.010 = $0.056
              200 calls = $11.20
Batch only:   $11.20 / 2 = $5.60

With cache (all calls inside the 5-minute lifetime):
  call 1      = 20,000 x $2.50/M + 3,000 x $2/M + 1,000 x $10/M
              = $0.050 + $0.006 + $0.010 = $0.066
  calls 2-200 = 20,000 x $0.10/M + 3,000 x $2/M + 1,000 x $10/M
              = $0.002 + $0.006 + $0.010 = $0.018 each
  total       = $0.066 + 199 x $0.018 = $3.648

Cost per finished task (160 labels were right):
  $3.648 / 160 = $0.0228

Lower effort, 600 output tokens, only 100 labels right:
  total = $0.062 + 199 x $0.014 = $2.848
  $2.848 / 100 = $0.0285   <- cheaper night, dearer task

The cache cut the night from $11.20 to about $3.65. The low-effort run cost less in total, but each correct label cost more. The team keeps the higher effort.

সহজ English

This is an invented example. The prices are the Claude Sonnet 5.5 list prices on 2026-10-28. Input is $2, a 5-minute cache write is $2.50, a cache read is $0.10, and output is $10, all per MTok Source 1সোর্স 1. A batch would cut input and output in half Source 1সোর্স 1.

A test-triage agent reads each failing test from a nightly run. It labels each one "product bug", "test bug", or "flaky". One night has 200 failures. Each call sends a shared start of 20,000 tokens and a failure log of 3,000 tokens. It gets 1,000 output tokens back, thinking included.

  • No cache: each call costs $0.046 for input and $0.010 for output, so $0.056. 200 calls cost $11.20.
  • Batch only: half of that, $5.60.
  • With cache: the first call writes the cache and costs $0.066. Each of the other 199 calls reads the cache and costs $0.018. The total is $3.648.
  • Cost per finished task: 160 labels were right. $3.648 / 160 = $0.0228.
  • Lower effort: 600 output tokens and only 100 right labels. The night costs $2.848, but each right label costs $0.0285.

The cache cut the night from $11.20 to about $3.65. The low-effort run was cheaper in total, but each correct label cost more. The team keeps the higher effort.

বাংলা ব্যাখ্যা

এটা একটা বানানো উদাহরণ। দামগুলো 2026-10-28 তারিখের Claude Sonnet 5.5-এর লিস্ট প্রাইস। প্রতি MTok-এ input $2, 5 মিনিটের cache write $2.50, cache read $0.10, আর output $10 Source 1সোর্স 1। Batch করলে input আর output-এর দাম অর্ধেক হতো Source 1সোর্স 1।

একটা test-triage agent রাতের রানের প্রতিটা ফেল করা টেস্ট পড়ে। সে প্রতিটাকে "product bug", "test bug" বা "flaky" লেবেল দেয়। এক রাতে 200টা ফেল আছে। প্রতিটা call পাঠায় 20,000 token-এর শেয়ার করা শুরুর অংশ আর 3,000 token-এর ফেল log। ফেরত আসে 1,000 output token, thinking সহ।

  • Cache ছাড়া: প্রতি call-এ input $0.046 আর output $0.010, মোট $0.056। 200টা call-এ $11.20।
  • শুধু batch: তার অর্ধেক, $5.60।
  • Cache সহ: প্রথম call cache-এ লেখে, খরচ $0.066। বাকি 199টা call cache থেকে পড়ে, প্রতিটা $0.018। মোট $3.648।
  • Cost per finished task: 160টা লেবেল ঠিক ছিল। $3.648 / 160 = $0.0228।
  • কম effort: 600 output token, আর মাত্র 100টা লেবেল ঠিক। রাতের খরচ $2.848, কিন্তু প্রতিটা ঠিক লেবেলের খরচ $0.0285।

Cache রাতের খরচ $11.20 থেকে প্রায় $3.65-এ নামিয়েছে। কম effort-এর রানে মোট খরচ কম, কিন্তু প্রতিটা ঠিক লেবেলের দাম বেশি। তাই টিম বেশি effort-ই রাখে।

Common mistakes

  • One ratio for every provider. "Output costs 5x input" and "a cache hit costs 5%" are not laws. On the Claude API a cache read is 0.1x on most models and 0.05x only on Opus 5.5 and Sonnet 5.5 Source 1সোর্স 1. OpenAI says "up to 95%" off cached input Source 7সোর্স 7. Read the price page of your provider and model, and write down the date.
  • Free cache writes. On the Claude API a cache write costs 1.25x or 2x the base input price Source 1সোর্স 1. A cache that is never read again costs more than no cache.
  • A silent cache miss. A prompt below the minimum length (for example 512 tokens on Claude Sonnet 5.5; 4,096 on Claude Haiku 4.5) is not cached, and no error comes back Source 2সোর্স 2. Changing the top-level output_config.effort between requests can also break the cache Source 2সোর্স 2.
  • Counting only the visible answer. You pay for the full thinking, not the summary that you see Source 5সোর্স 5.
  • Token counts carried across models. Claude 4.7 and later models use a tokenizer that makes about 30% more tokens for the same text Source 1সোর্স 1. The same prompt can cost more on a new model at the same price per token.
  • Batch for a live user. A batch can take up to 24 hours Source 3সোর্স 3.
  • Price per call as the goal. A cheaper call that fails more often can raise the cost per finished task (see the example above).

সহজ English

  • One ratio for all providers. "Output costs 5 times input" and "a cache hit costs 5%" are not rules. On the Claude API, a cache read costs 0.1 times on most models. It costs 0.05 times only on Opus 5.5 and Sonnet 5.5 Source 1সোর্স 1. OpenAI says "up to 95%" off cached input Source 7সোর্স 7. Read the price page for your provider and model, and note the date.
  • Believing that cache writes are free. On the Claude API, a cache write costs 1.25 or 2 times the normal input price Source 1সোর্স 1. A cache that nobody reads again costs more than no cache.
  • A cache miss you do not see. A prompt that is too short (for example under 512 tokens on Claude Sonnet 5.5, or under 4,096 on Claude Haiku 4.5) is not cached. No error comes back Source 2সোর্স 2. If you change the top-level output_config.effort between requests, the cache can also break Source 2সোর্স 2.
  • Counting only the answer you see. You pay for all the thinking, not only the summary on the screen Source 5সোর্স 5.
  • Using old token counts on a new model. Claude 4.7 and later models make about 30% more tokens for the same text Source 1সোর্স 1. The same prompt can cost more, even at the same price per token.
  • Batch for a user who waits. A batch can take up to 24 hours Source 3সোর্স 3.
  • Price per call as the goal. A cheaper call that fails more can make each finished task cost more. The example above shows this.

বাংলা ব্যাখ্যা

  • সব প্রোভাইডারের জন্য একই অনুপাত ধরা। "Output-এর দাম input-এর ৫ গুণ" বা "cache hit-এ ৫% খরচ" কোনো নিয়ম নয়। Claude API-তে বেশিরভাগ মডেলে cache read 0.1 গুণ। শুধু Opus 5.5 আর Sonnet 5.5-এ 0.05 গুণ Source 1সোর্স 1। OpenAI বলে cached input-এ "up to 95%" ছাড় Source 7সোর্স 7। আপনার প্রোভাইডার আর মডেলের দামের পেজ পড়ুন, আর তারিখটা লিখে রাখুন।
  • Cache write বিনা পয়সায় ভাবা। Claude API-তে cache write-এ সাধারণ input দামের 1.25 বা 2 গুণ লাগে Source 1সোর্স 1। যে cache আর কেউ পড়ে না, তার খরচ cache না থাকার চেয়েও বেশি।
  • চোখে না পড়া cache miss। খুব ছোট prompt (যেমন Claude Sonnet 5.5-এ 512 token-এর কম, বা Claude Haiku 4.5-এ 4,096-এর কম) cache হয় না। কোনো error-ও আসে না Source 2সোর্স 2। রিকুয়েস্টের মাঝে top-level output_config.effort বদলালেও cache ভেঙে যেতে পারে Source 2সোর্স 2।
  • শুধু দেখা উত্তরটা গোনা। আপনি পুরো thinking-এর দাম দেন, স্ক্রিনে দেখা summary-র নয় Source 5সোর্স 5।
  • নতুন মডেলে পুরোনো token সংখ্যা ধরা। Claude 4.7 আর পরের মডেলগুলো একই লেখায় প্রায় 30% বেশি token বানায় Source 1সোর্স 1। প্রতি token-এর দাম একই থাকলেও একই prompt-এর খরচ বেশি হতে পারে।
  • অপেক্ষারত ইউজারের জন্য batch। একটা batch-এ 24 ঘণ্টা পর্যন্ত লাগতে পারে Source 3সোর্স 3।
  • প্রতি call-এর দামকে লক্ষ্য বানানো। সস্তা call বেশি ফেল করলে প্রতিটা finished task-এর খরচ বেড়ে যেতে পারে। ওপরের উদাহরণে এটা দেখানো আছে।

What a tester can check

Claude Code shows the session cost with /usage. The figure is a local estimate at list price, not the bill Source 9সোর্স 9. It matters for API-key use; subscription plans show plan-usage bars instead Source 9সোর্স 9. The same screen shows the share of input tokens served from cache and the cache misses Source 9সোর্স 9. In print mode, --output-format json gives machine-readable output Source 10সোর্স 10, and --max-budget-usd stops a run once the estimated spend reaches a limit. The spend can pass the cap, so leave headroom Source 10সোর্স 10. In the API response, read cache_read_input_tokens, cache_creation_input_tokens, and input_tokens Source 2সোর্স 2, and usage.output_tokens_details.thinking_tokens Source 5সোর্স 5.

Tutorial advice

This list is the tutorial's own advice.

  • Log the tokens of each kind and the cost of every test run. Store them next to the pass or fail result.
  • Report the cost per finished task: total spend divided by the tasks that passed review, not by the calls.
  • Check the cache hit rate: cache read tokens divided by total input tokens. Alert when it drops after a prompt or tool change.
  • Check that a prompt you mark for caching is above the minimum length, and that the second request shows cache reads.
  • Compare two effort levels or two models on the same task set. Compare success rate and cost together.
  • Set a cost budget in CI. Fail or warn the job when one run passes it, and keep headroom under the hard cap.
  • Re-read the price page when you change provider, model, or region, and record the date of the prices you used.

সহজ English

Claude Code shows the cost of a session with /usage. The number is a local guess at list price, not the bill Source 9সোর্স 9. It matters for API-key use; subscription plans show plan-usage bars instead Source 9সোর্স 9. The same screen shows how much input came from the cache, and how many times the cache missed Source 9সোর্স 9. In print mode, --output-format json gives output that a program can read Source 10সোর্স 10. --max-budget-usd stops a run when the guessed spend reaches a limit. The spend can go a bit over, so leave room Source 10সোর্স 10. In the API response, read the cache read, cache write, and plain input counts Source 2সোর্স 2, and the thinking token count Source 5সোর্স 5.

Tutorial advice

This list is the tutorial's own advice.

  • Save the token counts and the cost of every test run, next to the pass or fail result.
  • Report the cost per finished task: all the spend divided by the tasks that passed review, not by the calls.
  • Check how often the cache hits: cache read tokens divided by all input tokens. Raise an alert when it drops after a change to a prompt or a tool.
  • Check that a prompt you mark for caching is long enough, and that the second request shows cache reads.
  • Try two effort levels or two models on the same tasks. Compare success and cost together.
  • Set a cost budget in CI. Fail or warn the job when one run goes over it. Keep some room under the hard limit.
  • Read the price page again when you change provider, model, or region. Write down the date of the prices you used.

বাংলা ব্যাখ্যা

Claude Code-এ /usage দিয়ে একটা session-এর খরচ দেখা যায়। এই সংখ্যাটা লিস্ট প্রাইসে লোকাল আনুমানিক হিসাব, আসল বিল নয় Source 9সোর্স 9। এটা API-key ব্যবহারে জরুরি; subscription plan-এ এর বদলে plan-usage বার দেখায় Source 9সোর্স 9। একই স্ক্রিনে দেখা যায় কতটা input cache থেকে এসেছে, আর cache কতবার miss করেছে Source 9সোর্স 9। Print mode-এ --output-format json এমন output দেয় যা একটা প্রোগ্রাম পড়তে পারে Source 10সোর্স 10। --max-budget-usd আনুমানিক খরচ একটা সীমায় পৌঁছালে রান থামিয়ে দেয়। খরচ সীমা একটু পার হতে পারে, তাই আপনি কিছুটা জায়গা রাখুন Source 10সোর্স 10। API response-এ cache read, cache write আর সাধারণ input-এর সংখ্যা পড়ুন Source 2সোর্স 2, আর thinking token-এর সংখ্যাও পড়ুন Source 5সোর্স 5।

Tutorial advice

এই তালিকাটা টিউটোরিয়ালের নিজের পরামর্শ।

  • প্রতিটা টেস্ট রানের token সংখ্যা আর খরচ pass বা fail ফলের পাশে সেভ করুন।
  • Cost per finished task রিপোর্ট করুন: মোট খরচকে review-তে পাস করা task দিয়ে ভাগ করুন, call দিয়ে নয়।
  • Cache hit rate দেখুন: cache read token-কে মোট input token দিয়ে ভাগ করুন। Prompt বা tool বদলের পর এটা কমে গেলে alert দিন।
  • যে prompt cache-এর জন্য মার্ক করেছেন, সেটা যথেষ্ট লম্বা কিনা দেখুন। দ্বিতীয় রিকুয়েস্টে cache read আসছে কিনা দেখুন।
  • একই task-এর সেটে দুটো effort লেভেল বা দুটো মডেল চালান। সাফল্য আর খরচ একসাথে তুলনা করুন।
  • CI-তে একটা cost budget ঠিক করুন। কোনো রান সেটা পার হলে job fail বা warn করুন। কড়া সীমার নিচে কিছুটা জায়গা রাখুন।
  • প্রোভাইডার, মডেল বা region বদলালে দামের পেজ আবার পড়ুন। যে দাম ব্যবহার করেছেন, তার তারিখ লিখে রাখুন।

Key words

TermMeaning
InferenceOne run of a trained model on a prompt
TokenA small piece of text that the model reads or writes; the unit of billing
MTokOne million tokens; the unit of most price tables
Input tokensWhat you send: prompt, system prompt, tools, history
Output tokensWhat the model writes: text, tool calls, and thinking
Thinking tokensTokens of the model's reasoning, billed as output
Prompt cachingStoring a prompt prefix so that later requests read it at a lower price
Cache write / cache readStoring the prefix (a higher price) / reusing it (a lower price)
Cache hit rateCache read tokens divided by total input tokens
Batch APIAn API that runs many requests later at a discount
EffortA Claude setting that changes how many tokens the model spends
max_tokensThe hard limit on output tokens of one request
Cost per finished taskTotal spend divided by the tasks that really succeeded

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

  1. [1]
    Pricing

    Anthropic (Claude Platform docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  2. [2]
    Prompt caching

    Anthropic (Claude Platform docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  3. [3]
    Batch processing

    Anthropic (Claude Platform docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  4. [4]
    Effort

    Anthropic (Claude Platform docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  5. [5]
    Steering thinking

    Anthropic (Claude Platform docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  6. [6]
    Pricing

    OpenAI (API docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  7. [7]
    Prompt caching

    OpenAI (API docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  8. [8]
    Batch API

    OpenAI (API docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  9. [9]
    Manage costs effectively

    Anthropic (Claude Code docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  10. [10]
    CLI reference

    Anthropic (Claude Code docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28