Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an apply_patch_call_output on the next turn.

Example Usage

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

let value: ApplyPatchCallItem = {
  callId: "call_abc123",
  operation: {
    diff: "@@ function main() {\n+  console.log(\"hi\");\n }",
    path: "/src/main.ts",
    type: "update_file",
  },
  status: "completed",
  type: "apply_patch_call",
};

Fields

FieldTypeRequiredDescriptionExample
callIdstring:heavy_check_mark:N/A
idstring:heavy_minus_sign:N/A
operationmodels.ApplyPatchCallOperation:heavy_check_mark:The patch operation requested by an apply_patch_call. create_file and update_file carry a V4A diff; delete_file omits it.{"diff": "@@ function main() {\n+ console.log(\"hi\");\n }”,
“path”: “/src/main.ts”,
“type”: “update_file”
}
statusmodels.ApplyPatchCallStatus:heavy_check_mark:Lifecycle state of an apply_patch_call output item.completed
typemodels.ApplyPatchCallItemType:heavy_check_mark:N/A