ToolChoiceAllowed - TypeScript SDK

ToolChoiceAllowed type definition

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

1import { ToolChoiceAllowed } from "@openrouter/sdk/models";
2
3let value: ToolChoiceAllowed = {
4 mode: "auto",
5 tools: [
6 {
7 "name": "get_weather",
8 "type": "function",
9 },
10 ],
11 type: "allowed_tools",
12};

Fields

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