Skip to content

OpenAI

Status: beta native support for both the direct OpenAI SDK and OpenAI Agents.

Choose the path

  • OpenAI Agents SDK: use openai_agents.instrument.
  • Direct Responses, Chat Completions, or embeddings: use openai.instrument or instrument_openai inside an existing execution.
  • LangChain or LangGraph with an OpenAI model: use that framework's Witdem wrapper and pass provider="openai"/model= only when framework metadata is incomplete.
  • Haystack 3: use the Haystack wrapper; it observes OpenAI generator response metadata at the native component boundary.

OpenAI Agents example

cd examples/openai/basic_agent
cp .env.example .env
uv sync
uv run python sdk_enriched.py

Required variables:

OPENAI_API_KEY=...
OPENAI_MODEL=gpt-4o-mini
WITDEM_ENDPOINT=http://localhost:4318

See the full integration guide and multi-agent handoff example.

Cost

The bundled catalog includes the exact OpenAI models listed in catalog.yaml, including GPT-4o, GPT-4.1, o3/o4-mini, GPT-5.3 Codex, and GPT-5.4–5.6 families. Other model names remain unmeasured unless the provider reports money or you supply a custom pricing catalog. See Pricing catalog for tier, long-context, regional, search, and media pricing behavior.

Limitations

  • Direct OpenAI and OpenAI Agents are separate adapters; neither globally monkey-patches the other SDK.
  • Azure OpenAI has separate endpoint/deployment semantics; use the Azure guide.
  • Cost is not proof that content capture is enabled. Prompts and outputs remain disabled by default.