EcoCoder (https://api.leanlm.ai, from LeanLM)
is an Anthropic- (/v1/messages), OpenAI- (/v1/chat/completions), and Codex-compatible
(/v1/responses) coding endpoint metered in hardware GPU Joules by Loupe.
See benchmark results.
Supported Languages & Wire Protocols
| Category | Supported |
|---|---|
| First-class languages | Python (.py), TypeScript (.ts, .tsx), JavaScript (.js, .jsx, .mjs, .cjs), Java (.java) |
| Companion repo files | SQL, Shell/Bash, YAML, TOML, JSON, HTML/CSS, Dockerfiles, and Markdown |
| Wire protocols | Anthropic Messages (POST /v1/messages), OpenAI Chat (POST /v1/chat/completions), Codex Responses (POST /v1/responses) |
Step 1: Install the Single-File CLI & Verify Your Key
The ecocoder helper uses only the Python 3 standard library. Your key is stored at ~/.ecocoder/key with 0600 permissions:
curl -fsSLO https://api.leanlm.ai/ecocoder && chmod +x ecocoder
./ecocoder login --key "<YOUR_ECO_LIVE_KEY>"
./ecocoder check
Step 2: Pick an Execution Profile
Both profiles work across every client and wire endpoint:
| Profile ID | Alias | When to Use |
|---|---|---|
ecocoder-turbo |
leanlm-turbo |
Recommended default. Fastest interactive turnaround and higher pass rate across our 12-repository suite. Use this for live sessions in Claude Code, Codex CLI, and pi. |
ecocoder |
leanlm-eco |
Lowest cost & energy on heavy tasks. Cost 23% less and used 14% less GPU energy across 12 repositories (saving 37% cost on the hardest repos). Use for background CI, batch runs, and strict dollar budgets. |
Step 3: Connect Your Coding Agent
Option A — Delegated Subagent Inside Your Current Workflow (Recommended First Step)
Keep your interactive lead session on Claude Opus, Sonnet, or Codex and delegate bounded implementation, refactoring, and test-repair tasks to @ecocoder with a per-run dollar ceiling:
# Install .claude/agents/ecocoder.md so Claude Code delegates to @ecocoder automatically
./ecocoder install-subagent --max-usd 1.50
# Or run a one-shot bounded task from any terminal or CI runner ($1.00 cap)
./ecocoder delegate "Add boundary timeout tests in retry.py and fix failures" --max-usd 1.00
Option B — Claude Code (claude CLI)
Scopes ANTHROPIC_BASE_URL to this terminal tab only, leaving your normal claude command in other tabs untouched:
cd /path/to/your/repo
./ecocoder claude
# Pass standard claude flags or select ecocoder-turbo:
./ecocoder claude -- --model ecocoder-turbo -p "Refactor parser.ts and run tests"
Option C — pi (@mariozechner/pi-coding-agent)
cd /path/to/your/repo
./ecocoder pi
# Optional: persist provider config in ~/.pi/agent/models.json (0600)
./ecocoder setup-pi --write
pi --provider ecocoder --model ecocoder-turbo
Option D — Codex CLI (POST /v1/responses)
Add to ~/.codex/config.toml:
[model_providers.ecocoder]
name = "EcoCoder"
base_url = "https://api.leanlm.ai/v1"
env_key = "ECOCODER_API_KEY"
wire_api = "responses"
supports_websockets = false
export ECOCODER_API_KEY="eco_live_..."
codex --provider ecocoder --model ecocoder-turbo
Step 4: View Session Spend & NVML GPU Joules
Inspect your session cost and hardware-metered NVIDIA NVML GPU Joules compared against frontier API baselines:
./ecocoder stats
HTTP Status Troubleshooting
| Status | Meaning & Fix |
|---|---|
401 |
Missing, mistyped, or revoked eco_live_... key. Run ./ecocoder check or ./ecocoder setup-pi --write. |
402 |
Account credit ceiling or per-run --max-usd limit reached. Reply to your invite email to top up your allocation. |
411 |
Credit-enforced keys require a bounded Content-Length header on inference POSTs. |
503 |
Transient upstream capacity reset; safe to retry automatically. |
EcoCoder · $10 Free Credit
Get your eco_live_... key
Enter your email for a provisioned $10.00 EcoCoder allocation with live NVML Joule telemetry and a hard spend cap.