Additional configurations
Tool choice
By default the model will determine when and how many tools to use. You can force specific behavior with the tool_choice parameter.
- Auto: (Default) Call zero, one, or multiple functions.
tool_choice: "auto" - Required: Call one or more functions.
tool_choice: "required" - Forced Function: Call exactly one specific function.
tool_choice: \{"type": "function", "name": "get_weather"\} - Allowed tools: Restrict the tool calls the model can make to a subset of the tools available to the model.
When to use allowed_tools
You might want to configure an allowed_tools list in case you want to make only a subset of tools available across model requests, but not modify the list of tools you pass in, so you can maximize savings from prompt caching.
"tool_choice": {
"type": "allowed_tools",
"mode": "auto",
"tools": [
{ "type": "function", "name": "get_weather" },
{ "type": "function", "name": "search_docs" }
]
}
}You can also set tool_choice to "none" to imitate the behavior of passing no functions.
When you use tool search, tool_choice still applies to the tools that are currently callable in the turn. This is most useful after you load a subset of tools and want to constrain the model to that subset.
Parallel function calling
On supported models beginning with GPT-5, functions can be called in parallel when built-in tools are also available. Built-in tools cannot be included in a parallel function-call batch.
The model may choose to call multiple functions in a single turn. You can prevent this by setting parallel_tool_calls to false, which ensures exactly zero or one tool is called.
Note: Currently, if you are using a fine tuned model and the model calls multiple functions in one turn then strict mode will be disabled for those calls.
Note for gpt-4.1-nano-2025-04-14: This snapshot of gpt-4.1-nano can sometimes include multiple tool calls for the same tool if parallel tool calls are enabled. It is recommended to disable this feature when using this snapshot.
Strict mode
Setting strict to true will ensure function calls reliably adhere to the function schema, instead of being best effort. We recommend always enabling strict mode.
Under the hood, strict mode works by leveraging our structured outputs feature and therefore introduces a couple requirements:
additionalPropertiesmust be set tofalsefor each object in theparameters.- All fields in
propertiesmust be marked asrequired.
You can denote optional fields by adding null as a type option (see example below).
If you send strict: true and your schema does not meet the requirements above, the request will be rejected with details about the missing constraints. If you omit strict, the default depends on the API: Responses requests will attempt to normalize your schema into strict mode when possible, and will fall back to non-strict, best-effort function calling if the schema cannot be made compatible with strict mode. When fallback happens, the response tool will show strict: false. Chat Completions requests remain non-strict by default. To opt out of strict mode in Responses and keep non-strict, best-effort function calling, explicitly set strict: false.
Strict mode enabled
{
"type": "function",
"name": "get_weather",
"description": "Retrieves current weather for the given location.",
//highlight-start
"strict": true,
//highlight-end
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. Bogotá, Colombia"
},
"units": {
//highlight-start
"type": ["string", "null"],
//highlight-end
"enum": ["celsius", "fahrenheit"],
"description": "Units the temperature will be returned in."
}
},
//highlight-start
"required": ["location", "units"],
"additionalProperties": false
//highlight-end
}
}Strict mode disabled
{
"type": "function",
"name": "get_weather",
"description": "Retrieves current weather for the given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. Bogotá, Colombia"
},
"units": {
//highlight-start
"type": "string",
//highlight-end
"enum": ["celsius", "fahrenheit"],
"description": "Units the temperature will be returned in."
}
},
//highlight-start
"required": ["location"],
//highlight-end
}
}All schemas generated in the playground have strict mode enabled.
While we recommend you enable strict mode, it has a few limitations:
- Some features of JSON schema are not supported. (See supported schemas.)
Specifically for fine tuned models:
- Schemas undergo additional processing on the first request (and are then cached). If your schemas vary from request to request, this may result in higher latencies.
- Schemas are cached for performance, and are not eligible for zero data retention.