TS2353: Object literal may only specify known properties

Object literal may only specify known properties, and '<name>' does not exist in type '<type>'.

You passed an object literal directly to something expecting a specific type, and TypeScript's excess-property check caught a key on your object that isn't part of that type at all.

Why this happens in documentation specifically

This fires specifically for object literals passed inline — `fn({ ...})` — which is exactly how most documentation examples pass options, since it's the most readable form on the page. When an option is renamed or dropped between versions, every inline example using it breaks this way.

A real example

ai@7.0.66
const result = await embed({ model: "text-embedding-3-small", value: "hi", unrecognizedFlag: true });
Object literal may only specify known properties, and 'unrecognizedFlag' does not exist in type '{ model: EmbeddingModel; value: string; maxRetries?: number; abortSignal?: AbortSignal; headers?: Record<string, string>; providerOptions?: SharedV4ProviderOptions; ... 6 more ...; _internal?: { ...; }; }'.

How to fix it

Check the function's current parameter type for the real option name. No suggestion here means TypeScript didn't find a close-enough match on the type — the option may be gone outright, moved into a nested object, or renamed to something not textually similar.

If you assign the same object to a variable typed loosely (or untyped) first and pass the variable instead, TypeScript's excess-property check doesn't run — which hides this exact class of bug rather than fixing it. Worth knowing if you're wondering why a colleague's equivalent code doesn't show the error.

Related codes

snippetcheck finds diagnostics like this one across a whole documentation site, not just a single sample — see how it works.