AmpleRun GPU rentals

v0.1.1
com.amplerun/gpu-rentals Checked 2 days ago Published 2 months ago

Find, price, rent and stop GPUs on AmpleRun.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_agent_account_challenge Start registering this agent's own AmpleRun account

Step 1 of 2. Returns an EIP-4361 (Sign-In with Ethereum) message for a wallet address this agent controls, valid five minutes, single use. Signing it accepts the AmpleRun Terms version it names. Sign the message exactly as returned with personal_sign (EIP-191), then call register_agent_account with message and signature. Never send a private key to any tool.

ParameterTypeDescription
addressstringThe agent's wallet address (0x...). Defaults to this server's wallet when it has one.

register_agent_account Register this agent's own AmpleRun account

Step 2 of 2. Opens an AmpleRun account for this AI agent, tagged as agent-created, with its wallet as the verified payout wallet, and returns an API key (shown once; keep it secret). The same wallet again returns the same account and a new key. There is no free credit: renting needs a deposit first. Pass message and signature from get_agent_account_challenge. scopes defaults to ["renter"]; add "host" to host machines.

ParameterTypeDescription
agent *object
messagestringThe challenge message, exactly as returned.
scopesarray
signaturestring0x-prefixed EIP-191 signature of message.

list_templates List GPU templates

List published AmpleRun templates: pinned container images a rental runs, such as an inference server with fixed model weights or a PyTorch or Jupyter runtime. Returns each template's id, slug (template_id), name, kind, engine, minimum VRAM in bytes and minimum GPU count, plus next_cursor. Read-only; no API key needed. search_offers finds machines for a template.

ParameterTypeDescription
cursorstringnext_cursor from the previous page.
gpu_vram_gibintegerOnly templates that fit on a GPU with this much VRAM, in GiB (e.g. 24).
kindstringmodel: an inference server with pinned weights; classical: a general runtime; custom: other images.
limitintegerPage size, 1 to 100.

search_offers Search GPU offers

Search GPU machines that can be rented now on AmpleRun. gpu_model, gpu_count and max_rate_micro_per_hour filter on the server. min_vram_gib and region filter each fetched page here because the API has no such filters, so a page can return fewer than limit matches: scanned is how many offers were checked, and next_cursor continues. Prices are micro-units per hour for the whole machine, fee included; cheapest first. With template, each offer carries fit {fits, reason}. Read-only; no API key needed.

ParameterTypeDescription
cursorstringnext_cursor from the previous page.
gpu_countintegerMinimum number of GPUs in the machine.
gpu_modelstringCase-insensitive part of the GPU model name, e.g. "4090" or "A100".
limitintegerPage size, 1 to 100.
max_rate_micro_per_hourstringHighest machine price per hour in micro-units, e.g. "500000" for 0.50 USDC/h.
min_vram_gibintegerMinimum VRAM per GPU in GiB. Offers with unmeasured VRAM are excluded.
regionstringCase-insensitive part of the host's cloud region, e.g. "us-east". Offers without a reported region are excluded.
templatestringTemplate slug such as "pytorch-cuda", or its id (UUID), from list_templates.

get_quote Get a rental quote

Price a rental without committing: creates a free, non-binding AmpleRun quote (valid 60 seconds; nothing is reserved or charged) for a template on an offer, capped by budget_micro. Returns the quote exactly as the API sent it plus fee_split: the most the rental can cost and how that divides into the platform fee (platform_fee_bps) and the host's share. Needs AMPLERUN_API_KEY with the renter scope. create_rental quotes again when it reserves, so this step is optional.

ParameterTypeDescription
budget_micro *stringSpending cap in micro-units of the asset ("1000000" = 1 USDC). The rental is never charged more than this.
duration_limit_s *integerMaximum runtime in seconds (60 to 31536000), e.g. 7200 for two hours.
offer_id *stringoffer_id from search_offers.
template *stringTemplate slug such as "pytorch-cuda", or its id (UUID), from list_templates.
assetstringBalance to pay from. USDC when omitted.

create_rental Rent a GPU (spends balance)

Rent a GPU on AmpleRun: quotes the template on the offer and reserves the machine in one step, holding up to budget_micro from the account balance. budget_micro is required and is a hard cap: the rental is never charged more, and metering starts only once the machine is verified ready. Returns rental_id, state, the quote, fee_split and the idempotency_key used; retrying with the same idempotency_key never creates a second rental. get_rental reports state and access. Spends money. Write tool: refused unless the server was started with AMPLERUN_MCP_ALLOW_SPEND=1 (the default is read-only).

ParameterTypeDescription
budget_micro *stringSpending cap in micro-units of the asset ("1000000" = 1 USDC). The rental is never charged more than this.
duration_limit_s *integerMaximum runtime in seconds (60 to 31536000), e.g. 7200 for two hours.
offer_id *stringoffer_id from search_offers.
ssh_public_key *stringOne-line OpenSSH public key (the .pub file), e.g. "ssh-ed25519 AAAA... you@laptop". Installed for SSH access.
template *stringTemplate slug such as "pytorch-cuda", or its id (UUID), from list_templates.
assetstringBalance to pay from. USDC when omitted.
idempotency_keystringUUID that makes retries safe. Generated when omitted and returned in the result.

get_rental Get rental status and access

Get one AmpleRun rental by rental_id: state, cumulative charge (micro-units), rate and funded-through time. While it is RUNNING (verified ready), and read-only for a limited window after STOPPED, also returns access: endpoints, SSH host-key fingerprint, a ready-made command and, for model templates, the endpoint's per-rental API key. Read-only. list_rentals finds rental ids.

ParameterTypeDescription
rental_id *stringrental_id from create_rental or list_rentals.

list_rentals List my rentals

List the account's AmpleRun rentals with state, charge so far (micro-units), rate and funded-through time. Ordered by id, not by time; page with next_cursor. Read-only. get_rental gives details and access for one rental.

ParameterTypeDescription
cursorstringnext_cursor from the previous page.
limitintegerPage size, 1 to 100.

stop_rental Stop a rental

Stop an AmpleRun rental: ends the workload and its metering. Files inside the machine stay reachable read-only only for a limited retrieval window. Stopping again is harmless. Returns rental_id and the new state (STOPPING or a later state). Write tool: refused unless the server was started with AMPLERUN_MCP_ALLOW_SPEND=1 (the default is read-only).

ParameterTypeDescription
rental_id *stringrental_id from create_rental or list_rentals.
idempotency_keystringUUID that makes retries safe. Generated when omitted.
reasonstringRecorded with the stop.

get_balance Get account balance

Get the AmpleRun account's USDC and USDT balances as micro-unit strings: spendable (available for new rentals), held by live rentals, pending, disputed and withdrawable, plus the last 30 days' spend. Read-only; needs AMPLERUN_API_KEY.

host_this_machine Earn with this machine's GPU

Explains how to add the GPU of the machine this agent runs on to AmpleRun, so its owner earns from rentals. Returns the one-line installer command, the steps and the earnings links. It runs nothing itself. The installer needs root, so ask the machine's owner before running it, and the owner must approve the machine from the approve_url it prints: nothing is listed without that approval.

top_up Get top-up payment instructions

Get what it takes to top up the AmpleRun USDC balance by amount_micro with x402: the payment requirements (network, USDC contract, treasury payTo, amount, EIP-712 domain). A wallet signs them as an EIP-3009 transferWithAuthorization and repeats POST /api/v1/billing/x402/top-up with the PAYMENT-SIGNATURE header (@amplerun/sdk does this with its x402 option). This server holds no wallet, so it pays nothing; an operator who configures AMPLERUN_MCP_WALLET_KEY_FILE and allows spending lets it pay.

ParameterTypeDescription
amount_micro *stringTop-up amount in micro-USDC, e.g. "5000000" for 5 USDC.