Skip to main content
Attach an SSH key to an instance.

Signature

VastAI.attach_ssh(
    instance_id: int,
    ssh_key: str
) -> dict

Parameters

instance_id
int
required
id of instance to attach to
ssh_key
str
required
ssh key to attach to instance

Returns

dict

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.attach_ssh(instance_id=12345, ssh_key="value")
print(result)