Skip to main content

openai_transcription

Generates a transcription of spoken audio in the input language, using the OpenAI API.

This processor sends an audio file object along with the input language to the OpenAI API and returns a text transcription. By default it submits the entire message payload, unless you use the file field to customize what is sent.

# Config fields, showing default values
processor:
label: ""
openai_transcription:
api_key: "" # No default (required)
file: "" # No default (required)
language: ""
model: "" # No default (required)
prompt: ""
server_address: https://api.openai.com/v1

Examples

Transcribe the full message payload using a chosen model.

processor:
openai_transcription:
server_address: https://api.openai.com/v1
api_key: "${OPENAI_API_KEY}"
model: whisper-1
file: 'root = content()'

Fields

api_key

The API key for the OpenAI API. :::warning Secret This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info. :::

Type: string

file

The audio file object (not file name) to transcribe, in one of the following formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

Type: string

language

The language of the input audio. Supplying the input language in ISO-639-1 format improves accuracy and latency. This field supports interpolation functions.

Type: string
Default: ""

model

The name of the OpenAI model to use.

Type: string

prompt

Optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language. This field supports interpolation functions.

Type: string
Default: ""

server_address

The OpenAI API endpoint that the processor sends requests to. Set this to target another OpenAI-compatible service.

Type: string
Default: "https://api.openai.com/v1"