“Empty reply from server” when calling o3 with web-search tool

I’m getting an Empty reply from server error when using the Responses API with the o3 model and the web-search tool.

  • Endpoint: https://api.openai.com/v1/responses
  • Model: o3
  • Tools: web-search
  • Error text: Empty reply from server for https://api.openai.com/v1/responses
    Minimal repro (curl):
    curl https://api.openai.com/v1/responses
    -H “Authorization: Bearer $OPENAI_API_KEY”
    -H “Content-Type: application/json”
    -d ‘{
    “model”: “o3”,
    “input”: “Search online for information about this domain: example.com”,
    “tools”: [{“type”: “web-search”}]
    }’

Result: curl: (52) Empty reply from server

Is o3 with web-search via responses api not working correctly, or is it something from my end?
Any help would be appreciated.

I’ve been struggling with this issue for too long.

I was coding with PHP, so there was no clear error message rather than “Empty reply”.
I switched to Python, and voila, the connection was dropped because it took too long to fetch the answer while searching online.

After some search, for long-running jobs (web-search + heavy reasoning on o3/o3-pro, etc.) you should send the request in background mode so the work happens server-side without keeping a single connection open.
More detail could be found here
https://platform.openai.com/docs/guides/background