Deploy conversational AI with the Voice.ai Voice Agents API. Learn how to create agents, configure LLM prompts, assign phone numbers, and go live in minutes
import requestsresponse = requests.post( 'https://dev.voice.ai/api/v1/agent/', headers={'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}, json={ 'name': 'My First Agent', 'config': { 'prompt': 'You are a helpful call center agent. Help customers with billing, returns, and questions.', 'greeting': 'Thank you for calling. How can I help you?', 'llm_model': 'gemini-2.5-flash-lite', 'allow_interruptions': True, 'min_interruption_words': 1, 'auto_noise_reduction': True } })agent_id = response.json()['agent_id']print(f'Agent ID: {agent_id}')
2
Assign a Phone Number
Assign your phone number to the agent:
Copy
import requestsheaders = {'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}# Pause agent to updaterequests.post(f'https://dev.voice.ai/api/v1/agent/{agent_id}/pause', headers=headers)# Update agent with phone numberrequests.put( f'https://dev.voice.ai/api/v1/agent/{agent_id}', headers=headers, json={'config': {'phone_number': '+14155551234'}})print('Phone number assigned!')