List Agents
Retrieve all configured agents and their current status.
curl https://api.karen.dev/api/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY"
Array of agent configuration objects
LLM provider: openai, anthropic, grok, or gemini
Model identifier (e.g., gpt-4, claude-3-opus)
Agent’s trading/action strategy
Guardrail configuration for this agent
Decision loop interval in milliseconds
Agent status: idle, running, paused, stopped, or error
ISO 8601 timestamp of agent creation
Create Agent
Requires admin authentication
Create a new autonomous agent with custom configuration.
curl -X POST https://api.karen.dev/api/v1/agents \
-H "Authorization: Bearer ADMIN_SECRET" \
-H "Content-Type: application/json" \
-d '{
"name": "momentum-trader",
"walletId": "wallet_abc",
"llmProvider": "anthropic",
"llmModel": "claude-3-opus-20240229",
"strategy": "Trade based on momentum indicators",
"loopIntervalMs": 60000,
"guardrails": {
"maxSolPerTransaction": 1.0,
"maxTransactionsPerMinute": 3,
"dailySpendingLimitSol": 5.0
}
}'
Wallet ID for the agent to use
LLM provider: “openai”, “anthropic”, “grok”, or “gemini”
Agent’s strategy description
Decision loop interval in milliseconds
Custom guardrail configuration
Maximum SOL per transaction
Rate limit for transactions
Daily spending limit in SOL
Whitelist of allowed program IDs
Blacklist of blocked addresses
Start Agent
Requires admin authentication
Start an agent’s autonomous decision loop.
curl -X POST https://api.karen.dev/api/v1/agents/AGENT_ID/start \
-H "Authorization: Bearer ADMIN_SECRET"
Stop Agent
Requires admin authentication
Stop an agent’s autonomous decision loop.
curl -X POST https://api.karen.dev/api/v1/agents/AGENT_ID/stop \
-H "Authorization: Bearer ADMIN_SECRET"
Chat with Agent
Send a message to an agent and receive a response.
curl -X POST https://api.karen.dev/api/v1/agents/AGENT_ID/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "What is your current portfolio value?"}'
Message to send to the agent
Agent Status Values
idle - Agent created but not running
running - Agent actively making decisions
paused - Agent temporarily paused
stopped - Agent stopped
error - Agent encountered an error
Example Agent Workflow
# 1. Create a wallet for the agent
curl -X POST https://api.karen.dev/api/v1/wallets \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"name": "trader-wallet"}'
# Response: {"walletId": "wallet_xyz", ...}
# 2. Fund the wallet (devnet)
curl -X POST https://api.karen.dev/api/v1/wallets/wallet_xyz/airdrop \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"amount": 2}'
# 3. Create an agent (admin only)
curl -X POST https://api.karen.dev/api/v1/agents \
-H "Authorization: Bearer ADMIN_SECRET" \
-d '{
"name": "my-trader",
"walletId": "wallet_xyz",
"llmProvider": "anthropic",
"llmModel": "claude-3-sonnet-20240229",
"strategy": "Conservative SOL/USDC trading",
"guardrails": {
"maxSolPerTransaction": 0.5,
"dailySpendingLimitSol": 2.0
}
}'
# Response: {"id": "agent_abc", ...}
# 4. Start the agent
curl -X POST https://api.karen.dev/api/v1/agents/agent_abc/start \
-H "Authorization: Bearer ADMIN_SECRET"
# 5. Chat with the agent
curl -X POST https://api.karen.dev/api/v1/agents/agent_abc/chat \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"message": "What trades have you made today?"}'