createOpenaiChat example from docs produce type error
Open
@AlemTuzlak is already working on this.
Since Sep 17, 2026.
waiting-on: maintainer
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 331
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 160
Description
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
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.