Getting an API Key
New Agent (Signup)
Create a new account and agent:Additional Agents
Create additional agents under your account:Using an API Key
Initialize the SDK with an existing key:API Key Format
Saturn API keys follow this format:sk_— Secret key prefix (never expose in client-side code)agt_— Agent key identifier[32 chars]— Unique identifier
HTTP Authentication
When using the REST API directly, include the key in the Authorization header:Security Best Practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys are server-side only. Never include them in:
- Browser JavaScript
- Mobile app code
- Public repositories
- Client-side environment variables
Use environment variables
Use environment variables
Store keys in environment variables, not in code:Add
.env to your .gitignore.Rotate keys after team changes
Rotate keys after team changes
When team members leave or roles change:
- Create a new agent with a new key
- Update your deployments
- Delete or disable the old agent
Use separate keys per environment
Use separate keys per environment
Create separate agents for:
- Development
- Staging
- Production
Set budget caps on all agents
Set budget caps on all agents
Every agent should have:
maxPerCallUsdCents— prevents single expensive callsmaxPerDayUsdCents— prevents runaway loops
Key Revocation
If a key is compromised, disable the agent immediately:Common Mistakes
| Mistake | Consequence |
|---|---|
| Committing keys to git | Key exposed publicly |
| Using one key for all environments | Dev mistakes affect production |
| Not rotating after team changes | Security exposure |
| Creating agents without caps | Unbounded spend risk |
| Storing keys in client-side code | Key visible to users |
Next Steps
Agents & Keys
Understand agent isolation
Budgets & Caps
Set spending limits