Skip to main content

Using Arize AX

Arize AX is the full-featured observability and evaluation platform from Arize AI for production teams, AI-native companies, and enterprises, available as managed cloud or enterprise self-hosted deployment. Since OpenRouter uses the OpenAI API schema, you can use Arize’s OpenInference auto-instrumentation with the OpenAI SDK to automatically trace and monitor your OpenRouter API calls. If you need an open-source path for local development or self-hosted experimentation, see Arize Phoenix. For production evaluation workflows, Arize’s agent evaluation guide and LLM evaluation guide show how traces help debug failures, score behavior, and evaluate model responses.

Installation

Prerequisites

  • OpenRouter account and API key
  • Arize account with Space ID and API Key

Why OpenRouter Works with Arize AX

Arize’s OpenInference auto-instrumentation works with OpenRouter because:
  1. OpenRouter provides a fully OpenAI-API-compatible endpoint - The /v1 endpoint mirrors OpenAI’s schema
  2. Reuse official OpenAI SDKs - Point the OpenAI client’s base_url to OpenRouter
  3. Automatic instrumentation - OpenInference hooks into OpenAI SDK calls seamlessly

Configuration

Set up your environment variables:

Simple LLM Call

Initialize Arize AX and instrument your OpenAI client to automatically trace OpenRouter calls:

What Gets Traced

All OpenRouter model calls are automatically traced and include:
  • Request/response data and timing
  • Model name and provider information
  • Token usage and cost data (when supported)
  • Error handling and debugging information

JavaScript/TypeScript Support

OpenInference also provides instrumentation for the OpenAI JavaScript/TypeScript SDK, which works with OpenRouter. For setup and examples, please refer to the OpenInference JavaScript examples for OpenAI.

Common Issues

  • API Key: Use your OpenRouter API key, not OpenAI’s
  • Model Names: Use exact model names from OpenRouter’s model list
  • Rate Limits: Check your OpenRouter dashboard for usage limits

Learn More