secrets
Validated on 14 Dec 2023 • Last edited on 17 Jun 2025
set
Set secret
Arguments
cluster, project, team
Examples
gradient secrets set project \
--id "prjpkflqz" \
--name "NewKey" \
--value "NewValue"curl -X PUT 'https://api.paperspace.io/projects/secrets/NewKey?projectId=prjpkflqz' \
-H 'x-api-key: d44808a2785d6a...' \
-H 'Content-Type: application/json' \
--data-raw '{
"value": "NewValue"
}'from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.set(
entity='project',
entity_id='prjpkflqz',
name='NewKey',
value='NewValue'
))Options
| Name | Type | Attributes | Description |
|---|---|---|---|
--id |
string | required | Entity ID |
--name |
string | required | Secret name |
--value |
string | required | Secret value |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |
Response
Set project secret 'NewKey'
Nonelist
List secrets
Arguments
cluster, project, team
Examples
gradient secrets list project \
--id "prjpkflqz"from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.list(
entity='project',
entity_id='prjpkflqz'
))Options
| Name | Type | Attributes | Description |
|---|---|---|---|
--id |
string | required | Entity ID |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |
Response
+--------+
| Name |
+--------+
| NewKey |
+--------+[{ "name": "NewKey" }][Secret(name='NewKey')]delete
Delete secret
Arguments
cluster, project, team
Examples
gradient secrets delete project \
--id "prjpkflqz" \
--name "NewKey"curl -X DELETE 'https://api.paperspace.io/projects/secrets/NewKey?projectId=prjpkflqz' \
-H 'x-api-key: d44808a2785d6a...'from gradient import SecretsClient
api_key='d44808a2785d6a...'
secrets_client = SecretsClient(api_key)
print(secrets_client.delete(
entity='project',
entity_id='prjpkflqz',
name='NewKey'
))Options
| Name | Type | Attributes | Description |
|---|---|---|---|
--id |
string | required | Entity ID |
--name |
string | required | Secret name |
--apiKey |
string | optional | API key to use this time only |
--optionsFile |
string | optional | Path to YAML with predefined options |
--createOptionsFile |
string | optional | Generate template options file |
Response
Deleted project secret 'NewKey'
None