Skip to main content
This command is marked as unstable and may change in future releases.

Command: phala api

Syntax

phala api [options] <endpoint>

Description

Make an authenticated HTTP request to Phala Cloud API.

Arguments

ArgumentDescription
<endpoint>API endpoint path

Options

OptionDescription
-X, --method <value>HTTP method (default: GET)
-f, --query <value>Query parameter: key=value (use key=@file to read from file)
-F, --field <value>Body field: key=value (string) or key:=value (typed JSON). Supports @file
-H, --header <value>HTTP header: key:value
-d, --data <value>Request body data (cURL-style)
--input <value>Read body from file (use ”-” for stdin)
-i, --includePrint response headers
-q, --jq <value>Filter output with jq expression
--silentDon’t print response body

Global Options

OptionDescription
-h, --helpShow help information for the current command
-v, --versionShow CLI version
--api-token TOKEN, --api-key TOKENAPI token used for authentication
-j, --json, --no-jsonOutput in JSON format
--api-version <value>API version to use (e.g. 2025-10-28, 2026-01-21)

Examples

  • List CVMs
phala api /cvms
  • Get CVM by app ID
phala api /cvms/app_xxx
  • Filter with jq
phala api /cvms -q '.items[].name'
  • GET with query params
phala api /endpoint -f status=active -f page=2
  • POST with body fields
phala api /endpoint -X POST -F name=foo -F count:=10
  • POST with cURL-style -d
phala api /endpoint -X POST -d '{"foo":"bar"}'
  • POST from file
phala api /endpoint -X POST --input data.json
  • Query params + body combined
phala api /endpoint -X POST -f page=1 -F name=foo
  • Body field from file
phala api /endpoint -X POST -F config:=@settings.json
  • Show response headers
phala api /cvms -i