Pricing13 min readPublished 2026-07-26

How Much Does SWE-agent Cost to Fix One GitHub Issue?

Estimate SWE-agent API cost by repository search, editing and testing stages, configure an OpenAI-compatible LumeAPI route and account for failed runs.

By LumeAPI Engineering Team

Cheap LLM API hub → Compare Lower-Cost Agent Models →

Short path: Cheap LLM API · Cheap OpenAI API · AI agent API · Usage logs · AI API pricing · Models

Last verified: July 26, 2026

A SWE-agent issue run calculates to about $0.105 for a short Terra trajectory, $0.69 for a medium Sol trajectory or $1.62 for a long Sol trajectory under the scenarios below. A failed run repeated from scratch roughly doubles model cost. SWE-agent’s current official documentation also says the project is maintenance-only and recommends evaluating mini-swe-agent for new deployments.

Quick answer

Issue typeToken assumptionCandidate routeCalculated LumeAPI cost
Localized fix80k input / 10k outputGPT-5.6 Terra$0.105
Reproduce, patch and test250k / 35kGPT-5.6 Sol$0.690
Long multi-file investigation600k / 80kGPT-5.6 Sol$1.620
Long Claude route600k / 80kClaude Sonnet 4.6$1.500

These are cost models, not observed SWE-agent success rates.

In short

A SWE-agent issue run calculates to about $0.105 for a short Terra trajectory, $0.69 for a medium Sol trajectory or $1.62 for a long Sol trajectory under the scenarios below.

What SWE-agent does

SWE-agent converts a GitHub issue or problem statement into an agent trajectory over a repository environment. The model searches files, executes terminal-oriented tools, edits code, runs reproduction steps or tests and submits a patch. Its configuration controls prompts, tools, parsers, model settings, retries and per-instance limits.

text
GitHub issue
   ↓
Repository environment
   ↓
Search → inspect → edit → test → revise
   ↓
Submitted patch and trajectory

The official docs now place SWE-agent in maintenance mode and point new users to mini-swe-agent. Existing benchmark or CI pipelines may still justify a pinned SWE-agent version; a new project should compare both.

Candidate LumeAPI configuration

SWE-agent documents OpenAI-compatible endpoints through its LiteLLM-based model configuration:

yaml
agent:
  model:
    name: openai/gpt-5.6-sol
    api_base: https://api.lumeapi.site/v1
    api_key: $LUMEAPI_API_KEY
    per_instance_call_limit: 80
    per_instance_cost_limit: 0

Use the exact LumeAPI model id after the openai/ client prefix. Unknown model metadata may require a custom LiteLLM registry for internal cost tracking. Do not enter the Research publishing secret as the model key.

This is a candidate configuration. Test function calling, streaming, tool parsing and the installed SWE-agent version before batch execution.

Medium-issue cost breakdown

Assume a 250k-input/35k-output issue. The stages below sum to that total.

StageInput/output tokensTerra costSol cost
Clone context and understand issue60k / 5k$0.0675$0.1350
Search and inspect repository80k / 8k$0.0960$0.1920
Edit and reason about patch60k / 12k$0.0990$0.1980
Run tests and repair failure50k / 10k$0.0825$0.1650
Total250k / 35k$0.3450$0.6900

The phase labels are analytical allocations. Actual API records will show requests, not “search-stage dollars,” unless the application tags each round.

Failed-run economics

If one medium Sol attempt costs $0.69 and fails, then a second identical attempt makes total spend $1.38. If only the second patch is accepted, cost per accepted issue is $1.38—not $0.69.

Common failure multipliers are:

  • Incorrect reproduction environment.
  • Repeated test timeouts.
  • Tool-call parser mismatch.
  • Oversized terminal observations.
  • Wrong base commit or stale issue description.
  • Automatic API retries followed by a full semantic rerun.

Set both call and wall-time limits. SWE-agent’s reference exposes per_instance_call_limit, cost controls and retry settings; LumeAPI usage records should be reconciled independently.

Production scenario: 100 issues

Assume 60 short Terra runs, 30 medium Sol runs and 10 long Sol runs:

  • 60 × $0.105 = $6.30
  • 30 × $0.69 = $20.70
  • 10 × $1.62 = $16.20

Calculated model spend is $43.20 before failures. With 20% retry overhead it becomes $51.84. If only 40 patches are accepted, model cost per accepted patch is $1.30 after that overhead.

This should be compared with reviewer time and regression risk, not used as a claim that an agent replaces a developer. A fast rejected patch has no delivery value.

How to control issue-level spend

  1. Triage issue reproducibility before starting the coding agent.
  2. Pin repository revision and agent configuration.
  3. Limit call count, elapsed time and test output.
  4. Use Terra for bounded issues and Sol only under an explicit complexity rule.
  5. Stop identical failures rather than resetting blindly.
  6. Attach trajectory id and LumeAPI request ids to the issue.
  7. Measure accepted patches and reviewer corrections.

Compare the architecture with OpenHands versus SWE-agent, the PR denominator in coding-agent cost per pull request, and the long-session model in 100 tool-call cost.

What most guides get wrong

The usual mistake on How Much Does SWE-agent Cost to Fix One GitHub Issue? is to chase the lowest posted per-million-token rate while ignoring orchestration: repeated context, oversized tool output, silent retries, and premium-model defaults often dominate the invoice.

A cheaper list price does not help when every agent hop resends the same repository map or when failed tests trigger unbounded re-runs. Optimize cost per successful task—not the price of a single completion—before you renegotiate vendor contracts or swap gateways.

A realistic production scenario

A six-person platform team standardized on one premium model for How Much Does SWE-agent Cost to Fix One GitHub Issue? after a strong demo score. Early invoices looked fine; by week three, failing test loops had doubled input tokens without more accepted output.

They kept the orchestrator but tightened routing: a lower-cost catalog model handled exploration, a mid-tier model handled implementation, and premium routes required a logged failure condition. They truncated test logs and stopped attaching full diffs on every retry.

The breakthrough was reconciling LumeAPI usage records with task ids. Token list price mattered less than eliminating duplicate context across retries.

Expert take

LumeAPI is an independent third-party OpenAI-compatible gateway—not OpenAI, Anthropic, or Google. Published catalog rates can be materially below official reference pricing, but compatibility does not guarantee identical behavior for every native feature, streaming edge case, tool schema, Batch workflow, or prompt-cache semantics.

Follow this advice when you control prompts, retries, and routing and need auditable USD billing across GPT, Claude, and Gemini on one key. Do not cut over blindly if you depend on provider-native capabilities your stack has not tested end to end.

Run a bounded smoke test on your exact SDK, model id, streaming mode, and tool path; reconcile usage logs with orchestrator task ids; and keep a fallback route until error rates and latency are acceptable.

FAQ

Is SWE-agent still maintained?

Its repository remains active, but its official documentation describes SWE-agent as maintenance-only and recommends mini-swe-agent for new work.

Can SWE-agent use an OpenAI-compatible API?

Its current documentation supports OpenAI-compatible endpoints through model configuration. Verify the exact model and tool parser.

Which LumeAPI model should fix issues?

Start with Terra for bounded work and evaluate Sol or Sonnet for harder trajectories. Use your accepted-patch data rather than a universal recommendation.

Does the calculation include GitHub Actions or sandbox cost?

No. It covers model tokens only. Compute, storage, network and review are separate.

Sources and methodology

No customer issue data or success-rate benchmark is represented as a LumeAPI result.

Ready to call these models?

Create a LumeAPI key in under a minute — one OpenAI-compatible gateway for GPT, Claude, Gemini, and more.