{"record":{"id":"a2477ea526555f8b","repo":"vercel/ai","slug":"provideroptions-elevenlabs-streaming-filterbackgro","errorCode":null,"errorMessage":"providerOptions.elevenlabs.streaming.filterBackgroundAudio cannot be combined with includeTimestamps or includeLanguageDetection","messagePattern":"providerOptions\\.elevenlabs\\.streaming\\.filterBackgroundAudio cannot be combined with includeTimestamps or includeLanguageDetection","errorType":"validation","errorClass":"InvalidArgumentError","httpStatus":null,"severity":"error","filePath":"packages/elevenlabs/src/elevenlabs-transcription-model.ts","lineNumber":281,"sourceCode":"      ) {\n        warnings.push({\n          type: 'unsupported',\n          feature: `providerOptions.elevenlabs.${option}`,\n          details: `ElevenLabs realtime transcription does not support ${option}.`,\n        });\n      }\n    }\n\n    // ElevenLabs documents filter_background_audio as incompatible with\n    // include_timestamps. Language detection is delivered on the same\n    // timestamp-bearing event, so it also requires include_timestamps here.\n    // https://elevenlabs.io/docs/api-reference/speech-to-text/v-1-speech-to-text-realtime\n    if (\n      streamingOptions?.filterBackgroundAudio === true &&\n      (streamingOptions.includeTimestamps === true ||\n        streamingOptions.includeLanguageDetection === true)\n    ) {\n      throw new InvalidArgumentError({\n        argument: 'providerOptions',\n        message:\n          'providerOptions.elevenlabs.streaming.filterBackgroundAudio cannot be combined with includeTimestamps or includeLanguageDetection',\n      });\n    }\n\n    const inputFormat = getElevenLabsRealtimeAudioFormat(\n      options.inputAudioFormat,\n    );\n    const url = buildElevenLabsRealtimeTranscriptionUrl({\n      baseUrl: toWebSocketUrl(\n        this.config.url({\n          path: '/v1/speech-to-text/realtime',\n          modelId: this.modelId,\n        }),\n      ),\n      inputFormat: inputFormat.audioFormat,\n      languageCode: elevenLabsOptions?.languageCode ?? undefined,","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/elevenlabs/src/elevenlabs-transcription-model.ts#L263-L299","documentation":"InvalidArgumentError thrown by doStream when providerOptions.elevenlabs.streaming.filterBackgroundAudio is true while includeTimestamps or includeLanguageDetection is also true. The ElevenLabs realtime speech-to-text API does not allow combining background-audio filtering with timestamps or language detection in one stream.","triggerScenarios":"Passing providerOptions: { elevenlabs: { streaming: { filterBackgroundAudio: true, includeTimestamps: true } } } (or includeLanguageDetection: true) to a realtime transcription doStream call.","commonSituations":"Developers enable all realtime options at once for better quality without knowing the API-level incompatibility documented in the ElevenLabs realtime speech-to-text docs.","solutions":["Remove filterBackgroundAudio: true if you need timestamps or language detection.","Or remove includeTimestamps/includeLanguageDetection if background-audio filtering is required.","Run two passes (one filtered, one with timestamps) if you need both capabilities."],"exampleFix":"// before\nproviderOptions: { elevenlabs: { streaming: { filterBackgroundAudio: true, includeTimestamps: true } } }\n// after\nproviderOptions: { elevenlabs: { streaming: { includeTimestamps: true } } }","handlingStrategy":"validation","validationCode":"const s = providerOptions?.elevenlabs?.streaming;\nif (s?.filterBackgroundAudio === true && (s.includeTimestamps === true || s.includeLanguageDetection === true)) {\n  throw new Error('filterBackgroundAudio cannot be combined with includeTimestamps or includeLanguageDetection');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await model.doStream(options);\n} catch (e) {\n  if (InvalidArgumentError.isInstance?.(e) || (e as Error).message.includes('filterBackgroundAudio')) {\n    // strip the conflicting option and retry\n  }\n  throw e;\n}","preventionTips":["Validate providerOptions against an app-level schema before each request.","Document mutually exclusive realtime options in your options-builder UI/API.","Read the ElevenLabs realtime speech-to-text API reference for option constraints."],"tags":["elevenlabs","provider-options","invalid-argument","validation"],"backgroundTag":"incompatible-options-combination","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}