Introduction
Vercel AI SDK is a TypeScript toolkit for building AI-powered applications with React, Next.js, Vue, and more.The Planck provider for Vercel AI SDK lives in this repository as the
@inquantum/planck-ai-sdk-provider workspace package.Integration Steps
1
Sign up at inquantum.ai and generate an API key.
You’ll also need to configure your provider API keys (OpenAI, Anthropic, etc.) at Planck Providers for BYOK (Bring Your Own Keys).
2
bash PLANCK_API_KEY=sk-planck-... 3
Install the local Planck AI SDK provider
The example declares the workspace package as a local dependency:Build the unpublished package, then install the example:
4
Configure Vercel AI SDK with Planck
You can switch between 100+ models without changing your code. Just update the model name!
Complete Working Examples
Basic Text Generation
Streaming Text
Provider Selection
By default, Planck’s AI gateway automatically routes to the cheapest provider. You can also manually select a specific provider:With Custom Properties and Session Tracking
Tool Calling
Planck Prompts Integration
Use prompts created in your Planck dashboard instead of hardcoding messages in your application:When using
promptId, you must still pass a placeholder messages array to
satisfy the Vercel AI SDK’s validation. The actual prompt content will be
fetched from your Planck dashboard, and the placeholder messages will be
ignored.- 🎯 Centralized Management: Update prompts without code changes
- 👩🏻💻 Perfect for non-technical users: Create prompts using the Planck dashboard
- 🚀 Lower Latency: Single API call, no message construction overhead
- 🔧 A/B Testing: Test different prompt versions with environments
- 📊 Better Analytics: Track prompt performance across versions
Additional Examples
For a complete Geist-style Next.js application, see the Vercel AI SDK example. It includes routed examples for chat streaming, model discovery, embeddings, image generation, asynchronous video generation, and request feedback. The example consumes the unpublished provider directly from this monorepo.Related Documentation
AI Gateway Overview
Learn about Planck’s AI Gateway features and capabilities
Provider Routing
Configure intelligent routing and automatic failover
Model Registry
Browse all available models and providers
Prompt Management
Version and manage prompts with Planck Prompts
Custom Properties
Add metadata to track and filter your requests
Sessions
Track multi-turn conversations and user sessions
Rate Limiting
Configure rate limits for your applications
Caching
Reduce costs and latency with intelligent caching