{"record":{"id":"976d620c07c25b66","repo":"vercel/ai","slug":"provider-is-no-longer-needed-in-streamui-use","errorCode":null,"errorMessage":"`provider` is no longer needed in `streamUI`. Use `model` instead.","messagePattern":"`provider` is no longer needed in `streamUI`\\. Use `model` instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/rsc/src/stream-ui/stream-ui.tsx","lineNumber":190,"sourceCode":"         * Response headers.\n         */\n        headers?: Record<string, string>;\n      };\n    }) => Promise<void> | void;\n  }): Promise<RenderResult> {\n  // TODO: Remove these errors after the experimental phase.\n  if (typeof model === 'string') {\n    throw new Error(\n      '`model` cannot be a string in `streamUI`. Use the actual model instance instead.',\n    );\n  }\n  if ('functions' in settings) {\n    throw new Error(\n      '`functions` is not supported in `streamUI`, use `tools` instead.',\n    );\n  }\n  if ('provider' in settings) {\n    throw new Error(\n      '`provider` is no longer needed in `streamUI`. Use `model` instead.',\n    );\n  }\n  if (tools) {\n    for (const [name, tool] of Object.entries(tools)) {\n      if ('render' in tool) {\n        throw new Error(\n          'Tool definition in `streamUI` should not have `render` property. Use `generate` instead. Found in tool: ' +\n            name,\n        );\n      }\n    }\n  }\n\n  const ui = createStreamableUI(initial);\n\n  // The default text renderer just returns the content as string.\n  const textRender = text || defaultTextRenderer;","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/rsc/src/stream-ui/stream-ui.tsx#L172-L208","documentation":"streamUI no longer accepts a `provider` option; the model is passed directly via the `model` option as a provider model instance. The throw exists to migrate users off the deprecated `provider` setting during the experimental phase.","triggerScenarios":"Calling streamUI({ ..., provider: someProvider }) — the `'provider' in settings` check throws before execution.","commonSituations":"Migrating from the earliest experimental API where streamUI took `provider` plus a string model; old examples configuring a provider instance separately; leftovers after updating the `model` argument.","solutions":["Remove the `provider` option entirely","Pass a model instance created from the provider, e.g. openai('gpt-4o'), to `model`"],"exampleFix":"// before\nstreamUI({ provider: openai, model: 'gpt-4o' });\n// after\nstreamUI({ model: openai('gpt-4o') });","handlingStrategy":"validation","validationCode":"if ('provider' in settings) throw new TypeError('Remove `provider`; pass a model instance via `model`');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove legacy provider option from shared config objects","Construct model instances once and reuse them","Grep for 'provider:' in streamUI call sites during migration"],"tags":["api-misuse","migration","renamed-api"],"backgroundTag":"renamed-api-option","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}