{"record":{"id":"04ccb8eab42fad94","repo":"BoundaryML/baml","slug":"baml-internal-error-openai-responses-video-is-not-yet","errorCode":null,"errorMessage":"BAML internal error (openai-responses): video is not yet supported by OpenAI Responses API","messagePattern":"BAML internal error \\(openai-responses\\): video is not yet supported by OpenAI Responses API","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs","lineNumber":201,"sourceCode":"                    })),\n                    baml_types::BamlMediaContent::File(file_content) => {\n                        anyhow::bail!(\n                            \"BAML internal error (openai-responses): Local PDF files are not supported by OpenAI Responses API - use file_url for remote files or upload file and use file_id. File path: {:?}\",\n                            file_content.relpath\n                        );\n                    }\n                    baml_types::BamlMediaContent::Base64(b64_media) => Ok(json!({\n                        \"type\": \"input_file\",\n                        \"file_data\": format!(\n                            \"data:{};base64,{}\",\n                            media.mime_type_as_ok()?,\n                            b64_media.base64\n                        ),\n                        \"filename\": \"document.pdf\"\n                    })),\n                },\n                baml_types::BamlMediaType::Video => {\n                    anyhow::bail!(\n                        \"BAML internal error (openai-responses): video is not yet supported by OpenAI Responses API\"\n                    );\n                }\n            }\n        }\n        ChatMessagePart::WithMeta(inner_part, metadata) => {\n            let mut content = responses_content_part(inner_part, role, allowed_metadata)?;\n            {\n                let content_object = content.as_object_mut().ok_or_else(|| {\n                    anyhow::anyhow!(\n                        \"BAML internal error (openai-responses): content part must be an object\"\n                    )\n                })?;\n                for (key, value) in metadata {\n                    if allowed_metadata.is_allowed(key) {\n                        content_object.insert(key.clone(), value.clone());\n                    }\n                }","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs#L183-L219","documentation":"BAML's OpenAI Responses API converter rejects video media in a chat message part. The Responses API content-part builder in openai_client.rs only supports image/audio/document base64 media; video hits an explicit bail. This is a deliberate not-yet-implemented guard, not a transient failure.","triggerScenarios":"Calling a BAML client whose provider strategy is ResponsesApi (openai-responses) while the prompt contains a ChatMessagePart with BamlMediaType::Video (e.g. an image{ ... } block given a video file or a video URL passed as media).","commonSituations":"Developers migrating a prompt from chat completions to the new Responses API while still passing video media, or reusing a prompt with media blocks across providers where video was allowed.","solutions":["Remove video media from the prompt when targeting the OpenAI Responses API","Extract key frames from the video into images and pass those as image media instead","Switch the client back to the chat completions provider strategy, which routes video differently","Track BAML releases for Responses API video support before retrying"],"exampleFix":"// before (baml prompt targeting openai-responses)\nmedia { type video url ctx.video_url }\n// after\nmedia { type image url ctx.first_frame_url } // or use chat-completions provider","handlingStrategy":"validation","validationCode":"// before sending media to an openai-responses client\nif (media.type === \"video\") {\n  throw new Error(\"Video is not supported by the OpenAI Responses API; use images instead\");\n}","typeGuard":"function isSupportedResponsesMedia(m: { type: string }): boolean {\n  return [\"image\", \"audio\", \"document\"].includes(m.type);\n}","tryCatchPattern":null,"preventionTips":["Keep per-provider media support matrices next to your prompt definitions","Gate video media behind provider checks in prompt logic","Pin and review BAML changelogs for Responses API feature additions"],"tags":["openai","responses-api","video","unsupported-media"],"backgroundTag":"unsupported-operation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}