Back to Docs

Getting Started

Get up and running with the VoiceCraft AI API in under 5 minutes. Follow these steps to create your first voice agent and make a test call.

Step 1: Get Your API Key

Navigate to Settings → API Keys in the VoiceCraft AI dashboard. Click "Create New Key", give it a name, and copy the generated key. Store it securely — you will not be able to view it again.

Important: Never expose your API key in client-side code or public repositories.

Step 2: Install the Python SDK

Install the official VoiceCraft AI Python SDK from PyPI:

pip install voicecraft-ai

Step 3: Create Your First Agent

Use the SDK to create a voice agent with a system prompt and language configuration:

from voicecraft import VoiceCraftClient

client = VoiceCraftClient(api_key="vc_your_api_key")

agent = client.agents.create(
    name="Sales Assistant",
    system_prompt="You are a helpful sales assistant for an Indian e-commerce company. Greet the customer in Hindi and assist with product inquiries.",
    language="hi-IN",
    voice_id="meera-hindi",
    max_call_duration=300,
)

print(f"Agent created: {agent.id}")

Step 4: Test the Agent

Before making a live call, test the agent with a simulated conversation:

test_result = client.agents.test(
    agent_id=agent.id,
    test_message="Hi, I want to know about your latest offers",
)

print(f"Agent response: {test_result.response}")
print(f"Latency: {test_result.latency_ms}ms")

Step 5: Make a Call

Initiate an outbound call using the agent you just created:

call = client.calls.create(
    agent_id=agent.id,
    to_number="+919876543210",
    from_number="+911234567890",
    metadata={"campaign": "welcome_offer"},
)

print(f"Call initiated: {call.id}")
print(f"Status: {call.status}")
Note: Outbound calls require a verified phone number and sufficient account balance. Ensure your account is TRAI-compliant before making production calls.

Next Steps