FangCode works in your terminal, edits your repository, and writes down the tokens, the cache hit rate and the dollars behind every turn. One static Go binary. And a gateway that gives you 8.5% more DeepSeek V4 Flash headroom than OpenCode Go, the closest comparable $10 plan.
MIT licensed agent · bring your own key any time · no telemetry
curl -fsSL https://fangcode.ai/install.sh | sh fang setup # probes the endpoint before you spend on it fang # open a workspace here
The number that decides whether an agent is usable is how many turns you get before it stops. Here is ours against OpenCode Go — the closest comparable $10 subscription — on the same model, in the same 5-hour rolling window.
How this is calculated, so you can check it. A “request” here is a real agent turn from our own fixture suite: 20,927 prompt tokens at a 69.7% cache hit rate and 828 completion tokens. Priced on FangCode's published rate card, that turn costs $0.002183, and an $18 five-hour window buys 8,246 of them. OpenCode publishes 7,600 for DeepSeek V4 Flash on their Go plan and does not state the turn shape behind it; at their $12 window that implies roughly $0.001579 per request — close enough to the same turn at raw upstream list price that the comparison is fair. Both numbers move if your turns are larger. Ours is the one you can recompute from the rate card below.
Ten fixtures whose success is machine-checkable. Each check must fail against the untouched repository before the agent starts, and protected files must be byte-identical afterwards — so deleting the failing test is not a pass. Cost per attempt flatters an agent that fails cheaply. This does not.
| Harness | Model | Resolved | $ / resolved | Avg wall |
|---|---|---|---|---|
| FangCode | deepseek-v4-flash-0731 | 10 / 10 | $0.0016 | 64.5s |
| Claude Code | claude-opus-5[1m] | 10 / 10 | $0.2321 | 38.7s |
| Hermes | claude-opus-4.6 | 10 / 10 | $0.3102 | 59.9s |
What this is and is not. Ten tasks, one run each, every harness invoked the way its own documentation says to run it headlessly, on the model it ships configured with — so it compares products as delivered, not model quality. All three resolved every task. FangCode is roughly 1.7× slower. Figures are each harness's own reported spend, normalised to one token convention. Priced on FangCode's rate card rather than raw upstream cost, a resolved task is $0.0023.
Cached input costs a fifth of fresh input, so the largest lever in an agent is keeping the conversation prefix byte-stable. FangCode pins the system prompt, the project memory and the repository map, and never rewrites them. A follow-up runs against a warm cache; every one-shot invocation pays to rebuild it.
auto › fix the release() bug in inventory.js and add a test for it [1] 7.8s · 3,184 tok (0% cached) · $0.0003 [6] 58.2s · 24,910 tok (87% cached) · $0.0008 auto › now also guard reserve() against a negative qty [9] 1m14s · 43,421 tok (89% cached) · $0.0013 the follow-up costs a fifth of the first turn — same conversation, warm cache
Included credit is metered at the rate card and expires with the billing period. Credit you buy on top never expires and is never throttled. Windows are denominated in credit value, not request count, and reset from first use rather than on a clock boundary.
Committed volume on invoice, with the controls a security and procurement review actually asks about. No rolling windows — you bought throughput, not a rate limit. Terms by agreement, because there is not an honest public price for them.
USD per million tokens — the figures the gateway meters against. GET /api/v1/plans on api.fangcode.ai returns them live, so this page and the biller cannot drift apart.
Every request-count on this page is that rate card divided into a window. Multiply your own turn shape by these three numbers and you will get the same answer we did.
These are properties of how the gateway is built, not assurances about how it is operated.
Request and response bodies are not written to our database. A usage row holds token counts, the model, the route, latency and cost. There is no column for your source code.
An API key is stored only as its SHA-256 digest. The secret is shown exactly once, at creation. A copy of the database yields nothing that can be replayed.
If the limiter cannot be consulted, the request is denied rather than let through. A surface that moves money defaults to refusing, never to spending.
A limit on the individual key, a cap on the seat inside a pooled allowance, and rolling windows on the plan. All three are enforced before a request is relayed upstream.
Who changed a role, a cap, a plan or an SSO configuration — recorded, exportable as CSV, never updated in place. Reading the log is itself an audited event.
The agent is MIT licensed and speaks plain OpenAI and Anthropic protocols. Point it at your own provider and it behaves identically. A subscription is convenience, not capture.
One model, chosen because it is the one that makes these economics work at this quality. Served through a pinned upstream route — an unpinned route silently loses the prefix cache the whole cost argument rests on.
Published here rather than discovered later. If one of these is a blocker for you, better that you know now.