This guide will help you implement enterprise-grade security, observability, and governance for OpenWebUI using Portkey. While OpenWebUI supports various provider plugins, Portkey provides a unified interface for all your LLM providers, offering comprehensive features for model management, cost tracking, observability, and metadata logging. For IT administrators deploying centralized instances of OpenWebUI, Portkey enables essential enterprise features including usage tracking, access controls, and budget management. Let’s walk through implementing these features step by step.

Understanding the Implementation

When implementing Portkey with OpenWebUI in your organization, we’ll follow these key steps:
  1. Basic OpenWebUI integration with Portkey
  2. Setting up organizational governance using Model Catlog
  3. Managing user access and permissions, setting- budget & rate limits, and more…
If you’re an individual user just looking to use Portkey with Open WebUI, you only need to complete Steps 1 and 2 to get started.

1. Setting Up Portkey

1

Create Portkey API Key

  1. Go to the API Keys section in the Portkey sidebar.
  2. Click Create New API Key with all the permissions.
  3. Save and copy the key — you’ll need it for OpenWebUI.
2

Add Your Provider

  1. Navigate to Model Catalog → AI Providers.
Portkey Model Catalog - Add Provider
  1. Click Create Provider (if this is your first time using Portkey).
  2. Select Create New Integration → choose your AI service (OpenAI, Anthropic, etc.).
  3. Enter your provider’s API key and required details.
  4. (Optional) Configure workspace and model provisioning.
  5. Click Create Integration.
3

Get Your Model Slugs

  1. Go to Model Catalog → Models.
  2. Copy the slug for each model you want to use (@provider-slug/model-name).
Example: @openai-test/gpt-4o — use this in the model field of API requests.
That’s it — your Portkey setup is ready. Now let’s integrate it with OpenWebUI.

2. Integrating Portkey with OpenWebUI

Since Portkey is OpenAI API–compatible, connecting it to OpenWebUI is quick and straightforward.
You’ll need your Portkey API key from Step 1 before continuing.
1

Access Admin Panel

  1. Start your OpenWebUI server.
  2. Click on your username at the bottom left.
  3. Go to the Admin Panel -> Settings tab -> Select Connections from the sidebar.
2

Enable Direct Connections

  1. Turn ON Direct Connections and OpenAI API toggle switch.
  2. Click the + icon next to Manage OpenAI API Connections.
3

Configure Portkey Connection

Fill in the following in the Edit Connection dialog:
  • URL: https://api.portkey.ai/v1
  • Key: Your Portkey API key from Step 1
  • Prefix ID: portkey (or any name you prefer)
  • Model IDs: Your model slugs (e.g., @openai/gpt-4o, @anthropic/claude-3-sonnet) from Step 1
Click Save to finish.
4

Select and Use Your Model

  1. Go back to the main chat interface and select Portkey model (format: @model-name) from the dropdown at the top.
  2. Start chatting!
For Anthropic models: You must set a Max Tokens value. Click the settings icon (top right) and set Max Tokens to a valid number (e.g., 1024).
You can track requests, usage, and costs in the Portkey Dashboard.

3. Set Up Enterprise Governance for Open WebUI

Why Enterprise Governance? If you are using Open WebUI inside your orgnaization, you need to consider several governance aspects:
  • Cost Management: Controlling and tracking AI spending across teams
  • Access Control: Managing team access and workspaces
  • Usage Analytics: Understanding how AI is being used across the organization
  • Security & Compliance: Maintaining enterprise security standards
  • Reliability: Ensuring consistent service across all users
  • Model Management: Managing what models are being used in your setup
Portkey adds a comprehensive governance layer to address these enterprise Enterprise Implementation Guide

Enterprise Features Now Available

Open WebUI now has:
  • Per-developer budget controls
  • Model access governance
  • Usage tracking & attribution
  • Code security guardrails
  • Reliability features for development workflows
Here’s the new section for image generation using Portkey with Open WebUI:

4. Image Generation with Portkey

Portkey enables seamless image generation through Open WebUI by providing a unified interface for various image generation models like DALL-E 2, DALL-E 3, and other compatible models. This integration allows you to leverage Portkey’s enterprise features including cost tracking, access controls, and observability for all your image generation needs.

Setting Up Image Generation

Before proceeding, ensure you have completed the basic Portkey setup from Step 1 and have your Portkey API key ready.
1

Access Image Settings

  1. Navigate to your Open WebUI Admin Panel
  2. Go to SettingsImages from the sidebar
Open WebUI Images Settings
2

Configure Image Generation Engine

In the Image Settings page, configure the following:
  1. Enable Image Generation: Toggle ON the Image Generation (Experimental) option
  2. Image Generation Engine: Select Default (Open AI) from the dropdown
  3. OpenAI API Config: Enter Portkey’s base URL:
    https://api.portkey.ai/v1
    
  4. API Key: Enter your Portkey API key (from Step 1)
  5. Set Default Model: Enter your model slug in the format:
    @provider-key/model-name
    
    For example: @openai-test/dall-e-3
3

Configure Model-Specific Settings

Choose the model you wish to use. Note that image size options will depend on the selected model:
  • DALL·E 2: Supports 256x256, 512x512, or 1024x1024 images.
  • DALL·E 3: Supports 1024x1024, 1792x1024, or 1024x1792 images.
  • GPT-Image-1: Supports auto, 1024x1024, 1536x1024, or 1024x1536 images.
Steps: Set the number of generation steps (typically 50 for good quality)
  • Other Models: Check your provider’s documentation (gemini, vertex, and more..) for supported sizes
4

Test Your Configuration

  1. Return to the main chat interface
  2. Type a prompt and click the image generation icon
  3. Your image will be generated using Portkey’s infrastructure
  4. Track usage and costs in the Portkey Dashboard

Monitoring Image Generation

All image generation requests through Portkey are automatically tracked with:
  • Cost Attribution: See exact costs per image generation
  • Request Logs: Full prompt and response tracking
  • Performance Metrics: Generation time and success rates
  • Metadata Tags: Track image generation by team/department
Portkey Image Generation Logs
Pro Tip: If you are using a different AI provider (Gemini, Vertex AI, etc..) and you need to pass some additional params for image gen, you can do that by adding them in portkey’s config as override_params and attaching it to your Portkey API key. Here’s a guide

Portkey Features

Now that you have enterprise-grade Zed setup, let’s explore the comprehensive features Portkey provides to ensure secure, efficient, and cost-effective AI operations.

1. Comprehensive Metrics

Using Portkey you can track 40+ key metrics including cost, token usage, response time, and performance across all your LLM providers in real time. You can also filter these metrics based on custom metadata that you can set in your configs. Learn more about metadata here.

2. Advanced Logs

Portkey’s logging dashboard provides detailed logs for every request made to your LLMs. These logs include:
  • Complete request and response tracking
  • Metadata tags for filtering
  • Cost attribution and much more…

3. Unified Access to 1600+ LLMs

You can easily switch between 1600+ LLMs. Call various LLMs such as Anthropic, Gemini, Mistral, Azure OpenAI, Google Vertex AI, AWS Bedrock, and many more by simply changing the model slug in your default config object.

4. Advanced Metadata Tracking

Using Portkey, you can add custom metadata to your LLM requests for detailed tracking and analytics. Use metadata tags to filter logs, track usage, and attribute costs across departments and teams.

Custom Metata

5. Enterprise Access Management

6. Reliability Features

7. Advanced Guardrails

Protect your Project’s data and enhance reliability with real-time checks on LLM inputs and outputs. Leverage guardrails to:
  • Prevent sensitive data leaks
  • Enforce compliance with organizational policies
  • PII detection and masking
  • Content filtering
  • Custom security rules
  • Data compliance checks

Guardrails

Implement real-time protection for your LLM interactions with automatic detection and filtering of sensitive content, PII, and custom security rules. Enable comprehensive data protection while maintaining compliance with organizational policies.

FAQs

Next Steps

Join our Community
For enterprise support and custom features, contact our enterprise team.