BoundaryML/baml · error · anyhow::Error

BAML internal error (openai-responses): video is not yet sup

Error message

BAML internal error (openai-responses): video is not yet supported by OpenAI Responses API

What it means

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.

Source

Thrown at engine/baml-runtime/src/internal/llm_client/primitive/openai/openai_client.rs:201

                    })),
                    baml_types::BamlMediaContent::File(file_content) => {
                        anyhow::bail!(
                            "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: {:?}",
                            file_content.relpath
                        );
                    }
                    baml_types::BamlMediaContent::Base64(b64_media) => Ok(json!({
                        "type": "input_file",
                        "file_data": format!(
                            "data:{};base64,{}",
                            media.mime_type_as_ok()?,
                            b64_media.base64
                        ),
                        "filename": "document.pdf"
                    })),
                },
                baml_types::BamlMediaType::Video => {
                    anyhow::bail!(
                        "BAML internal error (openai-responses): video is not yet supported by OpenAI Responses API"
                    );
                }
            }
        }
        ChatMessagePart::WithMeta(inner_part, metadata) => {
            let mut content = responses_content_part(inner_part, role, allowed_metadata)?;
            {
                let content_object = content.as_object_mut().ok_or_else(|| {
                    anyhow::anyhow!(
                        "BAML internal error (openai-responses): content part must be an object"
                    )
                })?;
                for (key, value) in metadata {
                    if allowed_metadata.is_allowed(key) {
                        content_object.insert(key.clone(), value.clone());
                    }
                }

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Remove video media from the prompt when targeting the OpenAI Responses API
  2. Extract key frames from the video into images and pass those as image media instead
  3. Switch the client back to the chat completions provider strategy, which routes video differently
  4. Track BAML releases for Responses API video support before retrying

Example fix

// before (baml prompt targeting openai-responses)
media { type video url ctx.video_url }
// after
media { type image url ctx.first_frame_url } // or use chat-completions provider
Defensive patterns

Strategy: validation

Validate before calling

// before sending media to an openai-responses client
if (media.type === "video") {
  throw new Error("Video is not supported by the OpenAI Responses API; use images instead");
}

Type guard

function isSupportedResponsesMedia(m: { type: string }): boolean {
  return ["image", "audio", "document"].includes(m.type);
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/04ccb8eab42fad94. Report an issue: GitHub.