Skip to main content

Audio

Transcribe audio

Speech to text from an audio file sent as multipart/form-data.

posthttps://api.pre.dev/v1/audio/transcriptionsTry it
curl --fail-with-body https://api.pre.dev/v1/audio/transcriptions \  -H "Authorization: Bearer $PREDEV_API_KEY" \  -F "model=openai/whisper-large-v3" \  -F "file=@meeting.m4a"
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.pre.dev/v1", api_key=os.environ["PREDEV_API_KEY"])with open("meeting.m4a", "rb") as audio:    transcript = client.audio.transcriptions.create(model="openai/whisper-large-v3", file=audio)print(transcript.text)
const body = new FormData();body.set(file, "string")body.set(model, "string")fetch("https://api.pre.dev/v1/audio/transcriptions", {  method: "POST",  headers: {    "Content-Type": "multipart/form-data"  },  body})
package mainimport (  "fmt"  "net/http"  "io/ioutil"  "mime/multipart"  "bytes")func main() {  url := "https://api.pre.dev/v1/audio/transcriptions"  body := new(bytes.Buffer)  mp := multipart.NewWriter(payload)  mp.WriteField("file", `string`)  mp.WriteField("model", `string`)  req, _ := http.NewRequest("POST", url, body)  req.Header.Add("Content-Type", "multipart/form-data")  res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.net.http.HttpResponse.BodyHandlers;import java.time.Duration;import java.net.http.HttpRequest.BodyPublishers;var body = BodyPublishers.ofByteArray(new byte[] { ... });HttpClient client = HttpClient.newBuilder()  .connectTimeout(Duration.ofSeconds(10))  .build();HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()  .uri(URI.create("https://api.pre.dev/v1/audio/transcriptions"))  .header("Content-Type", "multipart/form-data")  .POST(body)  .build();try {  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());  System.out.println("Status code: " + response.statusCode());  System.out.println("Response body: " + response.body());} catch (Exception e) {  e.printStackTrace();}
using System;using System.Net.Http;using System.Text;var body = new MultipartFormDataContent();var client = new HttpClient();var response = await client.PostAsync("https://api.pre.dev/v1/audio/transcriptions", body);var responseBody = await response.Content.ReadAsStringAsync();
use reqwest::{Result, Client};async fn main() -> Result<()> {  let client = Client::new();  let url = "https://api.pre.dev/v1/audio/transcriptions";  let res = client    .post(url)    .header("Content-Type", "multipart/form-data")    .send()    .await?    .text()    .await?;  println!("{}", res);  Ok(())}
{  "text": "Welcome to the Monday planning call."}
POST
/v1/audio/transcriptions

Authorization

AuthorizationBearer <token>

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

In: header

Header Parameters

x-predev-project-id?string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

The transcript.

TypeScript Definitions

Use the response body type in TypeScript.

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Was this page helpful?