Skip to main content
The Vercel AI SDK is a powerful toolkit for building AI-powered applications. Qualifire integrates seamlessly with the Vercel AI SDK by acting as a proxy layer, enabling you to add guardrails, evaluations, and observability to your AI applications.
1

Create an account + Generate an API Key

Log into qualifire or create an account. Once you have an account, you can generate an API key.
2

Set environment variables

Set the following environment variables in your project:
3

Install the Vercel AI SDK

Install the Vercel AI SDK and your preferred provider SDK:
4

Configure the provider client with Qualifire

Configure your AI provider to route requests through Qualifire by setting the baseURL and adding the Qualifire API key header:

Usage Examples

Basic Text Generation

Streaming Responses

AI Agents with Tools

Here’s a complete example of building an AI agent with tools using the Vercel AI SDK and Qualifire:

Key Configuration

The key to integrating Qualifire with the Vercel AI SDK is configuring your provider client with:
  1. baseURL: Point to the Qualifire proxy endpoint for your provider
  2. headers: Include the X-Qualifire-API-Key header with your API key
All your AI requests will now be routed through Qualifire, enabling guardrails, evaluations, tracing, and other observability features without any changes to your application logic.

Next Steps

Guardrails

Set up guardrails to protect your AI application

Evaluations

Add evaluations to monitor response quality

Tracing

Enable tracing for full observability

Proxy

Learn more about the Qualifire proxy