EcoCoder by LeanLM · Delegated Coding Subagent & Drop-In API
Cut your coding API bill 4×–5× — by delegating or running OpenCode, pi & Cline.
Keep Claude Code or Codex as your lead and delegate bounded tasks to @ecocoder, or wire open-source agents (OpenCode, pi, Cline) straight to api.leanlm.ai. Ties Opus & Sonnet on Java (91.7%) at 4.52s/turn with $0 cache-write fees.
Instant eco_live_... key via Google, GitHub, or email (no card required) · 2× bonus on your first Stripe refill (up to $100) · 2-min quickstart →
Set up EcoCoder (https://api.leanlm.ai) in this environment using https://api.leanlm.ai/setup.md. Verify the CLI SHA-256 checksum, detect which agent we are running in, show me any config files before editing, and wire the repo-synced ecocoder workflow (delegate @ecocoder in Claude Code/Codex, or synced CLI/proxy in OpenCode/pi/Cline). Never ask me to paste my API key in chat — tell me when to run `ecocoder login`, then verify with `ecocoder check`.
Paste into Claude Code, Codex, OpenCode, pi, or Cline / Kilo Code · SHA-256 verified · key stays out of chat · secrets skipped via ecocoder sync-preview.
# One command installs the EcoCoder skill for Claude Code and Codex: ecocoder install-subagent --global # Or launch a full interactive Claude Code / Codex session on EcoCoder: ecocoder claude ecocoder run -- codex -m ecocoder
# Run from your repo root (key stays inside ~/.ecocoder/key):
OPENCODE_CONFIG_CONTENT='{"provider":{"leanlm":{"npm":"@ai-sdk/openai-compatible","name":"LeanLM EcoCoder","options":{"baseURL":"{env:OPENAI_BASE_URL}","apiKey":"{env:OPENAI_API_KEY}"},"models":{"ecocoder":{"name":"EcoCoder","limit":{"context":130000,"output":32768}}}}},"model":"leanlm/ecocoder"}' ecocoder run -- opencode
# Run from your repo root (`ecocoder pi` auto-provisions an isolated models.json): ecocoder pi
# Run from your repo root, then set Provider: OpenAI Compatible # Base URL: http://127.0.0.1:8787/v1 | API Key: ecocoder-local-proxy | Model: ecocoder ecocoder proxy
# 1. Read key silently (never written to shell history or exported)
printf "EcoCoder API key: " >&2 && IFS= read -rs ECOCODER_API_KEY && echo
# 2. Direct HTTPS (no CLI install, zero repo sync; header via stdin avoids ps exposure)
printf 'header = "x-api-key: %s"\n' "$ECOCODER_API_KEY" | curl -i -sS -K - https://api.leanlm.ai/v1/messages \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"ecocoder","max_tokens":256,"messages":[{"role":"user","content":"Write a pytest check for Retry-After."}]}'
Step 1 (once per machine): Install SHA-256 verified ecocoder v1.6.7 & sign in
mkdir -p ~/.local/bin && tmp=$(mktemp) && \ curl -fsSL https://api.leanlm.ai/ecocoder -o "$tmp" && \ (printf "cae65789e1acc1803b0aa781057b462677f673b19695563c4b827b59be565788 %s\n" "$tmp" | shasum -a 256 -c - 2>/dev/null || \ printf "cae65789e1acc1803b0aa781057b462677f673b19695563c4b827b59be565788 %s\n" "$tmp" | sha256sum -c -) && \ chmod +x "$tmp" && mv "$tmp" ~/.local/bin/ecocoder && \ export PATH="$HOME/.local/bin:$PATH" ecocoder login && ecocoder check
9.2× lower cost (−$2.91), +2 tests passed, and 46% shorter wall time on this multi-file Python codebase.
HTTP/2 200 · X-LeanLM-Receipt-Id: rcpt_01J_circuit_eval_r3 $ ecocoder stats --run-id circuit-eval-r3 Settled spend: $0.357 (566/566 tests) · GPU energy: 86.6 kJ (provider-reported)
4.3× lower cost (−$1.04), 100% existing tests intact (−1 new test vs. Opus).
HTTP/2 200 · X-LeanLM-Receipt-Id: rcpt_01J_env_manager_r3 $ ecocoder stats --run-id env-manager-r3 Settled spend: $0.317 (302/304 tests) · GPU energy: 55.0 kJ (provider-reported)
5.0× lower total cost (−$14.30) across commons-cli, commons-codec, JSON-java, commander.js, and node-semver (Java tied Opus & Sonnet at 33/36; 1/72 timeout vs. 3–14/24 on comparable-cost open-weight APIs).
HTTP/2 200 · X-LeanLM-Receipt-Id: rcpt_01J_oss_24_pooled $ ecocoder stats --run-id oss-unseen-24-k3 Settled spend: $3.55 (59/72 resolved · 91.7% Java) · GPU energy: 310.41 kJ (provider-reported)
ecocoder CLI for full repo-aware coding-agent optimization (secrets like .env* skipped locally; Direct HTTPS runs stateless with zero repo sync). Every response returns X-LeanLM-Receipt-Id for ecocoder stats or Portal · Installer & CLI SHA · Status
Charges, Benchmarks & Design
How EcoCoder keeps agentic coding affordable without cutting corners.
Coding agents burn tokens in multi-turn loops—through high per-token base rates, 1.25×–2× prompt cache-write surcharges, and repeated debugging turns. EcoCoder keeps one flat $0.30/$0.03/$1.20 schedule with $0 cache-write fees, executes individual turns faster than Opus 5.5 on brownfield Python (17.5s/turn vs. 21.1s/turn), and keeps 98.66% of existing tests passing at 4×–6× lower settled API cost.
Low Cost & How Charges Work
Flat per-token pricing with $0 cache-write fees.
Published Standard rates are $0.30 per 1M uncached input tokens, $0.03 per 1M cached input tokens (90% off, $0 write fee vs. 1.25×–2× vendor surcharges), and $1.20 per 1M output tokens across all context lengths (cost calculator →). Across SlopCodeBench v1.0, EcoCoder settled at $7.87 ($0.0920/1M blended)—4× lower than Opus 5.5 ($31.81) and 26% lower than Haiku 5.5 ($10.60 billed once sessions crossed 100k context; receipt ledger →).
Brownfield & OSS Benchmark Scope
Built for real repositories — 91.7% Java (tied #1).
Across 24 held-out Java & JS PRs (k=3 = 72 runs/arm), EcoCoder resolved 59/72 (81.94%) ahead of Haiku (55/72) and matched Opus & Sonnet at 33/36 (91.7%) Java at 4.52s/turn with only 1/72 timeout (vs. 3–14/24 timeouts on comparable-cost direct open-weight APIs). On SlopCodeBench v1.0 (7 evolving Python repos, 5,775 tests), EcoCoder passed 5,645/5,775 (97.75%) and kept 98.66% existing tests green (Ledger v5.0 →).
Code Quality & Energy Payback
−86% complexity risk & 10×–23× less GPU energy.
EcoCoder keeps multi-checkpoint complexity bounded: on execution_server (CP1→CP6), EcoCoder passed 68/70 (97.1%) at max CC 10 with 55% unit coverage (CRAP 95.7 vs. Sonnet 5.5 702.0 at max CC 31 and 0% coverage — −86% risk), while cutting modeled GPU energy 10.4× on Python and 23.4× on OSS (payback data →).
Benchmark Summary · Ledger v5.0 (30 Nov 2026 · k=3 Held-Out)
SlopCodeBench v1.0: frontier quality at a fraction of the cost and energy.
Across 7 held-out evolving multi-file Python repositories in SlopCodeBench v1.0 (k=3 seeds, 21 runs/arm, 5,775 pooled tests: 4,788 existing + 987 new feature tests), EcoCoder holds 97.75% test pass rate at 17.5s/turn (faster per turn than Opus 5.5 at 21.1s/turn) for $7.87 total:
3,600 kJ = 1 kWh; excludes host CPU, DRAM, network, and cooling). EcoCoder figures come from GPU host telemetry; *Claude 5.5 figures are modeled estimates (methodology → · full per-repo & per-seed ledger →).
| Model (SlopCodeBench v1.0 · k=3) | API Cost (21 Runs) | GPU Energy | Tests / $ | Pass Rate (5,775 Tests) |
|---|---|---|---|---|
ecocoder Standard |
$7.87 $6.30 Flex · 4.0× less |
1,653.93 kJ 293 J/pass · 10.4× less |
717 tests/$ 17.5s/turn (46 turns/repo) |
97.75% 5,645/5,775 · 98.66% existing |
claude-opus-5-5 |
$31.81 RC $36.62 CLI |
17,269.41 kJ* [8.4k–33.7k] |
180 tests/$ 21.1s/turn (25 turns/repo) |
98.91% 5,712/5,775 · 99.62% existing |
claude-haiku-5-5 |
$10.60 CLI >100k tier ($2.73 ≤100k RC) |
10,232.13 kJ* [5.1k–19.8k] |
536 tests/$ 15.7s/turn (43 turns/repo) |
98.41% 5,683/5,775 · 99.62% existing |
Full tradeoffs, OSS commits & regression-fix verification: On SlopCodeBench v1.0, EcoCoder turns executed faster than Opus 5.5 (17.5s/turn vs. 21.1s/turn) while beating Opus on 2 of 7 repos; on the updated Dec 2 gateway, replicated etl_pipeline k=3 validation scored 492/492 (100.0%) across all 3 seeds (ex-etl_pipeline Nov 30 was already 98.33% vs. 98.81%). Across 24 held-out Java & JS commits (k=3 = 72 runs/arm), EcoCoder solved 59/72 (81.94%) at 4.52s/turn, $3.55 settled (5.0× cheaper than Opus $17.85 RC), and 310.41 kJ — matching Opus & Sonnet at 33/36 (91.7%) Java ahead of Haiku (55/72), with only 1/72 timeout vs. 3–14/24 timeouts on comparable-cost direct open-weight APIs (inspect full Ledger v5.0 →).
6-Checkpoint Codebase Evolution (execution_server, CP1 → CP6) & Follow-On Efficiency
Cleaner code pays off on every checkpoint and the next feature.
Across six sequential checkpoints on execution_server, EcoCoder held cyclomatic complexity at CC ≤ 10 with 55% unit coverage (−86% CRAP risk vs. Sonnet 5.5); on a ~3,500-LOC follow-on Feature N+1 transition, that structure cut turns 49%–63% and spend 35%–43%.
Passed 66/70 (94.3%) with max function complexity CC 31 and 0.0% unit coverage; unguided Feature N+1 needed 41 turns & 4.95M tokens ($1.79).
Passed 68/70 (97.1%) at max CC 10 (0 breaches) & 55% unit cov (62% peak); cut Feature N+1 to 15–21 turns & 1.23M–1.97M cached tokens.
6-checkpoint & follow-on maintainability data — inspect full CP1→CP6 & next-feature tables →
33/36 (91.7%) — tied Opus & Sonnet
Python 97.75% SlopCodeBench (etl 492/492 k=3)
JavaScript 26/36 held-out OSS commits (k=3)
TypeScript Supported (prior cohort / v3.0)
Energy Accounting · Powered by Loupe
Per-session GPU energy tracking on every request.
Every response returns X-LeanLM-Receipt-Id so you can audit settled spend and GPU energy (3,600 kJ = 1 kWh, excluding host CPU, DRAM, network, and cooling) via ecocoder stats or api.leanlm.ai/portal. EcoCoder energy comes from per-turn GPU host telemetry, while Claude 5.5 comparisons use modeled estimates with published uncertainty bands (equations & arXiv citations →).
circuit_eval r3 run)
# Every inference response carries a durable receipt ID (inspect via GET /v1/receipts/<id> or CLI):
HTTP/2 200 · X-LeanLM-Receipt-Id: rcpt_01J...
$ ecocoder stats --run-id circuit-eval-cp7-cp8-r3
Session reported energy: 86.6 kJ (24.1 Wh) · provider-reported (GPU only)
Session settled spend: $0.357 · 566/566 tests passed · 49 turns · 667.9s wall
Predictable Pricing · Built for Real Repositories
~$0.37 per multi-file feature. Flat pricing at any context size.
One flat schedule ($0.30 uncached in · $0.03 cached in · $1.20 out per 1M tokens) with $0 cache-write fees across all context lengths for Python, TypeScript, JavaScript, and Java. Credits never expire and hard-stop at $0—zero surprise overages.
Instant eco_live_... key via Google, GitHub, or email (~10+ multi-file features free, no card required). First Stripe refill ($5–$500) is matched 2× up to +$100 bonus. Full model, 1M-token context (compaction recommended at ~130K tokens for energy efficiency), 60 RPM / 2M TPM, non-expiring credits.
--flex)Flat 20% discount on every request via --flex (CLI) or X-LeanLM-Flex: eco (Direct HTTPS) on unattended/async runs (≥15m timeout; holds up to ~60s/turn under load) with per-run receipts.
Assistive engineering lane for orgs above ~60% steady GPU utilization needing higher RPM/TPM ceilings, dedicated single-tenant clusters, zero-data-retention DPA, or annual invoice billing.
Talk to engineering →| Model / Lane | Uncached Input | Cached Input | Output & Thinking | SlopCodeBench v1.0 (21 Runs) |
|---|---|---|---|---|
ecocoder Standard |
$0.30 / 1M ($0 write) | $0.03 / 1M (−90%) | $1.20 / 1M | $7.87 · 1,653.93 kJ |
ecocoder --flex (−20% CI) |
$0.24 / 1M ($0 write) | $0.024 / 1M (−90%) | $0.96 / 1M | $6.30* (0.80× repriced) |
claude-haiku-5-5 (≤100k) |
$0.10 / 1M (>100k surge) | $0.01 / 1M | $0.50 / 1M | $10.60 CLI (>100k context tier) |
claude-opus-5-5 |
$4.00 / 1M ($5 5m / $8 1h) | $0.20 / 1M | $20.00 / 1M | $31.81 RC ($36.62 CLI) |
*--flex ($6.30 repriced at 0.80×) is an unattended CI discount rather than a lower-energy mode: GPU energy can rise 4× during ~60 s server queue holds (live A/B note →). Anthropic reference rates per anthropic.com/pricing. EcoCoder Ledger v5.0 USD totals reflect exact settled gateway receipts (reconciliation note →).
Billing Rules & Stripe Top-Ups
$5 instant starter, 2× first refill & zero overage.
New accounts start immediately with a free $5.00 credit (no card required) on sign-in, and your first Stripe refill ($5–$500) is automatically matched 2× up to a +$100.00 bonus inside api.leanlm.ai/portal. Credits never expire, stop cleanly with HTTP 402 and zero overage, and keep automatic Stripe invoices plus saved-card management (dedicated GPU break-even math →).
SKU Stability & Support
Versioned behavior, ZDR defaults & engineer support.
The active ecocoder endpoint is pinned to dated benchmark releases (Ledger v5.0 · 2026-11-30) with zero silent quality-degrading swaps or unannounced precision downgrades (SKU stability policy & changelog →). Zero training on customer code or prompts by default. Support goes straight to engineers at [email protected]—no deflection bots.
Questions
Frequently asked questions
Why combine flat token pricing with $0 cache-write fees and brownfield quality?
Upfront token rates alone miss how coding agents pay 1.25×–2× cache-write surcharges and accumulate extra debugging turns in real codebases. EcoCoder keeps one flat $0.30/$0.03/$1.20 rate with $0 cache-write fees, finishes turns in 17.5s on SlopCodeBench v1.0 (faster per turn than Opus 5.5 at 21.1s), and kept 98.66% of existing tests passing (5,645/5,775 total passed) at 4×–6× lower settled cost.
How does EcoCoder compare with Claude Opus 5.5, Sonnet 5.5, and Haiku 5.5?
On 24 held-out Java & JS commits (commons-cli, commons-codec, JSON-java, commander.js, and node-semver), EcoCoder solved 59/72 (81.94%) and matched Opus & Sonnet at 33/36 (91.7%) Java at 4.52s/turn, $3.55 settled (5.0× cheaper than Opus $17.85 RC), and 310.41 kJ ahead of Haiku’s 55/72 (vs. 3–14/24 timeouts on comparable-cost direct open-weight APIs). On SlopCodeBench v1.0 (7 held-out Python repos, 5,775 tests), EcoCoder passed 97.75% at 17.5s/turn for $7.87 settled and 1,653.93 kJ—26% cheaper than Haiku 5.5 ($10.60 CLI past 100k context; comparison table ↑ · full Ledger v5.0 →).
How do charges work, and when should I use --flex?
Standard turns bill at $0.30 uncached input, $0.03 cached input ($0 write fee), and $1.20 output per 1M tokens across all context lengths, with exact per-turn gateway receipts in api.leanlm.ai/portal. Optional --flex (X-LeanLM-Flex: eco) cuts rates 20% ($0.24/$0.024/$0.96) for unattended CI on an async queue that can hold up to ~60s per turn and use more energy, so keep interactive coding on Standard (pricing details ↑).
How accurate are your energy numbers, and what hardware boundary do you use?
Every energy figure uses the GPU boundary (3,600 kJ = 1 kWh, excluding host CPU, system DRAM, networking, and facility cooling). EcoCoder’s Ledger v5.0 energy comes from per-turn GPU host telemetry at the GPU boundary (exact schema provenance documented in Ledger v5.0 JSON), while Claude 5.5 figures are modeled estimates shown with optimistic-to-conservative bands at leanlm.ai/energy-methodology.
Do you train on customer code, and how do starter credits and Stripe top-ups work?
Stellar Content Inc. (d/b/a LeanLM) never trains, fine-tunes, or distills models on customer code or prompts. Direct HTTPS requests run in volatile memory with zero file staging and 90-day numeric receipt retention, while the optional ecocoder CLI deletes staged files on session exit (or within 24 hours; Privacy Policy →). Sign in at api.leanlm.ai/portal for an instant $5.00 starter key (no card required), plus a 2× bonus match on your first Stripe refill up to +$100, non-expiring credits, and automatic invoices.
Built by
Chris Cholette — Founder, LeanLM
Engineering executive with 15+ years leading platform and infrastructure organizations at Navan, Salesforce/MuleSoft, and Sunrun. Built Loupe and EcoCoder to make production AI coding sustainable—delivering frontier repository reliability at lower dollar and lower energy cost (about & company facts → · LinkedIn ↗).
Team Onboarding · Dedicated Clusters · ZDR DPA
Need a dedicated cluster or team rollout?
Individual developers can get an instant eco_live_... key with $5.00 free starter credit and a 2× first-refill match (up to +$100) right in api.leanlm.ai/portal →. Setting up higher RPM/TPM ceilings, dedicated GPUs, or team billing? Leave your work email:
Request received — our engineering team will follow up directly. Need an individual key immediately? Sign in at Portal →
Pick your client to preview your ready-to-paste setup:
By requesting a key, you agree to our Terms of Service and Privacy Policy. Already provisioned? Sign in at api.leanlm.ai/portal →