API Reference
dstack-cloud exposes three API surfaces: the Guest Agent’s Unix socket (for apps inside the CVM), the KMS RPC (for key delivery over RA-TLS), and the Onboard HTTP endpoints (for first-time KMS bootstrap).Guest Agent API (Unix Socket)
The Guest Agent runs inside each dstack CVM and provides local APIs via a Unix socket at/var/run/dstack.sock.
Get TDX Quote
Obtain a TDX attestation quote from the hardware. GCP (TDX) only.| Parameter | Type | Description |
|---|---|---|
report_data | string (hex) | Optional challenge value (32 bytes). Used to prevent replay attacks. |
Get NSM Attestation
Obtain a Nitro Attestation Document from the NSM. AWS Nitro only.| Parameter | Type | Description |
|---|---|---|
user_data | string (hex) | Optional challenge value. |
Get Attestation (HTTP)
External attestation endpoint, accessible via HTTPS.KMS API
The KMS exposes an RPC interface for key management. All communication uses RA-TLS — the KMS verifies the workload’s attestation before processing any request.getKey(name)
Request a key from the KMS.| Parameter | Type | Description |
|---|---|---|
name | string | The name of the requested key. Keys are scoped per application. |
| Error | Description |
|---|---|
UNAUTHORIZED | Workload attestation verification failed. The workload is not running in a verified TEE. |
MEASUREMENT_NOT_FOUND | The workload’s measurement is not registered on-chain. |
KEY_NOT_FOUND | No key exists for the requested name. |
INTERNAL_ERROR | KMS encountered an internal error. |
How Applications Use getKey
Applications retrieve keys through the dstack SDK, which handles attestation and the RA-TLS connection automatically: Python:KMS Onboard API (HTTP, Bootstrap Only)
These endpoints are only available during the first-time bootstrap (Onboard mode). After bootstrap is completed, KMS switches to RA-TLS-only mode.Onboard.Bootstrap
Generate the KMS key pair and obtain attestation information.| Parameter | Type | Description |
|---|---|---|
domain | string | The domain name or IP address where KMS is accessible. Used in the attestation data. |
/finish
Complete the bootstrap process. KMS restarts and switches to Normal mode (HTTPS + RA-TLS).Docker Compose Volume for Guest Agent
To access the Guest Agent from within a Docker container, mount the socket:Next Steps
- Configuration Reference — Configuration file formats
- Glossary — Term definitions

