Prerequisites
The API launches virtual machines on QuantaCloud, Massed Compute, Verda and Hyperstack. It does not launch Vast.ai’s container offers, and it cannot start a template or app-link deployment. Those stay dashboard-only.
1. Browse offers
Find a GPU that fits your needs:
Filter out anything with "deploymentType": "dedicated" in the response. Those are Vast.ai containers, and a create call against one returns provider_not_supported. Note the id of a "virtual" offer you want.
2. Pick an OS image
List available images for the offer’s provider:
Note the id of the image you want (for example, ubuntu-22.04-cuda-12.4-docker).
3. Deploy
You will get back:
This endpoint has no idempotency key. If the request times out or your connection drops before you see a response, do not send it again right away. List your deployments first and look for one that already matches, or you risk creating and paying for a second GPU.
4. Wait for active
Poll until the status changes to active (typically 1 to 3 minutes for a plain VM):
A GET right after the 202 can return 404 for about a second while the row becomes visible for reads. Retry rather than treating that as an error.
Once active, the response includes connection details:
If the deployment instead reaches failed, read failure_code, retryable and suggested_action on the same object to decide what to do next. See the deployments reference and the deployment failures guide for the full list.
5. Connect via SSH
If ssh_key_ids was omitted from the create call, every key on your account was injected, including your default key if you have not added any others. Pass specific key IDs if you want only some of them attached.
6. Stop when done
Stop permanently terminates the VM and deletes its instance disk. Save any files you need before running this command. You cannot start or resume this VM afterward; another session requires a new deployment.
The instance is terminated and its disk is deleted. Unused seconds in the current hour are refunded to your balance, the same as stopping from the dashboard.