Introduction
Semantic Kernel is Microsoft’s open-source SDK for building AI agents and orchestrating LLM workflows across multiple languages (.NET, Python, Java). By integrating Helicone AI Gateway with Semantic Kernel, you can:- Route to different models & providers with automatic failover through a single endpoint
- Unified billing with pass-through billing or bring your own keys
- Monitor all requests with automatic cost tracking in one dashboard
This integration requires only one line change to your existing Semantic Kernel code - adding the AI Gateway endpoint.
Integration Steps
1
Create an account + Generate an API Key
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
Set environment variables
.env file in your project:3
Add the AI Gateway endpoint to your Semantic Kernel configuration
The only change from a standard Semantic Kernel setup is adding the
endpoint parameter. Everything else stays the same!4
Use the chat service normally
Your existing Semantic Kernel code continues to work without any changes:
5
View requests in the Helicone dashboard
All your Semantic Kernel requests are now visible in your Helicone dashboard:
- Request/response bodies
- Latency metrics
- Token usage and costs
- Model performance analytics
- Error tracking
Migration Example
Here’s what migrating an existing Semantic Kernel application looks like:Before (Direct OpenAI)
After (Helicone AI Gateway)
Complete Working Example
Here’s a full example that tests multiple models:Looking for a framework or tool not listed here? Request it here!
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
Custom Properties
Add metadata to track and filter your requests