{"record":{"id":"f690071d8c3c91d5","repo":"BoundaryML/baml","slug":"video-input-is-not-yet-supported-by-anthropic-claude-models","errorCode":null,"errorMessage":"Video input is not yet supported by Anthropic Claude models. Consider extracting frames from the video as images instead. See: https://docs.anthropic.com/en/docs/vision","messagePattern":"Video input is not yet supported by Anthropic Claude models\\. Consider extracting frames from the video as images instead\\. See: https://docs\\.anthropic\\.com/en/docs/vision","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/anthropic/anthropic_client.rs","lineNumber":416,"sourceCode":"                        content.insert(\"source\".into(), source.into());\n                    }\n                    BamlMediaContent::Url(url) => {\n                        content.insert(\"type\".into(), \"document\".into());\n                        let mut source = serde_json::Map::new();\n                        source.insert(\"type\".into(), \"url\".into());\n                        source.insert(\"url\".into(), url.url.clone().into());\n                        content.insert(\"source\".into(), source.into());\n                    }\n                    BamlMediaContent::File(_) => {\n                        anyhow::bail!(\n                            \"BAML internal error (Anthropic): file should have been resolved to base64\"\n                        )\n                    }\n                }\n            }\n            baml_types::BamlMediaType::Video => {\n                // Anthropic does not support video yet\n                anyhow::bail!(\n                    \"Video input is not yet supported by Anthropic Claude models. \\\n                    Consider extracting frames from the video as images instead. \\\n                    See: https://docs.anthropic.com/en/docs/vision\"\n                );\n            }\n        }\n        Ok(content)\n    }\n\n    fn role_to_message(\n        &self,\n        content: &RenderedChatMessage,\n    ) -> Result<serde_json::Map<String, serde_json::Value>> {\n        let mut map = serde_json::Map::new();\n        map.insert(\"role\".into(), content.role.clone().into());\n        map.insert(\n            \"content\".into(),\n            json!(self.parts_to_message(&content.parts)?),","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/anthropic/anthropic_client.rs#L398-L434","documentation":"Anthropic's API does not accept video input, so BAML proactively rejects any video media targeted at an Anthropic client with this explanatory error, pointing to Anthropic's vision docs. The request is never sent.","triggerScenarios":"Passing b.Video / a BamlMediaType::Video media into a BAML function whose client is Anthropic (to_media_message hits the Video arm and bails).","commonSituations":"Building a multimodal pipeline that works with OpenAI (or Gemini) video inputs and switching the client to Claude; users assuming Claude accepts video because it accepts images/PDFs.","solutions":["Extract frames from the video into images and send them as image media","Use a provider that supports video (e.g. Gemini/OpenAI) for video inputs","Route video-containing calls to a non-Anthropic client via BAML strategy/fallback configuration","Follow Anthropic's vision docs for supported media types"],"exampleFix":"// before\nawait b.functions.Describe({ video: b.Video.fromUrl('...', 'video/mp4') }); // anthropic client\n// after\nconst frames = extractFrames('./clip.mp4', { fps: 1 });\nawait b.functions.Describe({ images: frames.map(f => b.Image.fromBase64('image/jpeg', f.toString('base64'))) });","handlingStrategy":"validation","validationCode":"function assertNoVideoForAnthropic(media, provider) {\n  if (provider === 'anthropic' && media && media.kind === 'video')\n    throw new Error('Anthropic does not accept video; extract frames instead');\n}","typeGuard":"const isVideo = (m) => m != null && (m.kind === 'video' || String(m.media_type||'').startsWith('video/'));","tryCatchPattern":"try {\n  return await b.functions.Describe(payload);\n} catch (e) {\n  if (/Video input is not yet supported/.test(String(e))) {\n    return describeViaFrames(extractFrames(payload.video));\n  }\n  throw e;\n}","preventionTips":["Check provider media support matrix before adding multimodal inputs","Extract video frames to images for Claude workflows","Route video workloads to providers with video support (Gemini, OpenAI)","Centralize media-type routing per provider in one helper"],"tags":["anthropic","video","unsupported-media","multimodal"],"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"}