A chat call makes one model request. An agent makes several. The same task that looks cheap in a demo can multiply into a bill you did not plan for, because every planning step, every tool call and every summary is another request against the model API.
If you are building an agent, here is where the money goes and what to watch.
One task, many calls
A typical agent loop reads the request, decides what to do, calls a tool, reads the tool result, decides again, and finally writes the answer. Each of those steps is a separate chat completion. A single user question can become five or ten model calls. If each call sends the full conversation history, the input grows with every step. The cost of one task is not the cost of one call; it is the sum of every call in the loop.
The three meters
On a hosted model API the bill has three text meters: cache, input and output. A cache hit is input the provider has already seen. Input is everything the model reads: the system prompt, the retrieved context, the tool results. Output is what the model writes. On the Standard tier those are $0.10, $0.40 and $1.60 per 1M tokens. An agent that resends a long system prompt on every step pays the input rate on every step unless the prompt is cached. An agent that writes long internal reasoning pays the output rate on text the user never sees. Transcription is a separate meter billed by audio duration.
What to measure
Four numbers tell you whether an agent bill is under control:
- Calls per task. Count the model requests each completed task makes. A loop that re-plans more than it needs is the first place to look.
- Input tokens per call. Track whether the context grows with each step. Trimming history or caching the system prompt changes this number directly.
- Output tokens per task. Separate user-visible output from internal reasoning. Long internal chains are expensive and often unnecessary.
- Cost per successful task. Compute it from token counts and the published rates, not from a monthly invoice. A cheap model that needs more retries can cost more per finished task.
How to keep it predictable
Put a cap on the number of steps in the loop. Cache the system prompt and any stable reference text. Send only the context a step actually needs instead of the whole history. Log token counts per step so you can see which part of the loop is expensive. And keep the provider behind an OpenAI-compatible base URL, so a cost or capability decision is a configuration change rather than a rewrite.
WebWright publishes an OpenAI-compatible API at https://webwright.ai/v1. The documented endpoints are GET /v1/models, POST /v1/chat/completions and POST /v1/audio/transcriptions. Model ids are wren-r1 and wren-r1-fast for chat and whisper-large-v3-turbo for speech to text.
If you want help finding which step in your agent loop is driving the bill, book a 30 minute consult and bring one real task trace.
The WebWright Team