Updated

CloudSwap docs

CloudSwap is an MCP server and HTTP API that finds the cheapest cloud for a stateless job (CPU, GPU, batch or container) across AWS, Vast.ai, RunPod, Shadeform, Hetzner and DigitalOcean, for AI coding agents and developers. Add the MCP server in one line, or call the HTTP API. Quotes need no key.

Get an API keyTry a quote

Install the MCP server

The endpoint is https://cloudswap.ai/mcp: streamable HTTP with JSON responses. It works with any MCP client, including Claude Code, Cursor, Windsurf, Cline and Codex.

Claude Code

Terminal
claude mcp add --transport http cloudswap https://cloudswap.ai/mcp

Or commit a .mcp.json file to the repo:

.mcp.json
{
  "mcpServers": {
    "cloudswap": {
      "type": "http",
      "url": "https://cloudswap.ai/mcp"
    }
  }
}

Cursor

Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in one project.

~/.cursor/mcp.json
{
  "mcpServers": {
    "cloudswap": {
      "url": "https://cloudswap.ai/mcp"
    }
  }
}

Windsurf

Add this to ~/.codeium/windsurf/mcp_config.json. Windsurf names the key serverUrl.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "cloudswap": {
      "serverUrl": "https://cloudswap.ai/mcp"
    }
  }
}

Any other MCP client

Most clients take this shape. Check your client's docs for the file it reads.

MCP config
{
  "mcpServers": {
    "cloudswap": {
      "url": "https://cloudswap.ai/mcp"
    }
  }
}

Then ask your agent

Prompt
Use cloudswap to quote a 16 vCPU, 32 GB job that runs 2 hours in the EU. Spot is OK.

Tools

The server has four tools. quote_job and list_providers only read prices and need no key. run_job and get_job need an API key; running jobs is not open to everyone yet. See also the MCP page and integrations.

quote_job

Prices a stateless container, batch or GPU job on every provider. It returns the cheapest place that fits with its cost per run, and the next best offers, five in all. The input is the job spec.

list_providers

Lists the providers CloudSwap prices. It takes no input.

Job spec

The same fields go to quote_job and to POST /api/quote. Only vcpus and mem_gb are required.

FieldTypeNotes
vcpusintegerRequired. At least 1.
mem_gbnumberRequired. RAM in GB, more than 0.
gpu_typestringFor example "H100", "A100" or "RTX 4090". Leave out for CPU jobs.
gpu_countintegerAt least 1 when gpu_type is set.
hoursnumberExpected wall time on an AWS c7i-class CPU or the named GPU. Default 1.
max_price_hrnumberCap in USD per hour.
regionsarray of strings"eu", "us", "asia" or region codes. Leave out for any region.
spot_okbooleanThe job may be interrupted and re-run. Default true.
truststring"any" or "datacenter". Default "any".
data_in_gbnumberData pulled from AWS per run, for the egress cost. Default 0.
statelessbooleanMust be true. Stateful jobs are refused. Default true.

With trust set to "datacenter", the quote leaves out peer hosts. With spot_ok set to false, it leaves out every offer that can be interrupted.

Quote a job over HTTP

POST/api/quote

Send the job spec as a JSON body. One extra field, top, sets how many ranked offers come back: 1 to 25, default 10.

curl
curl -s https://cloudswap.ai/api/quote \
  -H 'content-type: application/json' \
  -d '{"vcpus":16,"mem_gb":32,"hours":2,"regions":["eu"],"spot_ok":true,"trust":"datacenter"}'

The answer:

Response
{
  "ok": true,
  "choice": {
    "provider": "aws",
    "sku": "c7i.4xlarge (spot)",
    "region": "eu-central-1",
    "geo": "eu",
    "price_hr": 0.211,
    "vcpus": 16,
    "mem_gb": 32,
    "interruptible": true,
    "trust": "datacenter",
    "source": "live-api",
    "job_cost_usd": 0.4642,
    "wall_hours": 2.2
  },
  "ranked": [ ...the best offers in order, same fields... ],
  "suspect": [],
  "provider_errors": {},
  "offers_seen": 120,
  "offers_fit": 14,
  "dry_run_only": true
}

Example values.

FieldTypeNotes
okbooleanTrue when the spec was valid.
choiceobject or nullThe cheapest offer that fits. Null when no offer fits.
rankedarrayThe best offers, cheapest run first. choice is the first one.
suspectarrayOffers set aside because the price is under 35% of the median.
provider_errorsobjectProviders that did not answer this time, by name.
offers_seenintegerOffers read from all providers.
offers_fitintegerOffers that fit the spec.
dry_run_onlybooleanAlways true. A quote places nothing.

Fields of one offer

FieldTypeNotes
providerstringFor example "aws", "vast", "runpod" or "shadeform".
skustringThe instance or machine name at that provider.
region, geostringThe provider's region, and "eu", "us", "asia" or "other".
price_hrnumberCloudSwap price in USD per hour.
interruptiblebooleanTrue for spot offers.
truststring"datacenter" or "peer".
sourcestring"live-api", or "static-list:<date>" for a dated list price.
job_cost_usdnumberCloudSwap price per run in USD. The ranking uses this number.
wall_hoursnumberExpected wall time on this offer.

Read the price board

GET/api/board

The price board from the home page as JSON: 8 job shapes (4, 16 and 32 vCPU; 1x RTX 4090, L40S, A100, H100 and H200) with the cheapest offer per provider. It is refreshed every 15 minutes. Open /api/board

curl
curl -s https://cloudswap.ai/api/board
Response
{
  "generated": "2026-12-01T03:33:00Z",
  "providers": [
    { "name": "aws", "status": "ok", "offers": 124 },
    { "name": "hetzner", "status": "static", "as_of": "2026-11-30" }
  ],
  "categories": [
    {
      "key": "cpu-16",
      "label": "16 vCPU, 32+ GB",
      "kind": "cpu",
      "offers": [ ...the cheapest offer per provider, cheapest first... ]
    }
  ]
}

Example values, shortened. generated is the snapshot time in UTC. A provider with status "static" is a list price read on the as_of date.

API keys

A key is optional. Without one you can send 30 quotes a minute. With one you get 120 quotes a minute, and your usage history shows in your account.

Send the key as a bearer token: Authorization: Bearer cs_live_...

curl with a key
export CLOUDSWAP_API_KEY=cs_live_...

curl -s https://cloudswap.ai/api/quote \
  -H "Authorization: Bearer $CLOUDSWAP_API_KEY" \
  -H 'content-type: application/json' \
  -d '{"vcpus":16,"mem_gb":32,"hours":2}'

Keys come with an account. Quotes stay free.

Get an API key

Limits and errors

CaseStatusWhat you get
Quote rate20030 quotes a minute without a key, 120 a minute with a key.
Over the rate429{"error": "rate limited"} and a Retry-After: 30 header.
Spec not valid400{"ok": false, "errors": [...]}. Each error names the field to fix.
Stateful job400A spec with stateless set to false is refused.
No offer fits200choice is null and ranked is empty. Raise the max price, allow spot or widen the regions.

Try it before you install

The quote form on the home page sends the same request as the API.

Get an API keyTry a quote

Claude Code
claude mcp add --transport http cloudswap https://cloudswap.ai/mcp