Estimate Hy4 Flash API costs for repository changes and test verification using explicit token assumptions, cache rates, and cost-per-accepted-change calculations.
A practical cost model for repository changes using Hy4 Flash, with a dated price snapshot, an illustrative workload, and a method for calculating cost per accepted change.
For a repository-editing workflow, the useful budget unit is cost per accepted change: all model charges for an attempt, including calls used to interpret test failures and revise the patch, divided across changes that meet your acceptance criteria. A low input price is helpful, but it does not tell you how often a patch will pass tests or human review.
The illustrative workload below puts 100 attempts at $10.35 using the official rates in the OneMux catalogue, or $3.90195 using OneMux rates, before test infrastructure and other non-token costs. If 80 changes are accepted, those amounts become approximately $0.1294 and $0.0488 per accepted change, respectively. These are calculations, not measured Hy4 Flash performance.
OneMux is the publisher of this article and provides model access through an OpenAI-compatible API. Its pricing is one option in the comparison; check the actual provider and route before committing a budget.
The following OneMux catalogue snapshot was captured on November 23, 2026. For the calculations in this article, we assume the displayed token prices are in US dollars per 1 million tokens. Confirm the billing unit and applicable terms on the model page or with the provider before relying on the estimate: the supplied catalogue snapshot does not independently spell out the unit next to each value.
| Model and route | Input per 1M tokens | Output per 1M tokens | Cached input per 1M tokens | Published price ratio |
|---|---|---|---|---|
| Hy4 Flash — official, as listed by OneMux | $0.035 | $0.145 | $0.0015 | Reference: 1.0 |
| Hy4 Flash — OneMux | $0.013195 | $0.054665 | $0.0005655 | 0.37700000000000006 |
The published ratio is a price multiplier, not a measured workload saving. The listed OneMux rates are 37.7% of the corresponding official rates; actual bills depend on routing, usage and billing terms. No separate tier is specified in the supplied snapshot. Cache prices apply only to tokens that qualify as cached reads; cache creation charges, minimums, expiry rules and eligibility are unknown here and must be checked.
There is also a material source discrepancy. Shattered's Hy4 Flash report describes list prices of $0.070 per million fresh input tokens, $0.281 per million output tokens and $0.003 per million cached input tokens, and reports a half-price TokenHub promotion through November 30, 2026. The catalogue's official input and cache figures match half those reported list rates, but its $0.145 output figure is not exactly half of $0.281. The sources do not explain the difference. Do not silently substitute one schedule for the other; confirm the current rate for your route.
Assume a coding agent makes a small change, runs an existing test suite, reads the results and, when needed, revises the patch. The figures below describe 100 attempted changes in total, not one request. They include initial prompts, repository context, generated patches, test-output analysis and retries. They are invented planning inputs, not observed usage.
| Usage across 100 attempts | Assumption |
|---|---|
| Fresh input, including repository excerpts and test results | 2 million tokens |
| Eligible cached input | 3 million tokens |
| Output, including patches and explanations | 0.2 million tokens |
| Accepted changes after tests and review | 80 |
Fresh and cached input are separate categories in this example: the same tokens are not counted twice. The assumption that 3 million tokens qualify for the cache is particularly important. A repository file appearing in multiple prompts does not by itself establish a billable cache hit.
Multiply each token count in millions by its matching price, then add the three charges. With the catalogue's official rates:
| Component | Calculation | Cost |
|---|---|---|
| Fresh input | 2 × $0.035 | $0.0700 |
| Cached input | 3 × $0.0015 | $0.0045 |
| Output | 0.2 × $0.145 | $0.0290 |
| Total | $0.0700 + $0.0045 + $0.0290 | $0.1035 |
Those prices are per million tokens, so $0.1035 is the total for the stated 100 attempts, not $10.35. Using the OneMux rates, the same workload costs $0.02639 for fresh input, $0.0016965 for cached input and $0.010933 for output: $0.0390195 total.
With 80 accepted changes, divide those totals by 80: approximately $0.001294 per accepted change at the catalogue's official rates, or $0.000488 per accepted change at OneMux rates. The opening figures of $10.35 and $3.90195 would instead apply to 100 batches of this size, or 10,000 attempts, under the same assumptions. Use the smaller totals for the 100-attempt example.
If none of the 3 million assumed cached tokens qualify and they are billed as fresh input instead, the official total becomes $0.204 and the OneMux total becomes $0.0769085. That is still only a token estimate: it excludes any separately billed cache creation, tooling or infrastructure.
A useful pilot should also flag failure modes: tests that do not cover the requested behavior, truncated logs, unrelated file edits, repeated retries and context that omits a relevant dependency. A long context window does not guarantee that a model will use every included file correctly. Shattered reports a window of up to 1 million tokens for Hy4 Flash, but that is a stated capacity, not a measured repository-editing result.
Shattered reports Tencent's claim that Hy4 Flash cost one-twentieth as much per task as full Hy4 on its internal WorkIndex benchmark. That is an office-task benchmark and a vendor claim, not evidence of a 20-fold saving on repository changes with test verification. The supplied evidence does not establish a coding success rate, latency or cost per accepted code change for either model.
For another model or provider, repeat the calculation with its current fresh-input, output and applicable cache prices, then measure its own usage on the same tasks. If a price or cache condition is unavailable, mark that component unknown rather than treating it as free. OneMux offers access to leading models through one OpenAI-compatible API, but integration compatibility still depends on the documented endpoint and parameter support for the chosen route.
Start with a token estimate, then replace its assumptions with usage and acceptance data from your own repository. The decisive comparison is the fully accounted cost of a change that passes your tests and review—not the cheapest headline input rate.
Captured 2026-11-23T09:20:09.329Z from the OneMux published catalogue. Prices retain website billing units; this is not a live benchmark. Tiered, cached or time-based billing may differ. Unknown values are not zero.
| Model | Official input | Official output | OneMux input | OneMux output | Published price ratio |
|---|---|---|---|---|---|
| Hy4 Flash | $0.035 | $0.145 | $0.013195 | $0.054665 | 0.37700000000000006 |
Current OneMux prices. Compare workload costs only when input/output and billing units match; see each model page for tier conditions.
It depends on tokens, cache eligibility, retries and acceptance rate. In the illustrative 100-attempt workload, the token total is $0.1035 at the catalogue's official rates or $0.0390195 at OneMux rates, assuming prices are per million tokens. Infrastructure and review costs are excluded.
Not necessarily. Tests may miss the requested behavior or unintended edits. Define acceptance criteria that include appropriate test coverage and review.
The source reports list prices and a time-limited half-price promotion. The catalogue's official input and cache rates match half the reported list rates, but the output rate does not match exactly. The supplied sources do not explain that difference.
Guides
Estimate Hy4 Flash API costs with explicit billing-unit assumptions, cache scenarios, and a repeatable workload evaluation plan.
Guides
Estimate the token cost of repository changes and test verification, including cache use, context tiers, retries, and cost per accepted change.
Guides
Estimate Hy4 Preview API costs for repository edits and test verification using explicit token, cache, and pricing assumptions.
Guides
Estimate the API cost of repository code changes and test verification using explicit token assumptions, a dated price snapshot, and reproducible arithmetic.