Safe retries and dry runs
To retry one of the five write tools below, send the same idempotency_key and the same inputs. Acasia can replay the first result or refuse the retry if a check fails.
1 · Write tools take a key
These tools on the Acasia MCP server at https://mcp.acasia.com/mcp take an optional idempotency_key.
rent_gpuasks Acasia to rent GPUs on a machinestop_gpuasks Acasia to stop a rentalstart_gpuasks Acasia to start a GPUcancel_gpu_startasks Acasia to cancel a start that has not finishedkeep_gpu_onasks Acasia to keep a running GPU on for more minutes
- Format
- 1 to 128 characters from A–Z, a–z, 0–9, _ and -
- Left out
- A new key is made · a new request
- In the result
- The idempotency_key that was sent
2 · Retry with the same key
Retry these five tools as the same caller, with the same idempotency_key and the same inputs. If the retry passes the checks and matches the committed request, Acasia can return the recorded result. Replay is scoped to your organization.
A retry can be refused after the first request was accepted. rent_gpu looks up the machine, checks SSH key read permission when you pass key IDs, and can run an agent-limit check. stop_gpu looks up the rental binding.
An error that carries the idempotency key ends with a line that starts like this. A timeout can carry the key because Acasia may have acted.
Retry with the same idempotency_key=<key> and the same inputsA local input error before the request is sent omits the key.
3 · Same key, other inputs
Save new keys for requests you intend as separate writes. Acasia checks for reuse within each kind of write record. A rent_gpu retry that changes only ssh_key_ids can return the first receipt if it passes the checks above. These are the tool error codes and HTTP statuses Acasia’s API returns for the reuse conditions shown.
- start_gpu, cancel_gpu_start, keep_gpu_on · key used for a different GPU changeHTTP 409
conflict: Idempotency-Key was already used for a different request - rent_gpu, stop_gpu · key used for a different rental orderHTTP 400
invalid_request: the idempotency key was reused for a different order - rent_gpu, when Acasia checks the start against an agent limit · key used by another agentHTTP 409
request_id_conflict: this X-Request-Id was already used by another agent to start a rental
If rent_gpu reuses a key from stop_gpu, Acasia can create a rental record and its machine binding before returning HTTP 400 invalid_request for the order mismatch. That rejection happens before a new start order is queued.
4 · When the answer is lost
On HTTP 202 Accepted, rent_gpu returns a receipt for the queued rental start request. stop_gpu returns the same receipt fields for a queued rental stop request.
id- the rental id, read from rental_id in the receipt
action_id- the action Acasia queued
request_id- the request Acasia recorded
at- when Acasia accepted it
idempotency_key- the key that was sent
rental- the receipt exactly as Acasia sent it, rental_id included
Choose and save your own idempotency_key before the first rent_gpu call. If the call times out or the answer is lost, retry as the same caller with that same idempotency_key and the same inputs. A different key makes a separate rental request and can create a second paid rental.
A change to the machine’s GPU model or VRAM can make rent_gpu return invalid_request on retry. Even if a retry returns agent_limit_denied, agent_limit_approval_required or request_id_conflict, an earlier call with the same key may have been accepted. Use list_rentals to check for the earlier rental and keep the original key for retries.
If you left the key out and received no answer, check list_rentals for the earlier rental. A missing result there is insufficient to decide whether to rent again.
5 · Fair-use limits
If Acasia answers with HTTP 429, the tool returns an error that says a fair-use limit was reached. Its code is limit_exceeded unless Acasia sends a valid error code of its own. The MCP server does not retry or wait after a 429.
When Acasia gives a usable retry time, the error says when to try again, or to try again now if that time has passed. Otherwise it says to wait before retrying. When you retry one of the five write tools above, send the same idempotency_key.
6 · SSH keys
Off by defaultadd_ssh_key and delete_ssh_key are account tools. They are off by default; they appear in your agent’s tool list only when they are turned on. They take an optional idempotency_key. Calling either tool again makes a new request, even with the same key.
- Add the same key again
invalid_request: SSH key already exists- Delete a key that’s gone
not_found: SSH key not found
7 · Reads
These tools only read, so calling them again doesn’t change your rentals or GPUs. Use get_rental or list_rentals to check a rental’s status.
whoamilist_rentalsget_rentalget_gpulist_gpu_eventsapi_healthapi_ready
get_rental and list_rentals include ssh (host, port and user) when Acasia reports it. Check ssh itself. A running rental can lack ssh while ssh_keys_state is pending or failed, and older rentals can include ssh without ssh_ready.
list_ssh_keys and get_status are account tools that also only read. They are off by default; they appear in your agent’s tool list only when they are turned on.
8 · Dry runs
Dry runs are not available yet.