Skip to main content

API Overview

The Kernle API provides programmatic access to memory operations for cloud-synced agents.

Base URL

https://api.kernle.ai
For self-hosted deployments, use your configured backend URL.

Authentication

All API requests require authentication via API key:
Authorization: Bearer sk-your-api-key
Get your API key from the Dashboard or via CLI:
kernle auth keys create --name "My App"

Request Format

  • Content-Type: application/json
  • Accept: application/json

Response Format

All responses follow this structure:
{
  "success": true,
  "data": { ... },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z",
    "request_id": "req_abc123"
  }
}

Error Responses

{
  "success": false,
  "error": {
    "code": "invalid_request",
    "message": "Missing required field: agent_id"
  },
  "meta": {
    "timestamp": "2024-01-15T10:30:00Z",
    "request_id": "req_abc123"
  }
}

Common Error Codes

CodeHTTP StatusDescription
unauthorized401Invalid or missing API key
forbidden403API key lacks required permissions
not_found404Resource not found
invalid_request400Malformed request
rate_limited429Too many requests
internal_error500Server error

Rate Limits

PlanRequests/minuteRequests/day
Free601,000
Pro30050,000
EnterpriseCustomCustom
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705312200

API Endpoints

SDKs

Python

pip install kernle
from kernle import Kernle

kn = Kernle(agent_id="my-agent", api_key="sk-xxx")
kn.load()
kn.episode("Tested the API", "success", lessons=["It works!"])
kn.checkpoint_save("API testing complete")

CLI

The Kernle CLI wraps the API:
kernle -a my-agent sync push   # Uses API
kernle -a my-agent search "query"  # Uses API when cloud-enabled

Local vs Cloud

Kernle is local-first. The API is optional for cloud sync and search features:
FeatureLocalCloud API
Memory storage✓ SQLite✓ Supabase
Basic search✓ Text matching✓ Vector search
Sync across devices
BackupsManual✓ Automatic
Offline support✓ Full✓ Queue + sync
Enable cloud features with:
kernle auth login