Last Updated: May 18, 2026Documentation Index
Fetch the complete documentation index at: https://docs.salad.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
The Vercel AI SDK is a popular framework for building AI-powered applications in JavaScript and TypeScript. It provides a unified interface for text generation, streaming, structured output, and tool calling - and includes an@ai-sdk/openai-compatible package for connecting to any OpenAI-compatible endpoint, including SaladCloud.
The Vercel AI SDK works with SaladCloud in two ways:
- Salad AI Gateway - no infrastructure to deploy or manage. Sign up for access, point your app at a single shared endpoint, and use your Salad API key directly. Currently in closed beta with monthly flat-rate access.
- Self-hosted model - deploy your own SaladCloud container group for full control over the model, hardware, and configuration. Still very easy to set up and use.
Prerequisites
Before getting started, make sure you have:- A SaladCloud account
- Node.js 18+ installed
Step-by-Step Setup
Step 1: Choose Your Backend
- Salad AI Gateway
- Self-Hosted on SaladCloud
Salad AI Gateway is the fastest way to get started - no container groups to deploy, no cold starts to wait for.
- Sign up for early access at salad.com/ai-gateway.
- Once approved, find your Salad API key in the portal.
| Model | Description |
|---|---|
qwen3.6-35b-a3b | Qwen 3.6 35B-A3B - best for agentic tasks, coding, and complex reasoning |
qwen3.6-27b | Qwen 3.6 27B - strong balance of capability and speed |
qwen3.5-9b | Qwen 3.5 9B - fastest response times, suited for lighter tasks |
Step 2: Install the Dependencies
In your project directory, install the Vercel AI SDK and the OpenAI-compatible provider:package.json has "type": "module" set:
dotenv:
Step 3: Configure the SaladCloud Provider
- Salad AI Gateway
- Self-Hosted on SaladCloud
Store your credentials in a Create a provider instance pointing to the AI Gateway endpoint:No custom headers are needed - your Salad API key in
.env file:apiKey is all that’s required.Step 4: Generate Text and Test the Connection
UsegenerateText to test that your setup works:
Streaming Chat Responses
UsestreamText for chat interfaces that display responses as they are generated: