fix(relay): wrap transcription config in session object

The OpenAI client_secrets endpoint expects the body as
{ session: { type, audio: { input: { transcription, turn_detection } } } }
not as top-level fields. Also moves turn_detection under audio.input per
the Realtime transcription guide.

Signed-off-by: klopez4212 <klopez4212@gmail.com>
This commit is contained in:
klopez4212
2026-07-11 16:18:08 +01:00
parent 586d0de244
commit ed463c73bf
+10 -8
View File
@@ -81,16 +81,18 @@ pub async fn create_transcribe_session(
.header("Authorization", format!("Bearer {api_key}"))
.header("Content-Type", "application/json")
.json(&serde_json::json!({
"type": "transcription",
"audio": {
"input": {
"transcription": {
"model": model,
"session": {
"type": "transcription",
"audio": {
"input": {
"transcription": {
"model": model,
},
"turn_detection": {
"type": "server_vad",
}
}
}
},
"turn_detection": {
"type": "server_vad",
}
}))
.timeout(std::time::Duration::from_secs(10))