Introduction
Vercel AI SDK is a TypeScript toolkit for building AI-powered applications with React, Next.js, Vue, and more.The Helicone provider for Vercel AI SDK is available as a dedicated package:
@helicone/ai-sdk-provider.Integration Steps
1
Sign up at helicone.ai and generate an API key.
Youβll also need to configure your provider API keys (OpenAI, Anthropic, etc.) at Helicone Providers for BYOK (Bring Your Own Keys).
2
3
Install the Helicone AI SDK provider
4
Configure Vercel AI SDK with Helicone
You can switch between 100+ models without changing your code. Just update the model name!
Complete Working Examples
Basic Text Generation
Streaming Text
UI Message Stream Response
Convert streaming results to a UI-compatible response format:Provider Selection
By default, Heliconeβ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
Agents
Use Vercel AI SDKβs Agent API with Helicone to build multi-step reasoning agents:Helicone Prompts Integration
Use prompts created in your Helicone 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 Helicone dashboard, and the placeholder messages will be ignored.- π― Centralized Management: Update prompts without code changes
- π©π»βπ» Perfect for non-technical users: Create prompts using the Helicone 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 more comprehensive examples, check out the GitHub repository.Looking for a framework or tool not listed here? Request it here!
Additional Resources
Related Documentation
AI Gateway Overview
Learn about Heliconeβ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 Helicone 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