OpenRouter validates the diff and returns it as an apply_patch_call output item. Your application applies the patch to its own files and sends the result back as apply_patch_call_output on the next turn.
Available through the API. Patches are applied by your application, so there is no file system to edit in the chatroom.
Supported APIs: Responses.
curl https://openrouter.ai/api/v1/responses \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"tools": [
{
"type": "openrouter:apply_patch"
}
],
"input": "Rename the function greet to sayHello in src/index.ts."
}'