Integration

Use CloudSwap with curl

Send the job spec to POST https://cloudswap.ai/api/quote with content-type: application/json. The answer ranks offers by cost per run. GET https://cloudswap.ai/api/board returns the whole price board.

Quote a job

Only vcpus and mem_gb are required.

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}'

Only the cheapest fit

Pipe to jq.

curl
curl -s https://cloudswap.ai/api/quote \
  -H 'content-type: application/json' \
  -d '{"vcpus":4,"mem_gb":8,"hours":1}' | jq '.choice | {provider, region, price_hr, job_cost_usd}'

With your API key

Same call, higher limit.

curl
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}'

Read the board

The cheapest H100 on the board right now.

curl
curl -s https://cloudswap.ai/api/board \
  | jq '.categories[] | select(.key=="gpu-h100") | .offers[0]'

Tools on the server

4 tools
ToolWhat it doesNeeds a key
quote_jobPrices a stateless job on every provider; returns the cheapest fit with its cost per run and the next best offers. Places nothing.No
list_providersLists the providers CloudSwap prices.No
run_jobRuns a stateless container job on the cheapest fitting machine, paid from prepaid credits. Not open to everyone yet.Yes
get_jobState, price, wall time and log tail of one of your jobs.Yes

API keys

A key is optional for quotes. With one you get 120 quotes a minute instead of 30, and usage history. Keys start with cs_live_. Get an API key.

Other ways in

Install the MCP

One line in Claude Code. Quotes are free today and need no sign-up.

Get an API keyRead the docs

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