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
| Question | OpenHands | SWE-agent |
|---|---|---|
| Product shape | General coding-agent platform and SDK | Research-oriented issue-solving agent |
| Typical environment | Sandboxed runtime with UI/CLI and agent configuration | SWE-ReX/repository environment and configurable terminal tools |
| OpenAI-compatible path | LiteLLM/provider settings with Base URL | Model api_base and OpenAI-compatible provider via LiteLLM |
| New deployment recommendation | Evaluate current OpenHands release | Evaluate mini-swe-agent before choosing maintained SWE-agent |
| Main cost risk | Many prompts, retries and broad agent behavior | Long 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:
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-envsOpenHands 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:
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: 0SWE-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 trajectory | Assumed tokens | Terra | Sol | Sonnet 4.6 |
|---|---|---|---|---|
| Short: localized fix | 80k input / 10k output | $0.105 | $0.210 | $0.195 |
| Medium: reproduce, patch, test | 250k / 35k | $0.345 | $0.690 | $0.6375 |
| Long: multi-file investigation | 600k / 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
| Control | Why it matters |
|---|---|
| Per-issue call limit | Stops unattended loops from converting uncertainty into spend |
| Test timeout and output truncation | Prevents huge terminal logs from re-entering context |
| Retry cap | Avoids multiplying the same provider or schema failure |
| Model allowlist | Stops an issue or config from selecting an unapproved premium route |
| Accepted-patch metric | Distinguishes cheap failed trajectories from useful work |
| Request correlation id | Connects 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
| Situation | Recommendation |
|---|---|
| Building an internal multi-user agent platform | Start by evaluating OpenHands |
| Reproducing an existing SWE-agent research pipeline | Maintain SWE-agent with pinned versions and limits |
| Starting a new lightweight issue agent | Include mini-swe-agent in the evaluation |
| No sandbox or usage reconciliation | Do 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
- OpenHands LLM configuration
- OpenHands environment variables
- SWE-agent model and API-key documentation
- SWE-agent model configuration reference
- OpenHands repository
- SWE-agent repository
The cost scenarios are original calculations, not observed agent benchmark runs.