Vercel AI SDK
Use the AI SDK’s OpenAI-compatible provider to call Radium from Node.js or server-side code in a Next.js application.Before you start
You need:- Node.js 22 or newer
- npm
- A Radium API key
1. Create a project and install the packages
2. Set your Radium credentials
3. Create main.mjs
The base URL must include
/v1. The provider adds /chat/completions itself.4. Run it
Choose a model
Migrate an existing AI SDK application
Create the provider once:generateText, streamText, or your server route:
Streaming
UsestreamText for token-by-token streaming:
Tool calling
The Vercel AI SDK supports tool calling with Radium via the sametools parameter:
Troubleshooting
Validation
These instructions were verified with Node.js 24.1.0,
ai@7.0.71, and @ai-sdk/openai-compatible@3.0.33 on August 20, 2026. You do not need those exact package versions.hal-1.0, clarke-1.0, and tycho-1.0.
Next steps
API quickstart
Call Radium directly
Tool calling
The tool_use and tool_result contract