Getting Started
1. Install the required packages
2. Quickstart: Autogen AgentChat with Portkey
Model Catalog
- Portkey now uses Model Catalog instead of Virtual Keys. Reference models directly with
model="@provider_slug/model_name". - Learn more: Upgrade to Model Catalog and Model Catalog.
Production Features
1. Enhanced Observability
Portkey provides comprehensive observability for your Autogen agents, helping you understand exactly what’s happening during each execution.- Traces
- Logs
- Metrics & Dashboards
- Metadata Filtering

2. Reliability - Keep Your Autogen Agents Running Smoothly
When running agents in production, things can go wrong - API rate limits, network issues, or provider outages. Portkey’s reliability features ensure your agents keep running smoothly even when problems occur. It’s this simple to enable fallback in your Autogen agents:Automatic Retries
Request Timeouts
Conditional Routing
Fallbacks
Load Balancing
3. Prompting in Autogen Agents
Portkey’s Prompt Engineering Studio helps you create, manage, and optimize the prompts used in your Autogen agents. Instead of hardcoding prompts or instructions, use Portkey’s prompt rendering API to dynamically fetch and apply your versioned prompts.
Manage prompts in Portkey's Prompt Library
- Prompt Playground
- Using Prompt Templates
- Prompt Versioning
- Mustache Templating for variables
- Iteratively develop prompts before using them in your agents
- Test prompts with different variables and models
- Compare outputs between different prompt versions
- Collaborate with team members on prompt development
Prompt Engineering Studio
4. Guardrails for Safe Autogen Agents
Guardrails ensure your Autogen agents operate safely and respond appropriately in all situations. Why Use Guardrails? Autogen agents can experience various failure modes:- Generating harmful or inappropriate content
- Leaking sensitive information like PII
- Hallucinating incorrect information
- Generating outputs in incorrect formats
- Detect and redact PII in both inputs and outputs
- Filter harmful or inappropriate content
- Validate response formats against schemas
- Check for hallucinations against ground truth
- Apply custom business logic and rules
Learn More About Guardrails
5. User Tracking with Metadata
Track individual users through your Autogen agents using Portkey’s metadata system. What is Metadata in Portkey? Metadata allows you to associate custom data with each request, enabling filtering, segmentation, and analytics. The special_user field is specifically designed for user tracking.

Filter analytics by user
- Per-user cost tracking and budgeting
- Personalized user analytics
- Team or organization-level metrics
- Environment-specific monitoring (staging vs. production)
Learn More About Metadata
6. Caching for Efficient Agents
Implement caching to make your Autogen agents more efficient and cost-effective:- Simple Caching
7. Model Interoperability: using different LLMs
One of Portkey’s key strengths is providing access to 1600+ LLMs through a unified interface. Here’s how to use different providers with Autogen:Supported Providers
- OpenAI
- Anthropic
- Google
Set Up Enterprise Governance for Autogen agents
Why Enterprise Governance? If you are using Autogen agents inside your organization, you need to consider several governance aspects:- Cost Management: Controlling and tracking AI spending across teams
- Access Control: Managing which teams can use specific models
- Usage Analytics: Understanding how AI is being used across the organization
- Security & Compliance: Maintaining enterprise security standards
- Reliability: Ensuring consistent service across all users
Step 1: Implement Budget Controls & Rate Limits
Step 1: Implement Budget Controls & Rate Limits
Step 1: Implement Budget Controls & Rate Limits
Model Catalog enables you to have granular control over LLM access at the team/department level. This helps you:- Set up budget limits
- Prevent unexpected usage spikes using Rate limits
- Track departmental spending
Setting Up Department-Specific Controls:
- Navigate to Model Catalog in Portkey dashboard
- Create new Provider for each engineering team with budget limits and rate limits
- Configure department-specific limits

Step 2: Define Model Access Rules
Step 2: Define Model Access Rules
Step 2: Define Model Access Rules
As your AI usage scales, controlling which teams can access specific models becomes crucial. You can simply manage AI models in your org by provisioning model at the top integration level.
Step 4: Set Routing Configuration
Step 4: Set Routing Configuration
- Data Protection: Implement guardrails for sensitive code and data
- Reliability Controls: Add fallbacks, load-balance, retry and smart conditional routing logic
- Caching: Implement Simple and Semantic Caching. and more…
Example Configuration:
Here’s a basic configuration to load-balance requests to OpenAI and Anthropic:Step 4: Implement Access Controls
Step 4: Implement Access Controls
Step 3: Implement Access Controls
Create User-specific API keys that automatically:- Track usage per developer/team with the help of metadata
- Apply appropriate configs to route requests
- Collect relevant metadata to filter logs
- Enforce access permissions
Step 5: Deploy & Monitor
Step 5: Deploy & Monitor
Step 4: Deploy & Monitor
After distributing API keys to your engineering teams, your enterprise-ready Autogen setup is ready to go. Each developer can now use their designated API keys with appropriate access levels and budget controls. Apply your governance setup using the integration steps from earlier sections Monitor usage in Portkey dashboard:- Cost tracking by engineering team
- Model usage patterns for AI agent tasks
- Request volumes
- Error rates and debugging logs
Enterprise Features Now Available
Autogen agents now have:- Departmental budget controls
- Model access governance
- Usage tracking & attribution
- Security guardrails
- Reliability features
Frequently Asked Questions
How does Portkey enhance my Autogen agents?
How does Portkey enhance my Autogen agents?
Can I use any LLM with Autogen through Portkey?
Can I use any LLM with Autogen through Portkey?
How do I track costs for different agents?
How do I track costs for different agents?
Does Portkey support all Autogen features?
Does Portkey support all Autogen features?
How do I debug agent failures?
How do I debug agent failures?




