> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 음성 전사

> CometAPI POST /v1/audio/transcriptions를 사용해 선택한 전사 모델과 응답 형식으로 오디오를 텍스트로 전사합니다.

이 엔드포인트를 사용하면 오디오를 원본 언어의 텍스트로 전사할 수 있습니다. 회의 노트, 음성 메시지, 미디어 인덱싱, 자막, 검색 가능한 텍스트가 필요한 지원 워크플로에 적합합니다.

## 첫 번째 요청

`model`과 `file`이 포함된 지원되는 오디오 파일을 전송하세요. 업로드 처리, 인증, 응답 파싱을 검증하는 동안에는 첫 번째 파일을 짧게 유지하세요.

## 응답 읽기

기본 응답에는 전사된 `text`가 포함됩니다. 다른 응답 형식을 요청하는 경우, 기본 JSON 형태를 가정하지 말고 클라이언트가 해당 형식을 파싱하도록 하세요.

## 다음 단계

* 텍스트를 음성으로 출력해야 하는 경우 [음성 생성](/api/audio/create-speech)을 사용하세요.
* 대상 출력이 영어여야 하는 경우 [번역](/api/audio/create-translation)을 사용하세요.


## OpenAPI

````yaml api/openapi/audio/post-create-transcription.openapi.json POST /v1/audio/transcriptions
openapi: 3.1.0
info:
  title: Create transcription API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /v1/audio/transcriptions:
    post:
      summary: Create transcription
      operationId: create_transcription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  format: binary
                  type: string
                  description: >-
                    The audio file to transcribe. Supported formats: flac, mp3,
                    mp4, mpeg, mpga, m4a, ogg, wav, webm.
                model:
                  type: string
                  description: >-
                    The speech-to-text model to use. Choose a current speech
                    model from the [Models page](/overview/models).
                  default: whisper-1
                language:
                  type: string
                  description: >-
                    The language of the input audio in ISO-639-1 format (e.g.,
                    `en`, `zh`, `ja`). Supplying the language improves accuracy
                    and latency.
                prompt:
                  type: string
                  description: >-
                    Optional text to guide the model's style or continue a
                    previous audio segment. The prompt should match the audio
                    language.
                response_format:
                  type: string
                  description: The output format for the transcription.
                  enum:
                    - json
                    - text
                    - srt
                    - verbose_json
                    - vtt
                  default: json
                temperature:
                  type: number
                  description: >-
                    Sampling temperature between 0 and 1. Higher values produce
                    more random output; lower values are more focused. When set
                    to 0, the model auto-adjusts temperature using log
                    probability.
                  minimum: 0
                  maximum: 1
                  default: 0
              required:
                - file
                - model
      responses:
        '200':
          description: The transcription result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - text
                properties:
                  text:
                    type: string
                    description: The transcribed text.
              examples:
                Default:
                  summary: Transcription result
                  value:
                    text: Hello, welcome to CometAPI.
      x-codeSamples:
        - lang: python
          label: Create transcription
          source: |-
            import os
            from openai import OpenAI

            client = OpenAI(
                api_key=os.environ["COMETAPI_KEY"],
                base_url="https://api.cometapi.com/v1"
            )

            audio_file = open("audio.mp3", "rb")
            transcription = client.audio.transcriptions.create(
                model="whisper-1",
                file=audio_file
            )
            print(transcription.text)
        - lang: javascript
          label: Create transcription
          source: |-
            import OpenAI from "openai";
            import fs from "fs";

            const client = new OpenAI({
              apiKey: process.env.COMETAPI_KEY,
              baseURL: "https://api.cometapi.com/v1"
            });

            const transcription = await client.audio.transcriptions.create({
              model: "whisper-1",
              file: fs.createReadStream("audio.mp3")
            });
            console.log(transcription.text);
        - lang: shell
          label: Create transcription
          source: |-
            curl -X POST https://api.cometapi.com/v1/audio/transcriptions \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F model="whisper-1" \
              -F file="@audio.mp3"
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````