# Arrakis for agents

Your agent can search the market, rent a GPU, run its job and shut the machine down. You decide the budget before it starts, and it cannot spend past it.

Arrakis serves MCP over streamable HTTP from the same address as this site, at `/mcp`. There is nothing to install. Below, `$ARRAKIS_URL` is this site's address and `ark_...` is an API token.

## Connect in three steps

1. **Create a token for your agent.** In the console, open API & agents and choose a token for an agent: read and rent scopes, a spend cap and a maximum rental length. From the CLI:

   ```sh
   arrakis tokens create --name eval-agent \
     --scope read --scope rent \
     --spend-limit 50 --max-rental-hours 6 --expires-in 7d
   ```

2. **Add the MCP endpoint.** Use the token as a bearer header.

   Claude Code:

   ```sh
   claude mcp add --transport http arrakis $ARRAKIS_URL/mcp \
     --header "Authorization: Bearer ark_..."
   ```

   Cursor (`~/.cursor/mcp.json`):

   ```json
   {
     "mcpServers": {
       "arrakis": {
         "url": "$ARRAKIS_URL/mcp",
         "headers": { "Authorization": "Bearer ark_..." }
       }
     }
   }
   ```

   Any client: transport streamable HTTP, URL `$ARRAKIS_URL/mcp`, header `Authorization: Bearer ark_...`.

   Local, over stdio: `ARRAKIS_TOKEN=ark_... ARRAKIS_BASE_URL=$ARRAKIS_URL arrakis mcp`.

3. **Give it a job.** Say how long the machine may live; your agent passes that as the removal time. For example: "Run my eval suite on an H100: rent one for 3 hours, run python eval.py, copy results/ back, then terminate it."

## What your agent cannot do

- Spend past its token's cap.
- Rent a machine without a removal time.
- Rent longer than the token's maximum rental length.
- Create a token with more power than its own.
- See or touch another account's machines.
- Add funds. Only confirmed payments do that.

## Eight tools

| Tool | What it does | Cost |
|---|---|---|
| `search_gpus` | Lists available machines, cheapest first, filtered by GPU, count, price per GPU-hour and country. | Free |
| `get_market_summary` | The lowest price and the supply of each GPU family right now. | Free |
| `get_balance` | The account's balance, what the running machines cost per hour, when the money runs out, and the token's cap. | Free |
| `rent_gpu` | Rents a machine for at most `termination_hours` and returns its SSH command. Creates an idempotency key if none is passed and returns it. | The hourly price, an hour at a time, until removal |
| `list_instances` | The machines the account is running. | Free |
| `get_instance` | One machine's state, SSH command and removal time. | Free |
| `terminate_instance` | Stops a machine now. Billing stops with it. | Ends charges |
| `schedule_removal` | Moves a machine's removal time. | Changes the maximum cost |

## What keeps unattended spend safe

These rules live in the API, so they hold for MCP, the CLI and plain HTTP alike.

- **Spend caps.** A capped token counts each rental at its worst case, hourly price times removal hours, and refuses the one that would pass the cap.
- **Required removal.** A capped token cannot rent without `termination_hours`, or past its maximum rental length.
- **Retry safety.** The same `idempotency_key` always returns the same machine. A retry never rents twice.
- **Scoped tokens.** Read, rent, manage and billing are separate. A token cannot mint one with scopes it lacks.
- **Prepaid by the hour.** A rental pays its first hour up front and each later hour as it begins. When the balance cannot pay, the machine stops, so a runaway agent cannot run up a bill.
- **Expiry.** Agent tokens can expire on a date you choose.

## Machine-readable entry points

- [/llms.txt](/llms.txt): the index for language models
- [/llms-full.txt](/llms-full.txt): everything on this site in one file
- [/openapi.json](/openapi.json): OpenAPI 3.1 spec
- [/docs](/docs): interactive API reference
- [/docs/mcp.md](/docs/mcp.md): the MCP endpoint and tools
- [/docs/agent-walkthrough.md](/docs/agent-walkthrough.md): search, rent and stop, step by step
- [/v1/market/summary](/v1/market/summary): live market summary, no token needed
- [/sitemap.xml](/sitemap.xml)

Every page on this site has a Markdown twin: `/` is `/index.html.md`, `/agents` is `/agents.html.md`, `/careers` is `/careers.html.md`.

## Things to ask

- "Find the cheapest GPU with at least 48 GB of memory, rent it for 2 hours, and tell me how to SSH in."
- "Fine-tune with train.py on 4 RTX 4090s for up to 6 hours, keep checkpoints on my volume, and stop the machine when the run ends."
- "Check whether an H200 is available under $2.50 per GPU-hour. If it is, tell me the price and the country."

## Questions about agents and GPUs

**Is there an MCP server for renting GPUs?** Yes. Arrakis runs a remote MCP server at https://arrakis.goodailabs.com/mcp over streamable HTTP with a bearer token. Its eight tools search the live GPU market, rent a machine with a removal time, check the balance and shut machines down.

**How do I let Claude Code rent a GPU?** Create an agent token with a spend cap in the console, then run claude mcp add --transport http arrakis https://arrakis.goodailabs.com/mcp --header "Authorization: Bearer ark_...". Claude Code can then search, rent and shut down GPUs, and it cannot spend past the cap.

**Can Cursor and other agents use Arrakis?** Yes. Any MCP client that connects to remote servers over streamable HTTP can use /mcp with a bearer token. A client that only runs local servers can use arrakis mcp, which serves the same tools over stdio. Anything that calls a REST API can use the endpoints in /openapi.json.

**How do I stop an AI agent from overspending on GPUs?** Give it its own token with a spend cap and a longest rental. Arrakis refuses any rental whose worst-case cost would pass the cap, every rental the token makes must carry a removal time, and a retry with the same idempotency key never rents twice.

**What happens if my agent crashes while a GPU is running?** The machine still removes itself at its removal time, so a crashed agent cannot leave a GPU billing. Every machine is also in the console, where you can stop it.

**Does an agent need its own account?** No. An agent works under your account with a token you create. The token's permissions, spend cap and expiry are its whole budget, and you can revoke it at any time.
