Coding agentsCostsCloud development

AI coding agent monthly cost: a budget method

October 16, 2026 · Oyren AI Team (AI-written)

Coins are divided among four trays beneath a paper desk calendar.

A coding agent can look inexpensive on a token price sheet while tests keep a cloud machine running. A monthly budget needs separate rows for subscription access, metered model usage, machine runtime, storage and paid tools. After a short trial with real tasks, divide the observed spend by the number of accepted results.

Choose or create a workspace, then select the agents and repositories for the workflow.

Five rows in one budget equation

cash cost = subscriptions
          + metered model usage outside included access
          + billed machine runtime
          + billed storage
          + other paid services

Each row comes from a different bill or usage record:

  • subscriptions: active plan fees, counted once per account.
  • metered model usage outside included access: API or provider usage billed per token or per request beyond what a plan includes.
  • billed machine runtime: time the execution host bills for, in that host's billing unit.
  • billed storage: retained snapshots, checkouts, and artifacts that carry a storage charge.
  • other paid services: tools the agent calls that bill separately, such as a paid search API.

Some rows may be zero. A local machine has no cloud-runtime invoice, and a hosted plan may bundle storage. Record the terms of the account in use. Keep reviewer time in hours beside the cash total, since it is a planning cost rather than an invoice line.

Which account pays: subscription access or API billing

OpenAI documents ChatGPT sign-in and API key authentication as distinct access paths for local Codex work, and API key usage follows API billing (OpenAI authentication). Claude Code's cost documentation separates subscription information from API token usage, and its /usage display reports session usage whose billing relevance differs for API users and subscribers (Claude Code usage and costs). For OpenCode, the provider configuration names the endpoint and account that need inspection (OpenCode providers).

Mind map of the billing path behind an agent session: subscription sign-in, API key, or another provider, all recorded in the ledger's authentication column

Add an authentication column to the ledger: provider, billing account and whether the run used included plan access or separately metered usage. A separately configured API key can create a bill even when a subscription is active. Abbreviate account identifiers in shared reports and omit credential values.

Token usage and per-million rates

OpenAI's API pricing page lists separate input, cached input, and output rates for applicable models (OpenAI API pricing). A budget based only on generated output therefore misses part of the bill. The calculation groups measured usage by model and billing category, then applies the published rate:

row cost = (tokens in category / 1,000,000) x published rate per million tokens
  • tokens in category: measured input, cached input, or output tokens for one model.
  • published rate per million tokens: the current price for that model and category, read from the provider's price list.

Multiplying a raw token count by a per-million price overstates the row by a factor of one million. Paid tools and external services get their own rows: a task that calls a paid search API creates spend outside the model's generation bill, and that service's billing record is the source.

Runtime and storage

Runtime is the time the execution host bills for, not the time someone spends watching a terminal. A browser tab is a viewing surface, so closing it is not evidence that a billable machine stopped. GitHub Codespaces, for example, documents explicit lifecycle states and idle-timeout behavior, which describes GitHub's model rather than every provider's (GitHub Codespaces lifecycle). Unattended test runs, waiting processes, and forgotten servers all belong in the runtime row, at the billing granularity the host documents.

Storage needs an object and a unit. A snapshot, a repository checkout, and an artifact archive can follow different retention and billing rules, so each storage row records the object, its retained size, the billing period, and who is responsible for deleting it.

The worksheet

ItemQuantity to recordCalculation
ItemSubscriptionQuantity to recordActive subscriptionsCalculationSum of applicable fees
ItemAdditional model usageQuantity to recordUsage outside included access, by categoryCalculationUsage multiplied by its rate
ItemMachine runtimeQuantity to recordBilled runtime unitsCalculationUnits multiplied by the applicable rate
ItemStorageQuantity to recordRetained size and billing periodCalculationBillable storage multiplied by its rate
ItemOther paid servicesQuantity to recordBilled calls or unitsCalculationUnits multiplied by the service rate
ItemTotalQuantity to recordAll rows aboveCalculationSum without double counting included access

Quantity to record comes from the account's usage and billing records. Calculation uses that account's current rates. Keep an exclusions line for taxes, paid data sources or network transfer when those costs are outside the estimate. The worksheet leaves vendor prices blank because those rates change.

Cost per accepted task

The first measurement period covers several representative tasks: a small fix, a test update, and a change that needs repository exploration. Each task starts with a recorded configuration and ends with acceptance evidence and spend records.

Failed attempts stay in the ledger. If five attempts cost $60 and three produced accepted patches, the observed cost is $20 per accepted task. The two failed attempts remain in the $60 total. This measure catches repeated runs that a per-token price comparison misses.

Budget controls and the hosting comparison

A written operating budget defines the allowed account, the planned runtime, a review checkpoint, and the conditions for ending an unsuccessful run. These are management decisions. An estimate or an alert is not an enforced spending cap unless the service itself enforces it.

Local and cloud hosts compare fairly only on the same workload. The cloud environment comparison covers environment choices, and this ledger supplies the cost side of that decision. Oyren meters Codespace runtime separately from agent model usage, and retained snapshots carry a separate storage cost. The live Plans page lists current rates, and the Codespaces page describes the runtime they apply to.

Choose or create a workspace, then select the agents and repositories for the workflow.

Open Codespace setup

Cloud development environment for coding agents