Skip to main content

HTTP status

400 invalid_request_error

Typical cause

You included a hosted tool that the selected model doesn’t support. Recognized hosted tool types:
  • web_search_preview — web search
  • file_search — file search over uploaded files
  • code_interpreter — sandboxed code execution
  • image_generation — image generation and editing
Not all models support all hosted tools. The model must be served by a provider that supports the tool natively.

Resolution

Remove the hosted tool from the request, or switch to a model that supports it. Function tools (type: "function") work with all models that support tool calling.