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

# Arize AX

> Extend Prisma AIRS AI Gateway with Arize AX for unified LLM observability, tracing, and evaluation.

[Arize AX](https://arize.com/products/ax/) is the full-featured observability and evaluation platform from [Arize AI](https://arize.com/?utm_source=portkey-docs\&utm_medium=partner\&utm_campaign=partner-docs\&utm_content=tracing-provider-arize) for production teams, AI-native companies, and enterprises. It is available as managed cloud or enterprise self-hosted deployment.

The AI Gateway is a **production-grade AI Gateway and Observability platform** for AI applications. The [OpenInference Portkey instrumentation](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-portkey) lets Arize AX capture gateway-routed calls, including gateway requests and the underlying LLM completions.

<Note>
  Use Arize AX for production AI observability and evaluation. If you want an open-source path for local development, experimentation, or single-container self-hosting, use the separate [Arize Phoenix integration](/docs/aigw/integrations/tracing-providers/phoenix).
</Note>

## Why the AI Gateway + Arize AX?

Thanks to OpenInference instrumentation, the AI Gateway can emit structured traces automatically. This gives you visibility into each LLM call routed through the gateway, making it easier to debug behavior, inspect token usage, and evaluate production traffic in Arize AX. For production evaluation patterns, see Arize's [agent evaluation guide](https://arize.com/guides/ai-agent-handbook/agent-evaluation/) and [LLM evaluation guide](https://arize.com/resources/llm-evaluation/).

<CardGroup cols={2}>
  <Card title="AI Gateway Features" icon="shield">
    * **3,000+ LLMs**: Single API for OpenAI, Anthropic, AWS Bedrock, and more
    * **Advanced Routing**: Fallbacks, load balancing, conditional routing
    * **Cost Optimization**: Semantic caching and request controls
    * **Security**: PII detection, content filtering, compliance controls
  </Card>

  <Card title="Built-in Observability" icon="chart-line">
    * **40+ Key Metrics**: Cost, latency, tokens, error rates
    * **Detailed Logs & Traces**: Request/response bodies and custom tracing
    * **Custom Metadata**: Attach custom metadata to your requests
    * **Custom Alerts**: Real-time monitoring and notifications
  </Card>
</CardGroup>

With this integration, you can route LLM traffic through the AI Gateway and gain deep observability in Arize AX, bringing together gateway orchestration and ML observability.

## Getting Started

### Prerequisites

* Python 3.10+
* An Arize AX account
* An AI Gateway API key
* An OpenAI API key, or another provider key routed through the AI Gateway

### Step 1: Install dependencies

Install the required packages for Arize AX and the AI Gateway:

```bash theme={"system"}
pip install arize-otel openinference-instrumentation-portkey openai
```

### Step 2: Configure credentials

Set the Arize AX and AI Gateway credentials in the same shell that runs your application:

```bash theme={"system"}
export ARIZE_SPACE_ID="your-space-id"
export ARIZE_API_KEY="your-arize-api-key"
export ARIZE_PROJECT_NAME="portkey-gateway"
export PORTKEY_API_KEY="your-portkey-api-key"
export OPENAI_API_KEY="your-openai-api-key"
```

### Step 3: Register Arize AX and instrument the AI Gateway

<Steps>
  <Step title="Configure Arize AX">
    First, set up the Arize AX OpenTelemetry configuration:

    ```python theme={"system"}
    import os
    from arize.otel import register
    from openinference.instrumentation.portkey import PortkeyInstrumentor

    tracer_provider = register(
        space_id=os.environ["ARIZE_SPACE_ID"],
        api_key=os.environ["ARIZE_API_KEY"],
        project_name=os.environ["ARIZE_PROJECT_NAME"],
    )

    PortkeyInstrumentor().instrument(tracer_provider=tracer_provider)
    ```
  </Step>

  <Step title="Configure AI Gateway">
    Set up the AI Gateway in the same process after registering the `PortkeyInstrumentor`:
  </Step>
</Steps>

## Complete Integration Example

Here's a complete working example that connects AI Gateway with Arize AX for centralized monitoring.

## Verify in Arize AX

Open your Arize AX space and select the project configured by `ARIZE_PROJECT_NAME`. You should see a trace for the AI Gateway request, including the LLM span, prompt, response, token usage, model, and provider metadata.

<Card title="Arize AX AI Gateway Tracing Guide" icon="book" href="https://arize.com/docs/ax/integrations/python-agent-frameworks/portkey/portkey-tracing">
  See the Arize-side the AI Gateway tracing setup, verification steps, and troubleshooting guidance.
</Card>

<Card title="Cookbook on the AI Gateway x Arize" href="/docs/guides/integrations/arize-portkey">
  Learn how to use the AI Gateway's Universal API to orchestrate multiple LLMs in a structured debate while tracking performance and evaluating outputs with Arize.
</Card>

## AI Gateway Features

While Arize AX provides observability and evaluation, the AI Gateway delivers a complete AI infrastructure platform. Here's everything you get with the AI Gateway:

### 🚀 Core Gateway Capabilities

<CardGroup cols={2}>
  <Card title="3,000+ LLMs" icon="layer-group" href="/docs/integrations">
    Access OpenAI, Anthropic, Google, Cohere, Mistral, Llama, and 3,000+ models through a single unified API. No more managing different SDKs or endpoints.
  </Card>

  <Card title="Universal API" icon="key" href="/docs/aigw/product/ai-gateway/universal-api">
    Use the same code to call any LLM provider. Switch between models and providers without changing your application code.
  </Card>

  <Card title="LLM Integrations" icon="key" href="/docs/product/integrations">
    Secure vault for API keys with budget limits, rate limiting, and access controls. Never expose raw API keys in your code.
  </Card>

  <Card title="Advanced Configs" icon="cog" href="/docs/aigw/product/ai-gateway/configs">
    Define routing strategies, model parameters, and reliability settings in reusable configurations. Version control your AI infrastructure.
  </Card>
</CardGroup>

### 🛡️ Reliability & Performance

<CardGroup cols={3}>
  <Card title="Smart Fallbacks" icon="life-ring" href="/docs/aigw/product/ai-gateway/fallbacks">
    Automatically switch to backup providers when primary fails. Define fallback chains across multiple providers.
  </Card>

  <Card title="Load Balancing" icon="shield" href="/docs/aigw/product/ai-gateway/load-balancing">
    Distribute requests across multiple API keys or providers based on custom weights and strategies.
  </Card>

  <Card title="Automatic Retries" icon="rotate-ccw" href="/docs/aigw/product/ai-gateway/automatic-retries">
    Configurable retry logic with exponential backoff for transient failures and rate limits.
  </Card>

  <Card title="Request Timeouts" icon="clock" href="/docs/aigw/product/ai-gateway/request-timeouts">
    Set custom timeouts to prevent hanging requests and improve application responsiveness.
  </Card>

  <Card title="Conditional Routing" icon="route" href="/docs/aigw/product/ai-gateway/conditional-routing">
    Route requests to different models based on content, metadata, or custom conditions.
  </Card>

  <Card title="Canary Testing" icon="flask" href="/docs/aigw/product/ai-gateway/canary-testing">
    Gradually roll out new models or providers with percentage-based traffic splitting.
  </Card>
</CardGroup>

### 💰 Cost Optimization

<CardGroup cols={2}>
  <Card title="Semantic Caching" icon="database" href="/docs/aigw/product/ai-gateway/cache-simple-and-semantic">
    Intelligent caching that understands semantic similarity. Reduce costs by up to 90% on repeated queries.
  </Card>

  <Card title="Budget Limits" icon="dollar-sign" href="/docs/aigw/product/policies/budget-limits">
    Set spending limits per provider, team, or project. Get alerts before hitting limits.
  </Card>

  <Card title="Rate Limits" icon="clock" href="/docs/aigw/product/policies/rate-limits">
    Set rate limits per provider, team, or project.
  </Card>

  <Card title="Cost Analytics" icon="chart-pie" href="/docs/aigw/product/observability/analytics">
    Real-time cost tracking across all providers with detailed breakdowns by model, user, and feature.
  </Card>
</CardGroup>

### 📊 Built-in Observability

<CardGroup cols={2}>
  <Card title="Comprehensive Metrics" icon="chart-bar" href="/docs/aigw/product/observability/analytics">
    Track 40+ metrics including latency, tokens, costs, cache hits, error rates, and more in real-time.
  </Card>

  <Card title="Detailed Logs" icon="list" href="/docs/aigw/product/observability/logs">
    Full request/response logging with advanced filtering, search, and export capabilities.
  </Card>

  <Card title="Distributed Tracing" icon="list" href="/docs/aigw/product/observability/traces">
    Trace requests across your entire AI pipeline with correlation IDs and custom metadata.
  </Card>

  <Card title="Custom Alerts" icon="bell" href="/docs/aigw/product/observability/analytics">
    Set up alerts on any metric with webhook, email, or Slack notifications.
  </Card>
</CardGroup>

### 🔒 Security & Compliance

<CardGroup cols={3}>
  <Card title="PII Detection" icon="shield-check" href="/docs/aigw/product/guardrails">
    Automatically detect and redact sensitive information like SSN, credit cards, and personal data.
  </Card>

  <Card title="Content Filtering" icon="filter" href="/docs/aigw/product/guardrails">
    Block harmful, toxic, or inappropriate content in real-time based on custom policies.
  </Card>

  <Card title="Access Controls" icon="users" href="/docs/aigw/product/enterprise-offering/access-control-management">
    Fine-grained RBAC with team management, user permissions, and audit logs.
  </Card>

  <Card title="SOC2 Compliance" icon="certificate" href="/docs/aigw/product/enterprise-offering/security">
    Enterprise-grade security with SOC2 Type II certification and GDPR compliance.
  </Card>

  <Card title="Audit Logs" icon="history" href="/docs/aigw/product/enterprise-offering/access-control-management#audit-logs">
    Complete audit trail of all API usage, configuration changes, and user actions.
  </Card>

  <Card title="Data Privacy" icon="lock" href="/docs/aigw/product/enterprise-offering/security">
    Zero data retention options and deployment in your own VPC for maximum privacy.
  </Card>
</CardGroup>

### 🏢 Enterprise Features

<CardGroup cols={2}>
  <Card title="SSO Integration" icon="key" href="/docs/aigw/product/enterprise-offering/org-management/sso">
    SAML 2.0 support for Okta, Azure AD, Google Workspace, and custom IdPs.
  </Card>

  <Card title="Organisation Management" icon="building" href="/docs/aigw/product/enterprise-offering/org-management">
    Multi-workspace support with hierarchical teams and department-level controls.
  </Card>

  <Card title="Access Control" icon="user-lock" href="/docs/aigw/product/enterprise-offering/access-control-management">
    Team and individual level RBAC for AI services, LLMs, logs, and more.
  </Card>

  <Card title="Private Deployments" icon="server" href="/docs/aigw/self-hosting/hybrid-deployments/architecture">
    Deploy the AI Gateway in your own AWS, Azure, or GCP environment with full control.
  </Card>
</CardGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore AI Gateway Features" icon="rocket" href="/docs/aigw/product/ai-gateway">
    Discover all AI Gateway capabilities beyond observability
  </Card>

  <Card title="LLM Integrations" icon="key" href="/docs/product/integrations">
    Secure your API keys and set budgets
  </Card>

  <Card title="Advanced Routing" icon="route" href="/docs/aigw/product/ai-gateway/configs">
    Configure fallbacks, load balancing, and more
  </Card>

  <Card title="Built-in Analytics" icon="chart-bar" href="/docs/aigw/product/observability">
    Use the AI Gateway's native observability features
  </Card>
</CardGroup>


## Related topics

- [Arize Phoenix](/docs/aigw/integrations/tracing-providers/phoenix.md)
- [Supported OTel Libraries](/docs/aigw/product/observability/opentelemetry/list-of-supported-otel-instrumenters.md)
