How to Evaluate AI Coding Models on Your Own Code: Cost per Solved Task in ₹ (2026 Guide)
The cheapest model per token is often not the cheapest model per finished task, and public leaderboards can no longer settle the question for you. In February 2026 OpenAI stopped reporting SWE-bench Verified after finding contamination and flawed tests. The same model can score differently on two identical runs. The reliable answer comes from a small private evaluation on your own code: 20 to 30 tasks with tests, a few runs each, and one number that matters for your budget, the rupee cost per solved task.
This guide shows how to set that up in an afternoon, what to log, how to compute the metrics, and how to read the results without fooling yourself. It works for comparing models, comparing agents, or testing whether routing cheap and strong models saves money without hurting quality.
Feb 2026
OpenAI stopped reporting SWE-bench Verified, citing contamination and flawed tests
up to 15%
accuracy variation across identical runs at temperature 0 in one study
<25%
pass^8 for GPT-4o on tau-bench retail: success on all 8 tries of the same task
Why public coding benchmarks are not enough in 2026
Leaderboards are still useful for a shortlist. They are a poor basis for spending decisions, for three reasons.
- Contamination. SWE-bench Verified uses public GitHub issues and fixes that models may have seen in training. A 2025 study, The SWE-Bench Illusion, found models could name the right file to edit far more often on SWE-bench repositories than on others, with accuracy up to 76% on SWE-bench but at most 53% elsewhere. OpenAI's own audit of problems its models failed found many with tests that reject correct fixes.
- Saturation. Top models now cluster within a few points of each other on Verified, so small differences say little. Harder sets such as SWE-bench Pro spread models out again, but they are still not your code.
- No cost column. A leaderboard tells you how often a model succeeds, not what each success costs in rupees with your agent, your prompts and your repository.
That is why our coding agents research overview warned against treating a benchmark score as proof a model will work on your codebase. A private eval fixes all three problems: the tasks are unseen, you choose the difficulty, and you see the bill.
The metrics that matter
Metrics
What to measure for each model or setup
Run every task the same number of times for every model.
| Metric | How to compute it | What it tells you |
|---|---|---|
| Success rate | Passing runs ÷ all runs | How often the model gets it right on one try |
| pass^k | Share of tasks solved on all k runs | Consistency. A model you can trust to repeat |
| Median cost per task | Middle value of ₹ spent per run | Typical bill per attempt, ignoring outliers |
| Cost per solved task | Total ₹ across all runs ÷ number of passing runs | The real price of a working result |
| Time to passing solution | Median wall clock time of passing runs | How long you wait for a good answer |
| Regression rate | Runs where the target test passes but another test breaks ÷ passing runs | Hidden damage a pass hides |
pass^k comes from the tau-bench paper (Yao et al., ICLR 2025), which showed agents that look good on one try can be far less consistent across many.
success rate = runs that passed ÷ all runs
pass^3 = tasks solved on all 3 runs ÷ all tasks
Cost per solved task is the one to put at the top of your report. It folds in failed attempts, retries and long runs, which per token prices hide.
Why cheap per token is not always cheap per solve
Here is the arithmetic with illustrative numbers. These are not benchmark results. They show how the metric works.
Illustrative example
Two models on the same 24 tasks, 3 runs each
Hypothetical figures to show the calculation. Per step prices are Velona list prices on 16 October 2026 for 30,000 input and 1,000 output tokens.
| Model A (budget) | Model B (frontier) | |
|---|---|---|
| Cost per step | ₹0.30 | ₹7.16 |
| Average steps per run | 40 | 20 |
| Cost per run | ₹12.00 | ₹143.20 |
| Success rate | 60% | 90% |
| Cost per solved task | ₹20.00 | ₹159.11 |
In this example the budget model is still about 8 times cheaper per solve even though it needs twice the steps and fails more often. With different numbers the answer can flip, which is exactly why you measure.
Two things often change the picture on real code: a cheap model that loops for 100 steps on hard tasks, and a cheap model whose passing runs quietly break other tests. The regression rate and the cost distribution catch both.
Step by step: build your own coding model evaluation
Step 1. Pick 20 to 30 tasks with objective pass or fail checks
Use work from your own repositories, ideally from after the models' training cutoffs, so nobody has seen the answer. Every task needs a check a script can run: a failing test that should pass, a type check, or a command with an expected output.
Task mix
A balanced set of 24 tasks
| Category | Count | Example | Pass check |
|---|---|---|---|
| Bug fix | 8 | Duplicate email sent on retry | New regression test passes, full suite green |
| Feature | 6 | Add a CSV export endpoint | Provided acceptance tests pass |
| Refactor | 5 | Split a 600 line module without behaviour change | All existing tests still pass, lint clean |
| Test writing | 5 | Cover the discount calculator | Tests pass on correct code and fail on a planted bug |
For test writing tasks, a mutation check (plant a bug and confirm the new tests catch it) stops a model from passing with empty tests.
Write each task as a short markdown file: the instruction exactly as the agent will see it, the starting commit, and the command that decides pass or fail. Mix easy and hard. If every model solves every task, the eval tells you nothing.
Step 2. Standardise everything except the thing you are testing
Same starting pointSame repository, same commit, a clean checkout or git worktree for every run.
Same instructionsIdentical task text, identical system prompt and AGENTS.md for every model.
Same agent and permissionsSame agent version, same tools, same shell access, same network rules.
Same limitsSame maximum steps, same wall clock limit, same max output tokens.
Same judgeThe same test command decides pass or fail, run after the agent stops, not by the agent.
Record settingsLog model ID, temperature, agent version and date for every run.
If you are testing context engineering instead of models, hold the model fixed and change only the context, for example with and without your AGENTS.md. Our context engineering research review lists seven practices worth testing this way.
Step 3. Repeat each run
Model output varies even at temperature 0. One study found accuracy swings of up to 15% across identical runs, and the tau-bench authors found GPT-4o succeeded on fewer than 25% of retail tasks across all 8 of 8 tries even though it passed about 61% on a single try. Three runs per task is a practical minimum. Five is better for close calls.
Step 4. Log the evidence for every API call
Every OpenAI compatible API returns token counts with each response. Log them per call, tagged with the task and run, and keep measured values apart from estimates. If you use an agent that does not expose usage, the per request rupee cost in your Velona usage dashboard is the measured source.
import csv, os, time
from openai import OpenAI
client = OpenAI(api_key=os.environ["VELONA_API_KEY"], base_url="https://velona.in/v1")
def logged_call(task_id, run_id, model, messages, log="calls.csv"):
t0 = time.time()
resp = client.chat.completions.create(model=model, messages=messages, max_tokens=2000)
u = resp.usage
with open(log, "a", newline="") as f:
csv.writer(f).writerow([task_id, run_id, model, u.prompt_tokens,
u.completion_tokens, round(time.time() - t0, 2)])
return resp
Log schema
Two files are enough
| File | Columns | Measured or estimated |
|---|---|---|
| calls.csv | task, run, model, input tokens, output tokens, seconds | Measured from the API response |
| runs.csv | task, run, model, passed, regressions, steps, retries, total ₹, wall time | Passed and regressions measured by the test command. ₹ measured from the dashboard, or estimated from tokens × list price |
Mark any rupee figure computed from tokens and list prices as an estimate. Caching discounts and price changes mean the bill can differ.
Step 5. Compute the metrics
import pandas as pd
runs = pd.read_csv("runs.csv")
summary = runs.groupby("model").agg(
success_rate=("passed", "mean"),
median_cost=("total_inr", "median"),
total_cost=("total_inr", "sum"),
solved=("passed", "sum"),
)
summary["cost_per_solve"] = summary.total_cost / summary.solved
per_task = runs.groupby(["model", "task"]).passed.all()
summary["pass_all_runs"] = per_task.groupby("model").mean()
passed = runs[runs.passed == 1]
summary["regression_rate"] = passed.groupby("model").regressions.apply(lambda s: (s > 0).mean())
summary["median_time_to_pass"] = passed.groupby("model").wall_time.median()
print(summary.round(2))
Step 6. Read the results honestly
- Sample size. With 24 tasks, one task is about 4 percentage points. Treat gaps smaller than two or three tasks as a tie.
- Look at failures, not just totals. Read a few failed runs per model. A model that fails because of a flaky test is different from one that edits the wrong file.
- Check the cost spread. A low median with a few ₹200 runs means the model sometimes loops. A step limit or a fallback rule may fix it.
- Separate categories. A budget model may be fine for test writing and weak on refactors. That is a routing rule, not a reason to reject it.
- Rerun when prices or models change. Prices and model versions move every few months. Keep the task set and rerun it.
Use the same eval to test routing and trust
Once the task set exists, two more questions cost almost nothing to answer.
Run a third setup where a strong model plans and reviews and a cheap model does the edits. Compare its cost per solved task and regression rate with each model alone. Keep it only if quality holds.
A model that passes the target test but breaks two others, or solves a task on one run out of three, needs closer review. These two numbers tell you how much checking each model's work needs.
For a starting point on routing code, see our tutorial on building an AI model router in Python.
Do Habits that give trustworthy results
- Tasks from your own code, written after the models' cutoffs
- A test command that decides pass or fail, run outside the agent
- At least 3 runs per task per model
- Measured token and rupee logs, with estimates labelled
- The full test suite after every run, to catch regressions
- Reading a sample of failed runs by hand
- Writing down the limitations next to the results
Avoid Habits that mislead
- Copying tasks from public benchmarks or famous repositories
- Letting the agent report its own success
- One run per task and a winner declared on a two task gap
- Mixing measured costs with guesses in one column
- Checking only the target test
- Changing prompts or agent versions between models
- Treating your result as true for every codebase
Frequently asked questions
How do I choose the best AI coding model for my project?
Run a small private evaluation: 20 to 30 tasks from your own code, each with a test that decides pass or fail, at least 3 runs per task, and identical setup for every model. Compare success rate, regressions and cost per solved task in rupees rather than relying on public leaderboards.
What is cost per solved task?
It is the total amount spent across all runs divided by the number of runs that passed. It includes failed attempts and long runs, so it shows the real price of a working result better than the price per token.
Is SWE-bench Verified still a reliable benchmark?
Not on its own. In February 2026 OpenAI stopped reporting SWE-bench Verified because of contamination and flawed tests, and recommended SWE-bench Pro instead. Use public benchmarks for a shortlist and your own tasks for the final decision.
How many times should I run each task?
At least 3 times per model. Model output varies even at temperature 0, with one study finding accuracy swings of up to 15% across identical runs. Repeated runs also let you measure pass^k, the share of tasks solved on every attempt.
How do I track the cost of each coding task in rupees?
Log the input and output token counts returned with every API response and tag them by task and run. On Velona, the usage dashboard also shows the exact rupee cost of each request, which is the measured figure to use.
Can I use this method to test model routing?
Yes. Add a routed setup, for example a strong model for planning and review and a cheap model for edits, and run it on the same tasks. Keep it only if its cost per solved task is lower and its success and regression rates hold.
Test 300+ models with one key.
Every request shows its exact cost in rupees. Top up with UPI from ₹10.
Sources and method
This guide describes a method. It does not report benchmark results from Velona, and the worked example uses hypothetical success rates and step counts to illustrate the calculation. Per step rupee costs use Velona list prices on 16 October 2026 for 30,000 input and 1,000 output tokens.
- OpenAI, Why SWE-bench Verified no longer measures frontier coding capabilities (February 2026)
- The SWE-Bench Illusion: When State-of-the-Art LLMs Remember Instead of Reason (ICSE 2026)
- Yao et al., tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains (ICLR 2025)
- Atil et al., Non-Determinism of Deterministic LLM Settings
- Velona: Claude Sonnet 5 pricing in rupees
- Velona: DeepSeek price in India