{"record":{"id":"b1f7d8db1de19066","repo":"BoundaryML/baml","slug":"baml-internal-error-openai-transcriptions-multipart-body","errorCode":null,"errorMessage":"BAML internal error (openai-transcriptions): multipart body construction is not wired","messagePattern":"BAML internal error \\(openai-transcriptions\\): multipart body construction is not wired","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs","lineNumber":249,"sourceCode":"            ProviderStrategy::StandardOpenAI { .. } => {\n                if is_completion {\n                    format!(\"{base_url}/completions\")\n                } else {\n                    format!(\"{base_url}/chat/completions\")\n                }\n            }\n        }\n    }\n\n    fn build_body(\n        &self,\n        prompt: either::Either<&String, &[RenderedChatMessage]>,\n        properties: &BamlMap<String, serde_json::Value>,\n        chat_converter: &impl ToProviderMessageExt,\n    ) -> Result<serde_json::Value> {\n        match self {\n            ProviderStrategy::TranscriptionsApi => {\n                anyhow::bail!(\n                    \"BAML internal error (openai-transcriptions): multipart body construction is not wired\"\n                );\n            }\n            ProviderStrategy::ResponsesApi => {\n                // Start with all properties passed through\n                let mut body = properties.clone();\n\n                let input = match prompt {\n                    either::Either::Left(prompt) => {\n                        // For simple string prompts, pass directly as string\n                        json!(prompt)\n                    }\n                    either::Either::Right(messages) => {\n                        let structured_messages: Result<Vec<_>> = messages\n                            .iter()\n                            .map(|msg| {\n                                // Convert message parts to Responses API format\n                                let content_parts: Result<Vec<_>> = msg","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs#L231-L267","documentation":"The OpenAI transcriptions strategy in build_body is explicitly unwired: multipart body construction (required by /v1/audio/transcriptions) has not been implemented and bails immediately. It is a placeholder for future work, so any request routed to ProviderStrategy::TranscriptionsApi fails.","triggerScenarios":"Any LLM call whose client resolves to ProviderStrategy::TranscriptionsApi (openai transcriptions endpoint), because build_body has no multipart implementation.","commonSituations":"Configuring a BAML openai client with a transcriptions endpoint/strategy expecting BAML to handle audio file upload, before the feature exists.","solutions":["Do not route LLM calls through the TranscriptionsApi strategy; call the transcription endpoint outside BAML","Use the chat completions or responses strategy with audio encoded as input_audio media instead","Check BAML releases for multipart transcriptions support","File/track a BAML feature request for multipart body wiring"],"exampleFix":"// before\nprovider baml-openai { options { api_strategy \"transcriptions\" } }\n// after\nprovider baml-openai { options { api_strategy \"chat-completions\" } } // pass audio as input_audio media","handlingStrategy":"fallback","validationCode":"// fail fast if the client targets an unimplemented strategy\nif (client.provider.includes(\"transcriptions\")) {\n  throw new Error(\"Use a chat-completions client or call /v1/audio/transcriptions directly\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not select the transcriptions api_strategy in BAML openai clients","Implement transcription calls in application code outside BAML","Check BAML docs for supported strategies before configuring"],"tags":["openai","transcriptions","multipart","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}