Frequently Asked Question

Transcribe - Convert audio file to text and optionally summarise
Last Updated 8 days ago

Transcribe API

Overview

The Transcribe API converts audio files to text using speech recognition technology. It also offers an optional summarisation feature.

Version

1.001

Endpoint

/v2/transcribe

Authentication

This API requires authentication using an API key. The key should be passed in the X_API_KEY header.

Request

The API accepts a multipart/form-data POST request with the following parameters:

ParameterTypeRequiredDescription
audiofileYesThe audio file to transcribe.
summarisebooleanNoWhether to generate a summary of the transcribed text. Default is false.
summarisewithstringNoA prompt to perform the summarisation

Response

The API returns a JSON object with the following structure:

FieldTypeDescription
statusstringThe status of the request. Possible values: "success" or "error".
filenamestringThe name of the uploaded audio file.
transcriptionstringThe transcribed text from the audio file. Only present if status is "success".
languagestringThe language of the transcription (currently defaults to 'en'). Only present if status is "success".
durationfloatThe processing time in seconds. Only present if status is "success".
summarystringA summary of the transcribed content. Only present if summarise parameter was set to true and the summarization was successful.
messagestringError message explaining what went wrong. Only present if status is "error".
error_codeintegerThe PHP upload error code. Only present if status is "error" and there was a file upload issue.
error_detailsstringA detailed explanation of the upload error. Only present if status is "error" and there was a file upload issue.

Example Response (Success)


{
  "status": "success",
  "filename": "meeting_recording.mp3",
  "transcription": "Welcome to our annual conference on artificial intelligence and machine learning. Today, we'll be discussing the latest advancements in natural language processing.",
  "language": "en",
  "duration": 12.5,
  "summary": "This is a conference introduction about AI and machine learning, focusing on recent developments in NLP."
}

Example Response (Error)


{
  "status": "error",
  "message": "File upload failed",
  "error_code": 1,
  "error_details": "The uploaded file exceeds the upload_max_filesize directive in php.ini"
}

Error Handling

  • If the request method is not POST, the API will return an error.
  • If the API key is invalid or the user is not found, the response will contain the validation status.
  • If the file upload fails, the API will return an error with details about what went wrong.
  • If the transcription service encounters an error, the API will return an error with the specific message.

Notes

Transcription is billed per second of transcription time, that is, if it takes 1 minute to transcribe a long conversation, 60 x the second rate is charged. 

When summarisation is requested, the API makes an additional call to the LLM API to generate a summary of the transcribed text, and this additional request will consume API credit.

summarisewith should be a LLM prompt that expects the transcription to be embedded. Keep this terse and direct for best results. 

Security

  • Ensure that the API key is kept secure and not exposed in client-side code.
  • All responses are sent with the "Content-Type: application/json" header.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.
OK
Powered by GEN UK CLEAN GREEN ENERGY

Loading ...