Skip to main content
POST
Connect sandbox
The credentials and endpoint this method returns are for a direct connection to the runner that owns the sandbox. The runner does not serve this REST API: it accepts Connect RPC over HTTP/2 and requires the client certificate issued here. The client generates and keeps the private key, and sends only a signed certificate signing request (CSR). For the full flow, see Direct sandbox connections, which the cwsandbox Python SDK implements for you.

Authorizations

Authorization
string
header
default:Bearer {API_ACCESS_TOKEN}
required

CoreWeave API access token sent as a bearer token.

Path Parameters

sandboxId
string
required

Body

application/json

ConnectSandboxRequest requests sandbox-scoped direct-connection credentials. The sandbox must be running and its Runner must advertise a compatible direct data-plane endpoint.

sandboxId
string
required
csrDer
string<bytes>
required

DER-encoded PKCS #10 certificate signing request. The issuer validates the proof-of-possession signature and copies only the public key; requested identity, extensions, and lifetime are ignored.

requestedPermissions
enum<string>[]
required

Operations to authorize on the issued certificate. At least one concrete permission is required. SANDBOX_DATA_PERMISSION_UNSPECIFIED and unknown values are invalid. The server returns only permissions allowed for the caller.

Available options:
SANDBOX_DATA_PERMISSION_UNSPECIFIED,
SANDBOX_DATA_PERMISSION_EXEC,
SANDBOX_DATA_PERMISSION_STREAM_EXEC,
SANDBOX_DATA_PERMISSION_STREAM_LOGS,
SANDBOX_DATA_PERMISSION_WRITE_FILE,
SANDBOX_DATA_PERMISSION_READ_FILE

Response

OK

SandboxConnection contains everything except the client private key needed to establish a sandbox-scoped direct connection.

endpointUri
string
read-only

Stable absolute URI for the logical Runner data-plane endpoint.

clientCertificateChainPem
string<bytes>
read-only

PEM certificate chain for the public key in the request CSR. The leaf certificate is first.

serverCaBundlePem
string<bytes>
read-only

PEM trust bundle for authenticating the endpoint. Empty means the endpoint chains to roots available from the client's system trust store.

expiresAt
string<date-time>
read-only

Time at which the client certificate and established connection expire.

endpointId
string
read-only

Opaque stable identity of the logical Runner endpoint.

transport
enum<string>
read-only

Transport for the issued connection. Successful responses use SANDBOX_DATA_TRANSPORT_DIRECT_MTLS. SANDBOX_DATA_TRANSPORT_UNSPECIFIED means no transport is specified and is not emitted for a successful connection.

Available options:
SANDBOX_DATA_TRANSPORT_UNSPECIFIED,
SANDBOX_DATA_TRANSPORT_DIRECT_MTLS
protocol
enum<string>
read-only

Protocol for the issued connection. Successful responses use SANDBOX_DATA_PROTOCOL_CONNECT_H2_V1. SANDBOX_DATA_PROTOCOL_UNSPECIFIED means no protocol is specified and is not emitted for a successful connection.

Available options:
SANDBOX_DATA_PROTOCOL_UNSPECIFIED,
SANDBOX_DATA_PROTOCOL_CONNECT_H2_V1
grantedPermissions
enum<string>[]
read-only

Effective permissions encoded in the issued certificate. Successful responses contain at least one permission from the intersection of requested and allowed permissions and do not contain SANDBOX_DATA_PERMISSION_UNSPECIFIED.

Available options:
SANDBOX_DATA_PERMISSION_UNSPECIFIED,
SANDBOX_DATA_PERMISSION_EXEC,
SANDBOX_DATA_PERMISSION_STREAM_EXEC,
SANDBOX_DATA_PERMISSION_STREAM_LOGS,
SANDBOX_DATA_PERMISSION_WRITE_FILE,
SANDBOX_DATA_PERMISSION_READ_FILE