Skip to content

Cost & performance

WRITING AGENT spends real money on every run, autonomously. It’s built to make that spend visible and bounded at all times.

Real cost (OpenRouter’s usage.cost) is captured per call and surfaced everywhere:

  • Live in the run dashboard - USD accruing in real time, next to tokens / budget.
  • Per run on the post-run summary card - calls · words · tokens · cost.
  • Aggregated in /dashboard (all projects) and /dashboard <project> (per chapter/section), with a per-model breakdown.

Telemetry is one local JSONL record per call under .index/telemetry/ - it never leaves your machine. Cost is attributed per node and per unit, which is what powers the Telemetry and Cost views (in both /dashboard and the web dashboard).

Budget mode: the default that targets 100k tokens

Section titled “Budget mode: the default that targets 100k tokens”

cost_mode decides how aggressively a run is capped. The shipped default is budget; set standard for the old unpinned behavior.

Budget mode does three things:

  • A per-unit token budget. The session budget auto-scales as roughly budget_tokens_per_unit (default 20000) × unit count + a fixed overhead, so a full piece finishes instead of pausing mid-run. This is a soft target, not the hard cap.
  • Flash routing for judgment nodes. critic, judge, verifier, consolidation, and diagram are rerouted to the cheaper flash tier; the writer and planner stay on Pro.
  • Leaner knobs. divergent_drafts 1, max_revisions 1, table_read off, max_context_chars 12000 - each only ever tightened, never loosened past your value.

Together these target ≤100k tokens per article. An explicit max_run_tokens (see below) is still a hard ceiling that overrides the auto-scaled budget.

A minimal 2-section article on the default DeepSeek V4 Pro/Flash routing lands around ~$0.15 · ~15 calls · ~84k tokens.

A full agentic article (6 sections, divergent drafts, SVG diagrams, claim-checks) was measured at the other end of the range:

MetricValue
Cost~$0.52
LLM calls~108
Tokens~606k (367k prompt + 239k completion)
Prompt cache36% of prompt tokens served from cache (DeepSeek pin engaged)
Wall-clock~59 min (Pro is a slow reasoner)

Agentic mode, more units, divergent_drafts, diagrams, and deep_research each multiply the call count; the prompt cache and divergent_skeletons pull it back down.

LeverEffect on spendDefault
cost_modebudget pins knobs lean + flash-routes judgment nodes (targets ≤100k tok/article); standard is unpinnedbudget
budget_tokens_per_unitBudget mode’s per-unit soft target the session budget scales from20000
num_chapters / num_sectionsLinear - more units, more calls8 / 6
max_revisionsEach revision is another write + critique round2
divergent_draftsN first-draft variants per unit at varied temps, all critiqued2
divergent_skeletonsDrafts variants short and expands only the winner - ~60% fewer discarded-draft tokensoff
deep_researchAdds query expansion + full-page fetches + synthesisoff
use_imagesOne Pro-tier SVG diagram per unit (16k budget)on
Model routingPro nodes (writer, critic, planner, diagram) cost more than Flashmixed

Cheaper runs: keep cost_mode budget (the default), lower max_revisions, set divergent_drafts 1 (or divergent_skeletons true), /set use_images false, and keep deep_research off. Higher quality: set cost_mode standard and do the reverse.

Prompt tokens dominate spend (mostly repeated prefixes), so the provider’s prompt cache is the biggest lever. On OpenRouter, DeepSeek is load-balanced across upstreams and only some of them cache. The default is unpinned (openrouter_providers: "" - OpenRouter’s own load-balancing, no upstream pinned). The recommended opt-in is to set openrouter_providers: DeepSeek, which pins the upstream order so the DeepSeek prompt cache engages - measured live, this caches ~80% of the prompt prefix at roughly 3.5× lower cost. Note it isn’t 100% reliable over OpenRouter’s load-balancing; for guaranteed caching, run provider=deepseek direct (DeepSeek-direct caches automatically). Cache hits are reported in the run’s usage summary (N cached, X% of prompt) and in the telemetry JSONL.

max_run_tokens is a hard ceiling, checked before every LLM call:

/set max_run_tokens 200000

Crossing the cap pauses the run cleanly - state stays resumable, nothing committed is lost, and the dashboard shows tokens / budget the whole time. Run again, or raise the cap, to continue. See Production guards.

Runs are I/O-bound on the model API. The orchestrator overlaps everything it safely can - research, images, and skills for unit n+1 are prefetched while unit n is written, and the humanize/summarize/extract commit batch runs in parallel - but the unit chain itself is sequential for continuity, so wall-clock scales with unit count.