---
title: "빠른 시작 (API)"
description: "AI 에이전트로 첫 전화를 응대합니다. API 키를 발급하고, 에이전트를 생성하고, 전화번호를 개통한 다음, REST API만으로 실시간 테스트 전화를 걸 수 있습니다."
---

이 가이드에서는 AI 에이전트로 첫 전화를 받기 위해 필요한 네 번의 REST 호출을 안내합니다.

<Info>
  [ThunderPhone 계정](https://app.thunderphone.com)이 필요합니다.
  가입은 무료이며 1분 이내에 완료됩니다. curl보다 클릭을 선호하나요?
  [대시보드 빠른 시작](/ko/quickstart-dashboard)에서는 코드를 작성하지 않고도
  동일한 첫 통화를 진행할 수 있습니다.
</Info>

## 1단계: API 키 가져오기

<Steps>
  <Step title="로그인">
    [app.thunderphone.com](https://app.thunderphone.com)을 엽니다.
  </Step>
  <Step title="키로 이동">
    대시보드에서 **조직 → 키**로 이동합니다.
  </Step>
  <Step title="키 만들기">
    **키 만들기**를 클릭하고 이름을 지정한 다음
    `sk_live_...` 값을 복사합니다. 원본 키는 **한 번만** 표시되므로 즉시
    시크릿 관리자에 저장합니다.
  </Step>
</Steps>

<Tip>
  진행이 막혔나요? [서버 API 키 만들기](/ko/guides/api-keys)에서
  이 과정을 단계별로 자세히 안내하며, 앱 내 코파일럿이 실시간으로
  각 요소를 강조 표시할 수 있습니다.
</Tip>

이 가이드 전체에서 `sk_live_YOUR_API_KEY`를 방금 복사한 값으로
바꿉니다. 키가 조직을 자동으로 식별하므로 URL에 조직 ID를
입력할 필요가 없습니다.

## 2단계: 에이전트 만들기

에이전트는 AI가 대화를 처리하는 방식을 정의합니다. 여기에는 프롬프트, 음성,
제품 티어, 도구 및 위젯 사용 가능 여부가 포함됩니다.

<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`는 복잡한 프롬프트를 지능적으로 처리하도록 설계되었습니다.
  전체 비교는 [에이전트](/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-V2`
헤더를 검증합니다([Webhook 개요](/ko/webhooks/overview) 참조).

## 5단계: 에이전트 테스트

방금 프로비저닝한 전화번호로 전화를 겁니다. 에이전트가 전화를 받고 자신을 소개한 뒤 프롬프트를 따릅니다.

통화가 종료된 후 통화를 확인합니다.

```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="/ko/tools/overview">
    대화 중 에이전트가 API를 호출하도록 합니다.
  </Card>
  <Card title="발신 전화 걸기" icon="arrow-up-right" href="/api-reference/outbound-calls">
    자체 코드에서 통화를 실행합니다.
  </Card>
  <Card title="웹훅 처리" icon="bolt" href="/ko/webhooks/overview">
    통화 이벤트에 실시간으로 대응합니다.
  </Card>
  <Card title="전체 API 레퍼런스" icon="book" href="/api-reference/introduction">
    모든 공개 엔드포인트를 문서화했습니다.
  </Card>
</CardGroup>
