OpenAI Agents SDK errors / Config

agents.exceptions.UserError: Hosted tools are not supported with the ChatCompletions API.

platform: OpenAI Agents SDK / category: Config

Cause

HostedMCPTool (and tools like WebSearchTool) require the Responses API, but the agent was initialised with OpenAIChatCompletionsModel, which uses the Chat Completions endpoint that does not support hosted tools.

Fix

Switch to the default OpenAIResponsesModel (or omit the model argument) so the SDK uses the Responses API. If you must use Chat Completions, replace hosted tools with MCPServerStdio or MCPServerSse local integrations. Do not mix HostedMCPTool with a ChatCompletions-backed model.

Source thread →

Part of the Automation Error Index — OpenAI Agents SDK errors: browse all.

Hitting an automation error we have not covered?

AutomateLab builds and debugs n8n, Make, and agent workflows as fixed-scope projects. If something is broken in production, tell us what you are seeing.

Describe the problem