Agents API Overview
Manage AI agents for voice and chat interactions
Overview
The Agents API allows you to create and manage AI agents that can handle voice calls and chat conversations. Each agent is a configurable AI assistant that can be customized with specific instructions, tools, and settings.
Agent Types
Voice Agents
Voice agents handle phone-based conversations through Twilio integration and OpenAI's Realtime API. They can be assigned phone numbers and configured with specific voice characteristics.
Key Features:
- Phone number assignment
- Configurable voice settings (voice type, speed, interruption threshold)
- Real-time audio processing
- Tool integration for actions during calls
Chat Agents
Chat agents power website chat widgets, providing text-based conversational interfaces that can be embedded on any website.
Key Features:
- Customizable widget appearance (theme, colors, position)
- Domain restrictions for security
- Embed code generation
- Tool integration for actions during chats
Base URL
https://v2.heppu.ai/api/v1Authentication
All API requests require authentication using an API key. Include your API key in the request headers:
curl -H "x-api-key: YOUR_API_KEY" \
https://v2.heppu.ai/api/v1/agentsAlternatively, you can use the Authorization header:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://v2.heppu.ai/api/v1/agentsAvailable Endpoints
List Agents
GET /api/v1/agents - Retrieve all agents with filtering
Create Agent
POST /api/v1/agents - Create a new agent
Get Agent
GET /api/v1/agents/{agentId} - Get agent details
Update Agent
PATCH /api/v1/agents/{agentId} - Update agent configuration
Delete Agent
DELETE /api/v1/agents/{agentId} - Soft delete an agent
Agent Object
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Customer Support Agent",
"type": "voice",
"status": "active",
"model": "gpt-realtime-2025-08-28",
"instructions": "You are a helpful customer support agent...",
"config": {
"voice": "sage",
"speed": 1.0,
"interruptionThreshold": 0.5
},
"tools": [
{
"id": "web_search",
"name": "Web Search",
"description": "Search the web for information"
}
],
"phoneNumbers": ["+1234567890"],
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}Common Parameters
Agent Status
active- Agent is active and can receive requestsinactive- Agent is disabled and cannot receive requeststraining- Agent is being trained or configureddeployed- Agent is deployed and in production use
Agent Types
voice- Voice agent for phone callschat- Chat agent for website widgets
Default Models
- Voice agents:
gpt-realtime-2025-08-28(OpenAI Realtime API) - Chat agents:
gpt-4o(recommended) - Other chat models:
gpt-4o-mini,gpt-4,gpt-4-turbo,gpt-3.5-turbo
Error Handling
The API uses standard HTTP response codes:
200- Success201- Created successfully400- Bad request (invalid parameters)401- Unauthorized (invalid API key)403- Forbidden (access denied)404- Not found500- Internal server error
Error responses include details:
{
"success": false,
"error": {
"message": "Agent not found",
"code": 404
}
}Rate Limits
API requests are rate limited per organization. Contact support for rate limit increases.
Best Practices
- Use descriptive names - Give agents clear, descriptive names that indicate their purpose
- Provide clear instructions - Write detailed instructions for agent behavior and responses
- Test before deploying - Use the test interface to verify agent behavior before production use
- Monitor usage - Track agent metrics and conversations to optimize performance
- Keep tools minimal - Only enable the tools your agent needs for its specific use case
- Use appropriate models - Choose models based on your use case (realtime for voice, GPT-4o for complex chat)