Cost has a shape — and how to run an honest bake-off
Lesson 4 of 5 in Choosing a Cloud for Agents: A Decision You Can Defend.
Do not compare prices. Compare shapes, then measure your own workload.
The reason is arithmetic. All three platforms meter agent compute in something close to the same units — vCPU-time and memory-time, per second — and the published rates for that compute sit in the same order of magnitude. Google Cloud lists Agent Compute at $0.085 per vCPU-hour and Agent Memory at $0.009 per GiB-hour of RAM; AWS materials show AgentCore Runtime example rates of $0.0895 per vCPU-hour and $0.00945 per GB-hour. A single-digit percentage gap on a line item that is usually not the biggest line item is not a decision. The shape — which dimensions exist, and which of them your agent hammers — moves the bill by multiples.
The dimensions below are the ones to model. Note what appears in all three columns and dwarfs the rest: model inference, billed separately by whoever serves the model.
| Dimension | AWS — AgentCore | Microsoft Foundry | Google Cloud — Agent Platform |
|---|---|---|---|
Compute for the loop | Runtime bills actual CPU consumed and peak memory per second, from microVM start to termination. | Prompt agents have no compute line at all (inference plus tool usage only); hosted agents add container compute on top. | Runtime bills allocated vCPU and RAM, rounded to the nearest second. |
Time spent waiting on the model or a tool | No CPU charge while waiting on model or tool I/O if nothing is using CPU — but memory stays billable for the session. | Container compute is Foundry-managed and scales per session and request volume; idle sessions deprovision compute after the idle timeout. | For Runtime, idle time spent waiting for the next prompt between turns is documented as not billed. |
Conversation state and long-term memory | Memory meters short-term events written, long-term records stored, and long-term retrieval requests. | Conversations and the hosted-agent state store are platform-managed; standard setups run on your own Storage, AI Search and Cosmos DB, so that cost lands on those resources (a BYO Cosmos account for agent conversations needs at least 3000 RU/s total throughput). | Sessions and Memory Bank bill as storage plus operations, with reads and writes converted into Agent Compute units (documented as 1 vCPU-hour per 3 million reads and per 1 million writes). |
Tool and gateway traffic | Gateway meters API operations, search queries and indexed tools — so a large tool catalogue has a standing cost even before anyone calls it. | Tool usage is a named billing component for both agent types; connectors and managed MCP servers are provisioned per project. | Agent Gateway converts API calls and authorization requests into Agent Compute units (documented as 1 vCPU-hour per 15,000). |
Sandboxed tools (code execution, browser) | Browser and Code Interpreter meter active CPU and memory per session. | Platform tools such as code interpreter and file search fall under tool usage on the Responses API surface. | Sandbox environments including Code Execution and Computer Use bill on allocated vCPU and RAM like Runtime. |
Policy and guardrail evaluation | Guardrail checks evaluated at the Gateway are part of the policy/guardrail surface — model-level guardrails still apply when the model is invoked. | Guardrail controls attach at four intervention points; spotlighting has no direct cost but inflates document token counts, which shows up as inference. | Semantic Governance Policies bill in Agent Compute units per agent-model response evaluation plus the evaluation model’s tokens. |
Observability | CloudWatch bills telemetry ingestion, storage and query separately from the agent itself. | Traces land in an Application Insights resource you own and pay for. | Cloud Trace and Cloud Logging bill on their own terms. |
Model inference | Billed separately by the model provider — AgentCore is model-agnostic, including models not hosted on Bedrock. | Per-call inference is the first component of both agent types’ cost model; catalogue models can be swapped without changing agent code. | Billed as model usage alongside the platform SKUs. |
AWS — session lifecycle
AgentCore Runtime offers two substrates. microVM sessions last up to 8 hours, terminate after 15 minutes of inactivity (documented defaults — check current Service Quotas), and treat session state as ephemeral: durable context is supposed to live in AgentCore Memory. Instance sessions run on isolated instances from a capacity provider for up to 14 days, with persistent volumes that survive stops and re-attach on resume with the same session id.
Cost consequence. CPU is not charged while nothing runs, but memory is billed for the life of the session — so a long-lived session parked waiting on a human is not free. Design consequence. If your agent must survive days of back-and-forth, that is an explicit substrate choice, not a default.
Microsoft Foundry — session lifecycle
Hosted agents run in per-session VM-isolated sandboxes with a persistent filesystem, and the platform is built around scale-to-zero with stateful resume: the idle timeout is configurable from 2 to 60 minutes (default 15), after which compute is deprovisioned and session state persisted, then restored when the session resumes. Sessions are permanently deleted after 30 days of inactivity. A separate durable key-value state store holds keyed JSON items independently of compute — it survives crashes, restarts and idle eviction, with a default 30-day item idle window that writes renew, and it can hold framework checkpoints for LangGraph or Agent Framework.
Cost consequence. Bursty, human-paced workloads pay less because compute genuinely goes away. Design consequence. Your resume path has to work, and it is the platform’s state store — not your own database — that makes it work unless you decide otherwise.
Google Cloud — session lifecycle
Agent Runtime bills allocated vCPU and RAM rounded to the nearest second, and the pricing page states that for Runtime, idle time waiting for the next prompt between turns is not billed. Sessions hold short-term conversational state; Memory Bank derives long-term memories from those sessions using generative models. There is also a monthly per-account free tier — the first 50 vCPU-hours of Agent Compute, 100 GiB-hours of Agent Memory and 1 GiB-month of Agent Storage.
Cost consequence. Turn-based conversational agents look cheap here, and the free tier will make your prototype look even cheaper than it is. Design consequence. Exclude the free tier from any bake-off arithmetic; a pilot that fits inside it tells you nothing about the shape of the production bill.
Now the bake-off. A bake-off is not "try each platform for a week and see which felt nicer" — that experiment measures documentation quality and your own mood. It is a controlled comparison with one dependent variable: cost and latency per successfully resolved task, on your task set, at your traffic shape.
Seven rules make it honest. Skip any one of them and you will get a number that cannot be defended in the meeting where it matters.
1 · Fix the task set before you touch a console
Take 100–300 real tasks with known-good outcomes — your golden dataset — and freeze it. If the task set changes between platforms, you have measured nothing. This is also the moment to notice that the eval suite is the reusable asset here: it outlives the bake-off, the platform choice, and probably the framework.
2 · Hold the model class constant, then vary it deliberately
Run the same model family on every platform if you can — several are available in more than one place, and Foundry documents swapping catalogue models without changing agent code. Then run a second pass with each platform’s house model, because that is a real option you would exercise. Reporting one number that silently mixes model choice with platform choice is the single most common way bake-offs mislead.
3 · Measure cost per resolved task, not cost per run
A platform that fails 20% of tasks and retries is not cheaper. Divide total spend — inference, platform SKUs, retrieval, observability ingestion — by the number of tasks that actually met the success criterion. Then report p50 and p95 latency separately, because the tail is what users experience and what your timeout policy has to survive.
4 · Reproduce your real traffic shape, especially idleness
Bursty human-paced traffic and steady batch traffic land on completely different parts of these billing models, given how differently the three treat waiting and idling (see the tabs above). If your agents sit waiting for approvals, simulate the waiting. If they run overnight in batches, run overnight batches.
5 · Exclude free tiers and promotional credits
Google Cloud publishes a monthly per-account free tier for Agent Compute, Memory and Storage; vendors also hand out proof-of-concept credits. Both are real money and neither is a rate. Model the bill at your projected production volume, then note the free tier as a one-line footnote — never as part of the comparison.
6 · Count the platform-team hours, and count them at their real price
Time to first working deployment, time to wire identity, time to get a trace end-to-end, time to satisfy your security reviewer. These hours are usually a larger delta than the compute rates, and they compound: a platform inside your existing landing zone starts with account vending, networking and policy baselines already solved.
7 · Write down what would flip the result
Finish with two or three named conditions that would change the recommendation — a 10× volume increase, the delivery surface moving off Teams, the primary corpus moving to another cloud, an egress control leaving preview. This turns a snapshot into a decision you can revisit deliberately, which is exactly what the deployment and versioning module wants from you.
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.