ai and @ai-sdk/openai) with SUPA by pointing the OpenAI provider at SUPA’s base URL and using your SUPA model id (for example google/gemma-3-27b-it).
SUPA exposes an OpenAI-compatible HTTP API. Configure the provider with the same host and
/v1 prefix as in the Quickstart cURL example: https://api.supa.works/openai/v1.Prerequisites
- A SUPA API key from your profile page
- Node.js 18+
Install
zod is used for tool schemas in the examples below.
Configure the provider
Create an OpenAI provider instance with your SUPA API key and base URL, then pass a SUPA model name to each call.Generate text
Stream text
Next steps
- See Tool calls for function calling with the AI SDK.
- See Image attachments for vision-style prompts.
- TanStack alternative: TanStack AI (OpenAI adapter).