Troubleshooting
Supported environments
Section titled “Supported environments”The OpenAI Agents SDK is supported on the following server environments:
- Node.js 22+
- Deno 2.35+
- Bun 1.2.5+
Limited support
Section titled “Limited support”- Cloudflare Workers: The Agents SDK can be used in Cloudflare Workers, but currently comes with some limitations:
- The SDK current requires
nodejs_compatto be enabled - Traces need to be manually flushed at the end of the request. See the tracing guide for more details.
- Due to Cloudflare Workers’ limited support for
AsyncLocalStoragesome traces might not be accurate - Outbound WebSocket connections must use a fetch-based upgrade (not the global
WebSocketconstructor). For Realtime, use the Cloudflare transport in@openai/agents-extensions(CloudflareRealtimeTransportLayer).
- The SDK current requires
- Responses API WebSocket transport:
- Requires a global
WebSocketimplementation. - The
WebSocketimplementation must support custom headers for the handshake. - Many browser-style WebSocket APIs (and some edge runtimes) do not support custom outbound headers. In those environments, use the default HTTP Responses transport instead.
- If you see errors mentioning a missing global
WebSocketimplementation or lack of custom-header support, the runtime websocket implementation is not compatible with the Responses WebSocket transport.
- Requires a global
- Browsers:
- Tracing is currently not supported in browsers
- v8 isolates:
- While you should be able to bundle the SDK for v8 isolates if you use a bundler with the right browser polyfills, tracing will not work
- v8 isolates have not been extensively tested
Debug logging
Section titled “Debug logging”If you are running into problems with the SDK, you can enable debug logging to get more information about what is happening.
Enable debug logging by setting the DEBUG environment variable to openai-agents:*.
DEBUG=openai-agents:*Alternatively, you can scope the debugging to specific parts of the SDK:
openai-agents:core— for the main execution logic of the SDKopenai-agents:openai— for the OpenAI API callsopenai-agents:realtime— for the Realtime Agents components