Prompt

How do I add speech-to-text to my app using an API?

Artificial Intelligence / AI Platforms2 observationsLast seen Nov 1, 2026

Latest observation

Nov 1, 2026OpenAI APIWeb search: off

To add speech-to-text to your app using an API, the basic flow is:

  1. Record audio in your app
  2. Send the audio file/stream to a speech-to-text API
  3. Receive the transcript
  4. Display or process the text in your app

1) Choose an API

Common options include:

  • OpenAI Whisper / transcription APIs
  • Google Cloud Speech-to-Text
  • AWS Transcribe
  • Azure Speech to Text
  • AssemblyAI
  • Deepgram

Pick based on:

  • Languages supported
  • Real-time vs batch transcription
  • Pricing
  • Accuracy in your use case
  • Whether you need speaker diarization, punctuation, timestamps, etc.

2) Capture audio in your app

You need audio in a format the API accepts, often:

  • mp3
  • wav
  • m4a
  • webm
  • flac

If you’re building a browser app, you can use:

  • MediaRecorder in JavaScript
  • microphone permissions via getUserMedia()

3) Send the audio to the API

Usually this is done with an HTTP POST request as multipart form data.

Example: JavaScript frontend with fetch

async function transcribeAudio(file) {
  const formData = new FormData();
  formData.append("file", file);
  formData.append("model", "whisper-1"); // example, depends on provider

  const response = await fetch("https://api.example.com/transcribe", {
    method: "POST",
    headers: {
      Authorization: `Bearer YOUR_API_KEY`,
    },
    body: formData,
  });

  const data = await response.json();
  console.log(data.text);
}

4) Handle the response

Most APIs return something like:

{
  "text": "Hello, this is a test transcription."
}

You can then:

  • Show it in a text box
  • Save it to your database
  • Send it to another AI feature
  • Use it for search, notes, captions, etc.

5) Example backend pattern

It’s usually better to call the speech-to-text API from your server, not directly from the frontend, so your API key stays private.

Node.js example

import express from "express";
import multer from "multer";
import fs from "fs";
import fetch from "node-fetch";

const app = express();
const upload = multer({ dest: "uploads/" });

app.post("/transcribe", upload.single("audio"), async (req, res) => {
  try {
    const fileStream = fs.createReadStream(req.file.path);

    const formData = new FormData();
    formData.append("file", fileStream);
    formData.append("model", "whisper-1");

    const response = await fetch("https://api.example.com/transcribe", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}`,
      },
      body: formData,
    });

    const data = await response.json();
    res.json(data);
  } catch (err) {
    res.status(500).json({ error: "Transcription failed" });
  }
});

app.listen(3000);

6) Things to watch for

  • File size limits
  • Audio format requirements
  • Latency for real-time transcription
  • Cost per minute
  • Privacy/compliance if you’re handling sensitive audio
  • Background noise and microphone quality

7) If you need real-time speech-to-text

Use a streaming API or WebSocket-based service. This is better for:

  • Live captions
  • Voice assistants
  • Call transcription

Instead of uploading a full file, you send small audio chunks and receive partial transcripts as the user speaks.


If you want, I can give you a working example for:

  • JavaScript/React
  • Python/Flask
  • Node.js/Express
  • mobile app (iOS/Android)

and I can tailor it to a specific speech-to-text API too.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.