#9362·skypilot

Vast.ai provisioner broken with vastai-sdk 1.0.3

Author: reeceomahoneyCreated Apr 16, 2026Updated Sep 25, 2026

Bug

The Vast.ai provisioner fails to launch instances when using vastai-sdk>=1.0.0 (tested with 1.0.3).

The vastai-sdk package had a breaking rewrite in 1.0.0. The old SDK (0.2.5) exposed VastAI.api_key_access and accepted direct/ssh kwargs in create_instance(). The new SDK (1.0.3) moved the API key to VastAI.client.api_key, removed api_key_access, and dropped the direct/ssh parameters from create_instance() (replaced by runtype).

Errors

  1. 'VastAI' object has no attribute 'api_key_access' — from sky/provision/vast/utils.py line that writes the API key to the instance via onstart_cmd.

  2. create_instance() got an unexpected keyword argument 'direct' — direct=True and ssh=True are no longer accepted by the new SDK's create_instance(). They need to be replaced with runtype='ssh'.

  3. The new vastai 1.0.3 CLI also stores the API key in a different location (~/.config/vastai/vast_api_key) than where vastai-sdk looks (~/.vast_api_key), causing 403 errors even when credentials are configured.

Environment

  • skypilot-nightly==1.0.0.dev20260415
  • vastai==1.0.3 / vastai-sdk==1.0.3
  • Python 3.12, Linux

Workaround

Pin vastai>=0.2.8,<1.0 and skypilot-nightly<=1.0.0.dev20260326 to use the old compatible SDK.

Suggested fix

In sky/provision/vast/utils.py:

  • Replace vast.vast().api_key_access with vast.vast().client.api_key (or handle both)
  • Replace launch_params['direct'] = True / launch_params['ssh'] = True with launch_params['runtype'] = 'ssh'
  • Pin or gate on vastai-sdk version if needed