Skip to main content

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!
While you’re here, why not give us a star on GitHub? It helps us a lot!

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.
Benefits of using Helicone prompts:
  • 🎯 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

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