Authentication
PureRouter is a completely independent product from PureCPP. You can use PureRouter without needing PureCPP and vice versa.
Getting Your API Key
To use PureRouter, you need a valid API key:- Sign up for the PureAI platform: Visit pureai.com and create your account
- Get your PureRouter API key: In the API Keys section, generate a specific key for PureRouter
Your API keys grant access to platform resources. Treat them like passwords and never share them publicly or include them in code repositories.
Configuring the SDK
There are several ways to configure the PureRouter Python SDK with your API key:1. Direct Initialization
2. Environment Variables
A safer practice is to use environment variables:3. Configuration File
You can also use a configuration file:Key Rotation
For enhanced security, it’s recommended to rotate your keys periodically:- Generate a new key on the PureAI platform
- Gradually update your applications to use the new key
- After confirming all systems are working with the new key, revoke the old one
Security Best Practices
Never Expose Keys in Source Code
Never Expose Keys in Source Code
Never include API keys directly in source code, especially in public repositories. Use environment variables or secret management systems.
Limit Key Scope
Limit Key Scope
When possible, create keys with limited permissions for each specific application or service.
Monitor Usage
Monitor Usage
Regularly check API usage logs to detect suspicious activities or unauthorized usage.
Implement Rate Limiting
Implement Rate Limiting
Configure rate limits in your application to prevent accidental or malicious excessive API usage.