Skip to main content
The @phala/cloud SDK uses Zod schemas for runtime validation of all API responses. API version 2026-06-23 is the default. Its CVM and app endpoints use the V20260522 schemas, while its KMS endpoints use the contract-centric schemas documented on the KMS page.

Schema Validation

By default, every action validates the API response against the version-specific Zod schema. You can customize this:

Version 2026-01-21

CurrentUserV20260121

Three-layer user response with separate user, workspace, and credits objects.

CvmInfoV20260121

Compact CVM info returned in list endpoints.

CvmInfoDetailV20260121

Extended CVM info with compose file (returned by single-CVM endpoints).

PaginatedCvmInfosV20260121

Paginated list of CVMs.

Nested Objects

CvmResourceInfoV20260121

CvmOsInfoV20260121

CvmKmsInfoV20260121

CvmProgressInfoV20260121

CvmGatewayInfoV20260121

NodeRef

WorkspaceRef

UserRef

Version 2025-10-28 (Legacy)

CurrentUserV20251028

Flat user response.

KmsInfoLegacy

Legacy KMS information. Used in CvmInfoV20251028 and CvmDetailV20251028.

CvmInfoV20251028

Legacy CVM info with nested hosted VM object.

CvmDetailV20251028

Legacy CVM detail for single-CVM endpoints.

PaginatedCvmInfosV20251028

Importing Schemas

All Zod schemas are exported from @phala/cloud:
Use them for custom validation or to build derivative schemas: