Skip to main content
Use the Vercel AI SDK (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

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