Speech-To-Text API Reference
This page covers all steps to integrate speech-to-text (STT) API into your system.
Get your API keys
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
You can generate an API key from your user dashboard in Miragic website anytime.

Authentication
All requests must include the X-API-Key header containing your assigned API key.
How To Create Image Generation Task
POST /api/v1/speech-to-text/generate
This API starts the STT process by creating a task that generates text content from audio file.
Request
file
File
Yes
Input audio.
audio_format
String
Yes
This value can be set to mp3, or wav.
question
String
Yes
This value is text to specify output content. default value is Transcribe this audio:
Request Example
Response
Response Field
jobId
String
A unique identifier used to track task status and retrieve results.
status
String
The initial status will be PENDING. Use the Get Task Status API to track progress.
message
String
To indicates the status of task.
success
Logic
true or false to indicate whether task is successful or not.
How To Get Task Status
GET /api/v1/speech-to-text/jobs/:jobId
This API lets you check the status of a STT task and retrieve the final result. Because the STT process runs asynchronously, you’ll need to poll this endpoint until the task is finished.
Task Status:
PENDING
Task is currently being processed.
0~99%
Continue polling
COMPLETED
Task has finished successfully.
100%
Download result using download_signed_url
FAILED
Task processing failed.
N/A
Check error details and retry if needed
Request:
URL Parameters
JobId
String
Yes
This value indicates task ID assigned by requesting STT process API
Request Example
Response Example
Completed Status (200):
Response Fields
id
String
Unique identifier of the task
status
String
Current status of the task (PENDING/COMPLETED/FAILED)
transcription
String
text content from audio file.
createdAt
Number
Unix timestamp when processing is created
userId
String
Unique identifier of the user
Full Code Example
The following code lines are quick example to use our API in multiple languages.
Last updated