TanStack AI version
v0.8.1
Framework/Library version
Nodejs 24.14.0
Describe the bug and the steps to reproduce it
The docs example here produces a type error.
import { createOpenaiChat } from "@tanstack/ai-openai";
// Type error here
const adapter = createOpenaiChat(process.env.OPENAI_API_KEY!, {
// ... your config options
});
The docs suggest createOpenaiChat can be called to create an adapter with just an api key, however the code and type error suggest that the first argument should be a model, not an api key.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/devbox/xt8q39
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not know how
Terms & Code of Conduct
TanStack AI version
v0.8.1
Framework/Library version
Nodejs 24.14.0
Describe the bug and the steps to reproduce it
The docs example here produces a type error.
The docs suggest
createOpenaiChatcan be called to create an adapter with just an api key, however the code and type error suggest that the first argument should be a model, not an api key.Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/devbox/xt8q39
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not know how
Terms & Code of Conduct