API Keys
Manage API keys for authenticating with Tenzro Cloud services. Create keys with specific permissions and track usage.
Key Types
| Type | Prefix | Use Case |
|---|---|---|
| Development | dev_ | Local development, testing |
| Production | prod_ | Production applications |
| Client | client_ | Browser-safe, rate-limited |
Creating an API Key
- Go to your project in the Console
- Navigate to Settings → API Keys from the sidebar
- Click the Create New Key button
- Configure the key settings:
- Name: Descriptive name for identification (e.g., "Production API", "Dev Environment")
- Type: Development, Production, or Client
- Permissions: Select which services this key can access
- Expiration: Optional expiration date for enhanced security
- Click Create Key
- Important: Copy the key immediately - it will only be shown once for security
Store your API key securely in environment variables or a secrets manager. Never commit API keys to version control or expose them in client-side code.
Key Permissions
Configure granular permissions for each key:
Permissions:├── Vec (Vector Database)│ ├── Read│ ├── Write│ └── Delete├── Kev (Key-Value Store)│ ├── Read│ ├── Write│ └── Delete├── Data (SQL Database)│ ├── Read│ ├── Write│ └── Admin├── AI Services│ ├── Inference│ ├── Agents│ └── Workflows├── File Storage│ ├── Read│ ├── Write│ └── Delete└── Admin├── Manage Keys└── View Usage
Using API Keys
Environment Variables
Store your API key in environment variables for secure access:
# .env file (local development)TENZRO_API_KEY=dev_your_api_key_here# For production, use your hosting platform's secrets manager:# - Vercel: Environment Variables in project settings# - AWS: Secrets Manager or Parameter Store# - Google Cloud: Secret Manager# - Azure: Key Vault
TypeScript/JavaScript SDK
import { Tenzro } from '@tenzro/cloud';// Using environment variable (recommended)const tenzro = new Tenzro({apiKey: process.env.TENZRO_API_KEY,});// Or explicit configurationconst tenzro = new Tenzro({apiKey: 'dev_your_api_key_here',});
Python SDK
from tenzro_cloud import Tenzroimport os# Using environment variable (recommended)tenzro = Tenzro(api_key=os.environ.get("TENZRO_API_KEY"))# Or explicit configurationtenzro = Tenzro(api_key="dev_your_api_key_here")
REST API Authentication
# Using Authorization header (recommended)curl https://api.cloud.tenzro.com/cloud/vec/databases \-H "Authorization: Bearer dev_your_api_key_here" \-H "Content-Type: application/json"# Example with POST requestcurl -X POST https://api.cloud.tenzro.com/cloud/ai/infer \-H "Authorization: Bearer dev_your_api_key_here" \-H "Content-Type: application/json" \-d '{"model": "gemini-2.5-flash","messages": [{"role": "user", "content": "Hello!"}]}'
Client Keys for Browsers
Client keys (with client_ prefix) are designed for browser and mobile applications where the key may be exposed. They include additional security restrictions:
- Strict rate limiting: 100 requests/minute by default
- Domain restrictions: CORS policy limits to allowed domains
- Limited permissions: No admin operations or sensitive data access
- Usage tracking: Monitor usage per client IP/domain
- Reduced token limits: Lower AI inference quotas
// Browser-safe usage with client keyimport { Tenzro } from '@tenzro/cloud';const tenzro = new Tenzro({apiKey: 'client_your_client_key_here', // Safe to expose in frontend});// Rate-limited AI inferenceconst response = await tenzro.ai.infer({model: 'gemini-2.5-flash',messages: [{ role: 'user', content: 'Hello!' }],});
Key Rotation
Best practices for rotating API keys:
- Create the new key first: Generate a new API key before revoking the old one
- Update your applications: Deploy the new key to all services using rolling updates
- Monitor for errors: Watch for 401 errors indicating old key usage
- Revoke the old key: Once all services use the new key, revoke the old one
Recommended rotation schedule:
- Development keys: Rotate every 6-12 months or when exposed
- Production keys: Rotate every 90 days
- Client keys: Rotate when domains change or security incidents occur
Revoking Keys
Revoked keys are immediately invalidated. All requests using a revoked key will return 401 Unauthorized.
- Go to Settings → API Keys
- Find the key to revoke
- Click the menu (⋮) and select Revoke
- Confirm the revocation
Usage Monitoring
Track API key usage in the console:
- Requests: Total API calls per key
- Bandwidth: Data transferred
- Errors: Failed requests and error rates
- Last Used: Most recent activity
Security Best Practices
- Never commit API keys to version control
- Use
.envfiles locally, secrets in production - Set the minimum required permissions
- Use client keys for frontend applications
- Enable IP allowlists for production keys
- Set up usage alerts for anomaly detection