← All Essays

Budget AI Coding: 3 Billion Tokens for $20

· 5 min read

About 3 billion tokens a month on AI coding. That’s billion with a B. For about twenty dollars.

If you’re used to ChatGPT or Claude pricing, that sounds impossible. But the provider market has a sweet spot right now. String a few tools together and you get a firehose of AI assistance for pocket change.

Here’s how.

The Stack

Ghostty

Ghostty. Fast, easy to set up, looks modern, just works. Never got along with Alacritty. This one hit the sweet spot. GPU accelerated, simple config.

tmux

Inside Ghostty, tmux runs with 4 to 6 panes for opencode agents and another pane for servers. No IDE opened in months. When code needs reading, nvim handles it. No VS Code microslop bloat. Just terminal panes.

tmux setup with multiple opencode agent panes

opencode

The brain is opencode. Open source, works with any provider. OpenAI, Anthropic, Google, local models. Bring your own API keys or use their token plans.

The $10/month opencode-go plan gives access to many models. From what I understand they have their own servers. Generous free usage tiers too.

DeepSeek V4 Flash is the daily driver. The sweet spot. Fast, good code quality, cheap. Pricing works out to around $0.005 per million tokens. They don’t publish exact counts.

opencode-go token usage on the opencode site

10% leftover usage at the end of the month. Either their math is generous or the ceiling is higher than expected. No tracker set up yet.

The Providers

Two Providers, One Simple Rule

A second provider fills the gap when one plan runs out. DeepSeek V4 Flash runs through opencode. MiniMax picks up the slack for secondary and time pass tasks.

Mini-max usage dashboard

MiniMax is slower and the code quality feels worse. Was going to let it expire, but it renewed itself. Tokens will burn on whatever experiment is running that week.

Still, having a backup matters. When your primary goes dark at 2am, even a silly model beats error messages.

The Fun One: Fireworks AI

The wildcard is Fireworks AI. Firepass plan is $24 a month, unlimited 150tps Kimi K2 Turbo.

K2 Turbo feels incredible. Fast output, responsive, writes acceptable code. But acceptable is doing a lot of work. The choices are weird. No consistency. Not at the level of DeepSeek V4 Flash.

1.45 billion tokens burned in a week running 6 agents on Fireworks. Built a WhatsApp CRM called Wopps (wopps.xyz). Since pivoted. That week showed what these tools can do when you push them.

Fireworks AI Firepass usage

Kimi K2 Turbo is kind of stupid. But sometimes you need speed over polish. For $24 a month it’s worth having.

The Workflow

4 to 6 opencode agents run at once. Each in its own tmux pane. Average session is 30 minutes. Long enough to make progress, short enough to course correct.

One agent gets more attention. It handles smaller tasks where tighter feedback helps. The others do heavier work. Features, refactoring, exploring codebases, writing tests. Check in, review, redirect, let them keep going.

No IDE touched in months. When code needs reading, nvim handles it. The whole development environment is a terminal with tmux and opencode.

Hardcore yolo coding. Everything built this way. Astro sites, agentic experiments, entire projects. Even this essay was written through an opencode agent.

A typical session: Ghostty terminal. One tmux session for opencode agents. Four or five panes, each running a different task. Servers in separate tmux sessions. Tmux lets you switch instantly. Jumping from agent output to server logs takes a fraction of a second.

Agents churn. Review and redirect. Rinse and repeat for hours. The throughput is absurd. More gets done in a weekend than used to take weeks.

The secret isn’t any one tool. It’s the combination. A fast terminal, solid session management, a flexible open source AI coding tool, and multiple providers so you always have a fallback.

Want to Copy This Setup?

  • Terminal: Ghostty, Kitty, WezTerm, or anything fast.
  • tmux: one session for agents, one for servers. Flick between them.
  • opencode: open source, free tier to start. Grab it from their site.
  • Providers: opencode-go for DeepSeek V4 Flash ($10/mo). MiniMax or a second opencode-go plan for more headroom.
  • Go wild: set up your panes, point agents at a codebase, let them rip.

Total cost is about $20 a month. Total tokens is about 3 billion. Total productivity gain is ridiculous.

Configs

For anyone who wants the exact setup.

Ghostty
theme = Night Owl
command = tmux
window-save-state = always
tmux
# mouse support
set -g mouse on

# better indexing
set -g base-index 1
setw -g pane-base-index 1
bind r source-file ~/.tmux.conf ; display-message "Reloaded!"
set -s escape-time 0
setw -g mode-keys vi
set -g status off
set -g allow-passthrough off
bind '"' split-window -c "#${pane_current_path}"
bind % split-window -h -c "#${pane_current_path}"
bind c new-window -c "#${pane_current_path}"

set -g status on
set -g status-interval 10
set -g status-left " "
set -g status-right " "
set -g status-style bg=default,fg=default

set -g @plugin "tmux-plugins/tpm"
set -g @plugin "tmux-plugins/tmux-continuum"
set -g @plugin "tmux-plugins/tmux-resurrect"
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-save-interval "15"
run '~/.tmux/plugins/tpm/tpm'

People think you need expensive tools to code with AI. You don’t. You need a fast terminal, a solid multiplexer, an open source tool that doesn’t lock you in, and providers that don’t charge you per sip.

The rest is just letting the agents cook.

Enjoyed this? Subscribe on Substack for more essays on systems and operations.