Agents API
The Agents API provides comprehensive management of AI agents and agent groups. Agents can be configured with specific skills, memories, and behaviors, and organized into groups for coordinated operations. The system supports full CRUD operations, skill assignment, group management, and advanced features like skill sharing and memory management.Authentication
All agents endpoints require authentication with API key:Rate Limits
Agent Management
Create Agent
Create a new AI agent with configuration. Endpoint:POST /agents
Request Body:
name(string, required): Agent namedescription(string, optional): Agent descriptionmodel(string, required): LLM model to useconfig(object, optional): Agent configurationtemperature(float): Response randomnessmax_tokens(integer): Maximum response lengthsystem_prompt(string): System prompt
skills(array, optional): Assigned skill IDsmemory_settings(object, optional): Memory configurationenabled(boolean): Enable memoryretention_days(integer): Memory retention periodcompression_enabled(boolean): Enable compression
metadata(object, optional): Additional metadata
List Agents
Retrieve all agents with optional filtering. Endpoint:GET /agents
Query Parameters:
status(string): Filter by status (active, inactive, paused)department(string): Filter by departmentmodel(string): Filter by modellimit(integer, default: 20, max: 100): Results per pageoffset(integer, default: 0): Pagination offsetsort(string, default: “created_at desc”): Sort field and direction
Get Agent
Retrieve a specific agent by ID. Endpoint:GET /agents/{id}
Response:
Update Agent
Update an existing agent configuration. Endpoint:PUT /agents/{id}
Request Body:
Delete Agent
Permanently delete an agent. Endpoint:DELETE /agents/{id}
Response:
Agent Skills Management
Assign Skills to Agent
Assign skills to an agent. Endpoint:POST /agents/{id}/skills
Request Body:
skill_ids(array, required): Skill IDs to assignreplace_existing(boolean, default: false): Replace existing skills or add to them
Remove Skills from Agent
Remove skills from an agent. Endpoint:DELETE /agents/{id}/skills
Request Body:
Get Agent Skills
Retrieve skills assigned to an agent. Endpoint:GET /agents/{id}/skills
Response:
Agent Memory Management
Share Memory to Agent
Share a memory with an agent. Endpoint:POST /agents/{id}/memories
Request Body:
memory_id(string, required): Memory ID to shareaccess_type(string, required): Access type (read, read_write)expires_at(string, optional): Expiration time
Get Agent Memories
Retrieve memories shared with an agent. Endpoint:GET /agents/{id}/memories
Query Parameters:
access_type(string): Filter by access typelimit(integer, default: 20, max: 100): Results per pageoffset(integer, default: 0): Pagination offset
Remove Memory from Agent
Remove shared memory from an agent. Endpoint:DELETE /agents/{id}/memories/{memoryId}
Agent Group Management
Create Agent Group
Create a group of agents for coordinated operations. Endpoint:POST /groups
Request Body:
name(string, required): Group namedescription(string, optional): Group descriptionconfig(object, optional): Group configurationload_balancing(string): Load balancing strategyfallback_enabled(boolean): Enable fallback agentstimeout_ms(integer): Request timeout
skills(array, optional): Group skillsmetadata(object, optional): Additional metadata
List Groups
Retrieve all agent groups. Endpoint:GET /groups
Query Parameters:
department(string): Filter by departmentlimit(integer, default: 20, max: 100): Results per pageoffset(integer, default: 0): Pagination offset
Get Group
Retrieve a specific group by ID. Endpoint:GET /groups/{id}
Response:
Update Group
Update an existing group configuration. Endpoint:PUT /groups/{id}
Delete Group
Permanently delete a group. Endpoint:DELETE /groups/{id}
Group Member Management
Add Agent to Group
Add an agent to a group. Endpoint:POST /groups/{id}/members
Request Body:
agent_id(string, required): Agent ID to addrole(string, optional): Member role (primary, secondary, fallback)
Remove Agent from Group
Remove an agent from a group. Endpoint:DELETE /groups/{id}/members/{agentId}
Response:
Get Group Skills
Retrieve skills assigned to a group. Endpoint:GET /groups/{id}/skills
Get Group Memories
Retrieve memories shared with a group. Endpoint:GET /groups/{id}/memories
Agent Analytics
Get Agent Statistics
Retrieve comprehensive statistics for an agent. Endpoint:GET /agents/{id}/stats
Response:
Get Group Statistics
Retrieve comprehensive statistics for a group. Endpoint:GET /groups/{id}/stats
Response:
Error Handling
Common Error Responses
Error Codes
Best Practices
Agent Configuration
- Clear Naming: Use descriptive names for agents
- Appropriate Models: Choose the right model for the task
- Temperature Control: Adjust temperature for response consistency
- System Prompts: Write clear, specific system prompts
- Memory Settings: Configure memory retention appropriately
Skill Management
- Skill Selection: Assign relevant skills to agents
- Skill Testing: Test skills before assignment
- Performance Monitoring: Monitor skill performance
- Regular Updates: Update skills regularly
- Skill Dependencies: Consider skill dependencies
Group Management
- Logical Grouping: Group agents by function or purpose
- Load Balancing: Configure appropriate load balancing
- Fallback Strategy: Implement fallback agents
- Member Limits: Set appropriate member limits
- Skill Sharing: Share relevant skills across groups
Performance Optimization
- Response Time: Monitor and optimize response times
- Success Rates: Track and improve success rates
- Resource Usage: Monitor token and memory usage
- Load Distribution: Ensure even load distribution
- Scaling: Plan for scaling as usage grows
Security Considerations
- Access Control: Implement proper RBAC for agent management
- Memory Security: Secure sensitive memories shared with agents
- Skill Validation: Validate skills before assignment
- Audit Logging: Enable audit logging for agent operations
- Rate Limiting: Implement appropriate rate limiting