본 문서는 두 가지 주요 사용법을 안내합니다.
POST /upload)음성/영상 파일을 처리 대기열(input 폴더)에 추가합니다. 요청이 성공하면 서버는 즉시 202 Accepted 상태 코드를 반환하고, 실제 변환 작업은 백그라운드에서 수행됩니다.
curl -X POST http://localhost:8000/upload \
-F "file=@/path/to/your/audio.mp3"
응답 예시:
{
"message": "파일 수신 완료. 백그라운드에서 처리를 시작합니다.",
"filename": "audio.mp3"
}
GET /models)자동화 시스템에서 사용하는 기본 모델과 허용된 모델 목록을 조회합니다.
curl -X GET http://localhost:8000/models
응답 예시:
{
"default_model": "large-v3",
"allowed_models": ["tiny", "base", "small", "medium", "large-v3"]
}
POST /refresh/{filename})이미 변환이 완료된 output 폴더의 .json 결과물을 기반으로 .srt, .txt 파일을 다시 생성할 때 사용합니다.
curl -X POST http://localhost:8000/refresh/audio.json
응답 예시:
{
"message": "'audio.json'에 대한 후처리를 완료했습니다."
}
시스템은 허용된 확장자를 가진 파일만 처리합니다.
.mp3, .mp4, .mpeg, .mpga, .m4a, .wav, .webm, .mov, .mkv, .avi, .flac, .ogginput 폴더에 들어오면, 자동으로 rejected 폴더로 이동되며 처리되지 않습니다.경고: 아래의 /transcribe 엔드포인트는 곧 지원 중단될 예정입니다. 가급적 /upload를 사용한 자동화 시스템을 이용해 주세요.
POST /transcribe) - Deprecated파일을 업로드하면 변환이 완료될 때까지 기다렸다가 결과를 직접 반환받습니다.
curl -X POST http://localhost:8000/transcribe \
-F "file=@/path/to/your/audio.mp3"
model_name: 사용할 모델 이름 (기본값: large-v3)language: 오디오 언어 (ISO 639-1 코드, 예: ko)task: 작업 유형 (transcribe 또는 translate)response_format: 응답 형식 (json, text, srt, vtt)curl -X POST http://localhost:8000/transcribe \
-F "file=@/path/to/your/audio.mp3" \
-F "response_format=srt"
GET /)API 서버가 정상 동작하는지 확인합니다.
curl -X GET http://localhost:8000/
응답 예시:
{
"message": "Whisper 자동화 시스템이 정상적으로 동작 중입니다."
}
@/path/to/your/audio.mp3 부분은 실제 파일 경로로 수정해야 합니다.curl의 -o 옵션을 사용하면 응답 결과를 파일로 저장할 수 있습니다.
curl -X POST http://localhost:8000/transcribe \
-F "file=@/path/to/audio.mp3" \
-F "response_format=srt" \
-o transcription.srt
Content type
Image
Digest
sha256:ae0c5e8d5…
Size
16.2 GB
Last updated
about 19 hours ago
docker pull aisflow/whisper