OpenAI API · sdk · fg-0135

Agents SDK logs 'OPENAI_API_KEY is not set, skipping trace export' when using another model provider

If you see OPENAI_API_KEY is not set, skipping trace export, the cause and the fix for OpenAI API are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
OPENAI_API_KEY is not set, skipping trace exportAgent runs succeed but no traces appear in the OpenAI dashboard
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"])
Affected
openai-agents-python 0.x with non-OpenAI providers or ZDR organizations, checked October 2026
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun