> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-agentcore.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Open WebUI

> Enterprise-grade cost tracking, observability, and more for Open WebUI

For IT teams running centralized OpenWebUI deployments, Portkey brings enterprise-grade observability and governance. Get unified model management, automatic cost tracking, and per-user attribution across all your LLM providers.

# Understanding the Integration Paths

When implementing Portkey with OpenWebUI you can choose between two complementary approaches:

1. **Direct OpenAI-compatible connection** – ideal if you already rely on Portkey's Model Catalog and simply need to expose those models inside OpenWebUI.
2. **Portkey Manifold Pipe** – our official pipe unlocks richer governance, metadata, and resilience features directly within OpenWebUI.

Pick the path that matches your requirements: you can start with the API-compatible flow and graduate to the pipe whenever you need advanced controls.

<Note>
  If you're an individual user just looking to use Portkey with OpenWebUI, you only need to complete the workspace preparation and one of the integration options below.
</Note>

## 1. Prepare Your Portkey Workspace

<Steps>
  <Step title="Create Portkey API Key">
    1. Go to the [**API Keys**](https://app.portkey.ai/api-keys) section in the Portkey sidebar.
    2. Click **Create New API Key** with the permissions you plan to expose.
    3. Save and copy the key — you’ll paste it into OpenWebUI.
  </Step>

  <Step title="Add Your Provider">
    1. Navigate to **Model Catalog → AI Providers**.

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/Ltp6JMyDquiDb3_G/Screenshot2025-07-21at5.29.57PM.png?fit=max&auto=format&n=Ltp6JMyDquiDb3_G&q=85&s=3574ff0ad927fefee48f50b7a0dc6d89" alt="Portkey Model Catalog - Add Provider" width="1434" height="350" data-path="Screenshot2025-07-21at5.29.57PM.png" />
    </Frame>

    2. Click **Create Provider** (if this is your first time using Portkey).
    3. Select **Create New Integration** → choose your AI service (OpenAI, Anthropic, etc.).
    4. Enter your provider’s API key and required details.
    5. *(Optional)* Configure workspace and model provisioning.
    6. Click **Create Integration**.
  </Step>

  <Step title="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`).

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/fPgO_s2Dg28sj6d-/images/product/model-catalog/model-integration-model-box.png?fit=max&auto=format&n=fPgO_s2Dg28sj6d-&q=85&s=f3d5e2cbebd444e90d9dc0b6ea78893a" width="500" data-path="images/product/model-catalog/model-integration-model-box.png" />
    </Frame>

    <Note>
      Example: `@openai-test/gpt-4o` — use this in the `model` field of API requests.
    </Note>
  </Step>
</Steps>

Before switching to OpenWebUI, decide whether you want to connect via the OpenAI-compatible API or use the official Portkey Manifold Pipe.

***

## 2. Connect OpenWebUI to Portkey

Choose the option that best fits your needs.

### Option A: Direct OpenAI-Compatible Connection

This route keeps your setup lightweight by pointing OpenWebUI at Portkey's OpenAI-compatible endpoint.

<Note>
  You’ll need the API key and model slugs collected in [Step 1](#1-prepare-your-portkey-workspace).
</Note>

<Steps>
  <Step title="Access Admin Panel">
    1. Start your OpenWebUI server.
    2. Click your **username** at the bottom left.
    3. Open the **Admin Panel** → **Settings** tab → select **Connections** from the sidebar.

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/i1wSNMQW9E_Rd8pV/images/integrations/openwebui-settings-connection-page.png?fit=max&auto=format&n=i1wSNMQW9E_Rd8pV&q=85&s=670588b07b0107a610e3b168de31670b" width="400" data-path="images/integrations/openwebui-settings-connection-page.png" />
    </Frame>
  </Step>

  <Step title="Enable Direct Connections">
    1. Turn on **Direct Connections** and the **OpenAI API** toggle.
    2. Click the **+** icon next to *Manage OpenAI API Connections*.
  </Step>

  <Step title="Configure Portkey Connection">
    Fill in the **Edit Connection** dialog:

    * **URL**: `https://api.portkey.ai/v1`
    * **Key**: Your Portkey API key
    * **Prefix ID**: `portkey` (or a label you prefer)
    * **Model IDs**: Slugs such as `@openai/gpt-4o` or `@anthropic/claude-3-sonnet`

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/i1wSNMQW9E_Rd8pV/images/integrations/openwebui-edit-connection.png?fit=max&auto=format&n=i1wSNMQW9E_Rd8pV&q=85&s=03ff75bb164b60d90a7ecbaa381a972f" width="400" data-path="images/integrations/openwebui-edit-connection.png" />
    </Frame>

    Click **Save** to finish.
  </Step>

  <Step title="Select and Use Your Model">
    1. Return to the main chat interface and pick your Portkey-backed model (format: `@provider/model`).
    2. Start chatting.

    <Note>
      **Anthropic models** require a *Max Tokens* value. Click the settings icon (top right) and set **Max Tokens** to a valid number (for example, 1024).
    </Note>
  </Step>
</Steps>

Monitor requests, usage, and spend in the [Portkey Dashboard](https://app.portkey.ai/dashboard).

### Option B: Portkey Manifold Pipe (Recommended for Enterprise)

The official Portkey Manifold Pipe unlocks enterprise-grade observability and governance features that aren't available through the basic OpenAI-compatible connection:

<Note>
  In typical OpenWebUI deployments, a single shared API key means you lose visibility into which user made which request. Portkey logs show anonymous traffic instead of per-user attribution. The Portkey Manifold Pipe solves this by automatically forwarding OpenWebUI user context to Portkey, enabling true per-user observability, cost tracking, and governance—even with a shared API key setup.
</Note>

#### Why Use the Manifold Pipe?

<CardGroup cols={2}>
  <Card title="Per-User Attribution" icon="user">
    Automatically track which OpenWebUI user made each request—essential for enterprise deployments with shared API keys.
  </Card>

  <Card title="Structured Metadata" icon="tags">
    Forward OpenWebUI user context (email, name, role, chat ID) as structured metadata for filtering and analytics.
  </Card>

  <Card title="Auto Model Discovery" icon="magnifying-glass">
    Automatically populate OpenWebUI's model dropdown from your Portkey Model Catalog—no manual configuration.
  </Card>

  <Card title="Enhanced Resilience" icon="shield">
    Built-in retry logic with exponential backoff for non-streaming requests ensures reliable performance.
  </Card>
</CardGroup>

* **Download:** [portkey\_manifold\_pipe.py](https://raw.githubusercontent.com/Portkey-AI/docs-core/refs/heads/main/integrations/libraries/openwebui-portkey-pipe.py)
* **Best for:** Enterprise deployments with shared infrastructure where user-level tracking, governance, and automated model management are critical.

<AccordionGroup>
  <Accordion title="portkey_manifold_pipe.py">
    ```python title="portkey_manifold_pipe.py" theme={"system"}
    """
    title: Portkey Manifold Pipe
    author: Portkey
    version: 0.8.0
    license: MIT
    documentation: https://portkey.ai/docs/integrations/libraries/openwebui
    """

    from pydantic import BaseModel, Field
    from typing import Union, Generator, Iterator
    import json
    import requests


    class Pipe:
        class Valves(BaseModel):
            PORTKEY_API_KEY: str = Field(
                default="",
                description="Your Portkey API key (required).",
            )
            PORTKEY_API_BASE_URL: str = Field(
                default="https://api.portkey.ai/v1",
                description="Base URL for Portkey API.",
            )
            AUTO_DISCOVER_MODELS: bool = Field(
                default=True,
                description="Auto-fetch models from Portkey.",
            )
            PORTKEY_MODELS: str = Field(
                default="@openai-slug/gpt-4o, @anthropic-slug/claude-sonnet-latest",
                description="Comma-separated model IDs (used when auto-discovery is off or as fallback).",
            )

        def __init__(self):
            self.type = "manifold"
            self.valves = self.Valves()
            self.name = "PORTKEY"

        def pipes(self) -> list:
            model_ids = []

            # Auto-discover models from Portkey
            if self.valves.AUTO_DISCOVER_MODELS and self.valves.PORTKEY_API_KEY:
                try:
                    r = requests.get(
                        f"{self.valves.PORTKEY_API_BASE_URL}/models",
                        headers={"Authorization": f"Bearer {self.valves.PORTKEY_API_KEY}"},
                        timeout=10,
                    )
                    if r.status_code == 200:
                        data = r.json().get("data", [])
                        model_ids = [
                            m["id"] for m in data if isinstance(m, dict) and "id" in m
                        ]
                except:
                    pass  # Fallback to manual list

            # Add manual models
            if self.valves.PORTKEY_MODELS:
                manual = [
                    m.strip() for m in self.valves.PORTKEY_MODELS.split(",") if m.strip()
                ]
                model_ids.extend(manual)

            # Deduplicate
            seen = set()
            unique = []
            for m in model_ids:
                if m not in seen:
                    seen.add(m)
                    unique.append(m)

            return [{"id": m, "name": m} for m in unique]

        def pipe(self, body: dict, __user__: dict) -> Union[str, Generator, Iterator]:
            if not self.valves.PORTKEY_API_KEY:
                raise Exception("PORTKEY_API_KEY is required.")

            # Clean model ID (remove OpenWebUI prefix)
            full_model_id = body.get("model", "")
            actual_model_id = (
                full_model_id.split(".", 1)[-1] if "." in full_model_id else full_model_id
            )

            payload = {**body, "model": actual_model_id}

            # Build headers with metadata
            headers = {
                "Authorization": f"Bearer {self.valves.PORTKEY_API_KEY}",
                "Content-Type": "application/json",
            }

            metadata = {}
            if __user__:
                if "email" in __user__:
                    metadata["_user"] = __user__["email"]  # Special key for User column
                    metadata["email"] = __user__["email"]
                if "name" in __user__:
                    metadata["name"] = __user__["name"]
                if "id" in __user__:
                    metadata["user_id"] = __user__["id"]
                if "role" in __user__:
                    metadata["role"] = __user__["role"]
                if "chat_id" in __user__:
                    metadata["chat_id"] = __user__["chat_id"]

            if metadata:
                headers["x-portkey-metadata"] = json.dumps(metadata)

            try:
                r = requests.post(
                    url=f"{self.valves.PORTKEY_API_BASE_URL}/chat/completions",
                    json=payload,
                    headers=headers,
                    stream=body.get("stream", True),
                )
                r.raise_for_status()
                return r.iter_lines() if body.get("stream", True) else r.json()

            except requests.HTTPError as e:
                error_msg = f"Portkey API Error: {e.response.status_code}"
                try:
                    error_details = e.response.json()
                    error_msg += f" - {json.dumps(error_details)}"
                except:
                    pass
                raise Exception(error_msg)

            except Exception as e:
                raise Exception(f"Error: {str(e)}")

    ```
  </Accordion>
</AccordionGroup>

<Steps>
  <Step title="Install the Pipe">
    1. Open your **OpenWebUI Workspace**.
       * Click the **user icon** in the bottom-left corner.
       * Select **Admin Panel**.
    2. In the Admin Panel, go to the **Functions** tab.
    3. Click the **+** button to create a new function.
    4. Copy the function code provided in the accordion above and paste it into the editor.
    5. Set the function name to **Portkey Function** and add a description.
    6. Click **Save** to finish.
  </Step>

  <Step title="Configure Valves">
    1. In OpenWebUI, choose the `PORTKEY` pipe from the dropdown.
    2. Open the **Valves** panel and configure:

    **Required Configuration:**

    * **PORTKEY\_API\_KEY**: Your Portkey API key (required)
    * **PORTKEY\_API\_BASE\_URL**: Default `https://api.portkey.ai/v1` (change only for self-hosted)

    **Model Management:**

    * **AUTO\_DISCOVER\_MODELS**: Enable to automatically fetch available models from Portkey's catalog (recommended)
    * **PORTKEY\_MODELS**: Comma-separated model slugs for manual curation. Example: `@openai-provider/gpt-4o, @anthropic-provider-slug/claude-sonnet-latest`

    <Note>
      **Enterprise Tip:** The pipe automatically forwards OpenWebUI user metadata (name, email, role, chat\_id) to Portkey via the `x-portkey-metadata` header. This solves the shared API key attribution problem—you'll see per-user details in Portkey logs even when all users share the same API key.
    </Note>
  </Step>

  <Step title="Verify User Attribution">
    1. Start chatting in OpenWebUI with the PORTKEY pipe selected.
    2. Open the [Portkey Logs dashboard](https://app.portkey.ai/logs).
    3. You should now see detailed user attribution in your logs:
       * User email, name, and role visible in request metadata
       * Filter logs by specific users or teams
       * Track costs and usage per team member

    <Check>
      **Success!** You've solved the shared API key problem. Every request now shows which OpenWebUI user originated it, enabling true enterprise observability.
    </Check>
  </Step>

  <Step title="Apply Additional Governance (Optional)">
    1. Reference [Configs](https://docs.portkey.ai/configs) at the API key level to enable routing, fallbacks, caching, or segmentation.
    2. Set up [budget limits and rate controls](/product/model-catalog/integrations#3-budget-%26-rate-limits) through Portkey's Model Catalog.
    3. All governance policies automatically apply across OpenWebUI users via the shared setup.
  </Step>
</Steps>

#### What You'll See in Portkey

Once configured, the manifold pipe automatically captures and displays OpenWebUI user context in every request. **User emails appear directly in the User column** of your logs list view—no need to click into individual entries.

<Frame>
  <img src="https://mintcdn.com/portkey-docs-agentcore/i1wSNMQW9E_Rd8pV/images/integrations/owui-metadata.png?fit=max&auto=format&n=i1wSNMQW9E_Rd8pV&q=85&s=8b1b54681ded1f95e7b923f13a381a3b" alt="Portkey logs showing OpenWebUI user metadata including email, name, role, and chat ID" width="1126" height="1044" data-path="images/integrations/owui-metadata.png" />
</Frame>

**Captured metadata includes:**

* **User email** – Appears in the User column and metadata (via the special `_user` field)
* **User name** – Full name from OpenWebUI user profile
* **User role** – Admin, user, or custom roles for access control
* **Chat ID** – Track conversations and session context
* **User ID** – Unique identifier for programmatic filtering

This rich metadata enables you to filter logs by specific users, attribute costs to departments, and maintain complete audit trails—all without requiring individual API keys per user.

***

### How the Manifold Pipe Solves Enterprise Attribution

The manifold pipe bridges OpenWebUI's user context with Portkey's observability, solving a critical enterprise pain point:

<Tabs>
  <Tab title="Without Manifold Pipe">
    ```
    OpenWebUI (User A, User B, User C...) 
      ↓
    Shared Portkey API Key
      ↓  
    Portkey Logs: All requests appear anonymous
    ```

    **Problem:** No way to attribute costs, track usage, or audit which user accessed which models.
  </Tab>

  <Tab title="With Manifold Pipe">
    ```
    OpenWebUI User A → Pipe adds metadata → Portkey
      Headers: {"x-portkey-metadata": {"email": "user-a@company.com", "name": "User A", "role": "admin"}}

    OpenWebUI User B → Pipe adds metadata → Portkey
      Headers: {"x-portkey-metadata": {"email": "user-b@company.com", "name": "User B", "role": "user"}}
    ```

    **Solution:** Full per-user attribution in Portkey logs and analytics, even with a single shared API key.
  </Tab>
</Tabs>

**This enables:**

* **Cost attribution** per user or department
* **Usage analytics** segmented by team member
* **Compliance & audit trails** showing who accessed sensitive models
* **Governance policies** based on user roles and permissions

<Note>
  The pipe leverages OpenWebUI's `__user__` context object, which contains user details passed from the frontend. This data is automatically formatted as [Portkey metadata](/product/observability/metadata) and attached to every request.
</Note>

## 3. Set Up Enterprise Governance for OpenWebUI

**Why Enterprise Governance?**
If you are using OpenWebUI inside your organization, consider the following governance pillars:

* **Cost Management**: Controlling and tracking AI spending across teams
* **Access Control**: Managing which teams can access 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
* **Model Management**: Governing how models are provisioned and updated

Portkey adds a comprehensive governance layer to address these enterprise needs. Combine access policies, Configs, and API Keys to orchestrate usage across teams.

**Enterprise Implementation Guide**

<AccordionGroup>
  <Accordion title="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 & rate limits](/product/model-catalog/integrations#3-budget-%26-rate-limits)
    * Prevent unexpected usage spikes using Rate limits
    * Track departmental spending

    #### Setting Up Department-Specific Controls:

    1. Navigate to [Model Catalog](https://app.portkey.ai/model-catalog) in Portkey dashboard
    2. Create new Provider for each engineering team with budget limits and rate limits
    3. Configure department-specific limits

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/fPgO_s2Dg28sj6d-/images/product/model-catalog/create-provider-page.png?fit=max&auto=format&n=fPgO_s2Dg28sj6d-&q=85&s=aa9ebb081180cb16f5e290659a0e7848" width="500" data-path="images/product/model-catalog/create-provider-page.png" />
    </Frame>
  </Accordion>

  <Accordion title="Step 2: Define Model Access Rules">
    ### Step 2: Define Model Access Rules

    Use the Model Catalog to provision which models are exposed to each integration or workspace.

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/fPgO_s2Dg28sj6d-/images/product/model-catalog/model-provisioning-page.png?fit=max&auto=format&n=fPgO_s2Dg28sj6d-&q=85&s=8ed1d5d933c854acfaa8e2f193d61ab0" width="500" data-path="images/product/model-catalog/model-provisioning-page.png" />
    </Frame>

    Leverage Portkey Configs to enforce provider- or model-specific guardrails without editing your OpenWebUI setup.
  </Accordion>

  <Accordion title="Step 3: Set Routing Configuration">
    Portkey Configs control routing logic, fallbacks, caching, and data protection.

    ```json theme={"system"}
    {
      "strategy": {
        "mode": "load-balance"
      },
      "targets": [
        {
          "override_params": {
            "model": "@YOUR_OPENAI_PROVIDER_SLUG/gpt-model"
          }
        },
        {
          "override_params": {
            "model": "@YOUR_ANTHROPIC_PROVIDER/claude-sonnet-model"
          }
        }
      ]
    }
    ```

    Create or edit configs in the [Configs Library](https://app.portkey.ai/configs). Reference the config ID inside OpenWebUI requests or pipe valves.

    <Note>
      Configs can be updated anytime to adjust policies without redeploying OpenWebUI.
    </Note>
  </Accordion>

  <Accordion title="Step 4: Implement Access Controls">
    Create user- or team-specific API keys that automatically:

    * Track usage with metadata
    * Apply the right configs and access policies
    * Enforce scoped permissions

    Create API keys through the [Portkey App](https://app.portkey.ai/) or the [API Key Management API](/api-reference/admin-api/control-plane/api-keys/create-api-key):

    ```python theme={"system"}
    from portkey_ai import Portkey

    portkey = Portkey(api_key="YOUR_ADMIN_API_KEY")

    api_key = portkey.api_keys.create(
        name="frontend-engineering",
        type="organisation",
        workspace_id="YOUR_WORKSPACE_ID",
        defaults={
            "config_id": "your-config-id",
            "metadata": {
                "environment": "development",
                "department": "engineering",
                "team": "frontend"
            }
        },
        scopes=["logs.view", "configs.read"]
    )
    ```
  </Accordion>

  <Accordion title="Step 5: Deploy & Monitor">
    Distribute API keys, apply your governance defaults, and monitor live usage inside the Portkey dashboard:

    * Cost tracking by department
    * Model usage patterns
    * Request volumes and error rates
    * Audit-ready metadata
  </Accordion>
</AccordionGroup>

<Check>
  ### Enterprise Features Now Available

  **OpenWebUI now has:**

  * Per-developer budget controls
  * Model access governance
  * Usage tracking & attribution
  * Code security guardrails
  * Reliability features for development workflows
</Check>

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

<Note>
  Before proceeding, ensure you have completed the workspace setup in [Step 1](#1-prepare-your-portkey-workspace) and have your Portkey API key ready. Image generation works with either integration path above.
</Note>

<Steps>
  <Step title="Access Image Settings">
    1. Navigate to your Open WebUI **Admin Panel**
    2. Go to **Settings** → **Images** from the sidebar

    <Frame>
      <img src="https://mintcdn.com/portkey-docs-agentcore/i1wSNMQW9E_Rd8pV/images/integrations/openwebu-image-gen-image.png?fit=max&auto=format&n=i1wSNMQW9E_Rd8pV&q=85&s=a6c9c2d480377465a7bcd3949a8ea791" alt="Open WebUI Images Settings" width="2430" height="889" data-path="images/integrations/openwebu-image-gen-image.png" />
    </Frame>
  </Step>

  <Step title="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](#1-setting-up-portkey))
    5. **Set Default Model**: Enter your model slug in the format:
       ```
       @provider-key/model-name
       ```
       For example: `@openai-test/dall-e-3`
  </Step>

  <Step title="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 others) for supported sizes.
  </Step>

  <Step title="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](https://app.portkey.ai/logs)
  </Step>
</Steps>

### 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

<Frame>
  <img src="https://mintcdn.com/portkey-docs-agentcore/0sFC8formzYd7-pE/images/integrations/image-gen-logs.png?fit=max&auto=format&n=0sFC8formzYd7-pE&q=85&s=4567c8e026e018ba0ccdd4e1f28cff52" alt="Portkey Image Generation Logs" width="600" data-path="images/integrations/image-gen-logs.png" />
</Frame>

<Note>
  **Pro Tip**: If you are using a different AI provider (Gemini, Vertex AI, etc.) and need additional parameters for image generation, add them to a Portkey Config as `override_params` and attach it to your API key. Here's a [guide](/product/administration/enforce-default-config).
</Note>

# Portkey Features

Now that you have an enterprise-grade OpenWebUI setup, 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.

<Frame>
  <img src="https://mintcdn.com/portkey-docs-agentcore/i1wSNMQW9E_Rd8pV/images/integrations/observability.png?fit=max&auto=format&n=i1wSNMQW9E_Rd8pV&q=85&s=5d00b7535c73bf5249c680bdc2d9956a" width="600" data-path="images/integrations/observability.png" />
</Frame>

### 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...

<Frame>
  <img src="https://mintcdn.com/portkey-docs-agentcore/VWncD4ZLqoa55yhe/images/llms/openai/logs.png?fit=max&auto=format&n=VWncD4ZLqoa55yhe&q=85&s=e4aea72be4bc43d5b27d75a8cad62a92" width="3040" height="1764" data-path="images/llms/openai/logs.png" />
</Frame>

### 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.

<Card title="Custom Metata" icon="coins" href="/docs/product/ai-gateway/metadata" />

### 5. Enterprise Access Management

<CardGroup cols={2}>
  <Card title="Budget Controls" icon="coins" href="/product/model-catalog/integrations#3-budget-%26-rate-limits">
    Set and manage spending limits across teams and departments. Control costs with granular budget limits and usage tracking.
  </Card>

  <Card title="Single Sign-On (SSO)" icon="key" href="/docs/product/enterprise-offering/org-management/sso">
    Enterprise-grade SSO integration with support for SAML 2.0, Okta, Azure AD,
    and custom providers for secure authentication.
  </Card>

  <Card title="Organization Management" icon="building" href="/docs/product/enterprise-offering/org-management">
    Hierarchical organization structure with workspaces, teams, and role-based
    access control for enterprise-scale deployments.
  </Card>

  <Card title="Access Rules & Audit Logs" icon="shield-check" href="/docs/product/enterprise-offering/access-control-management#audit-logs">
    Comprehensive access control rules and detailed audit logging for security compliance and usage tracking.
  </Card>
</CardGroup>

### 6. Reliability Features

<CardGroup cols={3}>
  <Card title="Fallbacks" icon="life-ring" href="/product/ai-gateway/fallbacks">
    Automatically switch to backup targets if the primary target fails.
  </Card>

  <Card title="Conditional Routing" icon="route" href="/product/ai-gateway/conditional-routing">
    Route requests to different targets based on specified conditions.
  </Card>

  <Card title="Load Balancing" icon="key" href="/docs/product/ai-gateway/load-balancing">
    Distribute requests across multiple targets based on defined weights.
  </Card>

  <Card title="Caching" icon="database" href="/product/ai-gateway/caching">
    Enable caching of responses to improve performance and reduce costs.
  </Card>

  <Card title="Smart Retries" icon="database" href="/product/ai-gateway/retries">
    Automatic retry handling with exponential backoff for failed requests
  </Card>

  <Card title="Budget Limits" icon="shield-check" href="/product/model-catalog/integrations#3-budget-%26-rate-limits">
    Set and manage budget limits across teams and departments. Control costs
    with granular budget limits and usage tracking.
  </Card>
</CardGroup>

### 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

<Card title="Guardrails" icon="shield-check" href="/docs/product/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.
</Card>

# FAQs

<AccordionGroup>
  <Accordion title="Can I use multiple LLM providers with the same API key?">
    Yes! You can create multiple
    [Integrations](https://app.portkey.ai/integrations) (one for each provider)
    and attach them to a single config. This config can then be connected to
    your API key, allowing you to use multiple providers through a single API
    key.
  </Accordion>

  <Accordion title="How do I track costs for different teams?">
    Portkey provides several ways to track team costs: - Create separate
    Integrations for each team - Use metadata tags in your configs - Set up
    team-specific API keys - Monitor usage in the analytics dashboard
  </Accordion>

  <Accordion title="What happens if a team exceeds their budget limit?">
    When a team reaches their budget limit: 1. Further requests will be blocked
    2\. Team admins receive notifications 3. Usage statistics remain available in
    dashboard 4. Limits can be adjusted if needed
  </Accordion>
</AccordionGroup>

# Next Steps

**Join our Community**

* [Discord Community](https://portkey.sh/discord-report)
* [GitHub Repository](https://github.com/Portkey-AI)

<Note>
  For enterprise support and custom features, contact our [enterprise
  team](https://calendly.com/portkey-ai).
</Note>
