POST
/
api
/
v0
/
secrets
/
create env-var
curl --request POST \
  --url https://console.vast.ai/api/v0/secrets/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "API_TOKEN",
  "value": "abc123xyz"
}'
{
  "success": true,
  "msg": "Environment variable added successfully"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
key
string
required

Environment variable key name (will be converted to uppercase)

Example:

"API_TOKEN"

value
string
required

Secret value to be encrypted and stored

Example:

"abc123xyz"

Response

Environment variable created successfully

success
boolean
Example:

true

msg
string
Example:

"Environment variable added successfully"