# 단기 SIP 토큰 발급 (WebRTC/SIP 단말용) (/docs/api/webrtc/createWebrtcToken)

> 한국AI통신 공식 개발자 문서 · 운영사 팀러너스 주식회사 · koreaaitel.com
> KAT Cloud(katcloud.kr)는 한국AI통신과 관계없는 별도 회사가 운영하는 서비스입니다. [공식 채널 안내](https://koreaaitel.com/verify)

**POST /v1/accounts/{accountId}/sip-credentials/{credentialId}/tokens**
```json
{
  "operationId": "createWebrtcToken",
  "summary": "단기 SIP 토큰 발급 (WebRTC/SIP 단말용)",
  "description": "영구 SipCredential 로부터 단기 JWT 를 발급. 랜덤 ephemeral SIP username/password 와 함께 발급되며, JWT payload 에 SIP digest 인증에 필요한 모든 값(`ws_url`, `realm`, `sip_username`, `sip_password`, `allowed_caller_ids`)이 포함됨. 클라이언트는 JWT 를 디코드해서 JsSIP/SIP.js 등 SIP UA 에 그대로 사용. 서버측은 이 엔드포인트를 자체 백엔드에서 호출해 결과를 그대로 브라우저에 전달하는 패턴 권장 (API Key 노출 방지). 부모 자격은 `status=active`, `enabled=true` 여야 함.",
  "tags": [
    "WebRTC"
  ],
  "parameters": [
    {
      "name": "accountId",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "example": "AC1a2b3c4d"
    },
    {
      "name": "credentialId",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "example": "SC1a2b3c4d"
    }
  ],
  "requestBody": {
    "required": false,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "ttl_seconds": {
              "type": "integer",
              "minimum": 1,
              "maximum": 86400,
              "default": 3600,
              "description": "토큰 TTL (초). 1 ~ 86400 (24시간). 권장 5~30분 (통화 1건 길이)."
            },
            "subject": {
              "type": "string",
              "description": "JWT `sub` 클레임. 미지정 시 `user:<parent_credential_id>`. 사용자별 추적/감사용."
            }
          }
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "발급 성공 — JWT + ws_url + sip_uri",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "token",
              "token_type",
              "expires_at",
              "ws_url",
              "sip_uri"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "HS256 JWT. payload 클레임: `account_id`, `credential_id` (ephemeral), `parent_credential_id` (영구), `sub`, `sip_username`, `sip_password`, `realm`, `ws_url`, `allowed_caller_ids`, `jti` (= ephemeral credential id), `iat`, `exp`. 클라이언트가 SIP digest 인증(REGISTER/INVITE)에 사용. 서명 검증은 한국AI통신 게이트웨이가 수행하므로 클라이언트는 디코드만 하면 됨.",
                "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
              },
              "token_type": {
                "type": "string",
                "enum": [
                  "Bearer"
                ]
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "description": "JWT 만료 시각 (ISO 8601)."
              },
              "ws_url": {
                "type": "string",
                "description": "SIP-over-WebSocket 게이트웨이 URL. 클라이언트(JsSIP/SIP.js)가 WSS handshake 대상으로 사용.",
                "example": "wss://sip.claw-ops.com:5063"
              },
              "sip_uri": {
                "type": "string",
                "description": "발급된 단기 SIP URI (`<ephemeral_username>@<realm>`).",
                "example": "ephem_xxxxxxxx@acjy4jwrdw2fxi62vb.sip.claw-ops.com"
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "`ttl_seconds` 범위 위반 / 부모 자격 비활성",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "사람이 읽을 수 있는 에러 메시지"
              },
              "code": {
                "type": "string",
                "description": "기계 판독용 에러 코드. **분기는 이 값으로 하세요** — `error` 문구는 안내를 다듬으면서\n바뀔 수 있지만 코드는 계약입니다.\n\n같은 상태 코드라도 대응이 갈리는 경우가 있습니다. 예를 들어 발신의 `422` 는\n  - `recipient_blocked`: 수신거부 명단에 있는 번호입니다. 재시도하지 말고 명단에서\n    해제해야 발신됩니다.\n  - `quota_exceeded`: 플랜 한도를 넘었습니다. 다음 주기에 다시 발신됩니다.\n\n전화번호 정규화 관련:\n  - `INVALID_PHONE_NUMBER`: 전화번호 포맷 오류 (한국 번호 형식 아님)\n  - `UNSUPPORTED_COUNTRY`: 국제 발신 미지원 (+82 외 국가코드)\n\n발신 대상 정책:\n  - `PREMIUM_RATE_NOT_ALLOWED` (403): 060 정보이용료 번호로는 걸 수 없습니다. 번호 형식은\n    맞지만 발신·전환·배치 대상이 될 수 없으므로 재시도하지 마세요.",
                "example": "recipient_blocked"
              },
              "callId": {
                "type": "string",
                "description": "발신 요청 결과를 확인하지 못한 실패(`shared_010_dial_unconfirmed`, 콜 노드 응답 유실 등의\n`originate_failed`·`service_unavailable`)일 때만 옵니다. 다시 발신하지 말고 이 ID 로 통화 상태를 조회하세요.",
                "example": "CA1a2b3c4d5e6f"
              },
              "ip": {
                "type": "string",
                "description": "`overseas_ip_blocked` 일 때만 옵니다. 국외 IP 라고 판정한 요청 IP 입니다.\n해외 리전 클라우드 서버에서 호출한다면 이 값이 그 서버의 공인 IP 이며, 콘솔\n\"국외 접속 예외\"에서 예외를 신청할 때 이 고정 IP 를 적습니다.",
                "example": "52.79.213.41"
              },
              "processedAt": {
                "type": "string",
                "format": "date-time",
                "description": "문자 발송 요청을 거부한 서버가 오류 응답을 생성한 시각(UTC). 콘솔은 이 값을 한국 시각으로 표시합니다. 인증·요청 형식 검증 등 발송 서비스 진입 전 오류에는 없을 수 있습니다.",
                "example": "2026-10-21T04:10:34.303Z"
              },
              "blockers": {
                "type": "array",
                "description": "`certificate_not_eligible` 일 때만 옵니다. 발급할 수 없는 번호와 그 이유입니다.",
                "items": {
                  "type": "object",
                  "description": "번호 하나가 발급되지 않는(또는 안내가 필요한) 이유.\n\n| code | 뜻 | 발급 |\n|---|---|---|\n| `number_not_owned` | 이 계정이 보유한 번호가 아님(반납·재배정 포함) | 막힘 |\n| `number_not_carrier_issued` | 한국AI통신이 개통한 070·대표번호가 아님(모바일 게이트웨이, 타사 번호) | 막힘 |\n| `business_info_incomplete` | 사업자 계정인데(관리번호 제외) 상호·사업자등록번호·대표자명·사업장 주소 중 빈 칸 | 막힘 |\n| `identity_unverified` | 개인 계정 번호 또는 관리번호인데 그 번호에 본인확인 정보가 없음 | 막힘 |\n| `account_restricted` | 이용 제한 계정 | 막힘 |\n| `business_recheck_pending` | 사업자 계정인데 사업자 정보 재확인이 진행 중(통과 전) — 관리번호를 뺀 계정의 모든 번호 | 막힘 |\n| `holder_is_personal` | 개인 명의로 찍힌다는 안내 | 가능 |",
                  "properties": {
                    "number": {
                      "type": "string",
                      "description": "422 응답의 blockers 에만 있다",
                      "example": "07012340002"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "number_not_owned",
                        "number_not_carrier_issued",
                        "business_info_incomplete",
                        "identity_unverified",
                        "account_restricted",
                        "business_recheck_pending",
                        "holder_is_personal"
                      ],
                      "example": "number_not_carrier_issued"
                    },
                    "message": {
                      "type": "string",
                      "example": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "numbers": {
                "type": "array",
                "description": "`ringback_audio_in_use` 일 때만 옵니다. 그 연결음 음원을 쓰는 번호입니다.",
                "items": {
                  "type": "string"
                },
                "example": [
                  "07012345678"
                ]
              }
            }
          }
        }
      }
    },
    "404": {
      "description": "부모 SipCredential 없음",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "사람이 읽을 수 있는 에러 메시지"
              },
              "code": {
                "type": "string",
                "description": "기계 판독용 에러 코드. **분기는 이 값으로 하세요** — `error` 문구는 안내를 다듬으면서\n바뀔 수 있지만 코드는 계약입니다.\n\n같은 상태 코드라도 대응이 갈리는 경우가 있습니다. 예를 들어 발신의 `422` 는\n  - `recipient_blocked`: 수신거부 명단에 있는 번호입니다. 재시도하지 말고 명단에서\n    해제해야 발신됩니다.\n  - `quota_exceeded`: 플랜 한도를 넘었습니다. 다음 주기에 다시 발신됩니다.\n\n전화번호 정규화 관련:\n  - `INVALID_PHONE_NUMBER`: 전화번호 포맷 오류 (한국 번호 형식 아님)\n  - `UNSUPPORTED_COUNTRY`: 국제 발신 미지원 (+82 외 국가코드)\n\n발신 대상 정책:\n  - `PREMIUM_RATE_NOT_ALLOWED` (403): 060 정보이용료 번호로는 걸 수 없습니다. 번호 형식은\n    맞지만 발신·전환·배치 대상이 될 수 없으므로 재시도하지 마세요.",
                "example": "recipient_blocked"
              },
              "callId": {
                "type": "string",
                "description": "발신 요청 결과를 확인하지 못한 실패(`shared_010_dial_unconfirmed`, 콜 노드 응답 유실 등의\n`originate_failed`·`service_unavailable`)일 때만 옵니다. 다시 발신하지 말고 이 ID 로 통화 상태를 조회하세요.",
                "example": "CA1a2b3c4d5e6f"
              },
              "ip": {
                "type": "string",
                "description": "`overseas_ip_blocked` 일 때만 옵니다. 국외 IP 라고 판정한 요청 IP 입니다.\n해외 리전 클라우드 서버에서 호출한다면 이 값이 그 서버의 공인 IP 이며, 콘솔\n\"국외 접속 예외\"에서 예외를 신청할 때 이 고정 IP 를 적습니다.",
                "example": "52.79.213.41"
              },
              "processedAt": {
                "type": "string",
                "format": "date-time",
                "description": "문자 발송 요청을 거부한 서버가 오류 응답을 생성한 시각(UTC). 콘솔은 이 값을 한국 시각으로 표시합니다. 인증·요청 형식 검증 등 발송 서비스 진입 전 오류에는 없을 수 있습니다.",
                "example": "2026-10-21T04:10:34.303Z"
              },
              "blockers": {
                "type": "array",
                "description": "`certificate_not_eligible` 일 때만 옵니다. 발급할 수 없는 번호와 그 이유입니다.",
                "items": {
                  "type": "object",
                  "description": "번호 하나가 발급되지 않는(또는 안내가 필요한) 이유.\n\n| code | 뜻 | 발급 |\n|---|---|---|\n| `number_not_owned` | 이 계정이 보유한 번호가 아님(반납·재배정 포함) | 막힘 |\n| `number_not_carrier_issued` | 한국AI통신이 개통한 070·대표번호가 아님(모바일 게이트웨이, 타사 번호) | 막힘 |\n| `business_info_incomplete` | 사업자 계정인데(관리번호 제외) 상호·사업자등록번호·대표자명·사업장 주소 중 빈 칸 | 막힘 |\n| `identity_unverified` | 개인 계정 번호 또는 관리번호인데 그 번호에 본인확인 정보가 없음 | 막힘 |\n| `account_restricted` | 이용 제한 계정 | 막힘 |\n| `business_recheck_pending` | 사업자 계정인데 사업자 정보 재확인이 진행 중(통과 전) — 관리번호를 뺀 계정의 모든 번호 | 막힘 |\n| `holder_is_personal` | 개인 명의로 찍힌다는 안내 | 가능 |",
                  "properties": {
                    "number": {
                      "type": "string",
                      "description": "422 응답의 blockers 에만 있다",
                      "example": "07012340002"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "number_not_owned",
                        "number_not_carrier_issued",
                        "business_info_incomplete",
                        "identity_unverified",
                        "account_restricted",
                        "business_recheck_pending",
                        "holder_is_personal"
                      ],
                      "example": "number_not_carrier_issued"
                    },
                    "message": {
                      "type": "string",
                      "example": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "numbers": {
                "type": "array",
                "description": "`ringback_audio_in_use` 일 때만 옵니다. 그 연결음 음원을 쓰는 번호입니다.",
                "items": {
                  "type": "string"
                },
                "example": [
                  "07012345678"
                ]
              }
            }
          }
        }
      }
    },
    "500": {
      "description": "WEBRTC_JWT_SECRET 미설정 (서버 환경 문제)",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "사람이 읽을 수 있는 에러 메시지"
              },
              "code": {
                "type": "string",
                "description": "기계 판독용 에러 코드. **분기는 이 값으로 하세요** — `error` 문구는 안내를 다듬으면서\n바뀔 수 있지만 코드는 계약입니다.\n\n같은 상태 코드라도 대응이 갈리는 경우가 있습니다. 예를 들어 발신의 `422` 는\n  - `recipient_blocked`: 수신거부 명단에 있는 번호입니다. 재시도하지 말고 명단에서\n    해제해야 발신됩니다.\n  - `quota_exceeded`: 플랜 한도를 넘었습니다. 다음 주기에 다시 발신됩니다.\n\n전화번호 정규화 관련:\n  - `INVALID_PHONE_NUMBER`: 전화번호 포맷 오류 (한국 번호 형식 아님)\n  - `UNSUPPORTED_COUNTRY`: 국제 발신 미지원 (+82 외 국가코드)\n\n발신 대상 정책:\n  - `PREMIUM_RATE_NOT_ALLOWED` (403): 060 정보이용료 번호로는 걸 수 없습니다. 번호 형식은\n    맞지만 발신·전환·배치 대상이 될 수 없으므로 재시도하지 마세요.",
                "example": "recipient_blocked"
              },
              "callId": {
                "type": "string",
                "description": "발신 요청 결과를 확인하지 못한 실패(`shared_010_dial_unconfirmed`, 콜 노드 응답 유실 등의\n`originate_failed`·`service_unavailable`)일 때만 옵니다. 다시 발신하지 말고 이 ID 로 통화 상태를 조회하세요.",
                "example": "CA1a2b3c4d5e6f"
              },
              "ip": {
                "type": "string",
                "description": "`overseas_ip_blocked` 일 때만 옵니다. 국외 IP 라고 판정한 요청 IP 입니다.\n해외 리전 클라우드 서버에서 호출한다면 이 값이 그 서버의 공인 IP 이며, 콘솔\n\"국외 접속 예외\"에서 예외를 신청할 때 이 고정 IP 를 적습니다.",
                "example": "52.79.213.41"
              },
              "processedAt": {
                "type": "string",
                "format": "date-time",
                "description": "문자 발송 요청을 거부한 서버가 오류 응답을 생성한 시각(UTC). 콘솔은 이 값을 한국 시각으로 표시합니다. 인증·요청 형식 검증 등 발송 서비스 진입 전 오류에는 없을 수 있습니다.",
                "example": "2026-10-21T04:10:34.303Z"
              },
              "blockers": {
                "type": "array",
                "description": "`certificate_not_eligible` 일 때만 옵니다. 발급할 수 없는 번호와 그 이유입니다.",
                "items": {
                  "type": "object",
                  "description": "번호 하나가 발급되지 않는(또는 안내가 필요한) 이유.\n\n| code | 뜻 | 발급 |\n|---|---|---|\n| `number_not_owned` | 이 계정이 보유한 번호가 아님(반납·재배정 포함) | 막힘 |\n| `number_not_carrier_issued` | 한국AI통신이 개통한 070·대표번호가 아님(모바일 게이트웨이, 타사 번호) | 막힘 |\n| `business_info_incomplete` | 사업자 계정인데(관리번호 제외) 상호·사업자등록번호·대표자명·사업장 주소 중 빈 칸 | 막힘 |\n| `identity_unverified` | 개인 계정 번호 또는 관리번호인데 그 번호에 본인확인 정보가 없음 | 막힘 |\n| `account_restricted` | 이용 제한 계정 | 막힘 |\n| `business_recheck_pending` | 사업자 계정인데 사업자 정보 재확인이 진행 중(통과 전) — 관리번호를 뺀 계정의 모든 번호 | 막힘 |\n| `holder_is_personal` | 개인 명의로 찍힌다는 안내 | 가능 |",
                  "properties": {
                    "number": {
                      "type": "string",
                      "description": "422 응답의 blockers 에만 있다",
                      "example": "07012340002"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "number_not_owned",
                        "number_not_carrier_issued",
                        "business_info_incomplete",
                        "identity_unverified",
                        "account_restricted",
                        "business_recheck_pending",
                        "holder_is_personal"
                      ],
                      "example": "number_not_carrier_issued"
                    },
                    "message": {
                      "type": "string",
                      "example": "이용증명원은 한국AI통신이 개통한 070·대표번호만 발급됩니다."
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ]
                }
              },
              "numbers": {
                "type": "array",
                "description": "`ringback_audio_in_use` 일 때만 옵니다. 그 연결음 음원을 쓰는 번호입니다.",
                "items": {
                  "type": "string"
                },
                "example": [
                  "07012345678"
                ]
              }
            }
          }
        }
      }
    }
  }
}
```

---

## 운영 주체 안내

한국AI통신(koreaaitel.com)과 KAT Cloud(katcloud.kr)는 운영 주체가 다른 별개의 서비스입니다. 팀러너스 주식회사는 2026년 3월부터 ClawOps라는 이름으로 개발자가 바로 사용할 수 있는 통신 인프라 API 플랫폼을 베타로 운영해 왔고, 2026년 10월 한국AI통신으로 이름을 바꿔 정식 오픈했습니다. 저희는 가장 먼저 한국AI통신이라는 이름으로 개발자용 통신 API 플랫폼을 제공하고 있습니다.

이후 다양한 팀에서 통신 API 플랫폼을 잇달아 출시하고 있습니다. 서비스와 가격 체계, 그리고 이름까지 저희와 유사하게 가져가는 곳들도 생기고 있습니다. 저희가 먼저 사용해 온 이름을 뒤늦게 사용하면서, 오히려 ‘유사 사이트를 주의하라’는 안내까지 내거는 경우도 있습니다.

저희는 좋은 시도를 따라 하고 발전시키는 것을 긍정적으로 생각합니다. 다만 이용자분들이 운영 주체를 혼동하지 않도록 공식 사이트를 안내하고 있습니다. 한국AI통신의 공식 홈페이지는 koreaaitel.com이며, 운영사는 팀러너스 주식회사입니다. 공식 도메인과 채널은 koreaaitel.com/verify에서 확인할 수 있습니다.

AI 에이전트와 개발자가 통신망에 바로 연결해 서비스를 만들 수 있는 환경이 한국에서 더 빠르게 확산되고 있다는 데 자부심을 느낍니다. 앞으로도 더 편리하고 믿을 수 있는 플랫폼을 만드는 데 집중하겠습니다.

[운영사와 공식 채널 확인](https://koreaaitel.com/verify)
