Secrets API
The Secrets API lets you manage environment variables for your agents. Access viaclient.secrets:
Methods
list(slug)
List all secrets for an agent.
Returns:
Promise<Secret[]>
Example:
Secret values are never returned by the API. Only keys and metadata are included.
set(slug, key, value)
Set a secret for an agent.
Returns:
Promise<void>
Example:
delete(slug, key)
Delete a secret from an agent.
Returns:
Promise<void>
Example:
Full Example
CI/CD Example
Setting secrets in a GitHub Actions workflow:See Also
- Agents API — Manage agents
- cast secrets — CLI equivalent
- Secrets Concept — How secrets work