> ## 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)

> 4번의 REST 호출로 에이전트가 첫 전화를 받도록 설정합니다.

이 가이드에서는 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 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`는 복잡한 프롬프트를 위한 지능에 최적화되어 있습니다. 전체
  비교는 [에이전트](/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` 헤더를 검증합니다(
[웹훅 개요](/ko/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="/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>
