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

Signature

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

Parameters

instance_id
int
required
instance_id
ssh_key
str
required
ssh_key

Returns

str — Result from the API call.

Example

from vastai import VastAI

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