Platform · OpenAI

Observe AI agents that call OpenAI.

Your agent calls OpenAI for chat, embeddings, assistants, or the Responses API. Trefur auto-instruments the SDK and captures each invocation as a span on the agent trace — with the prompt the model saw, the completion it returned, and every tool call in between.

What you see.

Chat Completions — model, prompt, completion, tool calls, stream mode, finish reason.
Responses API — single span per response, tool steps as children.
Embeddings — model, input length, dimensions, tokens, USD attributed.
Assistants — thread ID, run ID, every step on the run, tool outputs submitted.
Streaming completions captured as one span with the full text on close.
Rate limits (429), context-length errors, model deprecation warnings.
Per-org and per-project tagging if you set the OpenAI-Organization header.

Why it matters.

For engineers

One line at startup auto-instruments the OpenAI SDK. Existing code keeps working; the trace shows every call with the prompt the model saw and the completion it returned.

For platform teams

Roll up OpenAI usage per agent, per environment, per project. Give finance a clean breakdown. One trace shape so swapping to Azure or Anthropic later does not break dashboards.

For business operators

See which workflows depend on OpenAI and what they cost. Catch silent model changes (gpt-4o → 4o-mini fallbacks) that drift cost-per-run.

For SRE

OpenAI throttling and context-length errors land on the span. Envelope alerts catch retry-rate spikes and route to oncall with the trace already attached.

How it works.

The Trefur SDK wraps the OpenAI client. TrefurObserve.init() and patch_openai(obs) at startup register the hooks; every call to client.chat.completions.create, client.responses.create, client.embeddings.create, and the Assistants APIs emits a span. The trace carries prompt and completion content, tokens, USD per OpenAI pricing, tool args, and any retries. The collector can run inside your network if you want prompt content to stay local.

See what your OpenAI agents are actually doing.

Free tier. No card required. First trace in under five minutes.