Using apply_patch

GPT
Template Prompt
Intermediate

Prompt

response = client.responses.create( 
model="gpt-5.1", 
input=RESPONSE_INPUT, 
tools=[{"type": "apply_patch"}]
)