Skip to main content
Deploy CVMs programmatically using the Phala Cloud API. The API exposes the same backend used by the Phala Cloud dashboard, so anything you can do in the UI you can automate via API.

Authentication

All API requests require an API key passed in the X-API-Key header. Generate your key at Settings → API Keys in the Phala Cloud dashboard.

Deployment Flow

CVM deployment follows a two-phase provision → commit workflow:
  1. Provision — reserve resources and receive a compose_hash and app_env_encrypt_pubkey
  2. Commit — finalize the deployment with the provisioned values
Browse the interactive API reference for full request/response details on each endpoint.

KMS Types

FeatureBuilt-in KMSOn-chain KMS
SetupAutomaticRequires smart contract deployment
App IDDerived from compose hashContract address
Best forDevelopment and standard productionDecentralized access control
For on-chain KMS details, see the On-chain KMS guide.

Using SDKs

For a simpler experience, use one of the official SDKs instead of raw API calls:

JavaScript SDK

@phala/cloud — provision, deploy, and manage CVMs

Python SDK

phala-cloud — sync and async client

Go SDK

github.com/Phala-Network/phala-cloud/sdks/go