Authentication API

API endpoints for authentication and authorization.

Base URL

https://api.cloud.tenzro.com

Authentication

All API requests require authentication using an API key:

# Using Authorization header (recommended)
curl https://api.cloud.tenzro.com/... \
-H "Authorization: Bearer YOUR_API_KEY"
# Using X-API-Key header
curl https://api.cloud.tenzro.com/... \
-H "X-API-Key: YOUR_API_KEY"

Endpoints

Verify API Key

GET /auth/verify
# Response
{
"valid": true,
"key_id": "key_abc123",
"project_id": "proj_xyz",
"permissions": ["vec:read", "vec:write", "ai:inference"],
"rate_limit": {
"limit": 1000,
"remaining": 950,
"reset": 1700000000
}
}

Get Current User

GET /auth/me
# Response
{
"user_id": "user_abc123",
"email": "user@example.com",
"name": "John Doe",
"organizations": [
{
"id": "org_xyz",
"name": "My Company",
"role": "admin"
}
]
}

List API Keys

GET /auth/keys?project_id=proj_xyz
# Response
{
"keys": [
{
"id": "key_abc123",
"name": "Development Key",
"prefix": "dev_abc",
"created_at": "2024-01-01T00:00:00Z",
"last_used": "2024-01-15T12:00:00Z",
"permissions": ["vec:*", "kev:*"]
}
]
}

Create API Key

POST /auth/keys
Content-Type: application/json
{
"project_id": "proj_xyz",
"name": "Production Key",
"type": "production",
"permissions": ["vec:read", "ai:inference"],
"expires_at": "2025-01-01T00:00:00Z"
}
# Response
{
"id": "key_new123",
"key": "prod_full_key_here", // Only shown once!
"name": "Production Key",
"prefix": "prod_abc",
"created_at": "2024-01-15T00:00:00Z"
}

Revoke API Key

DELETE /auth/keys/{key_id}
# Response
{
"success": true,
"revoked_at": "2024-01-15T12:00:00Z"
}

Error Responses

{
"error": {
"code": "unauthorized",
"message": "Invalid API key",
"status": 401
}
}

Rate Limiting

Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1700000000