1
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:
- OpenAI
- Anthropic
- Google
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:- OpenAI
- Anthropic
- Google
Usage Examples
Basic Text Generation
- OpenAI
- Anthropic
- Google
Streaming Responses
- OpenAI
- Anthropic
- Google
AI Agents with Tools
Here’s a complete example of building an AI agent with tools using the Vercel AI SDK and Qualifire:- OpenAI
- Anthropic
- Google
Key Configuration
The key to integrating Qualifire with the Vercel AI SDK is configuring your provider client with:baseURL: Point to the Qualifire proxy endpoint for your providerheaders: Include theX-Qualifire-API-Keyheader 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