API Key Management
API keys are how you prove your identity when making programmatic requests. SimpleFunctions uses API keys at two levels:
SimpleFunctions API Key
Your SF API key (sf_live_...) authenticates requests to the SimpleFunctions platform:
- Thesis management
- Edge calculations
- Portfolio data
- Heartbeat monitoring
Venue API Keys
To trade or access real-time data, you also need keys from the venues themselves:
- Kalshi: Uses RSA-PSS key pairs for authentication (more complex but more secure)
- Polymarket: Uses wallet-based authentication
Security Best Practices
- Never commit keys to git: Use environment variables or
.env.local - Use key rotation: Revoke and regenerate keys periodically
- Scope permissions: Create read-only keys for monitoring, read-write for trading
- Monitor usage: Check
sf keys statusfor last-used timestamps
Setting Up Keys
sf auth login # Authenticate with SimpleFunctions
sf auth add-venue kalshi # Add Kalshi credentials
sf auth add-venue polymarket # Add Polymarket credentials
The CLI securely stores venue credentials and handles authentication headers automatically. You never need to manually construct authentication headers.