Skip to content

CPU Virtual Machines

Varity TeamCore Contributors

A CPU VM is a machine you administer through SSH. Varity does not build your code, wire application services, or assign it an application URL. For a managed application runtime, see What You Can Deploy.

Profiles, regions, images, availability, resources, and prices are mutable. Read them from the authenticated catalog immediately before requesting a quote:

Terminal window
curl "https://varity.app/api/deployment-profiles?workload=virtual_machine&execution_class=cpu_virtual_machine" \
-H "Authorization: Bearer $VARITY_API_KEY"

Keep the selected profile_id and one os_images[].id returned on that same profile. Do not copy an identifier, region, disk size, or rate from documentation into automation.

If you need additional storage, include additional_storage_gb in both the quote and create requests. Read its current validation bounds and billing fields from the OpenAPI contract and returned quote.

  1. Pick a profile and an image

    Read the catalog and keep the profile_id (format mp- plus 24 hex characters) and one os_images[].id.

    Terminal window
    curl "https://varity.app/api/deployment-profiles?workload=virtual_machine&execution_class=cpu_virtual_machine" \
    -H "Authorization: Bearer $VARITY_API_KEY"
  2. Get a quote

    Terminal window
    curl -X POST https://varity.app/api/pricing/machine-quote \
    -H "Authorization: Bearer $VARITY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
    "profile_id": "mp-0628f148846594bc2dd04c9c",
    "execution_class": "cpu_virtual_machine",
    "os_image": "os-ubuntu-24-04-lts-x64-70031bd79dea"
    }'

    The response carries quote_token, quote_reference, resource_fingerprint, hourly_usd, authorization_usd, valid_until, and pricing_policy_version. The quote expires. Read valid_until and request a new one rather than retrying an old token.

  3. Create the machine

    Terminal window
    curl -X POST https://varity.app/api/machines \
    -H "Authorization: Bearer $VARITY_API_KEY" \
    -H "Idempotency-Key: my-vm-create-001" \
    -H "Content-Type: application/json" \
    -d '{
    "name": "my-worker",
    "profile_id": "mp-0628f148846594bc2dd04c9c",
    "execution_class": "cpu_virtual_machine",
    "os_image": "os-ubuntu-24-04-lts-x64-70031bd79dea",
    "ssh_public_key": "ssh-ed25519 AAAA...",
    "accelerator_quote_token": "<quote_token from step 2>"
    }'

    The quote’s quote_token is sent as accelerator_quote_token. The field name is the same for CPU VMs as for GPU machines. name is lowercase letters, digits, and hyphens, up to 63 characters. Idempotency-Key is required (8 to 128 characters).

    The response is 202 with machine_id, replayed, and an operation block.

  4. Poll until access appears

    Terminal window
    curl https://varity.app/api/machines/$MACHINE_ID \
    -H "Authorization: Bearer $VARITY_API_KEY"

    access is null until the machine is ready, then becomes protocol: "ssh" with host, port, and username. lifecycle.status moves through accepted, running, and succeeded or failed.

Terminal window
ssh -p <port> <username>@<host>

Take all three values from the machine’s access block. There is no default username or port to assume.

A CPU VM bills hourly and never costs more than its monthly maximum for compute in a month. Storage is billed separately.

The machine’s billing block reports:

  • state is pending, active, or stopped.
  • customer_price is the hourly rate, in microdollars.
  • monthly_cap_microusd is present only for cpu_virtual_machine.
  • month_to_date holds compute_microusd (never more than monthly_cap_microusd in a month), storage_microusd (no monthly maximum), and month_started_at. It is null until the first billed hour completes, so a new machine legitimately shows nothing.
Terminal window
curl -X POST https://varity.app/api/machines/$MACHINE_ID/actions \
-H "Authorization: Bearer $VARITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"action": "restart"}'

action is restart or soft_reboot. Both act in place: same machine, same SSH access, same billing. Rebooting does not pause charges.

Terminal window
curl -X DELETE https://varity.app/api/machines/$MACHINE_ID \
-H "Authorization: Bearer $VARITY_API_KEY"

Deletion is asynchronous, and acceptance is not proof of closure. Read the machine back and check lifecycle.cleanup_state. It reaches complete when release has actually finished. Deleting destroys the disk; there is no suspend state that keeps data while stopping charges.