Quick answer
An OpenCode request sends the whole conversation context, so the token count grows with every turn. Early requests are small; late requests in a long session can be a hundred times larger. Measure a specific message rather than quoting an average.
Why the number grows
| Turn | Typical input | Why |
|---|---|---|
| First | Small to medium | System prompt plus task |
| Fifth | Medium to large | Prior messages and tool output |
| Twentieth | Large | Full history resent |
| After compaction | Medium | Summary replaces history |
Output tokens stay roughly flat per turn. Input is the part that compounds.
Measure one request
- Open the message record in the database.
- Read input, output, cache read, and cache write.
- Compare it with the previous message in the same session.
- Note the difference: that is the cost of the turn plus the new context.
Keep requests small
- Start a new session per task.
- Point at file ranges instead of whole files.
- Avoid pasting long logs.
- Ask for a diff rather than a rewritten file.
- Use a cheaper model for exploration.
Why one request can cost so much
A request carries the whole conversation up to that point. The tenth turn of a session pays for nine previous turns of context, plus whatever files and tool output were added. That is why cost per request rises through a session even when your prompts stay short.
- Long sessions get more expensive per turn, not less.
- Tool output enters the context and stays there.
- Cached input reduces the rate but not the count.
- Starting a new session per task is the cheapest structural fix.
Compare with cost per session, which is the number to use for planning.
Questions, answered
Is there a fixed token count per OpenCode request?
No. It depends on the context sent, which grows with the conversation.
Does OpenCode send the whole conversation every time?
Yes, unless the model or client compacts it. That is how chat models maintain state.
Do cached tokens reduce the input count?
They reduce the price, not the reported input count. Input includes cached tokens in most views.