How-to Walkthrough

Build a real multi-turn career-guidance feature end to end.

A complete example: a “career guidance” feature that asks a first question, renders the answer with suggested follow-ups, and supports a second turn that remembers the first.

  1. Collect birth details

    Gather date, time, latitude, longitude and IANA timezone from the user. Time is local wall-clock with no offset.

  2. Make the first call
    import os, requests
    KEY = os.environ["VEDIKA_KEY"]
    birth = {"datetime": "1990-05-15T10:30:00", "latitude": 28.6139,
             "longitude": 77.2090, "timezone": "Asia/Kolkata"}
    
    r = requests.post("https://api.vedika.io/api/v1/astrology/query",
        headers={"x-api-key": KEY},
        json={"question": "Which career field suits me best?",
              "birthDetails": birth, "conversationId": "u123-s1"},
        timeout=180)
    d = r.json()
    print(d["answer"])
    print("Follow-ups:", d["followUps"])
    print("Cost $", d["metadata"]["cost"]["costUsd"])
  3. Render answer + follow-ups

    Show answer, and offer followUps as tappable next questions. Optionally show birthChart for transparency.

  4. Ask a follow-up on the same thread
    r2 = requests.post("https://api.vedika.io/api/v1/astrology/query",
        headers={"x-api-key": KEY},
        json={"question": "What is the best time to switch jobs?",
              "birthDetails": birth, "conversationId": "u123-s1"},
        timeout=180)
    print(r2.json()["answer"])  # remembers turn 1
  5. Go faster for chat

    For an interactive UI, add "speed": "fast" (Vedika Swift, Business+) or stream tokens with the stream endpoint.

#Ship checklist