Skip to content

EcoCoder — $5.00 free starter credit + 2× bonus on your first Stripe refill (up to $100).

Get instant API key ($5 free) →
LeanLM / EcoCoder

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.

91.7% Java (33/36, tied #1 w/ Opus) 4×–5× lower bill ($0 cache writes) 1/72 timeout vs. 3–14/24 direct peers
View setup.md ↗
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
Recorded Ledger v5.0 traces
EcoCoder (Seed r3)
566/566 passed · $0.36 settled
529/529 existing + 37/37 new · 86.6 kJ (24.1 Wh) · 49 turns (13.6s/turn, 667.9s wall)
Claude Opus 5.5 (Seed r3)
564/566 passed · $3.27 RC
529/529 existing + 35/37 new · 1,836 kJ* modeled · 44 turns (28.2s/turn, 1,240.7s wall)

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)
EcoCoder (Seed r3)
302/304 passed · $0.32 settled
235/235 existing + 67/69 new · 55.0 kJ (15.3 Wh) · 38 turns (15.0s/turn, 569.1s wall)
Claude Opus 5.5 (Seed r3)
303/304 passed · $1.36 RC
235/235 existing + 68/69 new · 750 kJ* modeled · 21 turns (16.4s/turn, 344.6s wall)

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)
EcoCoder (Pooled k=3)
59/72 resolved · $3.55 settled
33/36 Java (91.7%) + 26/36 JS ($0.060/solve) · 310.4 kJ (86.2 Wh) · 4.52s/turn
Claude Opus 5.5 (Pooled k=3)
63/72 resolved · $17.85 RC
$0.283/solve · 7,268 kJ* modeled · 4.1s/turn (Haiku: 55/72)

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)
Use 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

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 →).

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:

SlopCodeBench v1.0 (Ledger v5.0, 30 Nov 2026, k=3 across 7 held-out Python repositories, 5,775 pooled tests): Claude Opus 5.5 used an estimated 17,269 kJ modeled GPU energy (range 8,397–33,676 kJ, $31.81 rate-card cost, 98.9% passed); Claude Haiku 5.5 used an estimated 10,232 kJ modeled GPU energy (range 5,091–19,820 kJ, $10.60 CLI billed after exceeding 100k context pricing, 98.4% passed); EcoCoder Standard reported 1,653.93 kJ host-reported GPU energy (293 J per passing test, $7.87 settled gateway cost, 97.75% passed). SLOPCODEBENCH v1.0 (7 REPOS, k=3) · GPU ENERGY API COST PASSED claude-opus-5-5 17,269 kJ* [8.4k–33.7k] $31.81 98.9% claude-haiku-5-5 10,232 kJ* [5.1k–19.8k] $10.60 CLI* 98.4% ecocoder 1,654 kJ (293 J/pass) $7.87 (−75% vs Opus) 97.8%
claude-opus-5-517,269 kJ* · $31.81 RC
Modeled [8,397–33,676 kJ] · $36.62 CLI · 98.91% (5,712/5,775) · 21.1s/turn (436.5s p50)
claude-haiku-5-510,232 kJ* · $10.60 CLI*
Modeled [5,091–19,820 kJ] · >100k tier · 98.41% (5,683/5,775) · 15.7s/turn (567.6s p50)
ecocoder1,654 kJ · $7.87 (−75% vs Opus)
293 J/pass · 97.75% (5,645/5,775) · 98.66% existing · 17.5s/turn (767.7s p50)
SlopCodeBench v1.0 (Ledger v5.0 · k=3) · Boundary: GPU energy only (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 →).

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%.

Claude Sonnet 5.5 (CP1 → CP6) & Baseline Follow-On
702 CRAP (992 peak)

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).

Next-Feature Spend
$1.79
Higher turn & token overhead
Follow-On Pass Rate
65 / 81
80.2% next-feature tests
EcoCoder (CP1 → CP6) & Maintained Follow-On
95.7 CRAP (−86% risk)

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.

Next-Feature Spend
$1.03–$1.16
−35% to −43% vs. unguided
Follow-On Pass Rate
72 / 81
88.9% pass rate (+8.6 pp)

6-checkpoint & follow-on maintainability data — inspect full CP1→CP6 & next-feature tables →

Java 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)

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 →).

Per-turn receipt ID & settled session audit (single completed 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

~$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.

Estimate your monthly bill — current Claude Opus 5.5 spend:
$200/mo
Estimated EcoCoder Bill
~$50/mo
Save ~$150/mo (4.0× lower on SlopCodeBench v1.0)
Workload Equivalent
~133 features
$25 first refill = $50 matched (~133 features)
Modeled Energy Impact
~10.4× less
GPU energy (SlopCodeBench v1.0)
Individual / Self-Serve
$5 free + 2× first refill

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.

Get instant key →
Spend 20% Less (--flex)
$0.24 / $0.024 / $0.96 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.

Use --flex to save 20% →
Enterprise / Dedicated
Custom / Dedicated

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.

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 ↗).

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:

Ready-to-paste client setup

Run a zero-key local sanity check while waiting for your email: ecocoder sync-preview · Full CLI & API quickstart →

By requesting a key, you agree to our Terms of Service and Privacy Policy. Already provisioned? Sign in at api.leanlm.ai/portal →