How to reach a sandbox by SSH

The cell's SSH endpoint (`ssh.{cell}.{domain}`, port 22, one host key per cell), the login (the sandbox's id; `{id}+{user}` runs as that user) and a command line that connects.

GET/v1/sandboxes/{sandbox_id}/ssh

The cell's SSH endpoint (ssh.{cell}.{domain}, port 22, one host key per cell), the login (the sandbox's id; {id}+{user} runs as that user) and a command line that connects. Signing in takes an SSH key the person added to their account (addSshKey) and a role that holds sandboxes:exec in the sandbox's project; no SSH server or key is needed in the sandbox, so every image works, VS Code and Cursor Remote-SSH included. Commands, shells, sftp, ssh -L and ssh -R to the sandbox's own loopback work; password sign-in, agent and X11 forwarding do not. An API key reads it, but no API key signs in.

A key with the sandboxes:read scope.

Request

curl "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b/ssh" \
  -H "Authorization: Bearer $POD_API_KEY"

Parameters

NameInTypeRequiredWhat it is
sandbox_idpathstringYes

Answer

200. The sandbox's SSH endpoint.

200
{
  "host": "example",
  "port": 1,
  "user": "example",
  "command": "example"
}
FieldTypeAlwaysWhat it is
hoststringYesThe cell's SSH endpoint, ssh.{cell}.{domain}.
portintegerYesFrom 1 to 65535.
userstringYesThe login: the sandbox's id; {id}+{user} runs as that user.
commandstringYesA command line that connects, such as ssh sbx_…@ssh.c7k.pod.example.

Errors

The refusals this call is known for: not_found, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.

In the SDKs

ClientCall
TypeScriptpod.ports.ssh(sandboxId)
Pythonpod.ports.ssh(sandbox_id)