Back to guides
Coding agents·September 21, 2026·9 min read

mini-SWE-agent cost: the free agent and the real API bill

mini-SWE-agent sells nothing, so the only question is what a run costs: its own $3 stop rule, the published per-issue record, and where that guard breaks.

Last reviewed on .

mini-SWE-agent costs $0. It is MIT-licensed software with no plan, no seat, no hosted tier and no account to buy, so "mini-SWE-agent cost" in practice means the model API bill of whatever endpoint you point it at. The number worth budgeting is tokens per run, and mini ships exactly one default guard on it: cost_limit: 3. in the configuration the mini command loads. That guard has a failure mode on a custom endpoint, covered below, and it is the single most expensive thing to get wrong here.

Three disambiguations first, because the search results mix them and each one puts wrong numbers on the page. SWE-agent, the original, is a different product with its own repository, its own documentation site and its own config schema; its README states that "Most of our current development effort is on mini-swe-agent, which has superseded SWE-agent" and recommends mini going forward, but it is not archived (20,382 stars, last push September 21, 2026), so treat it as maintained-but-superseded and never quote its defaults as mini's. "SWE-bench Verified Mini" is a dataset, not this agent, and has no price: its Hugging Face card describes it as a 50-instance subset of SWE-bench Verified chosen to cut storage and evaluation cost. And "mini" inside a model name is not this agent either: GPT 5 mini appears on mini's own leaderboard rows, and MiniMax is a vendor whose name simply starts the same way — so a sentence like "mini costs $0.047 per instance" is only true of one model run under mini-SWE-agent, and has to name both.

One thing to check for yourself if a third-party summary tells you otherwise: mini's licence is MIT. The GitHub licence API returns MIT, PyPI carries the License :: OSI Approved :: MIT License classifier, and the licence text bundled with the package reads "Copyright (c) 2025 Kilian A. Lieret and Carlos E. Jimenez".

What mini charges, and what actually bills you

Line itemWhat it costsSource, checked September 21, 2026
mini-SWE-agent, the software$0, MIT licencePyPI metadata for release 2.4.6, uploaded July 23, 2026, Python 3.10 or newer
A hosted mini serviceNone offeredNo pricing page and no plans in the documentation navigation; the repository serves no .github/FUNDING.yml
Model API tokensYour provider's per-token rateYour own account
Batch sandbox computeNo per-request charge when the sandbox runs on your own machinemini's SWE-bench usage page says of --environment-class: "Recommended are docker or singularity"; its API reference also documents local, bubblewrap and container environments
Cloud sandbox computeA third party's meterThe only shipped config implying paid infrastructure is the Modal benchmark one, which also switches the model class to a gateway
Benchmark scoringDescribed as free by miniIts SWE-bench page calls sb-cli cloud evaluation "extremely fast, cloud-based evaluations (and it's free!)"; that sentence is the only price statement. sb-cli itself meters submissions — its get-quotas page documents a per-subset "Remaining Runs" count and says "Quotas are refreshed periodically according to your subscription level", without publishing a number

The project is alive, which matters before you standardise on it: the repository is not archived and not disabled, 7,843 stars, created June 28, 2025, last push September 14, 2026, 70 open issues and pull requests together (the GitHub API's open_issues_count, September 21, 2026), and release v2.4.6 was published July 23, 2026.

mini's own spend controls, and the one that quietly stops working

mini is unusual among coding agents in shipping a dollar limit at all. There are four numbers, and they are not the same number.

WhereStep limitCost limitWhat it governs
config/mini.yaml — the mini command0 (unlimited)3.Your interactive runs; also starts in confirm mode
agents/default.py — library default03.0Anything constructing the agent directly
config/default.yaml00. (no limit)The bare config, with no ceiling at all
config/benchmarks/swebench.yaml2503.Per benchmark instance in a batch run

Read from the files on the main branch on September 21, 2026. Two properties change how you should treat the $3. First, it is a stop rule, not a cap: default.py checks 0 < cost_limit <= self.cost before a call, and the field's own docstring says "Stop agent after exceeding (!) this cost" — so the run halts once accumulated spend has already passed the ceiling, not before. Second, in the interactive CLI hitting it does not end anything: interactive.py prints the limits and the current spend, then prompts for a new step limit and a new cost limit. Unattended runs raise LimitsExceeded instead.

Across runs there are two environment variables, and both ship off: MSWEA_GLOBAL_CALL_LIMIT and MSWEA_GLOBAL_COST_LIMIT are documented on the global configuration page as "(0 = no limit) (default: 0)". They bound one mini process, not an account. Two more settings quietly add tokens: retries default to 10 attempts (MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT), and the agent aborts after 3 consecutive format errors. Whether a failed attempt is billed is your provider's decision, not mini's, and was not verified here.

Now the failure mode. mini's dollar figure is computed locally, by LiteLLM's price table — so a model id LiteLLM does not know makes the run raise on cost calculation, and the $3 ceiling has nothing to enforce. If you point the LiteLLM classes at a gateway, supply the rates yourself rather than reaching for MSWEA_COST_TRACKING="ignore_errors", which mini annotates "CAREFUL: This can lead to unmanaged spending!". The registry file is keyed on the model name without its provider prefix, in dollars per token, with litellm_provider matching your custom_llm_provider:

litellm-registry.json · LITELLM_MODEL_REGISTRY_PATH
{
  "claude-sonnet-5": {
    "input_cost_per_token": 0.0000020000,
    "output_cost_per_token": 0.0000100000,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

mini's own bill lands in the trajectory file: its output-files page documents info.model_stats with instance_cost ("total cost of API calls for this run") and api_calls, plus a cost on each assistant message. That is arithmetic over a price file you typed, not your provider's ledger — the one exception is mini's OpenRouter class, which asks that API to include usage accounting and then reads the charged cost out of the response. The full endpoint configuration is in the mini-SWE-agent setup page.

Cost per SWE-bench issue: the only published per-run figures

swebench.com offers a "Bash Only" entry into its Verified leaderboard, described on the site as "The default Verified view: every model in the same mini-SWE-agent environment" over 500 instances. In the site's own leaderboard code it is a preset rather than a separate board — the Agent filter narrowed to mini-SWE-agent with nothing else selected — and the rows it leaves standing are submissions whose trajectories are filed under bash-only. Each row carries an average cost per instance and an average number of model calls per instance. The last column below is derived here, not published: cost per instance divided by the resolved fraction, which assumes one attempt with the cost of failures counted in.

Model, as the leaderboard names itResolvedCost per instanceModel calls per instanceDerived cost per solved issue
GPT 5 mini56.2%$0.047220.3$0.084
MiniMax M2.5 (high)75.8%$0.073360.5$0.097
Kimi K2.5 (high)70.8%$0.146651.2$0.207
Gemini 3 Flash (high)75.8%$0.356056.1$0.470
Claude 4.5 Haiku (high)66.6%$0.330966.2$0.497
GPT 5.2 Codex72.8%$0.449428.1$0.617
DeepSeek V3.2 (high)70.0%$0.447888.5$0.640
GPT 5.2 (high)72.8%$0.473635.0$0.651
Claude 4.6 Opus75.6%$0.551528.9$0.729
GLM 5 (high)72.8%$0.534476.2$0.734
Claude 4.5 Sonnet (high)71.4%$0.657948.3$0.921
Claude 4.5 Opus (high)76.8%$0.753932.9$0.982
Gemini 3 Pro69.6%$0.960051.3$1.379

Scope, and it is the whole story: these are bash-only submission records read September 21, 2026 — SWE-bench Verified, 500 instances, each row tagged one attempt and mini v2.0.0, dated February 17 to 26, 2026, with cost as reported with each submission. The site does not document whether that figure is list price, a negotiated rate or mini's own LiteLLM estimate, so do not read it as a quote; nor does it record which environment class or step limit each submitter ran with, so neither is claimed here. A benchmark instance is not a developer's task: these are curated GitHub issues with a known fix, scored headless against a test patch.

Two readings survive that caveat. First, the ordering flips between the two cost columns three times. Claude 4.5 Haiku (high) is cheaper per instance than Gemini 3 Flash (high) and dearer per solved issue; DeepSeek V3.2 (high) undercuts GPT 5.2 Codex per instance and loses to it per fix; GLM 5 (high) undercuts Claude 4.6 Opus per instance and loses per fix. The per-instance figure hides two things at once: how often a model lands the fix, and how many model calls it burns getting there — 88.5 and 76.2 in those last two rows, against 28.1 and 28.9 for the models that beat them. Only GPT 5 mini leads on both columns. Second, the rows stop: February 26, 2026 is the newest mini submission on any of swebench.com's boards, so no model from the 2026 mid-year generation has a per-instance cost published there. Do not interpolate one. mini's own headline claim is separately worded — its documentation index says it "Scores >74% on the SWE-bench verified benchmark", which is a statement about a model under mini on 500 curated issues.

A worked estimate on live catalog rates

This is illustrative token arithmetic, not a measured task cost and not a bill ceiling. mini "has a completely linear history — every step of the agent just appends to the messages", so the whole conversation is re-sent every step and input dominates. Assume one run of 40 model calls (inside the roughly 20-to-89 band the leaderboard rows show), a conversation that reaches 40,000 tokens by the last call so the average request carries about half that, giving 800,000 input tokens across the run, and 400 output tokens per call, 16,000 in total. Every token is priced as fresh input: no cache discount is assumed, because whether a chat-completions gateway acts on the cache_control markers mini attaches was not tested for this page. Rates are live Kunavo catalog prices per million tokens.

ModelInput / output per 1MEstimate for the assumed runAgainst mini's shipped $3 ceiling
GPT-5.6 Luna$0.07 / $0.42$0.06347.8× headroom
Claude Haiku 4.5$0.40 / $2.00$0.3528.5× headroom
Gemini 3.8 Flash$0.525 / $2.625$0.4626.5× headroom
GPT-5.6 Terra$0.70 / $4.20$0.6274.8× headroom
Claude Sonnet 4.6$1.20 / $6.00$1.0562.8× headroom
Claude Sonnet 5$2.00 / $10.00$1.7601.7× headroom
Claude Opus 5$2.00 / $10.00$1.7601.7× headroom

Read it as a ratio. Under these assumptions the spread between GPT-5.6 Luna and Claude Opus 5 is about 28×, which is a bigger lever than anything in mini's configuration — and every row fits inside the default $3 stop rule, so that ceiling is a runaway guard rather than a budget. One detail the price tables miss: the long-context tiers the catalog declares for the GPT shelf and for Gemini 3.1 Pro are per request, not per run, so what matters is how large a single mini prompt grows, not the run total. mini's shipped observation template helps here, capping each observation at 10,000 characters and sending the first 5,000 and last 5,000 plus an elided count above that.

One scope note while you budget a pipeline around mini: Kunavo serves no embedding model, no text-to-speech model and no speech-to-text model, so a script that indexes a repository or transcribes audio alongside your runs keeps its own provider key for that step. mini itself only ever asks a model to produce text with one bash tool attached — chat completions on its default litellm class, or the Responses API on its *_response classes.

Kunavo's catalog amount is a billing floor rather than a cap: when the upstream reports its charge, the bill is the greater of catalog cost and upstream cost times the applicable markup. Cache charges and external tools sit outside this example. The minimum top-up is $10 in prepaid credit — a funding minimum, not a task fee or a subscription. See billing details and how cached tokens are priced.

Best API for mini-SWE-agent: which route wins when

The choice is narrower than it looks, because mini's model classes are not equally open. It ships gateway classes for three companies — OpenRouter, Requesty and Portkey, each with protocol variants — and none of them exposes an api_base field. The OpenRouter and Requesty classes go further and hardcode that vendor's URL in the class itself, beside a fixed key variable (OPENROUTER_API_KEY, REQUESTY_API_KEY); the Portkey classes name no URL at all and hand the request to the portkey-ai client with a PORTKEY_API_KEY, so the destination is whatever that SDK resolves. Either way, picking one of them picks that company's terms too. The LiteLLM family is the one you repoint from a config file.

RouteWins whenWhat you give up
Direct vendor APIYou stay on one vendor's flagship and want its own caching and batch discountsA second vendor means a second account and a second balance
OpenRouter, via mini's own classYou want mini's cost readout to be the charged amount rather than a local estimate — this class asks the API for usage accountingIts URL is fixed in the class. Its FAQ says it passes provider pricing through with no markup on inference and charges on credit purchases instead — 5.5% with a $0.80 minimum on card, 5% on crypto (checked September 21, 2026), so compare on funding terms
Requesty, via mini's own classSame one-key convenience, different fee shapeIts pricing page states a 5% markup on model cost for pay-as-you-go, above a free tier limited to free models at 200 requests a day (checked September 21, 2026)
Portkey, used by mini's shipped Modal configYou already run Portkey for observabilityA platform fee above the model bill — its pricing page lists a free Developer tier with 10,000 recorded logs a month and 3-day retention, and $49/month Production (checked September 21, 2026). mini's class also needs the portkey-ai package and a key or it raises at construction
An OpenAI-compatible gateway, via the LiteLLM classYou want one key and one balance on an endpoint mini has no class forA YAML file rather than an environment variable, and a registry file so the cost limit keeps working — see above
A local modelSmall or private work with no per-request chargeThe capability gap against hosted frontier models, plus the hardware; mini documents this path with a local api_base

Two boundaries worth knowing before you plan around them. mini's documented examples use vendor-native LiteLLM ids with provider prefixes, and a gateway's own ids are different strings that will not resolve at a vendor endpoint — mini's shipped SWE-bench benchmark config, for instance, sets model_name: "anthropic/claude-sonnet-4-5-20250929", which is an Anthropic-native id — copy that file unchanged and you are pointing at Anthropic, so swap the id for whatever your own endpoint publishes. And mini has three protocol paths: the default litellm class calls chat completions with native tool calling, litellm_textbased reaches the same endpoint with the older text-parsed actions, and litellm_response calls the OpenAI Responses API with a different tool schema, which a chat-completions-only endpoint cannot serve. mini-SWE-agent vs Claude Code covers that configuration in full, and OpenAI-compatible API and LLM gateway cover the generic pattern.

Cheapest API for mini-SWE-agent: two different questions

The table above already separates them. Cheapest listed price ranks by dollars per million tokens; lowest cost to finish the task ranks by what it takes to land a working change. mini makes the gap wider than usual, for a structural reason: its linear history means an extra step does not add one message, it adds one more full re-send of everything before it. A model that needs 88 calls where another needs 29 pays that surcharge on every one of them — which is exactly what the derived column shows, with two rows at similar per-instance cost separated by their call counts. Pick the least expensive model that finishes your work with review effort you accept, run one bounded task, and read the charge your own account recorded for it rather than the client's readout. AI cost optimization covers that method, and cheapest Claude API if Claude is the family you have settled on.

Setting it up and checking the first bill

Kunavo publishes a configuration reference for mini-SWE-agent. That is a published setup page, not a compatibility test: mini has not been runtime-tested here against Kunavo's endpoint — no session, no streamed turn, no tool round-trip — and everything above was read from mini's own source and documentation. Specifically unverified: whether LiteLLM's openai/ path negotiates mini's v2 default of native tool calling against a chat-completions surface, and whether cache_control markers are acted on. Keep a working route available while you try it, write the registry file first so the cost limit is live, run one bounded task, then reconcile. Start at the mini-SWE-agent integration guide and create a Kunavo account when you are ready to fund a key.

Comparing clients rather than providers? Aider pricing and OpenCode pricing cover two more agents with the same split between a free harness and a metered model bill.

FAQ

How much does mini-SWE-agent cost?

The software costs nothing. mini-SWE-agent is MIT licensed, the current release on PyPI is 2.4.6 uploaded July 23, 2026, requiring Python 3.10 or newer, and neither its documentation site nor its package listing offers a plan, a seat, a hosted tier or an account to buy — the repository does not even carry a sponsorship file. What you pay is the model API bill of whatever endpoint you point it at, plus sandbox compute if you run batches on a paid host instead of local Docker. The only spend guard in the configuration the mini command loads is cost_limit: 3. per run, and the two cross-run environment limits, MSWEA_GLOBAL_COST_LIMIT and MSWEA_GLOBAL_CALL_LIMIT, both default to 0 meaning no limit.

Does mini-SWE-agent have a subscription or a paid plan?

No. mini publishes no pricing page and no plans in its documentation navigation. Every model class it ships authenticates with an API key read from the environment — a vendor key on the LiteLLM classes, or OPENROUTER_API_KEY, REQUESTY_API_KEY or PORTKEY_API_KEY on the gateway ones — and none of them documents a chat-product login or a plan allowance as an input. So budget mini as metered tokens: that is the sharp edge against agents that can run on a consumer plan.

What is the best API for mini-SWE-agent?

It depends on which of mini's model classes you use, because they are not equally open. None of its gateway classes exposes an api_base field — the OpenRouter and Requesty ones hardcode that vendor's URL, and the Portkey ones delegate to the portkey-ai client — so choosing openrouter, requesty or portkey chooses that company's billing terms as well. The LiteLLM classes are the ones you can repoint: the endpoint goes in model.model_kwargs as custom_llm_provider plus an api_base, since mini's documentation says model_kwargs is passed directly to litellm.completion. A direct vendor API wins when you stay on one vendor's flagship and want its own caching and batch discounts. A gateway wins when you switch models per task and want one key and one balance. A local model through an OpenAI-compatible server wins for small or private work with no per-request charge. Note that mini's own OpenRouter class reads the charged cost out of the API response, while the LiteLLM path prices your run from a local table.

What is the cheapest API for mini-SWE-agent?

Cheapest rate and cheapest outcome are different claims, and the SWE-bench bash-only rows separate them. On SWE-bench Verified, 500 instances, one attempt, under mini v2.0.0 in February 2026, GPT 5 mini averaged $0.0472 per instance at 56.2 percent resolved, while Gemini 3 Pro averaged $0.9600 at 69.6 percent. Divide by the resolved fraction and the gap narrows from roughly twenty times to about sixteen — still large, but the ranking flips three times in the middle of the table, where a model that is marginally cheaper per instance while spending 88.5 model calls to another's 28.1 ends up costing more per fix. Those costs are as reported with each submission, on a curated benchmark, not a quote you can buy and not a developer's own task. Shortlist the least expensive model that finishes your work with review effort you accept, then read what your own account recorded for one bounded run.

How much does one task cost in mini-SWE-agent?

No one has published a per-task figure for ordinary development work, and this page does not invent one. The only official per-run numbers are swebench.com's bash-only submission records, whose newest mini row is dated February 26, 2026, and they describe 500 curated GitHub issues rather than your repository. What you can bound instead is shape: mini keeps a completely linear history, so the whole conversation is re-sent on every step and input tokens dominate; its shipped configuration caps each observation at 10,000 characters, passing the first 5,000 and last 5,000 plus an elided-character count above that; and the leaderboard rows show between about 20 and 89 model calls per instance. Multiply your own average prompt size by your own step count, then reconcile against your provider's ledger.

Why does mini-SWE-agent fail with a cost-calculation error on a custom endpoint?

Because mini's LiteLLM model classes price each call by looking the model id up in LiteLLM's registry, and a gateway's own id is usually not in it, so the run raises a RuntimeError on cost calculation rather than on a bad answer. The documented repair is a model-registry JSON file, pointed at by LITELLM_MODEL_REGISTRY_PATH or the litellm_model_registry config key, keyed on the model name without its provider prefix, with values in dollars per token and litellm_provider matching your custom_llm_provider; mini's local-models page also warns that model names are case sensitive. The alternative switch, MSWEA_COST_TRACKING set to ignore_errors, removes the guard instead of repairing it — mini labels it "CAREFUL: This can lead to unmanaged spending!" — and with cost tracking off the per-run cost_limit has nothing to enforce.

Checked September 21, 2026 by fetching each source directly: mini-SWE-agent's PyPI metadata; its GitHub repository metadata and latest release; config/mini.yaml, config/default.yaml, config/benchmarks/swebench.yaml, agents/default.py, agents/interactive.py, models/__init__.py and models/openrouter_model.py on the main branch; its documentation index and its global-configuration, local-models, SWE-bench usage and output-files pages; swebench.com's homepage submission records, its Verified leaderboard and its leaderboard-filter source, plus the sb-cli get-quotas page and the Hugging Face card for SWE-bench Verified Mini; the SWE-agent repository metadata and README; and the OpenRouter FAQ plus the Requesty and Portkey pricing pages. Gateway fee figures are each scoped to the plan named beside them. Not checked here and therefore not claimed: any vendor list price, any discount against one, and anything about how a failed or retried call is billed. No mini run was executed against Kunavo and no benchmark result was reproduced; Kunavo token rates come from the live catalog, and every dollar example here is illustrative token arithmetic.