Skip to main content
Valiqor automatically traces all OpenAI chat.completions.create calls — both sync and async. Every call is recorded as a span with model name, token usage, cost, and full message content.

Install

This installs valiqor plus openai>=1.0.0.
Add a single import at the top of your app — all OpenAI calls are automatically traced:
That’s it. Every chat.completions.create call is now traced with full metadata.

Selective Instrumentation

If you only want OpenAI tracing (not other providers), use the provider-specific function:
Both are equivalent — they enable tracing only for OpenAI.

Async Support

Async OpenAI calls are automatically traced too:

Tool / Function Calls

Tool calls are captured automatically. Each tool call in the response is recorded with the function name, call ID, and parsed arguments:

What Gets Captured

Each traced OpenAI call records:

With Workflows

Combine with trace_workflow to group multiple OpenAI calls into a single trace:
Both calls appear as child spans under the research-assistant trace.

Disabling

To disable OpenAI tracing:

Limitations

  • Streaming is not currently instrumented — streamed responses are not captured in traces
  • Embeddings (client.embeddings.create) are not traced — only chat.completions.create is instrumented

Next Steps

Tracing Guide

Learn about traces, spans, workflows, and exporters.

Failure Analysis

Run failure analysis on your traced OpenAI calls.