Implementation:Groq Groq python Transcriptions Create
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Audio, Speech_Recognition |
| Last Updated | 2026-02-15 16:00 GMT |
Overview
Concrete tool for submitting audio transcription requests to Groq-hosted Whisper models provided by the Groq Python SDK.
Description
The Transcriptions.create() method sends an audio file to the Groq API endpoint /openai/v1/audio/transcriptions as a multipart form upload. It returns a Transcription object containing the transcribed text. The method supports both file uploads and URL-based audio references.
Usage
Access via client.audio.transcriptions.create(). Provide the audio file and model identifier. Optionally specify language, prompt, response format, and timestamp granularity.
Code Reference
Source Location
- Repository: groq-python
- File: src/groq/resources/audio/transcriptions.py
- Lines: L47-241 (sync), L264-458 (async)
Signature
class Transcriptions(SyncAPIResource):
def create(
self,
*,
model: Union[str, Literal["whisper-large-v3", "whisper-large-v3-turbo"]],
file: FileTypes | Omit = omit,
language: Union[str, Literal["en", "zh", "de", "es", "fr", "ja", ...]] | Omit = omit,
prompt: str | Omit = omit,
response_format: Literal["json", "text", "verbose_json"] | Omit = omit,
temperature: float | Omit = omit,
timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit,
url: str | Omit = omit,
) -> Transcription:
Import
from groq import Groq
# Access via: client.audio.transcriptions.create(...)
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| model | str or Literal["whisper-large-v3", "whisper-large-v3-turbo"] | Yes | Whisper model ID |
| file | FileTypes | No | Audio file (not file name); either file or url required |
| url | str | No | Audio URL (Base64URL supported); either file or url required |
| language | str | No | ISO-639-1 language code for improved accuracy |
| prompt | str | No | Optional text to guide transcription style |
| response_format | Literal["json", "text", "verbose_json"] | No | Output format |
| temperature | float | No | Sampling temperature for transcription |
| timestamp_granularities | List[Literal["word", "segment"]] | No | Timestamp detail level |
Outputs
| Name | Type | Description |
|---|---|---|
| (return) | Transcription | Object with .text field containing the transcribed text |
Usage Examples
Basic Transcription
from groq import Groq
client = Groq()
with open("interview.mp3", "rb") as audio_file:
transcription = client.audio.transcriptions.create(
file=audio_file,
model="whisper-large-v3",
)
print(transcription.text)
With Language and Prompt
transcription = client.audio.transcriptions.create(
file=open("meeting.wav", "rb"),
model="whisper-large-v3-turbo",
language="en",
prompt="Technical discussion about machine learning and LLMs",
response_format="verbose_json",
timestamp_granularities=["segment"],
)
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment