/chat/completions, /responses, /embeddings, and /models at https://<gateway-host>/<context-path>, so any OpenAI client works with base_url set to the proxy. Arize AX captures every call via the openinference-instrumentation-openai package — the same instrumentor that covers OpenAI’s hosted API.
This guide instruments your application’s calls to the gateway, producing OpenInference LLM spans with prompts, responses, and token usage. Gravitee’s own OpenTelemetry support emits gateway HTTP spans instead, which do not carry LLM attributes.
Prerequisites
- Python 3.9+
- An Arize AX account (sign up)
- A deployed Gravitee LLM Proxy API — requires a self-hosted or hybrid APIM installation (4.10 or later) and an Enterprise license. See Proxy your LLMs.
- A subscription API key for a plan on that API
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 Gravitee
Expected output
Verify in Arize
- Open your Arize AX space and select project
gravitee-tracing-example. - You should see a new trace within ~30 seconds containing a
ChatCompletionLLM span with the prompt, response, and token usage attached. - 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.- Arize skill (agent)
- AX CLI
- SDK
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_IDandARIZE_API_KEYare set in the same shell that runsexample.py. Enable OpenTelemetry debug logs withexport OTEL_LOG_LEVEL=debugand re-run. - Gravitee spans missing but other spans present.
OpenAIInstrumentor().instrument(...)must run before anyimport openai. Make sureinstrumentation.pyis the first import in your entry point. 401from Gravitee. An API Key plan expects the subscription key in a custom header —X-Gravitee-Api-Keyby default — not inAuthorization: Bearer. Passing the key asapi_key=alone will fail. If your plan overrides the header name, use that name indefault_headers.404on the request path. The base URL is your Gateway URL plus the LLM Proxy context path, with no/v1segment (e.g.https://gateway.example.com/llmtest). The OpenAI client appends/chat/completionsitself.- Model not found. Model IDs are namespaced by context path in a
context-path:model-nameformat (e.g.llmtest:gpt-5.4-mini). Copy the exact ID fromcurl $GRAVITEE_BASE_URL/models.