base_url to Z.ai and use openinference-instrumentation-openai to send LLM traces to Phoenix.
This page instruments OpenAI SDK calls to Z.ai’s OpenAI-compatible endpoint. It is not a separate Z.ai-specific OpenInference instrumentor.
Install
Setup
Add your Z.ai API key as an environment variable:register function:
Run Z.ai
Observe
Now that you have tracing set up, all invocations of the OpenAI client pointed at Z.ai will be streamed to your running Phoenix for observability and evaluation. Each call appears as aChatCompletion LLM span with the prompt, response, model name, token usage, and latency.
Common Issues
- Spans missing:
register(..., auto_instrument=True)must run before your application sends requests, andopeninference-instrumentation-openaimust be installed in the same environment 401from Z.ai: Use your Z.ai API key, not an OpenAI key- Model not found: Replace
glm-5.3with a model available in your Z.ai account. Some Z.ai plans use a different OpenAI-compatible base URL, so confirm the endpoint in your Z.ai console

