Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

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

let value: ChatFunctionToolFunction = {
  function: {
    name: "get_weather",
  },
  type: "function",
};

Fields

FieldTypeRequiredDescriptionExample
cacheControlmodels.ChatContentCacheControl:heavy_minus_sign:Cache control for the content part{"ttl": "5m","type": "ephemeral"}
functionmodels.ChatFunctionToolFunctionFunction:heavy_check_mark:Function definition for tool calling{"description": "Get the current weather for a location","name": "get_weather","parameters": {"properties": {"location": {"description": "City name","type": "string"}
},
“required”: [
“location”
],
“type”: “object”
}
}
typemodels.ChatFunctionToolType:heavy_check_mark:N/A