---
title: "ક્વિકસ્ટાર્ટ (API)"
description: "AI એજન્ટ સાથે તમારો પ્રથમ ફોન કૉલ સંભાળો: API કી મેળવો, એજન્ટ બનાવો, ફોન નંબર પ્રોવિઝન કરો અને લાઇવ ટેસ્ટ કૉલ કરો — આ બધું REST API દ્વારા."
---

આ માર્ગદર્શિકા તમને AI એજન્ટ સાથે તમારો પ્રથમ ફોન કૉલ જવાબ આપવા માટે જરૂરી ચાર REST કૉલ્સ સમજાવે છે.

<Info>
  તમને [ThunderPhone એકાઉન્ટ](https://app.thunderphone.com)ની જરૂર પડશે.
  સાઇન અપ મફત છે અને એક મિનિટથી ઓછો સમય લે છે. કર્લ ચલાવવા કરતાં ક્લિક કરવાનું પસંદ કરો છો?
  [ડેશબોર્ડ ક્વિકસ્ટાર્ટ](/gu/quickstart-dashboard) કોઈ કોડ લખ્યા વિના
  એ જ પ્રથમ કૉલ સુધી પહોંચાડે છે.
</Info>

## પગલું 1: API કી મેળવો

<Steps>
  <Step title="લૉગ ઇન કરો">
    [app.thunderphone.com](https://app.thunderphone.com) ખોલો.
  </Step>
  <Step title="Keys પર જાઓ">
    ડેશબોર્ડમાં **Organization → Keys** પર જાઓ.
  </Step>
  <Step title="કી બનાવો">
    **Create key** પર ક્લિક કરો, તેને નામ આપો અને
    `sk_live_...` મૂલ્ય કૉપી કરો. કાચી કી **ફક્ત એક જ વાર** દેખાય છે — તેને
    તરત જ તમારા સિક્રેટ મેનેજરમાં સંગ્રહિત કરો.
  </Step>
</Steps>

<Tip>
  અટવાઈ ગયા છો? [સર્વર API કી બનાવો](/gu/guides/api-keys) આ
  પ્રક્રિયાને પગલું-દર-પગલું વિગતવાર સમજાવે છે, અને ઇન-એપ કોપાઇલટ
  તમારા માટે દરેક કંટ્રોલને લાઇવ હાઇલાઇટ કરી શકે છે.
</Tip>

આ માર્ગદર્શિકા દરમિયાન, `sk_live_YOUR_API_KEY`ને તમે હમણાં કૉપી કરેલા
મૂલ્યથી બદલો. કી તમારી સંસ્થાને આપમેળે ઓળખે છે, તેથી
તમારે URLsમાં ક્યારેય org id ઉમેરવાની જરૂર નથી.

## પગલું 2: એજન્ટ બનાવો

એજન્ટ નક્કી કરે છે કે AI વાતચીત કેવી રીતે સંભાળે છે — prompt, અવાજ,
પ્રોડક્ટ ટિયર, ટૂલ્સ અને વિજેટ પાત્રતા.

<CodeGroup>
```bash cURL
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
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
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` જટિલ prompt પર બુદ્ધિમત્તા માટે છે. સંપૂર્ણ
  સરખામણી માટે [Agents](/api-reference/agents#product-tiers-at-a-glance) જુઓ.
</Tip>

## પગલું 3: ફોન નંબર પ્રોવિઝન કરો

આ કૉલ ThunderPhone પાસે નંબર માંગે છે અને તમારા નવા એજન્ટને ઇનબાઉન્ડ હેન્ડલર તરીકે સોંપે છે. (VoIP પ્રદાતા પાસેથી તમારો પોતાનો નંબર લાવવા માટે, તેના બદલે [VoIP કનેક્શન્સ](/api-reference/voip-connections) જુઓ.)

<CodeGroup>
```bash cURL
# 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
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
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` હેડરને ચકાસવા માટે તે સિક્રેટનો ઉપયોગ કરો ([વેબહૂક્સ અવલોકન](/gu/webhooks/overview) જુઓ).

## પગલું 5: તમારા એજન્ટનું પરીક્ષણ કરો

તમે હમણાં જ પ્રોવિઝન કરેલા નંબર પર કૉલ કરો. એજન્ટ કૉલ ઉપાડે છે, પોતાનો પરિચય આપે છે અને તમારા prompt ને અનુસરે છે.

કૉલ પૂર્ણ થયા પછી તેનું નિરીક્ષણ કરો:

```bash
curl https://api.thunderphone.com/v1/calls \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
```

ટ્રાન્સક્રિપ્ટ અને રેકોર્ડિંગ URL મેળવવા માટે ચોક્કસ કૉલની વિગતો જુઓ:

```bash
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="/gu/tools/overview">
    વાતચીત દરમિયાન તમારા એજન્ટને તમારી APIs કૉલ કરવા દો.
  </Card>
  <Card title="આઉટબાઉન્ડ કૉલ કરો" icon="arrow-up-right" href="/api-reference/outbound-calls">
    તમારા પોતાના કોડમાંથી કૉલ ટ્રિગર કરો.
  </Card>
  <Card title="વેબહૂક્સ હેન્ડલ કરો" icon="bolt" href="/gu/webhooks/overview">
    રીઅલ ટાઇમમાં કૉલ ઇવેન્ટ્સ પર પ્રતિસાદ આપો.
  </Card>
  <Card title="સંપૂર્ણ API સંદર્ભ" icon="book" href="/api-reference/introduction">
    દરેક જાહેર એન્ડપોઇન્ટનું દસ્તાવેજીકરણ.
  </Card>
</CardGroup>
