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
- Click Create New Key
- Configure the key settings:
- Name: Descriptive name for the key
- Type: Development, Production, or Client
- Permissions: Select allowed services
- Expiration: Optional expiration date
- Click Create Key
- Copy the key immediately - it won't be shown again
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
# .env fileTENZRO_API_KEY=dev_your_api_key_hereTENZRO_PROJECT_ID=your_project_id
SDK Authentication
import { Tenzro } from 'tenzro';// Using environment variable (recommended)const tenzro = new Tenzro();// Or explicit configurationconst tenzro = new Tenzro({apiKey: 'dev_your_api_key_here',projectId: 'your_project_id',});
REST API Authentication
# Using Authorization headercurl https://api.cloud.tenzro.com/vec/databases \-H "Authorization: Bearer dev_your_api_key_here" \-H "X-Project-ID: your_project_id"# Or using X-API-Key headercurl https://api.cloud.tenzro.com/vec/databases \-H "X-API-Key: dev_your_api_key_here" \-H "X-Project-ID: your_project_id"
Client Keys for Browsers
Client keys are safe to expose in browser applications. They have:
- Strict rate limiting (100 req/min default)
- Domain restrictions (CORS)
- Limited permissions (no admin access)
- Usage tracking per client
// Browser-safe usageimport { TenzroEdge } from '@tenzro/edge';const edge = new TenzroEdge({clientId: 'client_your_client_id', // Safe to expose});// Rate-limited AI inferenceconst response = await edge.ai.generate({model: 'gemini-2.5-flash',prompt: 'Hello!',});
Key Rotation
Best practices for key management:
- Rotate production keys every 90 days
- Create new key before revoking old one
- Use environment variables, never hardcode
- Use separate keys per environment
# Rotate key via CLItenzro keys rotate prod_old_key --project my-project# This creates a new key and gives you 24 hours to migrate
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