VanaAPI

← Writing

A coding agent with ten dollars until midnight

Agents at the terminalEN2026-10-30

A coding agent has a small bug to fix and ten dollars available until midnight. The first patch fails a test, the second exposes another issue, and another investigation begins. Each step may be reasonable while the total becomes unreasonable. Keeping that work inside a daily budget requires separating an instruction to spend carefully from a mechanism that can stop spending.

Two approaches are worth comparing: session-level guidance and an external budget gate. Both help, but they provide different guarantees.

§ The spending rule: a reminder beside a gate

Session guidance: Tell the agent its daily allowance, ask for a short plan, and require approval before broad searches or repeated repair attempts. This is easy to introduce in Claude Code, Codex, or Gemini CLI. It also makes the intended scope explicit: fix the failing test, not reorganize the repository.

External gate: Keep the allowance in a ledger outside the conversation. Before forwarding a model request, check whether enough budget remains. Refuse new requests when the allowance is exhausted. This requires integration work, but the decision does not depend on the agent remembering an instruction.

The distinction matters: a prompt is a useful behavioral control, not a reliable spending boundary.

§ The accounting: conversation memory beside a ledger

Session guidance: The agent can report progress and summarize its work. It should not be treated as the authoritative source for cost. A conversation summary cannot reliably account for every request, retry, cached token category, or parallel session.

External gate: Record returned usage and apply the current rates for the selected model and token categories. Reconcile those records against provider billing data when available. Track every session using the same allowance, including background work. Keep credentials from bypassing the gate if the cap must be enforceable.

Vana API offers one OpenAI-compatible endpoint at https://api.vanaapi.com and also speaks the Anthropic Messages and Gemini native protocols. Its real-token billing and lack of a monthly fee make usage the relevant variable here. Protocol compatibility simplifies connection; it does not establish a shared daily cap across tools.

§ The last dollar: an estimate beside a reservation

Session guidance: Ask the agent to stop when little budget remains. This can reduce waste, but it cannot protect against a request already underway or several workers spending simultaneously.

External gate: Reserve budget before dispatch, using the request's input and configured output ceiling, with conservative allowances for billable categories. Release unused reservations after usage arrives. Make reservations atomic across workers. If you cannot establish a safe upper bound for a request, do not claim that your gate guarantees a hard cap.

Define the accounting day explicitly, such as midnight UTC. Decide how requests spanning that boundary are charged. A daily limit without a timezone and an in-flight accounting rule is still ambiguous.

§ The working style: cheaper calls beside fewer loops

Session guidance: Encourage bounded tasks: inspect the relevant files, propose one patch, run a targeted test, then reassess. Require approval after a small number of unsuccessful attempts. These rules address repeated work rather than merely reducing the price of each call.

External gate: Apply task-specific model permissions and request limits where your integration supports them. You might evaluate Gemini 2.5 Flash for narrow classification and Claude Sonnet 5.5 for repository changes. Compare current rates and measured task completion costs before choosing; a lower-priced call is not necessarily a cheaper completed fix.

§ A practical arrangement for tomorrow

Use both approaches. Give the agent a bounded task and clear stopping rules, then enforce the allowance outside its context. For a ten-dollar day, you might reserve seven dollars for planned work, two for approved recovery, and leave one unallocated as a buffer. Those are ledger allocations, not separate provider balances.

Create a Vana API account to test this arrangement with your existing coding client. Start with one session, verify usage accounting, and test that refusal actually stops new requests before enabling parallel agents. The useful outcome is not simply a lower bill: it is a predictable point at which unfinished work pauses for a human decision.