MondialMondial AI Docs

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

ParameterTypeDescription
llmstringLanguage model (gpt-4o, gpt-3.5-turbo)
temperaturenumberResponse creativity (0.0-1.0)
max_tokensnumberMaximum response length
system_promptstringAgent personality and behavior
toolsarrayAvailable tools and functions
memorybooleanEnable conversation memory
conversation_lengthnumberMax 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

  1. Clear purpose and scope
  2. Appropriate personality for use case
  3. Effective system prompts
  4. Proper tool configuration

Usage Optimization

  1. Monitor minute consumption
  2. Optimize conversation length
  3. Use appropriate models
  4. Track performance metrics

Cost Management

  1. Choose right plan for usage
  2. Monitor usage patterns
  3. Optimize agent efficiency
  4. Scale based on demand