Start an AI voice call
Starts a live voice call that answers questions about the person's chart. Your app joins the call with Agora's free SDK using the app_id, channel, uid and token we return. Counted per started minute, out of your call pack (or the free minutes on the Free plan); the call ends at max_minutes, when you end it, or 30 seconds after your user leaves.
https://api.vedicapi.co/v1/ai/call- Free50 minutes5 minutes to tryCalls at once1
- Starter50 minutes₹1,000 · $12Calls at once2
- Growth50 minutes₹1,000 · $12Calls at once10
- Scale50 minutes₹1,000 · $12Calls at once30
AI is prepaid: buy packs in Billing, valid 12 months. It never uses your plan's API calls and never adds to your monthly invoice. Free accounts get 5 minutes to try it, once. Failed requests cost nothing. AI pricing
Authentication
Send your API key as a Bearer token from your server. Never put the key in an app: start calls and ask questions from your backend. More on keys
Authorization: Bearer $VEDICAPI_KEY
Body parameters
datetimestringrequiredLocal birth time, ISO 8601 with no offset: 1990-10-21T00:45. Seconds are optional.
Example1990-10-21T00:45latnumberrequiredLatitude of the birth place, -90 to 90.
Example28.6139lonnumberrequiredLongitude of the birth place, -180 to 180.
Example77.209tzstringrequiredIANA zone (Asia/Kolkata) or an offset (+05:30). Past rule changes and daylight saving are handled.
ExampleAsia/KolkatalangstringLanguage of names and labels: en, hi, mr, bn, te, gu, ta, pa, kn, ml, en_IN (Hinglish) or de. Default en.
ExampleenayanamsastringAyanamsa. Lahiri (chitrapaksha) is the only one today and the default. Any other value gets 400 unsupported_ayanamsa.
One oflahirivoicestringThe astrologer's voice. Default Kore.
ExampleKoreOne ofAoede,Kore,Leda,Puck,Charon,Fenrir,Orus,Zephyrmax_minutesintegerLongest the call may run, 1 to 15. Default 10. If you have fewer minutes left, the call is limited to those; the answer says the real limit.
Example10greetingstringWhat the astrologer says first, up to 300 characters. Default: a short welcome in English or Hindi; for other languages send your own, or the astrologer waits for the user to speak.
How a call works
- 1WhereYour serverWhatPOST
/v1/ai/callwith the birth fields. We start the astrologer and returnapp_id,channel,uidandtoken. - 2WhereYour appWhatJoin the channel with Agora's SDK and publish the microphone. The astrologer greets the user and the conversation starts.
- 3WhereEitherWhatYour server ends it with
/end, or it ends by itself atmax_minutesor 30 seconds after your user leaves. - 4WhereYour serverWhatGET
/v1/ai/call/{id}for minutes and transcript.
// npm install agora-rtc-sdk-ng (Android, iOS, Flutter and React Native SDKs work the same way)
import AgoraRTC from "agora-rtc-sdk-ng";
// 1. On your server: POST /v1/ai/call with your key, pass app_id, channel, uid, token to the app.
const call = await fetch("/your-server/start-astrologer-call", { method: "POST" }).then(r => r.json());
// 2. In the app: join, play the astrologer, publish the microphone.
const client = AgoraRTC.createClient({ mode: "rtc", codec: "vp8" });
client.on("user-published", async (user, kind) => {
await client.subscribe(user, kind);
if (kind === "audio") user.audioTrack.play();
});
await client.join(call.app_id, call.channel, call.token, call.uid);
const mic = await AgoraRTC.createMicrophoneAudioTrack();
await client.publish([mic]);
// 3. To hang up: leave, then (on your server) POST /v1/ai/call/{call_id}/end for minutes and transcript.
await client.leave();Response
call_idstringUse it to end the call and to read its minutes and transcript.app_id, channel, uid, tokenstring / integerJoin the call with Agora's SDK: client.join(app_id, channel, token, uid), then publish the microphone.expires_atstringWhen the token stops working (max_minutes plus 5 minutes).max_minutesintegerThe call ends by itself after this many minutes.minutes_heldintegerTaken from your pack while the call runs. The minutes you don't use come back when it ends.minutes_leftintegerWhat remains in your packs meanwhile.
Errors
- 400Codes
invalid_jsoninvalid_datetimeinvalid_latinvalid_loninvalid_tzunsupported_langinvalid_voiceinvalid_max_minutesgreeting_too_longinvalid_end_userWhenA field is missing or invalid. The message names the field. - 401Codes
missing_keyunknown_keyWhenNo key, or the key is wrong, revoked or past its rotation window. - 403Codes
not_allowedWhenThe key has an allow list and this call came from another IP or domain. - 429Codes
rate_limitedtoo_many_callsai_limitWhenToo many calls running at once for your plan, or no call minutes left: buy a call pack in Billing. On Free: your free minutes, or the day's free minutes for everyone, are used. - 502Codes
ai_failedWhenThe voice agent could not start. The minutes go back to your pack. Retry. - 503Codes
ai_unavailableWhenVoice calls are switched off on the server.
Every error has one shape: { "error": "<message>", "code": "<code>", "request_id": "req_..." }. Errors and limits