OutputApplyPatchCallItem - TypeScript SDK

OutputApplyPatchCallItem type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

A native apply_patch_call output item matching OpenAI’s Responses API shape. Emitted when the client requested the apply_patch shorthand.

Example Usage

1import { OutputApplyPatchCallItem } from "@openrouter/sdk/models";
2
3let value: OutputApplyPatchCallItem = {
4 callId: "<id>",
5 id: "msg-abc123",
6 operation: {
7 diff: "@@ function main() {\n+ console.log(\"hi\");\n }",
8 path: "/src/main.ts",
9 type: "update_file",
10 },
11 status: "completed",
12 type: "apply_patch_call",
13};

Fields

FieldTypeRequiredDescriptionExample
callIdstring✔️N/A
idstring✔️N/A
operationmodels.ApplyPatchCallOperation✔️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✔️Lifecycle state of an apply_patch_call output item.completed
type”apply_patch_call”✔️N/A