Compute & Hosting

Coming soon · Pre-beta

Introducing S2A

Serverless Agent Service

S2A is a hosting service for AI agents. Give it a GitHub repository, a Dockerfile or a container image, and it builds your agent, runs it in the cheapest cloud region that fits, and serves it at a stable URL. Agents scale to zero when idle and wake on the first request, so you only pay while they are working.

S2A is in pre-beta and not yet available. This page previews the service and its API ahead of launch.

How it works

Three steps from code to a running agent. You write it, S2A places and deploys it, and it scales on its own.

  1. 1

    Build your agent

    Write your agent however you like: a FastAPI or any HTTP server, an MCP server, or a plain Docker image. Give S2A a GitHub repository, a Dockerfile or a pre-built image.

  2. 2

    Deploy with S2A

    Set the parameters you care about, or leave them to S2A. It prices every region across AWS, Google Cloud and Azure, picks the cheapest one that fits, and sets up the container, volume, networking and healthcheck for you.

  3. 3

    Serve and scale

    Your agent answers at a stable URL and scales from zero to thousands of users on demand. When traffic stops, it sleeps, so you pay the lowest possible cost.

Figure 01 · How S2A works

From your code to a production endpoint

One request deploys a repository, a Dockerfile or an image. Inside S2A it is built, priced across clouds, optimized and health-checked, then placed on the cheapest cloud. What comes out is a production-grade autoscaling API endpoint that wakes on the first request and sleeps when idle.

  • Request
  • Response
  • Container image
YOUS2AOUTPUTYour repositoryGitHub · Dockerfile · imageapiPOST /v1/deploymentsbuildclone · build · pushplacementquotes · cheapestoptimizesmaller imagecheckhealthcheckAWS Fargateus-east-1Azure Container AppswesteuropeGoogle Cloud Runus-central1 · cheapestgatewaywake on requestProduction endpointautoscaling · HTTPSYour usersapps · MCP · webhooks

Use cases

Anything that listens on a port can run on S2A. It fits best where traffic is bursty and idle time is the norm.

Deploy MCP servers in one click

Host a Model Context Protocol server as a container and connect it from Claude Desktop, Cursor, or any MCP client at a stable URL. It sleeps between sessions and wakes when a client connects.

Agent servers in Python with FastAPI

Wrap an agent in a FastAPI app, add a health route, and deploy straight from the repository. S2A builds the image and gates the rollout on that health route.

Swarms agents and swarms as services

Run a Swarms agent or a multi-agent swarm behind your own HTTP endpoint, with its prompts, tools and model choices packaged in the container.

Webhook and event handlers

Handlers for GitHub, Stripe or form events that sit idle most of the day. Scale to zero means they cost nothing until an event arrives.

Background workers and pipelines

Research agents, scrapers and data pipelines that run on a trigger. Give them a persistent volume for state and let them sleep between runs.

Tool backends for agents

Small services your agents call: converters, search wrappers, code runners. Each gets its own URL and its own sizing.

Internal tools and demos

Streamlit or Gradio apps, dashboards and prototypes that only need to exist when someone opens them.

Model and embedding servers

Self-hosted inference or embedding servers with a persistent volume for weights. Size them up to the largest instance a cloud offers, and let them sleep when no one is querying.

Quick start

Three steps from nothing to a running agent behind a stable URL.

  1. 1

    Get an API key

    S2A uses your Swarms API key. Create one on the API keys page and export it in your shell.

    Terminal
    export SWARMS_API_KEY=sk-...
  2. 2

    Create an agent

    Any service that listens on a port works. This one wraps a Swarms agent in FastAPI. The /health route is what S2A probes before sending traffic, and the app listens on port 8080 on all interfaces.

    main.py
    # main.pyfrom fastapi import FastAPIfrom swarms import Agentapp = FastAPI()agent = Agent(agent_name="Researcher", model_name="claude-sonnet-4-5", max_loops=1)@app.get("/health")def health():    return {"status": "ok"}@app.post("/run")def run(body: dict):    return {"output": agent.run(body["task"])}

    Add a Dockerfile next to it and push both to a GitHub repository.

    Dockerfile
    FROM python:3.12-slimWORKDIR /appCOPY . .RUN pip install fastapi uvicorn swarmsCMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
  3. 3

    Deploy with S2A

    One request creates the deployment. The response is immediate and the rollout runs in the background; poll until it is live, then call your agent at its URL.

    Terminal
    # Deploy from your repository. S2A builds the image and picks the cheapest region.curl -s https://sas.swarms.world/v1/deployments -X POST \  -H "x-api-key: $SWARMS_API_KEY" -H 'content-type: application/json' \  -d '{"name":"researcher","source":{"github_repo":"acme/researcher"},"resources":{"cpu":2,"memory_gb":4,"volume_gb":-1},"env":{"ANTHROPIC_API_KEY":"..."}}'# -> 202 {"id":"dep_...","status":"queued","url":"https://sas.swarms.world/apps/researcher",...}# Poll until status is livecurl -s https://sas.swarms.world/v1/deployments/researcher -H "x-api-key: $SWARMS_API_KEY"# Call your agent. No API key needed here; a sleeping container wakes on this request.curl -s https://sas.swarms.world/apps/researcher/run -X POST -H 'content-type: application/json' \  -d '{"task":"Summarise this filing"}'

Benefits

Deploy from anywhere

Point S2A at a GitHub repository, paste a Dockerfile, or hand it a pre-built image. It builds and ships the rest.

Multi-cloud by default

Workloads run on AWS, Google Cloud or Azure. You never pick a provider unless you want to.

Always the cheapest region

Every region is priced for the size you ask for and the cheapest one wins. Keep workloads in the Americas or Europe with one setting.

Scale to zero

Idle deployments go to sleep and stop costing money. The first request wakes them and is answered as soon as they are ready.

Healthcheck-gated rollouts

A deployment only goes live once its healthcheck passes, so a broken build never replaces a working one.

One stable URL

Each deployment gets a URL that never changes across redeploys, sleeps or wakes. Traffic is forwarded to your container as is.

Redeploy in one call

Ship a new version from the same source, or change just the branch or environment variables. Traffic waits while the new version rolls out.

Secured by your API key

Use the Swarms API key you already have. Your deployments are private to your account.

Built for agents

A self-describing REST API with an OpenAPI document and an llms.txt guide, so agents can deploy agents.

Pricing

You pay the cloud's list price for the region S2A selects, and only while your container is awake. Rates come from the clouds' own public price lists. With scale to zero, an agent that handles a few requests a day costs a few minutes of compute a day.

Cheapest region

Every region is priced for your size and the cheapest one wins.

Pay while awake

Billing follows the time the container is running, not the calendar.

Quote first

Ask for a quote before deploying and see the quote behind every placement.

Get a quote for a size without deploying anything. The response lists every region, cheapest first, with the monthly total and the hourly rate while active.

Terminal
curl -s https://sas.swarms.world/v1/pricing/quote -X POST \  -H "x-api-key: $SWARMS_API_KEY" -H 'content-type: application/json' \  -d '{"cpu": 2, "memory_gb": 4, "volume_gb": -1, "scope": "america"}'# {#   "cheapest": { "cloud": "...", "region": "...", "total_usd": ..., "hourly_usd": ... },#   "quotes":   [ ... every priced region, cheapest first ... ],#   "rejected": [ ... regions that cannot host the size, with the reason ... ]# }

Frequently asked questions

What can I deploy on S2A?

Anything that runs in a container and listens on a port: agent servers, MCP servers, webhook handlers, background workers, dashboards, and inference servers. Give S2A a GitHub repository, an inline Dockerfile, or a pre-built image.

Which clouds does it run on?

AWS (ECS Fargate), Google Cloud (Cloud Run) and Azure (Container Apps). By default S2A prices every enabled cloud and region for the size you ask for and picks the cheapest. You can pin a cloud or region, or restrict placement to the Americas or Europe.

How does scale to zero work?

After a period without traffic your container is stopped and you stop paying for it. The next request is held at the gateway while the container starts and passes its healthcheck, then answered normally. Expect the first request after idle to take longer than usual. You can also wake or sleep a deployment on demand.

Does the URL change when a deployment sleeps or is redeployed?

No. Each deployment gets one stable URL that stays the same across redeploys, sleeps and wakes.

What does a deployment need to work?

Listen on port 8080 on all interfaces (or set the port in the spec), and answer 2xx or 3xx on a health route, /health by default. S2A only sends traffic once that route passes, and it uses the same route to know when a woken container is ready.

How is it priced?

You pay the cloud list price for the region S2A selects, and only while your container is awake. You can request a quote for any size before deploying, and every deployment records the quote behind its placement.

How do I ship a new version?

Call redeploy on the deployment. S2A rebuilds from the same source, or from a new branch or environment you pass in the request, and rolls the new version out behind the same URL. Traffic is held while the rollout completes.

Do I need a separate account or key?

No. S2A uses your Swarms API key, and your deployments are private to your account.

Can an agent use S2A directly?

Yes. The API is fully described by an OpenAPI document and an llms.txt guide served from the API itself, so an agent can discover the endpoints, create a deployment, poll until it is live, and call it.

When can I use it?

S2A is in pre-beta and not yet available. The API, gateway and pricing are complete, and the cloud providers are being validated before launch. This page previews the service ahead of that.