Replit logoVistara AI + Replit Integration

Add AI Calling to Your App with Replit

Build full-stack AI voice calling applications in Replit with Replit Agent. Effortlessly equip your project with low-latency (450–600 ms) conversational telephony simply by copying and pasting the master prompt below into Replit.

Replit & Replit Agent Master Prompt
Production Telephony & Voice Agent Prompt Ready

The prompt contains complete knowledge of the Vistara Connect REST API, low-latency Hindi telephony defaults, voice agent craftsmanship guidelines, and an automated flow to trigger a live test call to your personal mobile phone.

Download as .md File

Coding agents work best with the file: save it in your project (for example as VISTARA.md) and ask Replit to follow it.

1-Click Copy No Manual SDK Config Required Live Phone Call Experience Included Up to ₹100 Free Credit on Signup

Using a different AI tool or editor?

Switch to dedicated integration pages for your favorite coding assistant:

View All AI Tools
Interactive Telephony Workflow

What Happens When You Paste This Prompt into Replit

Step 01

Account Verification

Replit asks if you are registered at app.vistaraai.in. If new, it guides you through phone OTP sign-up — ₹100 free credit with GSTIN (₹50 without); only connected minutes are billed, so unanswered test calls cost nothing.
Step 02

Agent Query & Selection

Uses your API key to list your existing voice agents. You can pick an active agent or let Replit construct a brand new dedicated persona.
Step 03

Voice Prompt Craftsmanship

Constructs a 10-section prompt with native Devanagari Hindi spoken text, phone conversation mechanics, objection handling, and CRM deliverables.
Step 04

Live Phone Test Call

Asks for your mobile number and dispatches a priority test call (x-call-type: test). Your phone rings immediately so you experience the AI conversation live!
Step 05

Codebase Scaffolding

Scaffolds clean outbound call dispatchers, webhook receivers for post-call transcripts, rate-limiting guards, and .env files directly in your repository.
Developer Telephony Specs

Under the Hood: Vistara Connect REST Architecture

Everything Replit will wire up into your backend application:

Programmatic Agent Management (GET, POST, PUT /api/v1/agents)

Manage conversational agent lifecycles via REST. Agents default to Hindi with native Indian speech synthesis (meera or Aoede).

// Create Voice Agent (100 req/min limit)
curl -X POST https://app.vistaraai.in/api/v1/agents \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support RM",
    "language": "Hindi",
    "calling_method": "traditional",
    "voice": "meera",
    "first_message": "नमस्ते {{customer_name}} जी! मैं आपकी क्या सहायता कर सकती हूँ?",
    "system_instruction": "You are a courteous, expert AI support assistant...",
    "deliverables": [
      { "question": "Was customer interested?", "type": "fixed", "options": "Yes, No", "isGoal": true, "goalValue": "Yes" }
    ]
  }'

Step-by-Step Guide: Replit + Vistara AI

The short answer: add your Vistara API key to the Repl's Secrets as VISTARA_API_KEY, paste the prompt from vistaraai.in/integration/replit into Replit Agent, and follow along. Replit Agent builds and tests your voice agent with a live call to your phone, adds the server code that starts calls, and receives each call's result on your Repl's public URL.

Why Replit makes this easy

Vistara sends call results to a webhook URL that must be reachable from the internet — localhost is rejected. On a laptop that means setting up a tunnel. On Replit your app already has a public URL, so the webhook works while you develop.

Step 1: Add your Secrets

  • VISTARA_API_KEY — from the Connect page at app.vistaraai.in.
  • VISTARA_WEBHOOK_TOKEN — a random string of 32+ characters that protects your webhook URL.
  • VISTARA_AGENT_ID — add it once your agent exists.

Replit Agent reads them from Secrets and never writes them into code.

Step 2: Paste the prompt into Replit Agent

Open your Repl, start Replit Agent, and paste the prompt. The agent checks the key is set without printing it, lists your Vistara agents, and asks whether to use one or build a new one.

Step 3: Build the agent and take a test call

Answer a few questions about your use case; the agent writes the voice agent's prompt and creates it after you approve. Then it confirms your number and places a test call. Test calls work at any time of day (up to five per minute), while regular calls wait for the 09:00–20:00 IST calling window.

Step 4: The server code

Replit Agent sets up an Express or FastAPI server — or extends the one you have — with a route that starts calls and a webhook route. For FastAPI, the webhook looks like this:

@app.post("/webhooks/vistara")
async def vistara_webhook(request: Request, background: BackgroundTasks, token: str = ""):
    if not hmac.compare_digest(token, os.environ["VISTARA_WEBHOOK_TOKEN"]):
        raise HTTPException(status_code=401)
    payload = await request.json()
    call_id, event = payload.get("callId"), payload.get("event")
    if not call_id or not event:
        raise HTTPException(status_code=400)
    if save_call_event(call_id, event, payload):        # False if already processed
        background.add_task(process_call_result, call_id)
    return {"ok": True}

Step 5: Point the agent's webhook at your Repl

The webhook URL is your Repl's public URL plus /webhooks/vistara?token=…. Replit Agent saves it on the agent through the API. When you deploy, the URL changes — update the agent's webhook URL to the deployed address, or better, keep a test agent on the development URL and a production agent on the deployed one.

Step 6: A screen to place calls and see results

Ask Replit Agent for a small UI: a test-call form (phone and name), a calls table with status badges, and a detail view with the summary, answers, transcript and an audio player for the recording. The form calls your own server route — never Vistara directly from the browser.

Replit Integration FAQ

How do I add AI calling to my app with Replit?
Copy the Vistara AI integration prompt on this page and paste it into Replit, or save it in your project as VISTARA.md and ask Replit to follow it. Replit then checks your Vistara account and API key, helps you create a voice agent, places a test call to your own phone, and writes the code that starts calls and receives each call's transcript, summary and extracted answers by webhook.
Where do I put my Vistara API key in Replit?
In the Repl's Secrets, as VISTARA_API_KEY (and VISTARA_WEBHOOK_TOKEN for the webhook). Replit Agent reads them from there and never writes them into code. Use the Repl's public URL as the webhook URL while you develop.
Is my Vistara API key safe?
The prompt never contains your key. Replit is told to read it from the VISTARA_API_KEY environment variable, keep it out of source files, examples and logs, and use it only on the server — never in browser or mobile app code.
How much does it cost to try?
The prompt is free. New Vistara AI accounts get ₹100 free credit with GSTIN (₹50 without); only connected minutes are billed, so unanswered test calls cost nothing. After that, calls are billed per connected minute from your prepaid wallet.
Where does my Vistara API key go in Replit?
In the Repl's Secrets, as VISTARA_API_KEY. Add VISTARA_WEBHOOK_TOKEN for the webhook as well. Replit Agent reads both from Secrets and keeps them out of your code.
Do I need a tunnelling tool for webhooks on Replit?
No. Your Repl's public URL is reachable from the internet, so Vistara can deliver webhooks to it while you develop.
Why did my webhooks stop arriving after I deployed?
The deployed app has a different URL. Update the agent's webhook URL to the deployed address (with the token), or use separate test and production agents.
Can I place calls at night while I test?
Test calls are allowed at any time, up to five per minute. Regular calls requested outside 09:00–20:00 IST wait in the queue and are dialled when the window opens.

Ready to integrate voice AI into your product?

Sign up in under 60 seconds with your mobile number and get your live API key — plus ₹100 free credit with GSTIN (₹50 without); only connected minutes are billed, so unanswered test calls cost nothing.

Claim Free Credit