Voice to Text API

Category: voice2text

Upload an audio file and transcribe it to text using OpenAI Whisper. Supports MP3, WAV, M4A, OGG, FLAC and more.

Endpoint

POST
No Server API Content-Type: multipart/form-data

Request Parameters

Name Type Required Description
file file Required The audio file to transcribe
Example: recording.mp3

Response

Content-Type: 200 OK

Returns the transcribed text from the audio file.

{
  "text": "Hello, this is a sample transcription of the uploaded audio file."
}

cURL Example

curl -X POST https://anythingtext.com/api/tools/voice2text \
  -H "X-API-Key: atk_your_key_here" \
  -F "file=@recording.mp3"

Code Samples

const formData = new FormData();
formData.append('file', audioFile);

const res = await fetch('/api/tools/voice2text', {
    method: 'POST',
    headers: { 'X-API-Key': 'atk_your_key_here' },
    body: formData
});
const data = await res.json();
console.log(data.text);
import requests

with open('recording.mp3', 'rb') as f:
    res = requests.post('https://anythingtext.com/api/tools/voice2text',
        headers={'X-API-Key': 'atk_your_key_here'},
        files={'file': f})
print(res.json()['text'])
// Use Java HttpClient with multipart body
var client = HttpClient.newHttpClient();
var body = new MultipartBodyBuilder()
    .addFilePart("file", audioPath)
    .build();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://anythingtext.com/api/tools/voice2text"))
    .header("X-API-Key", "atk_your_key_here")
    .POST(body)
    .build();