Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Constrains the model to a pre-defined set of allowed tools

Example Usage

import { ToolChoiceAllowed } from "@openrouter/sdk/models";

let value: ToolChoiceAllowed = {
  mode: "auto",
  tools: [
    {
      "name": "get_weather",
      "type": "function",
    },
  ],
  type: "allowed_tools",
};

Fields

FieldTypeRequiredDescription
modemodels.Mode:heavy_check_mark:N/A
toolsRecord<string, *any*>[]:heavy_check_mark:N/A
typemodels.ToolChoiceAllowedType:heavy_check_mark:N/A