DeepSeek V4 Flash · 1M context

The coding agent that tells you what it cost.

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

macOS & Linux
curl -fsSL https://fangcode.ai/install.sh | sh

fang setup     # probes the endpoint before you spend on it
fang           # open a workspace here
Usage limits

More DeepSeek V4 Flash for the same $10.

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.

FangCode Go · $10/mo

8,246
requests per 5-hour window +8.5% vs OpenCode

OpenCode Go · $10/mo

7,600
requests per 5-hour window, as published on their pricing page

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.

Benchmark

Dollars per resolved task.

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.

HarnessModelResolved$ / resolvedAvg wall
FangCodedeepseek-v4-flash-073110 / 10$0.001664.5s
Claude Codeclaude-opus-5[1m]10 / 10$0.232138.7s
Hermesclaude-opus-4.610 / 10$0.310259.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.

Why it is cheap

The session is the optimisation.

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.

one session, two questions
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
Pricing

One model, served properly.

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.

Free

$0
~916 requests / month
  • $2 of credit each month
  • $1 per 5-hour window
  • 1 seat
  • Bring your own key, always
Most developers

Go

$10 / month
8,246 requests / 5-hour window
  • $50 of credit each month
  • $18 per 5-hour window · $40 per week
  • Top up any amount — it never expires
  • On-demand credit is never throttled

Team

$15 / seat / month
13,743 requests / 5-hour window
  • $75 of credit per seat, pooled
  • $30 per 5-hour window · $90 per week
  • Per-seat spend caps
  • Audit log export

Enterprise

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.

  • SAML single sign-on
  • Domain-verified auto-join
  • Append-only audit log
  • CSV audit export
  • Pooled allowance
  • Per-seat spend caps
  • Owner / admin / member roles
  • Invoicing, PO and net terms
  • Committed annual volume
  • Bring your own provider key
  • Data-residency election
  • No usage windows
Rate card

What a token costs.

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.

Input
$0.20
Cached input
$0.04
Output
$0.40

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.

Security & data

We meter tokens, not your code.

These are properties of how the gateway is built, not assurances about how it is operated.

Prompts are never stored

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.

Keys are hashed at rest

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.

Spend fails closed

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.

Caps at three levels

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.

Append-only audit trail

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.

No lock-in by design

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.

The model

DeepSeek V4 Flash 0731

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.

Architecture
Sparse mixture-of-experts · 13B active of 284B
Context window
1,310,720 tokens
Released
31 July 2026
Built for
Coding, reasoning, agent workflows
Honest limitations

What it does not do yet.

Published here rather than discovered later. If one of these is a blocker for you, better that you know now.