Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
A call to a custom (freeform-grammar) tool created by the model — distinct from function_call. Used for tools like Codex CLI’s apply_patch whose payload is opaque text rather than JSON arguments.

Example Usage

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

let value: CustomToolCallItem = {
  callId: "call-abc123",
  input: "*** Begin Patch\n*** End Patch",
  name: "apply_patch",
  type: "custom_tool_call",
};

Fields

FieldTypeRequiredDescription
callIdstring:heavy_check_mark:N/A
idstring:heavy_minus_sign:N/A
inputstring:heavy_check_mark:N/A
namestring:heavy_check_mark:N/A
namespacestring:heavy_minus_sign:Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)
typemodels.CustomToolCallItemType:heavy_check_mark:N/A