You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrations/llms/groq.mdx
+125Lines changed: 125 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,6 +214,131 @@ curl -X POST "https://api.portkey.ai/v1/chat/completions" \
214
214
215
215
216
216
217
+
218
+
219
+
220
+
221
+
### Groq Speech to Text (Whisper)
222
+
223
+
OpenAI's Audio API converts speech to text using the Whisper model. It offers transcription in the original language and translation to English, supporting multiple file formats and languages with high accuracy.
curl -X POST "https://api.portkey.ai/v1/audio/transcriptions" \
271
+
-H "Authorization: Bearer YOUR_PORTKEY_API_KEY" \
272
+
-H "Content-Type: multipart/form-data" \
273
+
-F "file=@/path/to/file.mp3" \
274
+
-F "model=whisper-large-v3"
275
+
276
+
# Translation
277
+
curl -X POST "https://api.portkey.ai/v1/audio/translations" \
278
+
-H "Authorization: Bearer YOUR_PORTKEY_API_KEY" \
279
+
-H "Content-Type: multipart/form-data" \
280
+
-F "file=@/path/to/file.mp3" \
281
+
-F "model=whisper-large-v3"
282
+
```
283
+
</CodeGroup>
284
+
285
+
286
+
---
287
+
288
+
### Groq Text to Speech
289
+
290
+
Groq's Text to Speech (TTS) API converts written text into natural-sounding audio using six distinct voices. It supports multiple languages, streaming capabilities, and various audio formats for different use cases.
input="Today is a wonderful day to build something people love!"
301
+
)
302
+
303
+
withopen(speech_file_path, "wb") as f:
304
+
f.write(response.content)
305
+
```
306
+
307
+
```javascript Node.js
308
+
importpathfrom'path';
309
+
importfsfrom'fs';
310
+
311
+
constspeechFile=path.resolve("./speech.mp3");
312
+
313
+
asyncfunctionmain() {
314
+
constmp3=awaitportkey.audio.speech.createCertainly!I'll continue with the Text to Speech section and then move on to the additional features and sections:
315
+
316
+
```javascript Node.js
317
+
({
318
+
model: "playai-tts",
319
+
voice: "Fritz-PlayAI",
320
+
input: "Today is a wonderful day to build something people love!",
0 commit comments