🦋
SYNAPSE API
  • 📚SYNAPSE
  • Services
    • 💬Language Models
    • 🎨Stable Diffusion
    • 🖼️Stable Diffusion XL
    • 🛝Playground
    • 👨‍🎨DALL-E-3
    • 🎤Whisper
    • 🗣️Text To Speech
  • Info
    • ⛓️Limits
    • ❓Support
    • 🔑API Key
    • 👑Premium
Powered by GitBook
On this page
  1. Services

Whisper

OpenAI's Whisper transcription model

Create a new user

POST /whisper

Transcribe audio

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description
Default

audio

string

Base64 audio

none

language

number

Audio lang | Auto

none

Response

{
  "text": "The beach was a popular spot on a hot summer day. People were swimming in the ocean, building sandcastles, and playing beach volleyball.",
  "segments": [
    {
      "id": 0,
      "seek": 0,
      "start": 0.0,
      "end": 3.319999933242798,
      "text": "The beach was a popular spot on a hot summer day.",
      "tokens": [
        50364, 440, 7534, 390, 257, 3743, 4008, 322, 257, 2368, 4266, 786, 13, 50530
      ],
      "temperature": 0.0,
      "avg_logprob": -0.2860786020755768,
      "compression_ratio": 1.2363636493682861,
      "no_speech_prob": 0.00985979475080967
    },
    ...
  ],
  "language": "english"
  "input_length_ms": 1278
}
{
  "error": "Invalid request"
}
{
  "error": "Error during transcription"
}

Example

const res = await fetch('https://synapselabs.onrender.com/whisper', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your_api_key>'
  },
  body: JSON.stringify({
    audio: fs.readFileSync('demo.mp3', 'base64');
  }),
});

const data = await res.json();
console.log(data.text); //"This is a demo of OpenAI's Whisper transcription model"
PreviousDALL-E-3NextText To Speech

Last updated 1 year ago

🎤