Authentication
Endpoints for user registration, login, and API key management.
Register
Create a new Kernle account.
After registration, check your email for verification.
Request Body
Response
{
"success": true,
"data": {
"user_id": "user_abc123",
"message": "Verification email sent"
}
}
CLI Equivalent
Verify Email
Verify email address with the token from the verification email.
Request Body
{
"token": "verification_token_from_email"
}
Response
{
"success": true,
"data": {
"user_id": "user_abc123",
"verified": true,
"api_key": "sk-initial-key"
}
}
Login
Get authentication token for an existing account.
Request Body
{
"api_key": "sk-your-api-key"
}
Response
{
"success": true,
"data": {
"user_id": "user_abc123",
"token": "session_token",
"expires_at": "2024-01-16T10:30:00Z"
}
}
CLI Equivalent
kernle auth login --api-key sk-your-api-key
Get Auth Status
Check current authentication status.
Authorization: Bearer sk-your-api-key
Response
{
"success": true,
"data": {
"authenticated": true,
"user_id": "user_abc123",
"email": "[email protected]",
"created_at": "2024-01-01T00:00:00Z",
"agents": ["claire", "assistant"]
}
}
CLI Equivalent
List API Keys
List all API keys for the authenticated user.
Authorization: Bearer sk-your-api-key
Response
{
"success": true,
"data": {
"keys": [
{
"id": "key_abc123",
"name": "Development",
"prefix": "sk-abc",
"created_at": "2024-01-01T00:00:00Z",
"last_used_at": "2024-01-15T10:30:00Z",
"is_active": true
},
{
"id": "key_def456",
"name": "Production",
"prefix": "sk-def",
"created_at": "2024-01-10T00:00:00Z",
"last_used_at": null,
"is_active": true
}
]
}
}
CLI Equivalent
Create API Key
Create a new API key.
Authorization: Bearer sk-your-api-key
Request Body
Response
The full API key is only returned once at creation time. Store it securely.
{
"success": true,
"data": {
"id": "key_xyz789",
"name": "My New Key",
"key": "sk-full-api-key-only-shown-once",
"prefix": "sk-xyz",
"created_at": "2024-01-15T10:30:00Z"
}
}
CLI Equivalent
kernle auth keys create --name "My New Key"
Revoke API Key
Revoke (deactivate) an API key.
DELETE /auth/keys/{key_id}
Authorization: Bearer sk-your-api-key
Response
{
"success": true,
"data": {
"id": "key_abc123",
"revoked": true,
"revoked_at": "2024-01-15T10:30:00Z"
}
}
CLI Equivalent
kernle auth keys revoke key_abc123
Cycle API Key
Generate a new key and deactivate the old one atomically.
POST /auth/keys/{key_id}/cycle
Authorization: Bearer sk-your-api-key
Response
{
"success": true,
"data": {
"old_key_id": "key_abc123",
"old_key_revoked": true,
"new_key_id": "key_xyz789",
"new_key": "sk-new-api-key",
"new_key_prefix": "sk-xyz"
}
}
CLI Equivalent
kernle auth keys cycle key_abc123
Logout
Clear local credentials (client-side operation).
This is a local operation. API keys remain active until explicitly revoked.
CLI Equivalent