# Estate / Voice — single-property calling demo A client presentation demo for a fictional furnished 3 BHK in Vaishali Nagar, Jaipur. All property information is illustrative, not a real listing. The interface supports Hindi/Hinglish and English, property Q&A, a conversation transcript, mute/end controls and a running-cost calculator. ## Run locally From this directory in PowerShell: ```powershell & D:\Xampp\php\php.exe -S localhost:8787 -t . ``` Open http://localhost:8787 in Chrome or Edge. Alternatively start XAMPP Apache and open http://localhost/realestate-ai-demo/. Do not double-click index.html: the knowledge base is loaded over HTTP. No npm install or database is required. Use PHP 8.1+ with cURL and HTTPS certificate support; the XAMPP PHP runtime has cURL enabled. ## The two modes **Sample mode works without a paid API.** Select Start sample call, hear the greeting, and use Press to speak for each question. You can also type or use question chips. Speech recognition depends on browser support, microphone permission and the browser vendor's speech service; voice quality/language depends on installed voices. It is keyword-matched, prepared property Q&A, not a generative AI conversation. Audio output availability is browser dependent. Typed Q&A remains usable without microphone support. **Live AI mode uses OpenAI Realtime over WebRTC.** It supports natural voice conversation, automatic turn detection and interruption. The standard API key remains on the PHP server. The property JSON is added to server-side session instructions. No fine-tuning or vector database is needed for one small listing. 1. Open the prepared `config.local.php` (or copy `config.example.php` if starting from a fresh checkout). 2. Set `openai_api_key` to your OpenAI project API key (or provide the OPENAI_API_KEY server environment variable). Enable API billing in your own account. Do not paste keys into chat, client JavaScript, screenshots or a public repository. 3. Keep the default model `gpt-realtime-2.1-mini`, or update to a Realtime model available to your project. The estimator assumes this default model's rates. 4. Refresh the app or use Connect AI → Check connection, then Start AI call and allow the microphone. Configured status only checks that a key exists; the first real session validates the key, billing and model availability. No real AI call was tested during implementation because no key was provided. API errors are surfaced without returning the key or full upstream error payload. ## Client presentation: a 3-minute script 1. Explain: “Aria ek AI property assistant hai. Abhi yeh fictional demo listing hai.” 2. Ask “Is flat ki price kya hai?” 3. Ask “Carpet area kitna hai? Parking included hai?” 4. Ask “Kya amenities hain? Maintenance kitna hai?” 5. Ask “RERA number kya hai?” — it should say this is not supplied. 6. Ask “Visit kab kar sakte hain?” — it gives sample hours without claiming a booking. 7. Show the calculator and change expected call volume. ## Share with a client Localhost is accessible only on this computer. For a remote client, deploy to PHP-capable HTTPS hosting with cURL, set the key using the host's secret configuration or the PHP config file, and set a strong `demo_access_code`. A remote connection without an access code configured is blocked. Enter the code using Connect AI; it is kept only in the tab's memory. Do not expose the PHP development server publicly. Configure the host to deny access to config/dotfiles and disable directory listings (the included `.htaccess` covers Apache). Keep rate limits/spend controls in the API project; the demo has a 20-session-per-hour per-IP limiter and a client-side 10-minute timer, neither is a production billing hard cap. Behind a proxy, the per-IP limiter may group visitors. Use proper authentication and server-enforced session controls before a public production launch. The app does not save audio, transcripts or leads persistently. Reset/reload clears the transcript. Browser sample speech may be processed by the browser vendor; live audio and the sample knowledge are sent to OpenAI. No CRM, visit scheduling, message sending or payment integration is present. ## Property data `data/property.json` contains all question-answer knowledge, inclusions/exclusions and unknown facts. Update English and Hindi answers together. The facts list, title and FAQ panel render from this file. The hero summary cards/illustration are presentation content in `index.html`; update those too if replacing this property. Real legal status, exact landmarks and contact details must be verified before replacing the fictional listing. ## Cost estimate (checked 30 September 2026) Default model audio pricing: $10 / 1M input audio tokens and $20 / 1M output audio tokens. At 30 seconds user speech (300 audio tokens) plus 30 seconds agent speech (600 tokens), one call minute has a base audio cost of $0.015. The INR conversion uses **₹90/USD as a planning assumption**, not a live exchange rate. Base audio cost = minutes × [(300 × $10 + 600 × $20) / 1,000,000] × INR/USD. The UI adds a 25–100% planning allowance for text, repeated/cached context and optional transcription. These vary with actual usage and can exceed the allowance; this is not a guaranteed per-minute tariff. Input transcription uses `gpt-4o-mini-transcribe` and is billed separately. Reconcile real usage with provider billing after a pilot. | Scenario | Usage | Estimated AI cost | |---|---:|---:| | Prepared sample demo | no paid AI API | ₹0 API cost | | Small live presentation | 10 calls × 3 min | ₹51–₹81 | | Monthly browser pilot | 100 calls × 3 min | ₹506–₹810 | | Larger browser pilot | 1,000 calls × 3 min | ₹5,063–₹8,100 | Local hosting is ₹0. For a shared hosted pilot, reserve **₹500–₹1,000/month as a planning budget** (not a provider quote). Thus 100 three-minute browser calls plus hosting: **about ₹1,006–₹1,810/month**. Taxes, domain, FX/payment fees and development/support labour are extra. A ₹500–₹1,000 API testing budget is a reasonable allowance for repeated demos, not a mandatory fee or minimum top-up claim. Phone-number calling is **not connected or implemented** in this browser demo. It needs a carrier number/SIP integration and provider onboarding. The phone tab is a budget worksheet only: it assumes ₹1.50/min carrier cost and ₹500/month rental until replaced by a quote. For 300 minutes that is ₹450 + ₹500 + ₹506–₹810 AI = **₹1,456–₹1,760/month before hosting/taxes/integration**. This does not guarantee Indian number availability or compatibility. Twilio's India pricing lists outbound rates and international numbers, not an Indian inbound-number quote. Get a suitable India inbound/SIP quote before promising a +91 number. Extra telephony middleware may introduce further charges. Suggested **client quote**, based on scope judgment rather than a sourced market rate: ₹10,000–₹20,000 one-time for a branded single-property browser pilot, plus actual usage/hosting. Production telephone integration, CRM, support and authentication should be quoted separately after requirements/provider selection. This is a suggested selling price, not a charge incurred by this implementation. Sources: - https://developers.openai.com/api/docs/models/gpt-realtime-2.1-mini - https://developers.openai.com/api/docs/pricing - https://developers.openai.com/api/docs/guides/voice-latency-cost - https://developers.openai.com/api/docs/guides/voice-webrtc - https://developers.openai.com/api/docs/guides/realtime-conversations - https://www.twilio.com/en-us/voice/pricing/in ## Verification ```powershell node --test tests/engine.test.js node --check script.js & D:\Xampp\php\php.exe -l api\session.php ``` Manually verify a paid call after adding the key: greeting, Hindi and English turns, interruption, transcript, mute, cancel during connection, end/restart and network failure. Validate production access rules with the deployed host. Browser sample microphone recognition and a live API conversation require real device permissions/provider access.