News icon

Batch Inference is now generally available on Runpod Serverless

Best Platforms to Host AI Agents in 2026: GPUs, Sandboxes and Runtimes Compared

Updated November 24, 2026. Prices checked on each provider's own pricing page on that date.

"Where do I host my agent?" sounds like one question, but a production agent usually needs three different things, and few platforms do all three well:

  1. A place to run the agent loop. The orchestration code (LangGraph, CrewAI, Mastra, the OpenAI or Anthropic agent SDKs, or your own loop) that calls models and tools. Mostly CPU, often long-running, and it needs to keep state between steps.
  2. A sandbox for tool and code execution. When an agent writes and runs code, browses, or touches files, you want that isolated from everything else and cheap to create and throw away.
  3. Model inference. Either a hosted model API or your own open model on a GPU. If you self-host models for cost, privacy or fine-tuning, the GPU is the biggest line on the bill.

This guide compares 10 platforms across those three jobs: GPU clouds that host agents and their models together, purpose-built sandboxes, managed agent runtimes from the hyperscalers, and general app platforms.

Quick comparison

PlatformWhat it isHeadline priceMax sessionGPU accessPersistenceBest for
RunpodGPU cloud: Pods, Serverless, ClustersCPU Pods from $0.03/vCPU-hr; serverless CPU from $0.036/vCPU-hr; GPUs from $0.58/hrPods run until you stop themYes, 16GB to 288GB VRAMNetwork volumes $0.07/GB-monthAgents that run their own models or need GPUs
Modal (Sandboxes)Serverless platform with sandboxed code execution$0.00003942/core-s (about $0.142/core-hr) plus $0.00000667/GiB-s5 min default, up to 24 hoursYesFilesystem snapshotsPython teams running agent code and sandboxes in one SDK
E2BCode-execution sandboxes$0.000014/vCPU-s ($0.0504/vCPU-hr) plus $0.0000045/GiB-s1 hour (Hobby), 24 hours (Pro)NoPause and resume keeps disk and memoryMany short-lived sandboxes for code-interpreter agents
DaytonaSandboxes$0.0504/vCPU-hr plus $0.0162/GiB-hr, per secondNot publishedYes, up to 8 GPUs (H100 $2.47/hr preemptible)Snapshots (GPU sandboxes are ephemeral)Sandboxes with broad SDK language support
AWS Bedrock AgentCore RuntimeManaged agent runtime, one microVM per session$0.0895/vCPU-hr plus $0.00945/GB-hr8 hours per microVMThrough separate AgentCore InstancesSessions resume on a new microVMTeams standardized on AWS and Bedrock
Google Vertex AI Agent EngineManaged agent runtime$0.0994/vCPU-hr plus $0.0105/GiB-hrNot publishedNot publishedNot publishedTeams standardized on Google Cloud
Cloudflare Containers and SandboxContainers behind Durable Objects$0.000020/vCPU-s ($0.072/vCPU-hr) active, plus $0.0000025/GiB-s, 10ms incrementsNot publishedNot offeredThrough Durable ObjectsEdge-native agents in TypeScript
Vercel SandboxSandboxes$0.128/active CPU-hr plus $0.0212/GB-hr, $0.60 per 1M creations45 min (Hobby), 24 hours (Pro)Not offeredSnapshots, persistent sandboxesAgents inside Next.js and Vercel apps
NorthflankContainer platform$0.01667/vCPU-hr plus $0.00833/GB-hrNot publishedYes (L4 $0.80/hr; H100 $2.74/hr in 8-GPU units)VolumesLong-running agent services next to your app
Fly.io MachinesLightweight VMsshared-cpu-1x 256MB from $2.19/month, per secondNot applicable (VMs run until stopped)No (GPUs ended July 31, 2026)Volumes $0.15/GB-monthSmall always-on CPU agents close to users

A note on comparing prices: most platforms bill memory separately from CPU, Vercel bills only active CPU time (I/O wait is free), and sandboxes add per-creation or per-session overheads. Price the agent you actually run, not the headline rate.

1. Runpod

Runpod is the AI Developer Cloud: GPU and CPU compute on demand through Pods (persistent machines), Serverless (autoscaling endpoints) and Clusters (multi-node). For agents, it is the strongest fit when the agent needs a GPU: running its own open model, fine-tuning on its own data, generating images or video, or running evals.

Agent loop. Run it on a CPU Pod (from $0.03 per vCPU-hour) or a GPU Pod for as long as it needs; Pods have no session limit and bill per second. For request-driven agents, Serverless CPU workers start at $0.036 per vCPU-hour and scale to zero.

Model inference next to the agent. The agent and the model it calls can run in the same account and region: a vLLM worker on Serverless (24GB GPUs from $0.75/hr, H100 $5.89/hr, B200 $10.79/hr, per-second billing), or a dedicated GPU Pod (L4 $0.69/hr, RTX 4090 $0.89/hr). Keeping inference next to the loop cuts per-call latency and removes per-token API costs for open models.

For serverless GPU pricing across providers, see our serverless GPU providers comparison.

If your agent calls an open model through an API, see our AI inference platforms comparison for token prices and dedicated endpoints.

State. Network volumes ($0.07/GB-month under 1TB) persist files, checkpoints, vector indexes and memory across Pods and Serverless workers.

Agents that operate infrastructure. Runpod is built to be driven by agents as well as people. There's a hosted MCP server (mcp.runpod.io) so agents like Claude Code can create Pods, deploy endpoints and check spend; a CLI (runpodctl); agent skills (runpod/runpod-plugins-official); llms.txt and markdown versions of every docs page; and an agent login flow (runpod login --agent).

What Runpod doesn't do. Runpod has no managed sandbox API. If your agent needs thousands of short-lived, isolated code sandboxes created per request, a purpose-built sandbox (E2B, Daytona, Modal Sandboxes) is the better tool, and you can pair one with Runpod for the GPU side.

Best for: agents that run their own models, agents with GPU tools (image, video, speech, training), long-running agents that need a persistent machine, and agents that provision their own compute through MCP.

2. Modal (Sandboxes)

Modal is a Python-first serverless platform. Its Sandboxes product runs untrusted code in isolated containers, so you can host the agent's functions and its code-execution environment with one SDK.

Pricing. Sandboxes bill $0.00003942 per core-second (about $0.142 per core-hour, non-preemptible) and $0.00000667 per GiB-second of memory. GPUs are available in sandboxes.

Sessions and isolation. 5-minute default timeout, configurable up to 24 hours. Isolation is gVisor, with a VM runtime also offered. Filesystem snapshots let you save and restore sandbox state. SDKs in Python, JavaScript and Go.

Best for: Python teams that want agent code, sandboxes and GPU functions on one platform.

3. E2B

E2B is a sandbox service built for AI agents, widely used for code-interpreter features.

Pricing. $0.000014 per vCPU-second ($0.0504 per vCPU-hour) plus $0.0000045 per GiB-second of memory.

Sessions. Up to 1 hour on Hobby and 24 hours on Pro. Pause and resume keeps disk and memory state, and paused sandboxes are kept indefinitely. No GPU access. SDKs in Python and Node.

Best for: agents that create many short-lived sandboxes to run generated code.

4. Daytona

Daytona provides sandboxes with their own kernel, running as containers by default with a VM option.

Pricing. $0.0504 per vCPU-hour and $0.0162 per GiB-hour, billed per second. GPU sandboxes support up to 8 GPUs, with H100 at $2.47/hr preemptible.

Persistence. Snapshots for CPU sandboxes; GPU sandboxes are ephemeral. SDKs in Python, TypeScript/JavaScript, Ruby, Go and Java.

Best for: teams that need sandboxes from languages beyond Python and JavaScript, or occasional GPU access inside a sandbox.

5. AWS Bedrock AgentCore Runtime

AgentCore Runtime is AWS's managed runtime for agents, running each session in its own microVM.

Pricing. $0.0895 per vCPU-hour and $0.00945 per GB-hour of memory, with a 1-second minimum.

Sessions. A microVM lives up to 8 hours; sessions can resume on a new microVM. GPU workloads go through separate AgentCore Instances.

Best for: teams already on AWS that use Bedrock models and want per-session isolation managed by AWS.

6. Google Vertex AI Agent Engine

Agent Engine is Google Cloud's managed runtime for deploying agents built with Google's Agent Development Kit and other frameworks.

Pricing. $0.0994 per vCPU-hour and $0.0105 per GiB-hour of memory.

Best for: teams standardized on Google Cloud and Gemini.

7. Cloudflare Containers and Sandbox

Cloudflare runs containers behind Durable Objects, and its Agents SDK and Sandbox package build on that for stateful agents at the edge.

Pricing. $0.000020 per active vCPU-second ($0.072 per vCPU-hour) and $0.0000025 per GiB-second, billed in 10ms increments. No GPU access in Containers.

Best for: TypeScript agents that need to run close to users and keep per-user state in Durable Objects.

8. Vercel Sandbox

Vercel Sandbox runs isolated environments for agents and AI-generated code, alongside Vercel Functions.

Pricing. $0.128 per active CPU-hour, $0.0212 per GB-hour of memory and $0.60 per million sandbox creations. Billing counts active CPU only, so time spent waiting on I/O (model calls, network) is free.

Sessions. 45 minutes on Hobby and 24 hours on Pro. Snapshots and persistent sandboxes are available.

Best for: agents built into Next.js and Vercel-hosted apps, especially I/O-heavy agents that spend most of their time waiting on model responses.

9. Northflank

Northflank is a container platform for apps, databases and jobs, with GPUs on its cloud or yours.

Pricing. $0.01667 per vCPU-hour and $0.00833 per GB-hour. GPUs: L4 $0.80/hr, H100 $2.74/hr sold in 8-GPU containers.

Best for: running an agent as a long-lived service next to the rest of your application stack.

10. Fly.io Machines

Fly Machines are lightweight VMs that start fast and run in many regions.

Pricing. A shared-cpu-1x with 256MB starts at $2.19/month, billed per second. Volumes are $0.15/GB-month. Fly retired GPUs on July 31, 2026, so models need to be served elsewhere.

Best for: small, always-on CPU agents that need to run close to users, paired with a model API or a GPU cloud for inference.

Running Claude Code and other coding agents in the cloud

Coding agents such as Claude Code need a persistent machine with your repo, your toolchain and, for ML work, a GPU to run what they write. Anthropic offers Claude Code on the web as a managed option. If you want your own environment instead:

  • On Runpod, start a Pod (CPU from $0.03/vCPU-hr, or a GPU like an RTX 4090 at $0.89/hr), attach a network volume for your repo and caches, and run Claude Code over SSH or the web terminal. The agent can run training scripts and evals on the same GPU, and the Runpod MCP server lets it start and stop other Pods itself.
  • For isolated, disposable environments per task, a sandbox (E2B, Daytona, Modal Sandboxes, Vercel Sandbox) fits better, with the 1 to 24 hour session limits listed above.
  • For a cheap always-on box with no GPU, a small VM (Fly Machines, Northflank) works.

For a hands-on walkthrough of running agents on your own infrastructure, see hosting and running private AI agents.

How to choose

  • Your agent runs its own open model, or calls GPU tools: Runpod. Keep the loop and the model in one place.
  • Your agent executes generated code and you need thousands of disposable sandboxes: E2B, Daytona or Modal Sandboxes, paired with a GPU cloud if you self-host models.
  • You're on AWS and use Bedrock models: Bedrock AgentCore Runtime.
  • You're on Google Cloud and use Gemini: Vertex AI Agent Engine.
  • Your agent lives in a TypeScript or Next.js app: Cloudflare or Vercel Sandbox.
  • Your agent is a small always-on service calling a model API: Fly Machines or Northflank.

FAQ

What is the best platform to host an AI agent?

It depends on what the agent needs. For agents that run their own models or need GPUs, Runpod hosts the agent loop, the model and persistent storage on one platform. For agents that execute untrusted code at scale, sandbox services like E2B, Daytona and Modal Sandboxes are purpose-built. AWS AgentCore and Google Vertex AI Agent Engine suit teams already committed to those clouds.

Do AI agents need GPUs?

The agent loop itself runs on CPU. You need a GPU when the agent runs its own model (open-weight LLMs, embedding or reranking models), generates images, audio or video, or trains and evaluates models as part of its work. Agents that only call hosted model APIs can run on CPU.

What's the difference between an agent runtime and a sandbox?

A runtime hosts the agent's own code (the loop that plans, calls models and calls tools), usually for long periods. A sandbox is an isolated, disposable environment where the agent runs code it generated, so a bad command can't touch anything else. Many production agents use both.

How much does it cost to host an AI agent?

CPU for the agent loop runs from about $0.017 to $0.14 per vCPU-hour across the platforms here, plus memory on most of them. Model inference usually dominates: either per-token API fees or GPU time (24GB GPUs from about $0.67 to $0.85 per hour, H100s from about $2.50 to $8.00 per hour on serverless platforms).

Can I run Claude Code in the cloud?

Yes. Anthropic offers Claude Code on the web. To use your own environment, run Claude Code on a cloud machine such as a Runpod Pod over SSH, with a network volume for your repo. A GPU Pod lets it run and test ML code directly.

How long can an agent session run?

On sandbox services, sessions are capped: E2B up to 24 hours on Pro, Modal Sandboxes up to 24 hours, Vercel Sandbox up to 24 hours on Pro, AWS AgentCore microVMs up to 8 hours. Runpod Pods and Fly Machines have no session cap and run until you stop them.

Can an AI agent provision its own GPUs?

On Runpod, yes. The Runpod MCP server, CLI and API let an agent create Pods, deploy Serverless endpoints, check spend and tear resources down. Set spend limits on the account before giving an agent access.

Should I self-host the model or use an API for my agent?

Use an API to start. Consider self-hosting an open model when token costs pass the cost of a GPU, when data can't leave your environment, or when you need a fine-tuned model. Agents make many model calls per task, so they reach that crossover sooner than chat apps.

Sources

All checked November 24, 2026.

  • Runpod: runpod.io/pricing, runpod.io/product/serverless, docs.runpod.io/serverless/pricing, docs.runpod.io/get-started/mcp-servers, docs.runpod.io/get-started/agent-skills, docs.runpod.io/agent-setup, docs.runpod.io/runpodctl/overview
  • Modal: modal.com/docs/guide/sandbox, modal.com/pricing
  • E2B: e2b.dev/pricing, docs.e2b.dev/sandbox/persistence
  • Daytona: daytona.io/pricing, daytona.io/docs/en/sandboxes
  • AWS: aws.amazon.com/bedrock/agentcore/pricing, docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-lifecycle-settings.html
  • Google: docs.cloud.google.com/agent-builder/release-notes
  • Cloudflare: developers.cloudflare.com/containers/platform/pricing, developers.cloudflare.com/agents
  • Vercel: vercel.com/docs/vercel-sandbox/pricing
  • Northflank: northflank.com/pricing
  • Fly.io: docs.fly.io/about/pricing, community.fly.io (GPU deprecation notice, July 31, 2026)
Purple glow background

Build what’s next.

Build, train, and scale AI workloads on Runpod with cloud GPUs, Serverless, and Clusters.

Star field background