Skip to Content

Create transcription

Use this interface to transcribe audio into text. The interface format is compatible with the OpenAI audio/transcriptions protocol.

Request Address

MethodURL
POSThttps://api.ant-ling.com/v1/audio/transcriptions

Authorization

Authorization

  • Type: HTTP Bearer Auth, value type string
  • Required
  • Description: Used to verify account information. Go to API Console , click Create Token to obtain.
Authorization: Bearer <YOUR_API_KEY>

Request Headers

Content-Type

  • Type: enum<string>
  • Required, fixed value multipart/form-data
  • Description: The media type of the request body. Must be multipart/form-data because the audio file is uploaded as form data.

Request Body

Overview

ParameterTypeRequiredDefaultDescription
modelstringYes—ASR model ID
filefileYes—The audio file to transcribe
languagestringNo—Primary language hint
promptstringNo—Context from previous transcription results
response_formatstringNojsonThe format of the transcription result
temperaturenumberNo0Sampling temperature, range [0, 1]

model

  • Type: string
  • Required
  • Description: The ID of the ASR model to use.
  • Options: Ming-3.0-asr-tiny

file

  • Type: file
  • Required
  • Description: The audio file to transcribe.
  • Supported formats: .wav, .mp3
  • Limits: file size ≤ 10 MB, audio duration ≤ 30 seconds

language

  • Type: string
  • Optional
  • Description: A hint for the primary language spoken in the audio. If omitted, mixed-language recognition is enabled.

prompt

  • Type: string
  • Optional
  • Description: In long-text scenarios, provide the previous transcription result as context to improve continuity. Recommended length is less than 60 characters.

response_format

  • Type: string
  • Optional, default json
  • Description: The format of the transcription result.
  • Options: json

Only the json response format is currently supported.


temperature

  • Type: number
  • Optional
  • Description: The sampling temperature, between 0 and 1. Lower values produce more deterministic transcriptions.

Unsupported Parameters

The following OpenAI audio/transcriptions parameters are not supported by this interface:

  • chunking_strategy
  • include
  • keywords
  • known_speaker_names
  • known_speaker_references
  • languages
  • timestamp_granularities
  • stream

Response Body

The response follows the OpenAI audio/transcriptions protocol Transcription object.

text

  • Type: string
  • Description: The complete transcribed text.

usage

  • Type: object
  • Description: Token usage statistics for the request.

usage.input_tokens

  • Type: integer
  • Description: Number of input tokens consumed, including audio and text tokens.

usage.output_tokens

  • Type: integer
  • Description: Number of output tokens generated.

usage.total_tokens

  • Type: integer
  • Description: Total number of tokens consumed (input_tokens + output_tokens).

usage.input_token_details

  • Type: object
  • Description: Breakdown of input tokens.
  • Fields:
    • audio_tokens — Number of tokens consumed by the audio input.
    • text_tokens — Number of tokens consumed by the text input (such as prompt).

model

  • Type: string
  • Description: The ID of the model used for this request.

id

  • Type: string
  • Description: The unique identifier of this transcription request.

Example


Request Example

curl --request POST \ --url https://api.ant-ling.com/v1/audio/transcriptions \ --header 'Authorization: Bearer <YOUR_API_KEY>' \ --form 'model="Ming-3.0-asr-tiny"' \ --form 'file=@"/path/to/hellow.wav"'

Response Example

{ "text": "Our vision is to build the digital infrastructure of the future service industry and bring more small and beautiful changes to the world", "usage": { "input_tokens": 223, "output_tokens": 20, "total_tokens": 243, "type": "tokens", "input_token_details": { "audio_tokens": 218, "text_tokens": 5 } }, "model": "Ming-3.0-asr-tiny", "id": "1eef022e1790004326841103485411" }
Was this page helpful?
Last updated on