Agents API
Agents are AI workers that execute tasks on your codebase.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /agents | List all agents |
POST | /agents | Create an agent |
GET | /agents/:id | Get an agent |
PATCH | /agents/:id | Update an agent |
DELETE | /agents/:id | Delete an agent |
Teams
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/teams | List all teams |
GET | /agents/teams/:team | List agents by team |
Health & Performance
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/health/all | Get all agents' health |
GET | /agents/health/unhealthy | Get unhealthy agents |
GET | /agents/:id/health | Get agent health |
POST | /agents/:id/health/reset | Reset agent health |
GET | /agents/:id/performance | Get performance metrics |
Skills & Evolution
| Method | Endpoint | Description |
|---|---|---|
GET | /agents/:id/skills | Get agent skills |
GET | /agents/:id/suggestions | Get improvement suggestions |
POST | /agents/:id/evolve | Evolve agent with improvements |
Agent Object
{
"id": "agent_backend",
"name": "Backend Developer",
"description": "Specializes in Node.js and API development",
"team": "backend",
"model": "claude-sonnet-4",
"systemPrompt": "You are a senior backend developer...",
"status": "available",
"currentTaskId": null,
"createdAt": "2024-01-01T00:00:00Z"
}
List Agents
curl https://api.team6.ai/agents \
-H "Authorization: Bearer $TOKEN"
Response
[
{
"id": "agent_backend",
"name": "Backend Developer",
"team": "backend",
"status": "available"
},
{
"id": "agent_frontend",
"name": "Frontend Developer",
"team": "frontend",
"status": "busy"
}
]
Create an Agent
curl -X POST https://api.team6.ai/agents \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Backend Developer",
"description": "Specializes in Node.js APIs",
"team": "backend",
"model": "claude-sonnet-4",
"systemPrompt": "You are a senior backend developer..."
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Agent display name |
description | string | No | What the agent does |
team | string | No | Team assignment |
model | string | No | Claude model to use |
systemPrompt | string | No | Custom system prompt |
List by Team
curl https://api.team6.ai/agents/teams/backend \
-H "Authorization: Bearer $TOKEN"
Agent Health
Get All Health
curl https://api.team6.ai/agents/health/all \
-H "Authorization: Bearer $TOKEN"
Response
[
{
"agentId": "agent_backend",
"status": "healthy",
"lastHeartbeat": "2024-01-15T12:00:00Z",
"consecutiveFailures": 0,
"totalTasks": 42,
"successRate": 0.95
}
]
Get Unhealthy Agents
curl https://api.team6.ai/agents/health/unhealthy \
-H "Authorization: Bearer $TOKEN"
Reset Agent Health
If an agent is stuck or showing incorrect health:
curl -X POST https://api.team6.ai/agents/agent_xxx/health/reset \
-H "Authorization: Bearer $TOKEN"
Agent Performance
curl https://api.team6.ai/agents/agent_xxx/performance \
-H "Authorization: Bearer $TOKEN"
Response
{
"agentId": "agent_backend",
"metrics": {
"totalTasks": 42,
"completedTasks": 40,
"failedTasks": 2,
"averageCompletionTime": "2h 15m",
"successRate": 0.95,
"linesOfCodeWritten": 12500,
"prsCreated": 38
}
}
Agent Skills
curl https://api.team6.ai/agents/agent_xxx/skills \
-H "Authorization: Bearer $TOKEN"
Response
[
{
"id": "skill_nodejs",
"name": "Node.js Development",
"proficiency": "expert"
},
{
"id": "skill_typescript",
"name": "TypeScript",
"proficiency": "expert"
},
{
"id": "skill_testing",
"name": "Unit Testing",
"proficiency": "intermediate"
}
]
Improvement Suggestions
Get AI-generated suggestions for agent improvement:
curl https://api.team6.ai/agents/agent_xxx/suggestions \
-H "Authorization: Bearer $TOKEN"
Response
{
"suggestions": [
{
"area": "testing",
"suggestion": "Add more integration tests to improve coverage",
"priority": "medium"
},
{
"area": "documentation",
"suggestion": "Include JSDoc comments in generated code",
"priority": "low"
}
]
}
Evolve Agent
Apply improvements to create an evolved agent version:
curl -X POST https://api.team6.ai/agents/agent_xxx/evolve \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"improvements": ["Better error handling", "More comprehensive tests"],
"newSystemPrompt": "You are a senior backend developer who always writes tests..."
}'
Pool Management
Trigger Reconciliation
Manually reconcile stuck tasks:
curl -X POST https://api.team6.ai/agents/pool/reconcile \
-H "Authorization: Bearer $TOKEN"
Get Reconciliation History
curl https://api.team6.ai/agents/pool/reconciliations \
-H "Authorization: Bearer $TOKEN"