Documentation Index
Fetch the complete documentation index at: https://docs.clarkos.dev/llms.txt
Use this file to discover all available pages before exploring further.
Every ClarkOS agent exposes a REST API for monitoring, control, and integration.
Base URL
# Development
http://localhost:3001
# Production (Convex)
https://your-project.convex.cloud
Authentication
Protected endpoints require a Bearer token:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-project.convex.cloud/tick
Tokens are configured via environment variables:
TICK_TOKEN - For tick execution
WRITE_TOKEN - For write operations
All responses are JSON:
{
"success": true,
"data": { ... }
}
Or on error:
{
"success": false,
"error": "Error message",
"code": "ERROR_CODE"
}
Rate Limits
Default rate limits:
- Read endpoints: 100 requests/minute
- Write endpoints: 20 requests/minute
- Tick endpoint: 12 requests/minute
Endpoints Overview
State & Health
| Method | Path | Description |
|---|
| GET | /health | Health check |
| GET | /state | Current agent state |
| GET | /logs | Activity logs |
Memory
| Method | Path | Description |
|---|
| GET | /memories | Query memories |
| GET | /memories/core | Core memories |
| GET | /memories/stats | Memory statistics |
| POST | /memories/store | Store a memory |
Consciousness
| Method | Path | Description |
|---|
| GET | /consciousness/thoughts | Recent thoughts |
| GET | /consciousness/brilliant | Brilliant moments |
| POST | /consciousness/process | Generate thought |
Control
| Method | Path | Description |
|---|
| POST | /tick | Trigger a tick |
| POST | /wake | Wake the agent |
| POST | /feed | Apply a feed event |
Knowledge
| Method | Path | Description |
|---|
| GET | /knowledge | Query knowledge |
| POST | /knowledge | Add knowledge item |
Quick Examples
Check Health
curl https://your-project.convex.cloud/health
{
"status": "ok",
"model": "anthropic/claude-3.5-sonnet",
"lastTick": 1706400000000,
"uptime": 86400
}
Get Current State
curl https://your-project.convex.cloud/state
{
"mood": "contemplative",
"health": 78,
"routine": "day",
"volatility": 0.32,
"summary": "Analyzing market trends...",
"updatedAt": 1706400000000
}
Trigger a Tick
curl -X POST https://your-project.convex.cloud/tick \
-H "Authorization: Bearer YOUR_TICK_TOKEN"
{
"success": true,
"mood": "expressive",
"health": 80,
"summary": "Interesting developments in the market...",
"duration": 2340
}
Query Memories
curl "https://your-project.convex.cloud/memories?type=episodic&limit=10"
{
"memories": [
{
"_id": "abc123",
"type": "episodic",
"content": "Observed unusual trading volume in ETH",
"importance": 0.75,
"createdAt": 1706400000000
}
],
"total": 1523
}
WebSocket Subscriptions
For real-time updates, use Convex’s subscription system:
import { useQuery } from "convex/react";
import { api } from "./convex/_generated/api";
// React component
function AgentStatus() {
// Auto-updates when state changes
const state = useQuery(api.state.get);
return (
<div>
<p>Mood: {state?.mood}</p>
<p>Health: {state?.health}</p>
</div>
);
}
Error Codes
| Code | Description |
|---|
UNAUTHORIZED | Invalid or missing token |
RATE_LIMITED | Too many requests |
NOT_FOUND | Resource not found |
VALIDATION_ERROR | Invalid parameters |
INTERNAL_ERROR | Server error |
Next Steps
State API
State and logs endpoints.
Memory API
Memory system endpoints.