Base URL
All secret endpoints are under:Set Secrets
Set one or more secrets for an agent. This replaces existing values for the specified keys.Agent ID (e.g.,
agt_abc123)Key-value pairs of secrets to set. Keys are environment variable names, values are the secret values.
Array of all secret keys now set for this agent (not just the ones you added)
Secret values are write-only. You cannot retrieve secret values via the API — only the keys are returned.
List Secret Keys
Retrieve the names of all secrets set for an agent.Agent ID (e.g.,
agt_abc123)Array of secret key names
Delete Secret
Remove a specific secret from an agent.Agent ID (e.g.,
agt_abc123)Secret key to delete (URL-encoded)
Array of remaining secret keys after deletion
Required Secrets
When you deploy an agent, it may declare required secrets in its configuration. These are returned in the agent’srequired_secrets field:
Using Secrets in Agent Code
Secrets are injected as environment variables:CLI Usage
You can also manage secrets via the CLI:Security Best Practices
Never commit secrets
Add
.env files to .gitignore and use the CLI or API to set secretsRotate regularly
Update secrets periodically using
superserve secrets setPrinciple of least privilege
Only grant agents access to the secrets they need
Use strong values
Generate cryptographically secure API keys and tokens
Error Responses
HTTP status code
Error message
Additional error context
| Status | Message |
|---|---|
| 401 | Not authenticated |
| 404 | Agent not found |
| 422 | Invalid secret format |