Skip to main content
OpenRouter is a multi-provider LLM gateway — one API key, 100+ models from OpenAI, Anthropic, Google, Meta, Mistral, and more. The endpoint at https://openrouter.ai/api/v1 mirrors OpenAI’s schema, so any OpenAI client works with base_url set to OpenRouter. Arize AX captures every OpenRouter call via the openinference-instrumentation-openai package — the same instrumentor that covers OpenAI’s hosted API.
This page instruments your own application’s calls to OpenRouter. OpenRouter can also broadcast traces for every request to Arize directly, with no application code — see the OpenRouter platform integration.

Prerequisites

Launch Arize

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Configure credentials

Setup tracing

Run OpenRouter

Expected output

Verify in Arize

  1. Open your Arize AX space and select project openrouter-tracing-example.
  2. You should see a new trace within ~30 seconds containing a ChatCompletion LLM span with the prompt, response, and token usage attached. The model name on the span will be the OpenRouter model identifier you used (e.g. openai/gpt-5.4-mini).
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize. Confirm ARIZE_SPACE_ID and ARIZE_API_KEY are set in the same shell that runs example.py. Enable OpenTelemetry debug logs with export OTEL_LOG_LEVEL=debug and re-run.
  • OpenRouter spans missing but other spans present. OpenAIInstrumentor().instrument(...) must run before any import openai. Make sure instrumentation.py is the first import in your entry point.
  • 401 from OpenRouter. Use your OpenRouter API key (from the OpenRouter dashboard), not your OpenAI key. They are different services with different credentials.
  • Model not found. OpenRouter expects a <provider>/<model> identifier (e.g. openai/gpt-5.4-mini, anthropic/claude-sonnet-4-6, meta-llama/llama-3.3-70b-instruct). See the OpenRouter model list for current names.
  • Free models unavailable. OpenRouter’s :free tier models have aggressive rate limits and rotate availability. If a :free variant 429s, swap for a paid alternative.

Resources

OpenRouter Documentation

OpenInference OpenAI Instrumentor (used for OpenRouter)

OpenRouter Model Catalog