Getting Started with CallWhiz AI API
The CallWhiz AI Developer API enables you to build powerful conversational AI voice applications. Create voice agents, manage calls, and integrate voice AI into your products with our comprehensive REST API.
Base URL
http://localhost:9000/v1Quick Start
- 1. Get your API key from the dashboard
- 2. Install our SDK or use HTTP client
- 3. Make your first API call
- 4. Build amazing voice applications!
Key Features
- • RESTful API design
- • Comprehensive webhooks
- • Real-time voice calls
- • Enterprise-ready security
Quick Example
Create your first agent with curl:
# For local development
curl -X POST http://localhost:9000/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Agent",
"model": "nano",
"voice": "Olivia",
"prompt": "You are a helpful assistant. Be friendly and concise."
}'
# For production
curl -X POST https://developer.callwhiz.ai/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"name": "My First Agent",
"model": "nano",
"voice": "Olivia",
"prompt": "You are a helpful assistant. Be friendly and concise."
}'Note: SDKs for JavaScript and Python are coming soon. For now, use the REST API directly with curl or your favorite HTTP client.
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header using Bearer authentication:
# Using your API key
curl -X GET http://localhost:9000/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef"API Key Types
- •
cw_live_*- Production API keys
Security Best Practices
- • Never expose API keys in client-side code
- • Use environment variables for key storage
- • Rotate keys regularly
- • Use separate keys for development and production
Available Models
Choose the right model for your use case. All models support function calls, allowing your agents to interact with external services through webhooks.
| Model | Description | Speed | Cost | Function Calls | Status |
|---|---|---|---|---|---|
nano | Fastest and most cost-effective. Perfect for simple conversations and quick responses. | Fastest | ₹5/min | ✓ Supported | Available |
lite | More powerful with balanced cost. Ideal for complex conversations and business logic. | Fast | ₹7/min | ✓ Supported | Available |
pro | Real-time conversational model with lowest latency. Perfect for natural, flowing conversations. | Real-time | ₹10/min | ✓ Supported | Available |
gpt-realtime | OpenAI's most advanced real-time voice model with natural interruption handling and emotional intelligence. | Real-time | ₹15/min | ✓ Supported | Available |
Choosing the Right Model
Use nano when: You need fast responses, simple conversations, or cost is a primary concern. Great for appointment confirmations, basic Q&A, or simple data collection.
Use lite when: You need more sophisticated conversations, complex business logic, or multi-turn dialogues. Perfect for customer support, sales agents, or detailed information gathering.
Use pro when: You need the most natural, real-time conversations with minimal latency. Ideal for high-stakes customer interactions or when conversation quality is paramount.
Use gpt-realtime when: You require the most advanced conversational AI with natural interruption handling, emotional intelligence, and the highest quality voice interactions. Best for premium customer experiences and complex real-time scenarios.
Model Usage Examples
Using nano model for a simple agent:
curl -X POST http://localhost:9000/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"name": "Appointment Reminder Bot",
"model": "nano",
"voice": "Olivia",
"prompt": "You are calling to remind about an appointment. Be brief and friendly.",
"webhook_ids": ["func_webhook_calendar123"]
}'Using lite model for a complex support agent:
curl -X POST http://localhost:9000/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"name": "Technical Support Agent",
"model": "lite",
"voice": "Brian",
"prompt": "You are a technical support agent. Help customers troubleshoot issues, look up their account details, and create support tickets as needed.",
"webhook_ids": ["func_webhook_crm456", "func_webhook_ticket789", "func_webhook_kb123"]
}'Using pro model for real-time conversations (coming soon):
# Available next week
curl -X POST http://localhost:9000/v1/agents \
-H "Authorization: Bearer cw_live_sk_1234567890abcdef" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium Sales Consultant",
"model": "pro",
"voice": "Sarah",
"prompt": "You are a premium sales consultant. Engage in natural, flowing conversations to understand customer needs and provide personalized solutions.",
"webhook_ids": ["func_webhook_crm456", "func_webhook_inventory789", "func_webhook_pricing123"]
}'Available Voices
Select your language, model, and accent to see available voices. Use only the voice name when creating or updating agents.
Supported Language Codes
European Languages
en- English (with accents)es- Spanishfr- Frenchde- Germanit- Italianpt- Portugueseru- Russianpl- Polish
Asian Languages
hi- Hindite- Teluguta- Tamilkn- Kannadaml- Malayalammr- Marathibn- Bengaligu- Gujarati
Other Languages
zh- Chineseja- Japaneseko- Koreanar- Arabictr- Turkishid- Indonesianth- Thaivi- Vietnamese
Note: Only English (en) supports accent selection. Accents include: American, British, Australian, Indian, Canadian, Irish, Scottish, and South African.
Function Webhooks
Create custom functions that your agents can call during conversations. These webhooks act as external tools your agent can use to fetch data, perform actions, or integrate with third-party services. Supports full JSON Schema Draft 7 and OpenAPI 3.0 parameter definitions including nested objects, arrays, enums, validation constraints, and more.
What are Function Webhooks?
Function webhooks are HTTP endpoints that agents can call as functions during conversations. They enable your agents to:
- Look up customer information from your CRM
- Check real-time data (weather, stock prices, etc.)
- Perform actions (send emails, create tickets, etc.)
- Integrate with any external API or service
/user-webhooksCreate a function webhook that agents can use
/user-webhooksList all your function webhooks
/user-webhooks/{webhook_id}Get details of a specific function webhook
/user-webhooks/{webhook_id}Update an existing function webhook
/user-webhooks/{webhook_id}Delete a function webhook. Note: You cannot delete webhooks that are currently in use by active agents.
Voice Agents
Create and manage AI voice agents that can handle conversations naturally. Configure voice, personality, and behavior.
/agentsCreate a new AI voice agent with custom configuration
/agentsGet a list of all voice agents in your account
/agents/{agent_id}Retrieve details of a specific voice agent
/agents/{agent_id}Update an existing agent's configuration
/agents/{agent_id}Delete (deactivate) a voice agent
Call Management
Initiate outbound calls, track call status, and access call recordings and transcripts.
/callsStart an outbound call using a specific voice agent
/calls/{call_id}/transcriptRetrieve the conversation transcript for a completed call
Phone Numbers
Get a list of phone numbers assigned to your account with their channel limits. These phone numbers can be used for making outbound calls.
/phone-numbersGet all phone numbers assigned to your account
Call History
Access your complete call history with secure encrypted IDs for each call record.
About Call History
The Call History API provides access to:
- Complete call records with secure encrypted IDs
- Conversation transcripts for AI calls
- Call duration, status, and metadata
- Default limit of 10 records, newest first
- Support for filtering by call type, status, date range, and more
/call-historyGet paginated call history with filters and encrypted IDs
/call-history/{encrypted_call_id}Get detailed information about a specific call using encrypted ID
/call-history/{encrypted_call_id}/transcriptGet the conversation transcript for a completed AI call
Field Descriptions
Call History Fields
- id:
- Encrypted unique identifier for the call (use this for all API operations)
- call_type:
- Type of call: 'manual', 'ai', or 'campaign'
- direction:
- Call direction: 'inbound' or 'outbound'
- destination:
- Phone number that was called
- did:
- Your CallWhiz AI phone number used for the call
- duration:
- Call duration in MM:SS or HH:MM:SS format
- status:
- Call status: 'Completed', 'Failed', 'In Progress', 'No Answer', 'Busy'
- created_at:
- When the call was initiated (ISO 8601)
- has_transcript:
- Boolean indicating if transcript is available (AI calls only)
- agent_name:
- Name of the AI agent or 'Manual Call'
- contact_name:
- Name of the contact if available from CRM
- medium:
- Call medium: 'web', 'phone_line', or 'whatsapp'
Transcript Fields
- timestamp:
- When the message was spoken (ISO 8601)
- speaker:
- Either "agent" or "customer"
- text:
- Transcribed text of what was said
Credits
Monitor your credit balance and usage for making calls and using AI services.
/credits/balanceGet remaining credit balance
Rate Limiting
API rate limits are enforced based on your subscription plan:
| Plan | Rate Limit | Burst | Concurrent Calls |
|---|---|---|---|
| Starter | 100 requests/hour | 10 requests/minute | 2 |
| Professional | 1,000 requests/hour | 50 requests/minute | 10 |
| Enterprise | 10,000 requests/hour | 200 requests/minute | 100 |
SDKs & Libraries
Official SDKs are available for popular programming languages: