OpenRouter is a multi-provider LLM gateway — one API key, 100+ models from OpenAI, Anthropic, Google, Meta, Mistral, and more. The endpoint atDocumentation Index
Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
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.
Prerequisites
- Python 3.9+
- An Arize AX account (sign up)
- An
OPENROUTER_API_KEYfrom the OpenRouter dashboard
Launch Arize
- Sign in to your Arize AX account.
- From Space Settings, copy your Space ID and API Key. You will set them as
ARIZE_SPACE_IDandARIZE_API_KEYbelow.
Install
Configure credentials
Setup tracing
Run OpenRouter
Expected output
Verify in Arize
- Open your Arize AX space and select project
openrouter-tracing-example. - You should see a new trace within ~30 seconds containing a
ChatCompletionLLM 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-mini). - If no traces appear, see Troubleshooting.
Troubleshooting
- No traces in Arize. Confirm
ARIZE_SPACE_IDandARIZE_API_KEYare set in the same shell that runsexample.py. Enable OpenTelemetry debug logs withexport OTEL_LOG_LEVEL=debugand re-run. - OpenRouter spans missing but other spans present.
OpenAIInstrumentor().instrument(...)must run before anyimport openai. Make sureinstrumentation.pyis the first import in your entry point. 401from 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-mini,anthropic/claude-sonnet-4-5,meta-llama/llama-3.3-70b-instruct). See the OpenRouter model list for current names. - Free models unavailable. OpenRouter’s
:freetier models have aggressive rate limits and rotate availability. If a:freevariant 429s, swap for a paid alternative.