Use TanStack AI with the @tanstack/ai-openai adapter and SUPA’s OpenAI-compatible API.
TanStack’s OpenAI adapter builds on the official openai package. Set baseURL to SUPA and pass your SUPA model id (for example google/gemma-3-27b-it).
TanStack AI currently types chat model names as OpenAI model ids. Use a type assertion for custom SUPA model strings until your project exposes them in typings. The runtime request still sends your SUPA model name to the API.
Prerequisites
- A SUPA API key from your profile page
- Node.js 18+ (TanStack AI recommends current Node LTS; see their docs for any stricter requirement)
Install
Use createOpenaiChat with apiKey, baseURL, and your model id.
Chat (non-streaming)
The TanStack chat activity accepts your adapter and messages. Set stream: false to collect the full reply as a string.
Streaming
Omit stream or set stream: true to receive an async iterable of stream chunks (see TanStack AI docs for consuming chunks).
Next steps