> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thunderphone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# क्विकस्टार्ट (API)

> चार REST कॉल्स में AI एजेंट के साथ अपनी पहली फोन कॉल का जवाब दें।

यह गाइड आपको उन चार REST कॉल्स के बारे में बताती है जिनकी मदद से आप
AI एजेंट के साथ अपनी पहली फोन कॉल का जवाब दे सकते हैं।

<Info>
  आपको [ThunderPhone अकाउंट](https://app.thunderphone.com) की आवश्यकता होगी।
  साइन अप निःशुल्क है और इसमें एक मिनट से भी कम समय लगता है। curl चलाने के बजाय क्लिक करना पसंद है?
  [डैशबोर्ड क्विकस्टार्ट](/hi/quickstart-dashboard) बिना कोई कोड लिखे
  उसी पहली कॉल तक पहुंचाता है।
</Info>

## चरण 1: API key प्राप्त करें

<Steps>
  <Step title="लॉग इन करें">
    [app.thunderphone.com](https://app.thunderphone.com) खोलें।
  </Step>

  <Step title="कीज़ पर जाएं">
    डैशबोर्ड में **संगठन → कीज़** पर जाएं।
  </Step>

  <Step title="की बनाएं">
    **की बनाएं** पर क्लिक करें, इसे एक नाम दें और
    `sk_live_...` वैल्यू कॉपी करें। रॉ की **केवल एक बार** दिखाई जाती है — इसे
    तुरंत अपने सीक्रेट मैनेजर में स्टोर करें।
  </Step>
</Steps>

<Tip>
  अटक गए? [सर्वर API key बनाना](/hi/guides/api-keys) इस
  फ्लो को चरण-दर-चरण विस्तार से बताता है, और इन-ऐप कोपायलट
  हर कंट्रोल को लाइव हाइलाइट कर सकता है।
</Tip>

इस गाइड में, `sk_live_YOUR_API_KEY` को उस वैल्यू से बदलें जिसे आपने
अभी कॉपी किया है। की आपके संगठन की पहचान अपने-आप करती है, इसलिए
आपको URLs में कभी भी org id डालने की आवश्यकता नहीं होती।

## चरण 2: एजेंट बनाएं

एक एजेंट यह तय करता है कि AI बातचीत को कैसे संभालता है — प्रॉम्प्ट, वॉइस,
प्रोडक्ट टियर, टूल्स और विजेट पात्रता।

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.thunderphone.com/v1/agents \
    -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name":   "Customer Support",
      "prompt": "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
      "voice":  "john",
      "product": "spark"
    }'
  ```

  ```python Python theme={null}
  import os, requests

  agent = requests.post(
      "https://api.thunderphone.com/v1/agents",
      headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
      json={
          "name":   "Customer Support",
          "prompt": "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
          "voice":  "john",
          "product": "spark",
      },
  ).json()
  print("Agent id:", agent["id"])
  ```

  ```javascript Node.js theme={null}
  const agent = await fetch("https://api.thunderphone.com/v1/agents", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.THUNDERPHONE_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name:    "Customer Support",
      prompt:  "You are a friendly support agent for Acme Corp. Help with orders, returns, and product info. Be concise and helpful.",
      voice:   "john",
      product: "spark",
    }),
  }).then((r) => r.json());
  console.log("Agent id:", agent.id);
  ```
</CodeGroup>

<Tip>
  प्रोडक्ट टियर: `spark` लागत के लिए ऑप्टिमाइज़ किया गया है, `bolt` स्पीड के लिए, और
  `storm-base` / `storm-extra` जटिल प्रॉम्प्ट पर इंटेलिजेंस के लिए। पूरा
  तुलना देखने के लिए [Agents](/api-reference/agents#product-tiers-at-a-glance) देखें।
</Tip>

## चरण 3: फ़ोन नंबर प्रोविज़न करें

यह कॉल नंबर के लिए ThunderPhone के डेमो पूल से अनुरोध करती है और आपके
नए एजेंट को इनबाउंड हैंडलर के रूप में असाइन करती है। (किसी VoIP
प्रोवाइडर से अपना नंबर लाने के लिए, इसके बजाय [VoIP कनेक्शन](/api-reference/voip-connections)
देखें।)

<CodeGroup>
  ```bash cURL theme={null}
  # First provision
  curl -X POST https://api.thunderphone.com/v1/phone-numbers \
    -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"area_code": "415"}'

  # Then assign the agent you created in Step 2
  curl -X PATCH https://api.thunderphone.com/v1/phone-numbers/<id-from-previous> \
    -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"inbound_agent_id": 12}'
  ```

  ```python Python theme={null}
  number = requests.post(
      "https://api.thunderphone.com/v1/phone-numbers",
      headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
      json={"area_code": "415"},
  ).json()
  requests.patch(
      f"https://api.thunderphone.com/v1/phone-numbers/{number['id']}",
      headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}"},
      json={"inbound_agent_id": agent["id"]},
  )
  print("Your ThunderPhone number:", number["number"])
  ```
</CodeGroup>

आपका नया नंबर `status="provisioning"` में शुरू होता है और कुछ सेकंड में
`active` हो जाता है; जब तक आप अपने ब्राउज़र की कॉल बंद करते हैं, नंबर
कॉल लेने के लिए तैयार होता है।

## चरण 4 (वैकल्पिक): वेबहुक सेट अप करें

रियल-टाइम इवेंट्स के लिए (डायनामिक कॉल रूटिंग, कॉल के बाद की प्रोसेसिंग)
वेबहुक एंडपॉइंट जोड़ें। केवल उन इवेंट्स को सब्सक्राइब करें जिनकी आपको आवश्यकता है।

```bash theme={null}
curl -X POST https://api.thunderphone.com/v1/developer/webhook-endpoints \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "label":  "Prod webhook",
    "url":    "https://your-server.com/thunderphone-webhook",
    "events": ["telephony.incoming", "telephony.complete"]
  }'
```

रिस्पॉन्स में एक बार इस्तेमाल होने वाला `secret` होता है — इसे अपने सीक्रेट
मैनेजर में कॉपी करें। इनकमिंग रिक्वेस्ट पर `X-ThunderPhone-Signature`
हेडर को वेरिफ़ाई करने के लिए उस सीक्रेट का उपयोग करें (देखें
[वेबहुक ओवरव्यू](/hi/webhooks/overview))।

## चरण 5: अपने एजेंट का परीक्षण करें

उस नंबर पर कॉल करें जिसे आपने अभी प्रोविज़न किया है। एजेंट कॉल उठाता है,
अपना परिचय देता है और आपके प्रॉम्प्ट का पालन करता है।

कॉल समाप्त होने के बाद उसकी जांच करें:

```bash theme={null}
curl https://api.thunderphone.com/v1/calls \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
```

ट्रांसक्रिप्ट और रिकॉर्डिंग URL पाने के लिए किसी विशिष्ट कॉल की जानकारी देखें:

```bash theme={null}
curl https://api.thunderphone.com/v1/calls/{call_id}/transcript \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
curl https://api.thunderphone.com/v1/calls/{call_id}/audio \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
```

***

## अगले चरण

<CardGroup cols={2}>
  <Card title="फ़ंक्शन टूल जोड़ें" icon="screwdriver-wrench" href="/hi/tools/overview">
    बातचीत के दौरान अपने एजेंट को आपके APIs कॉल करने दें।
  </Card>

  <Card title="आउटबाउंड कॉल करें" icon="arrow-up-right" href="/api-reference/outbound-calls">
    अपने कोड से कॉल ट्रिगर करें।
  </Card>

  <Card title="वेबहुक हैंडल करें" icon="bolt" href="/hi/webhooks/overview">
    रियल टाइम में कॉल इवेंट्स पर प्रतिक्रिया दें।
  </Card>

  <Card title="पूर्ण API रेफ़रेंस" icon="book" href="/api-reference/introduction">
    हर पब्लिक एंडपॉइंट का दस्तावेज़ीकरण।
  </Card>
</CardGroup>
