cURL
curl --request PUT \ --url https://console.vast.ai/api/v0/secrets/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "key": "MY_API_KEY", "value": "xyz123" } '
{ "success": true, "msg": "Environment variable updated successfully" }
Updates the value of an existing environment variable for the authenticated user.
CLI Usage: vastai update env-var <key> <value>
vastai update env-var <key> <value>
API key must be provided in the Authorization header
The key of the environment variable to update (will be converted to uppercase)
"MY_API_KEY"
The new value for the environment variable
"xyz123"
Environment variable updated successfully
true
"Environment variable updated successfully"