Choose Your AI Coding Harness Before You Choose a Model
Before we chase cheap AI models, we need to choose the right coding harness. This decision matters because the harness controls how an AI agent reads your project, uses tools, keeps context, and repeats work. A cheap model can still cost more if the setup wastes tokens or needs constant retries.
First, understand the different parts
A coding setup has a few separate pieces:
Harness: the coding agent that manages the work, tools, context, and conversation. We'll start by comparing OpenCode (opens in a new tab) and Pi (opens in a new tab).
Model: the AI doing the reasoning and generating responses. Different models have different strengths, limits, and prices.
Provider: the service that runs the model and gives you access to it.
Model gateway: a service that lets one tool connect to models from different providers. OpenRouter (opens in a new tab) is one example.
API key: a secret credential that lets your tool make requests through a provider or gateway. You create it in that service's dashboard, then connect it to your harness. Never publish it or commit it to a repository.
These pieces work together, but they are not the same thing.
OpenCode vs Pi
OpenCode (opens in a new tab) is a full-featured open-source coding agent with terminal, desktop, and IDE options. It supports many model providers, and you can connect accounts or configure a model using its provider guide (opens in a new tab).
Pi (opens in a new tab) is a minimal terminal coding harness designed to be adapted to your workflow. You can extend it with skills, TypeScript extensions, prompt templates, and packages. Its README and quick start (opens in a new tab) explain how to install it and connect a provider.
Neither is automatically the winner. We need to test what each one does with the same tasks, models, and tools.
Where OpenRouter and OpenCode Console fit
OpenRouter (opens in a new tab) provides one API for accessing models from different providers. You create an OpenRouter account, generate an API key, and configure your harness to use it. Check the model's pricing and any account requirements before running tests.
OpenCode Console (opens in a new tab) is an optional service for connecting providers or using its model inference, with usage tracking and budget controls. Its getting-started guide (opens in a new tab) explains how to connect it to OpenCode. It is not another coding harness.
API keys, tokens, and cost
An API key is something you create. Tokens are the pieces of text a model processes and generates; you don't create them manually. Your prompt, project files, tool results, and the model's response can all use tokens. Providers generally charge based on input and output token usage, though plans and pricing differ.
A practical starting setup is:
Choose OpenCode or Pi.
Choose a provider or gateway, such as OpenRouter.
Create an API key in that service's dashboard and connect it to the harness.
Select a model and check its input/output prices.
Run a small task first, inspect usage, and set a budget or usage limit where available.
Start with the official OpenCode model guide (opens in a new tab) and OpenRouter quick start (opens in a new tab). Keep API keys private and never paste them into public code or posts.
What Poor AI will test
We'll run comparable coding tasks through OpenCode and Pi, then compare:
Did the task work correctly?
How much input and output usage did it take?
How many retries and tool calls were needed?
What was the total cost, and how much manual fixing remained?
The goal is not to find the lowest token price on a chart. It's to find a setup that reliably gets useful work done for less than $10/month.
This is our starting point, not a verdict. Next, we'll build a repeatable eval so the results are based on actual work rather than guesses.
Comments
Sign in to join the conversation.
No comments yet.