Guides15 min readPublished 2026-07-26

OpenHands vs SWE-agent: Which Self-Hosted Agent Fits GitHub Issue Work?

Compare OpenHands and SWE-agent by architecture, maintenance status, OpenAI-compatible configuration and calculated LumeAPI cost per GitHub issue.

By LumeAPI Engineering Team

LLM API Gateway hub → Build a Production Agent Backend →

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

Last verified: July 26, 2026

Choose OpenHands when you need a broader agent platform, UI/CLI workflows and configurable LLM roles. Choose SWE-agent when you are maintaining an existing research-style GitHub issue pipeline—but note that its official documentation now says SWE-agent is maintenance-only and recommends mini-swe-agent for new work. Both can target OpenAI-compatible endpoints, but every model route must pass tool-calling and sandbox tests.

On July 26, 2026, OpenHands had 82,102 GitHub stars and SWE-agent had 19,914. Both repositories were public and active; SWE-agent’s documented maintenance status matters more than its star count.

Quick answer

QuestionOpenHandsSWE-agent
Product shapeGeneral coding-agent platform and SDKResearch-oriented issue-solving agent
Typical environmentSandboxed runtime with UI/CLI and agent configurationSWE-ReX/repository environment and configurable terminal tools
OpenAI-compatible pathLiteLLM/provider settings with Base URLModel api_base and OpenAI-compatible provider via LiteLLM
New deployment recommendationEvaluate current OpenHands releaseEvaluate mini-swe-agent before choosing maintained SWE-agent
Main cost riskMany prompts, retries and broad agent behaviorLong trajectories, retry defaults and batch issue runs

In short

Choose OpenHands when you need a broader agent platform, UI/CLI workflows and configurable LLM roles. Choose SWE-agent when you are maintaining an existing research-style GitHub issue pipeline—but note that its official documentation now says SWE-agent is maintenance-only and recommends mini-swe-agent for new work.

Architecture: platform versus trajectory runner

OpenHands is broader than a benchmark harness. Its current documentation exposes UI and CLI model settings, custom LLM configurations, repository customization, hooks, sandboxing and an Agent SDK. It can assign named model configurations to different roles, which makes cheap exploration plus premium code writing possible—but also creates more operational surface.

SWE-agent centers on an issue/problem statement, a repository environment, tools, prompts, action parsing and an agent trajectory. It supports single and batch runs, cost/call limits, retry configuration and custom model registries. That makes it useful for controlled experiments and existing CI research pipelines. Its own current docs, however, say it has been superseded by mini-swe-agent and is maintenance-only.

Candidate LumeAPI configuration

OpenHands exposes model, key and Base URL settings. A development-mode environment example is:

bash
export LLM_MODEL="openai/gpt-5.6-terra"
export LLM_API_KEY="sk-your-lumeapi-key"
export LLM_BASE_URL="https://api.lumeapi.site/v1"
openhands --override-with-envs

OpenHands uses LiteLLM-style provider prefixes. Confirm the current UI/CLI version and do not assume every new model’s metadata is already registered.

A SWE-agent staging configuration can declare an OpenAI-compatible route explicitly:

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

SWE-agent documents OpenAI-compatible endpoints and warns that unknown model prices may require a custom LiteLLM registry or disabled internal cost tracking. LumeAPI’s own usage log should remain the billing source of truth.

Cost per GitHub issue

Use three controlled token scenarios rather than pretending that “40 tool steps” has one fixed token count.

Issue trajectoryAssumed tokensTerraSolSonnet 4.6
Short: localized fix80k input / 10k output$0.105$0.210$0.195
Medium: reproduce, patch, test250k / 35k$0.345$0.690$0.6375
Long: multi-file investigation600k / 80k$0.810$1.620$1.500

These calculations use current LumeAPI rates and exclude infrastructure. OpenHands containers, SWE-ReX execution, CI minutes, storage and review time are separate costs. A failed run retried from scratch can double model spend.

Reliability controls that change the bill

ControlWhy it matters
Per-issue call limitStops unattended loops from converting uncertainty into spend
Test timeout and output truncationPrevents huge terminal logs from re-entering context
Retry capAvoids multiplying the same provider or schema failure
Model allowlistStops an issue or config from selecting an unapproved premium route
Accepted-patch metricDistinguishes cheap failed trajectories from useful work
Request correlation idConnects the issue, agent trace and LumeAPI usage record

SWE-agent’s model reference documents retry defaults and instance limits. OpenHands documents retry controls and warns that it issues many prompts. Set limits in the harness and monitor the gateway; do not rely on one layer.

Production scenario

A platform team processing 100 issues per month could first triage all issues with a cheap model, then run a coding agent only on well-specified, reproducible candidates. If 60 short Terra runs cost $0.105 each, 30 medium Terra runs cost $0.345 and 10 long Sol runs cost $1.62, the calculated model total is $32.85 before retries and infrastructure.

The number is useful only with outcomes. If just 20 patches are accepted, model cost per accepted patch is $1.64. If 50 are accepted, it is $0.66. Track review time and regressions as additional costs.

Use the AI-agent cost control guide and the upcoming issue-level methodology in coding-agent cost per pull request.

Decision matrix

SituationRecommendation
Building an internal multi-user agent platformStart by evaluating OpenHands
Reproducing an existing SWE-agent research pipelineMaintain SWE-agent with pinned versions and limits
Starting a new lightweight issue agentInclude mini-swe-agent in the evaluation
No sandbox or usage reconciliationDo not run autonomous issue workloads yet

What most guides get wrong

The usual mistake on OpenHands vs SWE-agent: Which Self-Hosted Agent Fits GitHub Issue Work? 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 OpenHands vs SWE-agent: Which Self-Hosted Agent Fits GitHub Issue Work? 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 abandoned?

Its repository remains active, but its official docs describe it as maintenance-only and direct new users toward mini-swe-agent. Those facts can coexist.

Can both use LumeAPI?

Both document model configurations that can target OpenAI-compatible endpoints. A real tool-call and patch test is still required for each model/harness version.

Which one is cheaper?

The answer depends on token trajectories, retries, infrastructure and accepted patches. Platform breadth does not automatically mean higher or lower model cost.

Should I copy SWE-bench scores into this decision?

Only if the exact agent, model, budget and benchmark version match your question. Production issue cost requires your repository and acceptance criteria.

Sources and evidence boundary

The cost scenarios are original calculations, not observed agent benchmark runs.

Ready to call these models?

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