OpenAI API · sdk · fg-0135
Agents SDK logs 'OPENAI_API_KEY is not set, skipping trace export' when using another model provider
OPENAI_API_KEY is not set, skipping trace export
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Tracing is on by default and exports to OpenAI with an OpenAI key, even when the agent runs on a non-OpenAI model through a custom client. Tracing is also unavailable to organizations under Zero Data Retention.
Fix
Disable tracing, or give the exporter its own OpenAI key.
Apply
from agents import set_tracing_disabled, set_tracing_export_api_key set_tracing_disabled(True) # or keep tracing: set_tracing_export_api_key(os.environ["OPENAI_TRACING_KEY"])
Affects: openai-agents-python 0.x with non-OpenAI providers or ZDR organizations, checked October 2026
Sources
- https://openai.github.io/openai-agents-python/tracing/
- https://github.com/openai/openai-agents-python/issues/190
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp