Hy4 Preview API cost estimates for repository changes with test verification
Estimate Hy4 Preview API costs for repository edits and test verification using explicit token, cache, and pricing assumptions.
Summary · TL;DR
An illustrative cost model for using Hy4 Preview to inspect a repository, make changes, and verify them with tests, including uncached and cached pricing scenarios.
Key Takeaways
- At the stated per-million-token assumption, an illustrative workload using 10 million input tokens and 2 million output tokens costs $3.7674 at the published OneMux rates without cache reads.
- If 9 million of those input tokens qualify for the published cache-read rate, the same illustrative workload costs $1.764945, assuming no additional cache charges.
- The catalogue price snapshot and Venice's independently documented prices are separate sources; confirm current billing units, cache eligibility, and endpoint support before budgeting.
- Model output, including reasoning where billed, and test logs returned to the model can materially change the estimate.
On this page (9)
The cost decision
For a repository-change workload, estimate Hy4 Preview costs from the tokens exchanged across the entire edit-and-test loop, not from the size of the final patch. An agent may read files, propose changes, receive test output, and revise its work several times. Each exchange can add input and output tokens.
In the illustrative workload below, 10 million input tokens and 2 million output tokens cost $3.7674 at the published OneMux rates, assuming the listed prices are per 1 million tokens. If 9 million input tokens qualify for the listed cache-read price, the estimate falls to $1.764945, assuming no other cache charges. These are calculations, not measured results or a savings guarantee.
OneMux, the publisher of this guide, provides access to models through an OpenAI-compatible API, with model routing and spend visibility. Its Hy4 Preview model page is the relevant starting point for checking the current listing.
Hy4 Preview price snapshot
The supplied OneMux catalogue snapshot was captured on November 16, 2026, at 19:00:05 UTC. The table preserves its published price values and ratio. The calculation in this article assumes each listed token price is in USD per 1 million tokens; confirm that billing unit and any applicable conditions on the current model page before using the estimate for a budget. The supplied catalogue excerpt does not independently spell out the unit for each price.
| Price category | Official catalogue price | OneMux catalogue price | Published OneMux-to-official ratio |
|---|---|---|---|
| Input | $0.86 | $0.23478 | 0.273 |
| Output | $2.6 | $0.7098 | 0.273 |
| Cache read | $0.045 | $0.012285 | 0.273 |
A ratio of 0.273 corresponds to 72.7% below the listed official price for the matching category. It is a comparison of published rates, not a promise that a particular workload will save that amount. No tier details were supplied for this model. Cache-write charges and other possible conditions are unknown, not zero.
The separate Venice Hy4 Preview documentation lists $1.04 per 1 million input tokens, $3.13 per 1 million output tokens, and $0.0525 per 1 million cached input tokens. Those are Venice's documented prices, not the official catalogue values in the table. Provider terms and cache eligibility can differ, so use one provider's complete billing rules for an actual estimate.
Build a repository-change estimate
Consider an illustrative batch of 100 repository tasks. Each task includes reading relevant code, generating a patch, receiving test results, and making any necessary revision. The figures are assumptions for planning; they are not a benchmark or a tested integration.
| Assumption | Per task | Batch of 100 tasks |
|---|---|---|
| Total input, including returned test logs | 100,000 tokens | 10,000,000 tokens |
| Total output, including any billed reasoning | 20,000 tokens | 2,000,000 tokens |
| Requests, retries, and revisions | Included in token totals | Included in token totals |
With no cache reads, and using the assumed per-million unit for the OneMux snapshot:
- Input: 10 × $0.23478 = $2.3478.
- Output: 2 × $0.7098 = $1.4196.
- Total: $2.3478 + $1.4196 = $3.7674, or about $0.0377 per task.
Under the same unit assumption, the catalogue's official rates give 10 × $0.86 + 2 × $2.6 = $13.80 for the batch. The workloads and token counts must match for this comparison to be meaningful.
Add a cache scenario
Suppose 9 million of the 10 million input tokens qualify as cache reads, while the remaining 1 million are charged at the ordinary input rate. Output stays at 2 million tokens:
- Cached input: 9 × $0.012285 = $0.110565.
- Ordinary input: 1 × $0.23478 = $0.23478.
- Output: 2 × $0.7098 = $1.4196.
- Total: $1.764945, before any other applicable charges.
This is a sensitivity example, not a prediction of a 90% cache-hit rate. Repeated instructions or repository context may be candidates for reuse, but eligibility and cache behavior depend on the provider and request pattern. Verify actual billed cache reads and any cache-write or retention charges before relying on the lower figure.
Measure the edit-and-test loop
Use the following procedure to replace the assumptions with your own observations:
- Define a representative task. Record which files the agent can inspect, what change it should make, and the command that verifies it. Include tasks that need a revision as well as tasks that pass on the first attempt.
- Capture usage for every model call. Add input, output, and reported cache-read tokens across the task. Include the initial instructions, file contents, tool results, test logs, and any retry. Do not count local test execution as model tokens unless its output is sent back to the model.
- Separate cached and ordinary input. Apply the cache-read price only to tokens reported and billed as eligible. If usage does not distinguish them, calculate the uncached case and mark cache savings as unknown.
- Apply the corresponding provider's prices. Multiply each token category by its rate using the provider's stated unit, then add the results. Include any separately documented charges. Compare providers only after checking that token categories and units match.
- Report a range. Repeat the arithmetic with a larger output or retry allowance. Long test failures and extra repair cycles can make a single average task misleading.
Hy4 Preview's Venice documentation describes a 1,048,576-token context window, a 64,000-token maximum output, function calling, structured output, and reasoning effort settings. It also says Venice's output price includes reasoning tokens. These are documented capabilities and billing details for that service, not measurements of coding accuracy or test-pass rates. A large context window is a capacity limit, not a reason to send an entire repository on every call.
For an implementation, confirm that your chosen endpoint supports the model ID, tool-calling format, usage reporting, and any reasoning parameters your client sends. OneMux offers an OpenAI-compatible API, but compatibility with a particular endpoint or parameter should be checked in its documentation; this guide does not claim an integration test.
Troubleshooting a cost estimate
If actual spend is higher than expected, first check whether test logs, repeated file contents, or failed attempts were omitted from the input total. Then check whether reasoning or other generated tokens appear in billed output. If an expected cache saving does not appear, inspect the provider's reported cache usage and eligibility conditions rather than assuming repeated text was cached.
If test output exceeds the useful context for a repair, return a targeted failure summary and the relevant log excerpt to the model, while retaining the full log in your own workflow. Verify that the summary preserves the failing command, error, and location; otherwise, the agent may need extra calls or repair the wrong issue.
Conclusion
Start with an uncached estimate for the full repository edit-and-test loop, then add a separate cache scenario only when you can substantiate eligible reads. Check current units and conditions against OneMux pricing, and replace illustrative token counts with observed usage before committing a budget.
Sources
- Venice: Hy4 Preview model documentation — model specifications, capabilities, and Venice pricing.
- OneMux: Hy4 Preview and the supplied OneMux catalogue snapshot captured November 16, 2026 — catalogue prices and published ratio.
Published price snapshot
Captured 2026-11-16T19:00:05.958Z 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 Preview | $0.86 | $2.6 | $0.23478 | $0.7098 | 0.273 |
Current OneMux prices. Compare workload costs only when input/output and billing units match; see each model page for tier conditions.
FAQ
How much does Hy4 Preview cost for a repository coding task?
In the illustrative example, a task averaging 100,000 input tokens and 20,000 output tokens costs about $0.0377 at the supplied OneMux snapshot rates without cache reads, assuming those rates are per 1 million tokens. Actual cost depends on usage, billing units, and current terms.
Do test runs count toward API token costs?
Running tests locally is not itself a model token exchange. Test commands, logs, or summaries sent to the model count as input, while model-generated responses count as output under the provider's billing rules.
Can I assume repeated repository files receive the cache-read price?
No. Use the cache-read rate only for tokens the provider reports and bills as eligible, and check whether cache writes or other conditions carry separate charges.
Does Hy4 Preview's large context window prove it will pass repository tests?
No. The Venice documentation specifies a 1,048,576-token context window, but the supplied sources do not provide a measured repository test-pass rate for this workflow.
Related articles
Guides
GPT 6.2 Astra API cost for repository changes: a reproducible estimate
Estimate the token cost of repository changes and test verification, including cache use, context tiers, retries, and cost per accepted change.
Guides
Hy4 Preview API Cost Guide for Incident Diagnosis
Estimate Hy4 Preview costs for API incident diagnosis using explicit token assumptions, comparable prices, and reproducible examples.
Guides
Claude Fable 5.2 API costs for repository changes: a reproducible estimate
Estimate the API cost of repository code changes and test verification using explicit token assumptions, a dated price snapshot, and reproducible arithmetic.
Guides
MiniMax M3.1 Flash API Cost for Repository Changes: A Reproducible Estimate
Estimate MiniMax M3.1 Flash token costs for repository edits and test verification, with explicit assumptions, cache scenarios, and reproducible arithmetic.