Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.

interface ToolChoiceTypes {
    type:
        | "file_search"
        | "web_search_preview"
        | "web_search_preview_2025_03_11"
        | "computer_use_preview"
        | "mcp"
        | "code_interpreter"
        | "image_generation";
}

Properties

Properties

type:
    | "file_search"
    | "web_search_preview"
    | "web_search_preview_2025_03_11"
    | "computer_use_preview"
    | "mcp"
    | "code_interpreter"
    | "image_generation"

The type of hosted tool the model should to use. Learn more about built-in tools.

Allowed values are:

  • file_search
  • web_search_preview
  • computer_use_preview
  • code_interpreter
  • mcp
  • image_generation