{"record":{"id":"0dd46512011cbe84","repo":"BoundaryML/baml","slug":"openai-transcription-response-format-value-is-not-supported","errorCode":null,"errorMessage":"OpenAI transcription response_format `{value}` is not supported by model `{model}` in BAML; use `json`","messagePattern":"OpenAI transcription response_format `(.+?)` is not supported by model `(.+?)` in BAML; use `json`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/openai/types.rs","lineNumber":198,"sourceCode":"    }\n}\n\nfn optional_response_format(\n    properties: &BamlMap<String, Value>,\n    model: &str,\n) -> Result<Option<String>> {\n    match properties.get(\"response_format\") {\n        Some(Value::String(value))\n            if value == \"json\"\n                || (value == \"verbose_json\"\n                    && !matches!(\n                        model,\n                        \"gpt-4o-transcribe\"\n                            | \"gpt-4o-mini-transcribe\"\n                            | \"gpt-4o-mini-transcribe-2025-12-15\"\n                            | \"gpt-4o-transcribe-diarize\"\n                    )) => Ok(Some(value.clone())),\n        Some(Value::String(value)) => bail!(\n            \"OpenAI transcription response_format `{value}` is not supported by model `{model}` in BAML; use `json`\"\n        ),\n        Some(_) => bail!(\"OpenAI transcription field `response_format` must be a string\"),\n        None => Ok(None),\n    }\n}\n\nfn optional_temperature(properties: &BamlMap<String, Value>) -> Result<Option<String>> {\n    match properties.get(\"temperature\") {\n        Some(Value::Number(value)) => Ok(Some(value.to_string())),\n        Some(Value::String(value)) => Ok(Some(value.clone())),\n        Some(_) => bail!(\"OpenAI transcription field `temperature` must be a number or string\"),\n        None => Ok(None),\n    }\n}\n\nfn filename_for_mime(mime: &str) -> String {\n    let subtype = mime","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/openai/types.rs#L180-L216","documentation":"For the gpt-4o-transcribe family of models, BAML only supports response_format \"json\"; any other string value (e.g. \"text\" or \"verbose_json\") is rejected at client-construction time because BAML cannot parse those responses. This is a BAML-side restriction, not an OpenAI API error.","triggerScenarios":"Setting response_format to a string other than \"json\" while the model is one of gpt-4o-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, or gpt-4o-transcribe-diarize.","commonSituations":"Copying a whisper-style config that used response_format \"text\" or \"verbose_json\" and switching the model to gpt-4o-transcribe, or explicitly requesting plain-text output from a diarize model.","solutions":["Set response_format \"json\" in the client properties.","Remove the response_format property entirely so BAML uses its default handling.","If you need plain text, keep response_format json and extract the text field from the parsed result."],"exampleFix":"// before\nmodel \"gpt-4o-transcribe\"\nresponse_format \"text\"\n\n// after\nmodel \"gpt-4o-transcribe\"\nresponse_format \"json\"","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['gpt-4o-transcribe', 'gpt-4o-mini-transcribe', 'gpt-4o-mini-transcribe-2025-12-15', 'gpt-4o-transcribe-diarize']);\nif (SUPPORTED.has(props.model) && props.response_format !== undefined && props.response_format !== 'json') {\n  throw new Error(`response_format must be \"json\" for ${props.model}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await baml.transcribe(...);\n} catch (e) {\n  if (String(e).includes('response_format') && String(e).includes('not supported')) {\n    console.error('Switch response_format to \"json\" for gpt-4o transcription models');\n  }\n  throw e;\n}","preventionTips":["Use response_format \"json\" whenever the model is in the gpt-4o-transcribe family.","Omit response_format entirely for these models unless you specifically need json.","Update old whisper-style configs (text/verbose_json) when migrating models."],"tags":["config","openai","transcription","unsupported-value"],"backgroundTag":"unsupported-enum-value","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"}