Agent Module
AI agents with separate billing and minute-based consumption.
Agent Module
Create and manage AI agents with separate billing system and minute-based consumption.
Agent Management
List Agents
curl -X GET https://api.mondialspeech.com/api/v1/agents \
-H "Authorization: Bearer <ACCESS_TOKEN>"Create Agent
curl -X POST https://api.mondialspeech.com/api/v1/agents \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"SupportBot","description":"Tier1 Support Agent","configJson":"{\"llm\":\"gpt-4o\"}"}'Get Agent Details
curl -X GET https://api.mondialspeech.com/api/v1/agents/{id} \
-H "Authorization: Bearer <ACCESS_TOKEN>"Update Agent
curl -X PUT https://api.mondialspeech.com/api/v1/agents/{id} \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"SupportBot V2","description":"Updated agent","configJson":"{\"llm\":\"gpt-4o\"}"}'Delete Agent
curl -X DELETE https://api.mondialspeech.com/api/v1/agents/{id} \
-H "Authorization: Bearer <ACCESS_TOKEN>"Agent Configuration
Configuration JSON Structure
{
"llm": "gpt-4o",
"temperature": 0.7,
"max_tokens": 1000,
"system_prompt": "You are a helpful support agent",
"tools": ["search", "calculator"],
"memory": true,
"conversation_length": 10
}Configuration Options
| Parameter | Type | Description |
|---|---|---|
llm | string | Language model (gpt-4o, gpt-3.5-turbo) |
temperature | number | Response creativity (0.0-1.0) |
max_tokens | number | Maximum response length |
system_prompt | string | Agent personality and behavior |
tools | array | Available tools and functions |
memory | boolean | Enable conversation memory |
conversation_length | number | Max conversation turns |
Agent Subscription & Billing
Agent Plans
# List agent plans
curl -X GET https://api.mondialspeech.com/api/v1/agent-plans \
-H "Authorization: Bearer <ACCESS_TOKEN>"
# Get specific plan
curl -X GET https://api.mondialspeech.com/api/v1/agent-plans/{id} \
-H "Authorization: Bearer <ACCESS_TOKEN>"Subscribe to Agent Plan
curl -X POST https://api.mondialspeech.com/api/v1/agents/subscribe \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"agentId":"<AGENT_ID>","agentPlanId":"<PLAN_ID>"}'Get Agent Subscription
curl -X GET https://api.mondialspeech.com/api/v1/agents/{agentId}/subscription \
-H "Authorization: Bearer <ACCESS_TOKEN>"Agent Usage & Consumption
Get Agent Usage
curl -X GET https://api.mondialspeech.com/api/v1/agents/{agentId}/usage \
-H "Authorization: Bearer <ACCESS_TOKEN>"Consume Agent Minutes
curl -X POST https://api.mondialspeech.com/api/v1/agents/consume \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"agentId":"<AGENT_ID>","minutes":5,"metadata":"{\"session\":\"abc123\"}"}'Agent Types & Use Cases
Customer Support Agents
- Purpose: Handle customer inquiries
- Configuration: Professional, helpful tone
- Tools: Knowledge base, ticket system
- Memory: Session-based conversations
Sales Agents
- Purpose: Lead qualification and conversion
- Configuration: Persuasive, consultative
- Tools: CRM integration, product catalog
- Memory: Lead history tracking
Educational Agents
- Purpose: Tutoring and learning support
- Configuration: Patient, explanatory
- Tools: Curriculum access, assessment
- Memory: Learning progress tracking
Technical Agents
- Purpose: Technical support and debugging
- Configuration: Precise, technical
- Tools: Documentation, code analysis
- Memory: Issue resolution history
Agent Performance Monitoring
Usage Metrics
- Total minutes consumed
- Average session length
- Peak usage times
- Cost per interaction
Quality Metrics
- Response accuracy
- User satisfaction
- Resolution rate
- Escalation frequency
Error Handling
402 Payment Required (Insufficient Minutes)
{ "error": "Insufficient minutes", "minutes_needed": 10 }404 Not Found
{ "error": "Agent not found" }400 Bad Request
{ "error": "Invalid agent configuration" }Best Practices
Agent Design
- Clear purpose and scope
- Appropriate personality for use case
- Effective system prompts
- Proper tool configuration
Usage Optimization
- Monitor minute consumption
- Optimize conversation length
- Use appropriate models
- Track performance metrics
Cost Management
- Choose right plan for usage
- Monitor usage patterns
- Optimize agent efficiency
- Scale based on demand
