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.
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
claude mcp add --transport http cloudswap https://cloudswap.ai/mcp
Or commit a .mcp.json file to the repo:
{
"mcpServers": {
"cloudswap": {
"type": "http",
"url": "https://cloudswap.ai/mcp"
}
}
}
Cursor
Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in one project.
{
"mcpServers": {
"cloudswap": {
"url": "https://cloudswap.ai/mcp"
}
}
}
Windsurf
Add this to ~/.codeium/windsurf/mcp_config.json. Windsurf names the key serverUrl.
{
"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.
{
"mcpServers": {
"cloudswap": {
"url": "https://cloudswap.ai/mcp"
}
}
}
Then ask your agent
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.
| Field | Type | Notes |
|---|---|---|
| vcpus | integer | Required. At least 1. |
| mem_gb | number | Required. RAM in GB, more than 0. |
| gpu_type | string | For example "H100", "A100" or "RTX 4090". Leave out for CPU jobs. |
| gpu_count | integer | At least 1 when gpu_type is set. |
| hours | number | Expected wall time on an AWS c7i-class CPU or the named GPU. Default 1. |
| max_price_hr | number | Cap in USD per hour. |
| regions | array of strings | "eu", "us", "asia" or region codes. Leave out for any region. |
| spot_ok | boolean | The job may be interrupted and re-run. Default true. |
| trust | string | "any" or "datacenter". Default "any". |
| data_in_gb | number | Data pulled from AWS per run, for the egress cost. Default 0. |
| stateless | boolean | Must 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 -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:
{
"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.
| Field | Type | Notes |
|---|---|---|
| ok | boolean | True when the spec was valid. |
| choice | object or null | The cheapest offer that fits. Null when no offer fits. |
| ranked | array | The best offers, cheapest run first. choice is the first one. |
| suspect | array | Offers set aside because the price is under 35% of the median. |
| provider_errors | object | Providers that did not answer this time, by name. |
| offers_seen | integer | Offers read from all providers. |
| offers_fit | integer | Offers that fit the spec. |
| dry_run_only | boolean | Always true. A quote places nothing. |
Fields of one offer
| Field | Type | Notes |
|---|---|---|
| provider | string | For example "aws", "vast", "runpod" or "shadeform". |
| sku | string | The instance or machine name at that provider. |
| region, geo | string | The provider's region, and "eu", "us", "asia" or "other". |
| price_hr | number | CloudSwap price in USD per hour. |
| interruptible | boolean | True for spot offers. |
| trust | string | "datacenter" or "peer". |
| source | string | "live-api", or "static-list:<date>" for a dated list price. |
| job_cost_usd | number | CloudSwap price per run in USD. The ranking uses this number. |
| wall_hours | number | Expected 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 -s https://cloudswap.ai/api/board
{
"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_...
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.
Limits and errors
| Case | Status | What you get |
|---|---|---|
| Quote rate | 200 | 30 quotes a minute without a key, 120 a minute with a key. |
| Over the rate | 429 | {"error": "rate limited"} and a Retry-After: 30 header. |
| Spec not valid | 400 | {"ok": false, "errors": [...]}. Each error names the field to fix. |
| Stateful job | 400 | A spec with stateless set to false is refused. |
| No offer fits | 200 | choice 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.
claude mcp add --transport http cloudswap https://cloudswap.ai/mcp