Claude 5 API Cost Calculator by Route
A Claude 5 API cost calculator estimates spend by pairing a model with the route available to the account, then pricing input and output tokens separately. In the live catalog for this run, claude-sonnet-5 is $0.11 input and $0.55 output per 1M tokens on the Claude Sale Channel, or $0.22 input and $1.10 output per 1M tokens on the Claude Route. Record the route, multiply each token count by that route’s rate, and verify the current rate before a production decision.
That route detail is essential. A model name alone is not enough to produce a reliable estimate, because a model can be eligible for more than one route at different prices. This guide shows the live inputs, the calculation, and an OpenAI-compatible Python request. The prices are measured catalog facts from October 7, 2026; the implementation and rollout suggestions are recommendations to test with your own workload.
Claude 5 API cost calculator: live route inputs
Section titled “Claude 5 API cost calculator: live route inputs”The live pricing response lists a model ratio, completion ratio, eligible groups, and a group ratio for each public route. For a token-priced model, calculate a route’s input rate only when that route appears in the model’s eligible groups:
input USD per 1M tokens = model ratio x 2 x group ratio for the routeoutput USD per 1M tokens = input rate x completion ratioThe table applies that arithmetic to selected current Claude 5 entries. Every price includes its route; it does not imply that the route is available to every account.
| Model | Route | Input USD per 1M tokens | Output USD per 1M tokens |
|---|---|---|---|
claude-sonnet-5 | Claude Sale Channel | $0.11 | $0.55 |
claude-sonnet-5 | Claude Route | $0.22 | $1.10 |
claude-opus-5-5 | Claude Sale Channel | $0.22 | $1.10 |
claude-opus-5-5 | Claude Route | $0.44 | $2.20 |
claude-fable-5-1 | Claude Sale Channel | $0.55 | $2.75 |
For example, claude-sonnet-5 has a model ratio of 1 and a completion ratio of 5. The Claude Sale Channel group ratio is 0.055, so the input calculation is 1 x 2 x 0.055 = $0.11; its output calculation is $0.11 x 5 = $0.55. The Claude Route group ratio is 0.11, which produces $0.22 input and $1.10 output. claude-fable-5-1 is shown only on the Claude Sale Channel because that is the listed eligible route in this snapshot.
Use the pricing guide for the route-pricing structure and Supported Models for catalog and endpoint context. Both are useful references, but the live pricing page is the rate to check before putting an estimate into a budget: Frugal Relay pricing.
Estimate one Claude 5 request
Section titled “Estimate one Claude 5 request”After selecting an eligible model-and-route pair, the request estimate is straightforward:
estimated request cost = (input tokens / 1,000,000 x input route rate) + (output tokens / 1,000,000 x output route rate)Suppose a claude-sonnet-5 request on the Claude Sale Channel contains 18,000 input tokens and returns 1,200 output tokens. Using the listed rates above:
(18,000 / 1,000,000 x $0.11) + (1,200 / 1,000,000 x $0.55)= $0.00198 + $0.00066= $0.00264 per requestAt the same token profile on the Claude Route, the estimate is:
(18,000 / 1,000,000 x $0.22) + (1,200 / 1,000,000 x $1.10)= $0.00396 + $0.00132= $0.00528 per requestThose are arithmetic examples, not a forecast or invoice. Real traffic has a distribution of prompt sizes and completion sizes, and application retries can add calls. A monthly estimate should multiply a representative request distribution by expected successful requests, then add separately measured retries, evaluations, backfills, and any other model calls. Do not estimate all traffic from one unusually short test prompt.
Here is a small route-aware calculator for the first example. It keeps input and output rates together, which makes an accidental one-rate calculation less likely.
from decimal import Decimal
RATES_PER_MILLION = { ("claude-sonnet-5", "Claude Sale Channel"): (Decimal("0.11"), Decimal("0.55")), ("claude-sonnet-5", "Claude Route"): (Decimal("0.22"), Decimal("1.10")),}
def estimate_cost(model, route, input_tokens, output_tokens): input_rate, output_rate = RATES_PER_MILLION[(model, route)] return ( Decimal(input_tokens) / Decimal("1000000") * input_rate + Decimal(output_tokens) / Decimal("1000000") * output_rate )
cost = estimate_cost( "claude-sonnet-5", "Claude Sale Channel", input_tokens=18_000, output_tokens=1_200,)print(f"${cost:.5f}") # $0.00264Keep the model slug and route in the calculator input, not merely in a comment or a dashboard label. That makes it possible to rerun an estimate accurately when a team changes route, model, or traffic mix.
Send a Claude 5 request through an OpenAI-compatible API
Section titled “Send a Claude 5 request through an OpenAI-compatible API”The live catalog lists claude-sonnet-5 with the OpenAI endpoint type, whose documented path is POST /v1/chat/completions. An application already using the OpenAI Python client can point its base URL to https://frugalrelay.me/v1 and use the current model slug below. Start with Getting Started to obtain an API key and make an initial request.
import os
from openai import OpenAI
client = OpenAI( api_key=os.environ["FRUGAL_RELAY_API_KEY"], base_url="https://frugalrelay.me/v1",)
response = client.chat.completions.create( model="claude-sonnet-5", messages=[ { "role": "system", "content": "Return a concise JSON object with a category and confidence.", }, { "role": "user", "content": "Classify this request: I cannot sign in after changing my email.", }, ],)
print(response.choices[0].message.content)The endpoint type is a catalog fact; choosing a model and accepting its output quality is an engineering decision. Run a controlled sample using the prompt, response contract, tool configuration, and error handling that the feature will use in production. Capture the input and output token counts from that sample before turning the calculator into a budget.
Build a production cost model from measured traffic
Section titled “Build a production cost model from measured traffic”The following steps are recommendations for cost planning. They do not assert that one Claude model is better for a particular task.
- Sample representative requests. Include typical, long, malformed, and edge-case inputs. A support feature, extraction job, and coding workflow can have very different token distributions even when they use the same model.
- Measure both token directions. Store input tokens and output tokens separately with the model, route, response status, and retry count. Output is priced separately, so a short completion can matter as much as prompt trimming.
- Calculate cost per accepted result. Divide the full measured cost of calls, retries, and repair attempts by results that pass the feature’s validation. A lower token rate is useful only if the completed-task outcome remains acceptable.
- Compare candidates on the same evaluation set. Hold the prompt, validation rules, timeout, and retry policy constant while testing another eligible model-and-route pair. This separates a pricing difference from a changing workflow.
- Refresh the price input before scaling. Recheck the named route at Frugal Relay pricing before a material forecast or traffic increase. The live catalog and account eligibility can change.
A practical estimate can have low, expected, and high cases. For each case, use a different percentile or band from observed input and output token counts, a stated traffic volume, and a measured retry rate. This exposes the assumptions that deserve review instead of producing an overly precise monthly total.
Avoid common route-pricing mistakes
Section titled “Avoid common route-pricing mistakes”| Mistake | Better practice |
|---|---|
Saving one price for claude-sonnet-5 | Save a model, route, input rate, and output rate together. |
| Applying a route rate without checking eligibility | Confirm the route is listed for that model and available to the account before estimating. |
| Charging output tokens at the input rate | Calculate input and output as separate terms. |
| Treating a test request as a traffic profile | Use measured distributions and include retries and background work. |
| Treating a listed rate as permanent | Verify the named current rate before a production budget or rollout. |
The calculator should also reject unknown model-and-route pairs. For example, do not invent a Claude Route price for claude-fable-5-1 from this snapshot: the live catalog lists its Claude Sale Channel eligibility, not Claude Route eligibility. Failing closed is more useful than returning an attractive but unsupported number.
Claude 5 cost-estimation checklist
Section titled “Claude 5 cost-estimation checklist”- Select the exact current model slug and an eligible route.
- Verify the live route rate at Frugal Relay pricing.
- Store separate input and output token counts from representative traffic.
- Apply the named route’s separate input and output rates.
- Include retries, evaluations, batch work, and repair calls in planning volume.
- Compare cost per accepted result across candidates using the same test set.
- Refresh the estimate when the model, route, traffic mix, or response contract changes.
A route-aware Claude 5 API cost calculator is small, but it makes pricing discussions auditable. Start with a confirmed route, make the two token directions explicit, and update the live-rate input before a consequential deployment.