Complete reference for the LotsAgent REST API
Go to Settings and create a site-level API key with the scopes you need.
curl -X GET https://lotsagent.com/api/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY"All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYhttps://lotsagent.com/api/v1/api/v1/agentsList all agents
{
"agents": [
{
"id": "uuid",
"name": "My Agent",
"description": "Agent description",
"status": "active",
"model": "gpt-4o",
"total_requests": 42,
"created_at": "2025-01-01T00:00:00Z"
}
],
"total": 1
}/api/v1/agentsCreate a new agent
{
"name": "My Agent",
"description": "Agent description",
"instructions": "You are a helpful assistant",
"model": "gpt-4o",
"temperature": 0.7,
"max_tokens": 2000
}{
"id": "uuid",
"name": "My Agent",
"slug": "my-agent",
"created_at": "2025-01-01T00:00:00Z"
}/api/v1/agents/{agentId}Get agent details
{
"id": "uuid",
"name": "My Agent",
"description": "Agent description",
"instructions": "You are a helpful assistant",
"model": "gpt-4o",
"temperature": 0.7,
"status": "active"
}/api/v1/agents/{agentId}Update an agent
{
"name": "Updated Name",
"description": "Updated description",
"temperature": 0.8
}{
"id": "uuid",
"name": "Updated Name",
"updated_at": "2025-01-01T00:00:00Z"
}/api/v1/agents/{agentId}Delete an agent
{
"success": true
}/api/v1/agents/{agentId}/executeExecute an agent (chat or task mode)
{
"message": "Hello, how are you?",
"mode": "chat",
"session_id": "optional-session-id",
"model": "gpt-4o"
}// Streaming response (SSE format)
data: {"type":"text-delta","delta":"Hello!"}
data: {"type":"text-delta","delta":" I'm"}
data: {"type":"text-delta","delta":" doing"}
data: {"type":"text-delta","delta":" well!"}
data: [DONE]The API uses standard HTTP status codes and returns errors in JSON format.
{
"error": "Validation error",
"details": "Invalid input parameters"
}{
"error": "Unauthorized",
"details": "Invalid or missing API key"
}{
"error": "Not found",
"details": "Resource not found"
}API requests are rate limited to ensure fair usage. Current limits: