{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiej3s4s34qkxfa7hrsosst6xy2tzasiwsu6aiemrd6fb5occesav4",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mkjrwunjtep2"
},
"path": "/t/does-responses-api-support-stop-parameter-or-not/1379909#post_5",
"publishedAt": "2026-04-28T03:29:14.000Z",
"site": "https://community.openai.com",
"textContent": "Here is a simple Python example using a stop sequence with the OpenAI Responses API:\n\nfrom openai import OpenAI\n\nclient = OpenAI()\n\nresponse = client.responses.create(\nmodel=“gpt-4.1-mini”,\ninput=“Write a short bedtime story in two sentences. End the story with the marker .”,\nstop=[“END”]\n)\n\nprint(response.output_text)\n\nIn this example, `\"END\"` is the stop sequence. When the model generates `\"END\"`, the API stops producing more output, and the stop sequence itself is not included in `response.output_text`.",
"title": "Does Responses API support `stop` parameter or not?"
}