개발자

SpeakNotes API 퀵스타트

키를 생성하고 샌드박스에서 첫 번째 호출을 수행한 다음 라이브로 전환하세요. curl을 사용하는 4단계 과정입니다.

1. 키 생성

설정(Settings)의 API 키 메뉴에서 키를 생성하세요. 개발 중에는 샌드박스를 선택하세요. 샌드박스 키는 고정된 결과를 반환하며 크레딧을 소모하지 않고, 별도의 라이브러리에 기록되므로 언제든 삭제할 수 있습니다.

2. 샌드박스에서 요약하기

모든 경로는 샌드박스 키와 함께 작동합니다. 응답 형태는 라이브와 동일하므로 안심하고 개발할 수 있습니다.

curl -X POST https://api.speaknotes.io/v1/summaries \
  -H "Authorization: Bearer sn_test_YOUR_SANDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "We agreed to ship the billing fix on Friday. Sam owns the migration.",
    "styleId": "meeting-notes"
  }'

# {
#   "title": "Sandbox meeting notes",
#   "summary": "## Decisions\n- Sandbox mode confirmed working ...",
#   "styleId": "meeting-notes",
#   "creditsCharged": 0,
#   "notice": "Sandbox response: fixed output, no credits charged."
# }

3. 라이브 키로 전환

요청은 동일하지만 키만 다릅니다. 이 키는 실제 모델을 실행하고 크레딧을 차감하며, 응답을 통해 사용된 크레딧과 남은 크레딧을 확인할 수 있습니다.

curl -X POST https://api.speaknotes.io/v1/summaries \
  -H "Authorization: Bearer sn_live_YOUR_LIVE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "...", "styleId": "meeting-notes"}'

# Response headers include:
#   X-Credits-Remaining: 1998
# Response body includes:
#   "creditsCharged": 2

4. 파일 업로드

긴 미디어는 백그라운드에서 실행됩니다. 업로드를 생성하고, 서명된 URL에 파일을 PUT으로 전송한 뒤 완료 표시를 하고, 상태가 Done이 될 때까지 노트를 폴링하세요.

# 1. create the note and get a signed upload URL
curl -X POST https://api.speaknotes.io/v1/uploads \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "standup.m4a", "contentType": "audio/mp4", "styleId": "meeting-notes"}'

# 2. upload the file straight to the signed URL
curl -X PUT "$UPLOAD_URL" -H "Content-Type: audio/mp4" --data-binary @standup.m4a

# 3. tell SpeakNotes the upload finished (this is where credits are charged)
curl -X POST https://api.speaknotes.io/v1/uploads/$NOTE_ID/complete \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

# 4. poll until status is Done, then read the note
curl https://api.speaknotes.io/v1/notes/$NOTE_ID/status \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

curl https://api.speaknotes.io/v1/notes/$NOTE_ID \
  -H "Authorization: Bearer $SPEAKNOTES_API_KEY"

API 탐색

GET /v1은 자격 증명이 필요 없으며 리소스, 범위, 속도 제한, 크레딧 비용 및 인증 방법을 반환합니다. 에이전트가 API를 파악하는 가장 빠른 방법입니다.

curl https://api.speaknotes.io/v1

# Returns the resources, scopes, rate limits, credit costs,
# and how to authenticate. No credential required.

다음 단계: 인증 및 범위, 오류 코드, 각 작업의 비용 확인.