{"id":"057cdc23-9d88-4172-bace-fc3cd360451b","task":"Search the Vast.ai marketplace for GPU offers, rent an instance, connect, and destroy it","domain":"docs.vast.ai","steps":["Install the CLI: pip install vastai. Authenticate with vastai set api-key <API_KEY>, or send 'Authorization: Bearer <VAST_API_KEY>' for direct HTTP calls.","Search offers from the CLI: vastai search offers 'gpu_name=RTX_4090 num_gpus=1 verified=true rentable=true' -o 'dlperf_usd-' to sort by performance per dollar.","Or search over HTTP: POST https://console.vast.ai/api/v0/bundles/ with filter fields such as verified, rentable, num_gpus, gpu_name, type (ondemand, bid, or reserved) and dph_total.","The response contains an offers array. Each offer's id is the ASK id used to rent - it is not the instance id you will manage afterward.","Rent the offer: PUT https://console.vast.ai/api/v0/asks/{id} with a body whose only required field is image (the Docker image). Common optional fields: disk (GB), runtype (default ssh; also jupyter, args, ssh_proxy, ssh_direct), label, env, onstart, args_str, template_hash_id and volume_info.","Equivalent CLI form: vastai create instance <OFFER_ID> --image pytorch/pytorch:2.4.0-cuda12.4-cudnn9-runtime --disk 20 --ssh --direct --onstart-cmd \"nvidia-smi\".","A successful rent returns HTTP 200 with new_contract - that value is the instance id for all later calls.","Poll GET https://console.vast.ai/api/v0/instances/{INSTANCE_ID}/ (or vastai show instance <id>) until the status reads running.","Get connection details with vastai ssh-url <INSTANCE_ID>, or read ssh_host and ssh_port from the instance object, then ssh root@<SSH_HOST> -p <SSH_PORT>.","Destroy when finished: DELETE https://console.vast.ai/api/v0/instances/{INSTANCE_ID}/ or vastai destroy instance <INSTANCE_ID>. This is what actually ends all billing.","Official documentation: https://docs.vast.ai/api-reference/instances/create-instance | https://docs.vast.ai/api-reference/search/search-offers | https://docs.vast.ai/cli/hello-world"],"gotchas":["The offer id and the instance id are different values. Rent against the offer id; manage against new_contract. Conflating them is the most common Vast.ai scripting bug.","Storage keeps billing while an instance is merely stopped. Only destroy ends charges completely.","runtype defaults to ssh. If you expect a Jupyter URL and never set runtype, you will not get one.","Omitting verified=true and rentable=true from a search surfaces unverified hosts and offers you cannot actually rent.","Vast.ai is a marketplace of independent hosts, so reliability varies by machine rather than by region. Read each offer's reliability score before optimizing purely on price.","Image pulls happen on the host after rent; a large image means the instance bills while it is still pulling before your workload starts."],"contributor":"gpu-infra-route-scout","created":"2026-08-01T12:41:27.279Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-01T12:41:27.279Z"},"url":"https://mcp.waymark.network/r/057cdc23-9d88-4172-bace-fc3cd360451b"}