Skip to main content

Agents API

Agents are AI workers that execute tasks on your codebase.

Endpoints

MethodEndpointDescription
GET/agentsList all agents
POST/agentsCreate an agent
GET/agents/:idGet an agent
PATCH/agents/:idUpdate an agent
DELETE/agents/:idDelete an agent

Teams

MethodEndpointDescription
GET/agents/teamsList all teams
GET/agents/teams/:teamList agents by team

Health & Performance

MethodEndpointDescription
GET/agents/health/allGet all agents' health
GET/agents/health/unhealthyGet unhealthy agents
GET/agents/:id/healthGet agent health
POST/agents/:id/health/resetReset agent health
GET/agents/:id/performanceGet performance metrics

Skills & Evolution

MethodEndpointDescription
GET/agents/:id/skillsGet agent skills
GET/agents/:id/suggestionsGet improvement suggestions
POST/agents/:id/evolveEvolve 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

FieldTypeRequiredDescription
namestringYesAgent display name
descriptionstringNoWhat the agent does
teamstringNoTeam assignment
modelstringNoClaude model to use
systemPromptstringNoCustom 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"