SpyBara
Go Premium

Documentation 2026-07-08 22:02 UTC to 2026-07-09 17:03 UTC

75 files changed +3,248 −911. View all changes and history on the product overview
2026
Wed 15 16:58 Tue 14 21:58 Mon 13 21:58 Sat 11 07:01 Fri 10 23:02 Thu 9 17:03 Wed 8 22:02 Mon 6 22:58 Sat 4 16:59

concepts.md +1 −1

Details

6 6 

7## Text generation models7## Text generation models

8 8 

9OpenAI's text generation models (often referred to as generative pre-trained transformers or "GPT" models for short), like [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and [`gpt-5.4-mini`](https://developers.openai.com/api/docs/models/gpt-5.4-mini), have been trained to understand natural and formal language. These models allow text outputs in response to their inputs. The inputs to these models are also referred to as "prompts." Designing a prompt is essentially how you "program" a model, usually by providing instructions or some examples of how to successfully complete a task. GPT models can be used across a great variety of tasks including content or code generation, summarization, conversation, creative writing, and more. Read more in our introductory [text generation guide](https://developers.openai.com/api/docs/guides/text-generation) and in our [prompt engineering guide](https://developers.openai.com/api/docs/guides/prompt-engineering).9OpenAI's text generation models (often referred to as generative pre-trained transformers or "GPT" models for short), like [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and [`gpt-5.6-terra`](https://developers.openai.com/api/docs/models/gpt-5.6-terra), have been trained to understand natural and formal language. These models allow text outputs in response to their inputs. The inputs to these models are also referred to as "prompts." Designing a prompt is essentially how you "program" a model, usually by providing instructions or some examples of how to successfully complete a task. GPT models can be used across a great variety of tasks including content or code generation, summarization, conversation, creative writing, and more. Read more in our introductory [text generation guide](https://developers.openai.com/api/docs/guides/text-generation) and in our [prompt engineering guide](https://developers.openai.com/api/docs/guides/prompt-engineering).

10 10 

11## Embeddings11## Embeddings

12 12 

Details

41const agent = new Agent({41const agent = new Agent({

42 name: "Weather bot",42 name: "Weather bot",

43 instructions: "You are a helpful weather bot.",43 instructions: "You are a helpful weather bot.",

44 model: "gpt-5.5",44 model: "gpt-5.6",

45 tools: [getWeather],45 tools: [getWeather],

46});46});

47```47```


59agent = Agent(59agent = Agent(

60 name="Weather bot",60 name="Weather bot",

61 instructions="You are a helpful weather bot.",61 instructions="You are a helpful weather bot.",

62 model="gpt-5.5",62 model="gpt-5.6",

63 tools=[get_weather],63 tools=[get_weather],

64)64)

65```65```

Details

18const fastAgent = new Agent({18const fastAgent = new Agent({

19 name: "Fast support agent",19 name: "Fast support agent",

20 instructions: "Handle routine support questions.",20 instructions: "Handle routine support questions.",

21 model: "gpt-5.4-mini",21 model: "gpt-5.6-terra",

22});22});

23 23 

24const generalAgent = new Agent({24const generalAgent = new Agent({


27});27});

28 28 

29const runner = new Runner({29const runner = new Runner({

30 model: "gpt-5.5",30 model: "gpt-5.6",

31});31});

32 32 

33await runner.run(fastAgent, "Summarize ticket 123.");33await runner.run(fastAgent, "Summarize ticket 123.");


47fast_agent = Agent(47fast_agent = Agent(

48 name="Fast support agent",48 name="Fast support agent",

49 instructions="Handle routine support questions.",49 instructions="Handle routine support questions.",

50 model="gpt-5.4-mini",50 model="gpt-5.6-terra",

51)51)

52 52 

53general_agent = Agent(53general_agent = Agent(


62 result = await Runner.run(62 result = await Runner.run(

63 general_agent,63 general_agent,

64 "Investigate the billing issue on account 456.",64 "Investigate the billing issue on account 456.",

65 run_config=RunConfig(model="gpt-5.5"),65 run_config=RunConfig(model="gpt-5.6"),

66 )66 )

67 print(result.final_output)67 print(result.final_output)

68 68 


72```72```

73 73 

74 74 

75For most new SDK workflows, start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and move to a smaller variant only when latency or cost matters enough to justify it. Use the platform-wide <a href="/api/docs/guides/latest-model">Using GPT-5.5</a> guide for current model-selection advice.75For most new SDK workflows, start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and move to a smaller variant only when latency or cost matters enough to justify it. Use the platform-wide <a href="/api/docs/guides/latest-model">Model guidance</a> page for current model-selection advice.

76 76 

77## Choose the simplest default strategy77## Choose the simplest default strategy

78 78 

Details

36 name: "History tutor",36 name: "History tutor",

37 instructions:37 instructions:

38 "You answer history questions clearly and concisely.",38 "You answer history questions clearly and concisely.",

39 model: "gpt-5.5",39 model: "gpt-5.6",

40});40});

41 41 

42const result = await run(agent, "When did the Roman Empire fall?");42const result = await run(agent, "When did the Roman Empire fall?");


51agent = Agent(51agent = Agent(

52 name="History tutor",52 name="History tutor",

53 instructions="You answer history questions clearly and concisely.",53 instructions="You answer history questions clearly and concisely.",

54 model="gpt-5.5",54 model="gpt-5.6",

55)55)

56 56 

57 57 

Details

294 294 

295const agent = new SandboxAgent({295const agent = new SandboxAgent({

296 name: "Renewal Packet Analyst",296 name: "Renewal Packet Analyst",

297 model: "gpt-5.5",297 model: "gpt-5.6",

298 instructions:298 instructions:

299 "Review the workspace before answering. Keep the response concise, " +299 "Review the workspace before answering. Keep the response concise, " +

300 "business-focused, and cite the file names that support each conclusion.",300 "business-focused, and cite the file names that support each conclusion.",


346 346 

347agent = SandboxAgent(347agent = SandboxAgent(

348 name="Renewal Packet Analyst",348 name="Renewal Packet Analyst",

349 model="gpt-5.5",349 model="gpt-5.6",

350 instructions=(350 instructions=(

351 "Review the workspace before answering. Keep the response concise, "351 "Review the workspace before answering. Keep the response concise, "

352 "business-focused, and cite the file names that support each conclusion."352 "business-focused, and cite the file names that support each conclusion."


392 392 

393const agent = new SandboxAgent({393const agent = new SandboxAgent({

394 name: "Workspace reviewer",394 name: "Workspace reviewer",

395 model: "gpt-5.5",395 model: "gpt-5.6",

396 instructions: "Inspect the sandbox workspace before answering.",396 instructions: "Inspect the sandbox workspace before answering.",

397});397});

398 398 


487});487});

488const agent = new SandboxAgent({488const agent = new SandboxAgent({

489 name: "Workspace builder",489 name: "Workspace builder",

490 model: "gpt-5.5",490 model: "gpt-5.6",

491 instructions: "Inspect the sandbox workspace before answering.",491 instructions: "Inspect the sandbox workspace before answering.",

492});492});

493 493 

Details

17-H "Content-Type: application/json" \17-H "Content-Type: application/json" \

18-H "Authorization: Bearer $OPENAI_API_KEY" \18-H "Authorization: Bearer $OPENAI_API_KEY" \

19-d '{19-d '{

20 "model": "gpt-5.5",20 "model": "gpt-5.6",

21 "input": "Write a very long novel about otters in space.",21 "input": "Write a very long novel about otters in space.",

22 "background": true22 "background": true

23}'23}'


28const client = new OpenAI();28const client = new OpenAI();

29 29 

30const resp = await client.responses.create({30const resp = await client.responses.create({

31 model: "gpt-5.5",31 model: "gpt-5.6",

32 input: "Write a very long novel about otters in space.",32 input: "Write a very long novel about otters in space.",

33 background: true,33 background: true,

34});34});


42client = OpenAI()42client = OpenAI()

43 43 

44resp = client.responses.create(44resp = client.responses.create(

45 model="gpt-5.5",45 model="gpt-5.6",

46 input="Write a very long novel about otters in space.",46 input="Write a very long novel about otters in space.",

47 background=True,47 background=True,

48)48)


68const client = new OpenAI();68const client = new OpenAI();

69 69 

70let resp = await client.responses.create({70let resp = await client.responses.create({

71model: "gpt-5.5",71model: "gpt-5.6",

72input: "Write a very long novel about otters in space.",72input: "Write a very long novel about otters in space.",

73background: true,73background: true,

74});74});


89client = OpenAI()89client = OpenAI()

90 90 

91resp = client.responses.create(91resp = client.responses.create(

92 model="gpt-5.5",92 model="gpt-5.6",

93 input="Write a very long novel about otters in space.",93 input="Write a very long novel about otters in space.",

94 background=True,94 background=True,

95)95)


151-H "Content-Type: application/json" \151-H "Content-Type: application/json" \

152-H "Authorization: Bearer $OPENAI_API_KEY" \152-H "Authorization: Bearer $OPENAI_API_KEY" \

153-d '{153-d '{

154 "model": "gpt-5.5",154 "model": "gpt-5.6",

155 "input": "Write a very long novel about otters in space.",155 "input": "Write a very long novel about otters in space.",

156 "background": true,156 "background": true,

157 "stream": true157 "stream": true


168const client = new OpenAI();168const client = new OpenAI();

169 169 

170const stream = await client.responses.create({170const stream = await client.responses.create({

171 model: "gpt-5.5",171 model: "gpt-5.6",

172 input: "Write a very long novel about otters in space.",172 input: "Write a very long novel about otters in space.",

173 background: true,173 background: true,

174 stream: true,174 stream: true,


192 192 

193# Fire off an async response but also start streaming immediately193# Fire off an async response but also start streaming immediately

194stream = client.responses.create(194stream = client.responses.create(

195 model="gpt-5.5",195 model="gpt-5.6",

196 input="Write a very long novel about otters in space.",196 input="Write a very long novel about otters in space.",

197 background=True,197 background=True,

198 stream=True,198 stream=True,

Details

1# Code generation1# Code generation

2 2 

3Writing, reviewing, editing, and answering questions about code is one of the primary use cases for OpenAI models today. This guide walks through your options for code generation with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and Codex.3Writing, reviewing, editing, and answering questions about code is one of the primary use cases for OpenAI models today. This guide walks through your options for code generation with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and Codex.

4 4 

5## Get started5## Get started

6 6 


11 11 

12[**Codex**](https://developers.openai.com/codex/overview) is OpenAI's coding agent for software development. It helps you write, review and debug code. Interact with Codex in a variety of interfaces: in your IDE, through the CLI, on web and mobile sites, or in your CI/CD pipelines with the SDK. Codex is the best way to get agentic software engineering on your projects.12[**Codex**](https://developers.openai.com/codex/overview) is OpenAI's coding agent for software development. It helps you write, review and debug code. Interact with Codex in a variety of interfaces: in your IDE, through the CLI, on web and mobile sites, or in your CI/CD pipelines with the SDK. Codex is the best way to get agentic software engineering on your projects.

13 13 

14Codex works best with the latest models from the GPT-5 family, such as [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5). We offer a range of models specifically designed to work with coding agents like Codex, such as [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex), but we recommend using the latest general-purpose model for most code generation tasks.14Codex works best with the latest models from the GPT-5 family, such as [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol). We offer a range of models specifically designed to work with coding agents like Codex, such as [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex), but we recommend using the latest general-purpose model for most code generation tasks.

15 15 

16See the [Codex docs](https://developers.openai.com/codex) for setup guides, reference material, pricing, and more information.16See the [Codex docs](https://developers.openai.com/codex) for setup guides, reference material, pricing, and more information.

17 17 

18## Integrate with coding models18## Integrate with coding models

19 19 

20For most API-based code generation, start with <strong>`gpt-5.5`</strong>. It handles both general-purpose work and coding, which makes it a strong default when your application needs to write code, reason about requirements, inspect docs, and handle broader workflows in one place.20For most API-based code generation, start with <strong>`gpt-5.6`</strong>. It handles both general-purpose work and coding, which makes it a strong default when your application needs to write code, reason about requirements, inspect docs, and handle broader workflows in one place.

21 21 

22This example shows how you can use the [Responses API](https://developers.openai.com/api/docs/api-reference/responses) for a code generation use case:22This example shows how you can use the [Responses API](https://developers.openai.com/api/docs/api-reference/responses) for a code generation use case:

23 23 


28const openai = new OpenAI();28const openai = new OpenAI();

29 29 

30const result = await openai.responses.create({30const result = await openai.responses.create({

31 model: "gpt-5.5",31 model: "gpt-5.6",

32 input: "Find the null pointer exception: ...your code here...",32 input: "Find the null pointer exception: ...your code here...",

33 reasoning: { effort: "high" },33 reasoning: { effort: "high" },

34});34});


41client = OpenAI()41client = OpenAI()

42 42 

43result = client.responses.create(43result = client.responses.create(

44 model="gpt-5.5",44 model="gpt-5.6",

45 input="Find the null pointer exception: ...your code here...",45 input="Find the null pointer exception: ...your code here...",

46 reasoning={ "effort": "high" },46 reasoning={ "effort": "high" },

47)47)


54 -H "Content-Type: application/json" \54 -H "Content-Type: application/json" \

55 -H "Authorization: Bearer $OPENAI_API_KEY" \55 -H "Authorization: Bearer $OPENAI_API_KEY" \

56 -d '{56 -d '{

57 "model": "gpt-5.5",57 "model": "gpt-5.6",

58 "input": "Find the null pointer exception: ...your code here...",58 "input": "Find the null pointer exception: ...your code here...",

59 "reasoning": { "effort": "high" }59 "reasoning": { "effort": "high" }

60 }'60 }'


70## Next steps70## Next steps

71 71 

72- Visit the [Codex docs](https://developers.openai.com/codex) to learn what you can do with Codex, set up Codex in whichever interface you choose, or find more details.72- Visit the [Codex docs](https://developers.openai.com/codex) to learn what you can do with Codex, set up Codex in whichever interface you choose, or find more details.

73- Read <a href="/api/docs/guides/latest-model">Using GPT-5.5</a> for model selection, features, and migration guidance.73- Read <a href="/api/docs/guides/latest-model">Model guidance</a> for model selection, features, migration guidance, and prompting patterns that work well on coding and agentic tasks.

74- See <a href="/api/docs/guides/prompt-guidance">Prompt guidance for GPT-5.5</a> for prompting patterns that work well on coding and agentic tasks.74- Compare [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex) on the model pages.

75- Compare [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and [`gpt-5.3-codex`](https://developers.openai.com/api/docs/models/gpt-5.3-codex) on the model pages.

Details

122 122 

123# 1) Compact the current window123# 1) Compact the current window

124compacted = client.responses.compact(124compacted = client.responses.compact(

125 model="gpt-5.5",125 model="gpt-5.6",

126 input=long_input_items_array,126 input=long_input_items_array,

127)127)

128 128 


137]137]

138 138 

139next_response = client.responses.create(139next_response = client.responses.create(

140 model="gpt-5.5",140 model="gpt-5.6",

141 input=next_input,141 input=next_input,

142 store=False, # Keep the flow ZDR-friendly142 store=False, # Keep the flow ZDR-friendly

143)143)

Details

148 148 

149Likewise, the completions API can be used to simulate a chat between a user and an assistant by formatting the input [accordingly](https://platform.openai.com/playground/p/default-chat?model=gpt-3.5-turbo-instruct).149Likewise, the completions API can be used to simulate a chat between a user and an assistant by formatting the input [accordingly](https://platform.openai.com/playground/p/default-chat?model=gpt-3.5-turbo-instruct).

150 150 

151The difference between these APIs is the underlying models that are available in each. The Chat Completions API supports current GPT models like [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and lower-cost options like [`gpt-5.4-mini`](https://developers.openai.com/api/docs/models/gpt-5.4-mini).151The difference between these APIs is the underlying models that are available in each. The Chat Completions API supports current GPT models like [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and lower-cost options like [`gpt-5.6-terra`](https://developers.openai.com/api/docs/models/gpt-5.6-terra).

Details

23const openai = new OpenAI();23const openai = new OpenAI();

24 24 

25const response = await openai.responses.create({25const response = await openai.responses.create({

26 model: "gpt-5.5",26 model: "gpt-5.6",

27 input: [27 input: [

28 { role: "user", content: "knock knock." },28 { role: "user", content: "knock knock." },

29 { role: "assistant", content: "Who's there?" },29 { role: "assistant", content: "Who's there?" },


40client = OpenAI()40client = OpenAI()

41 41 

42response = client.responses.create(42response = client.responses.create(

43 model="gpt-5.5",43 model="gpt-5.6",

44 input=[44 input=[

45 {"role": "user", "content": "knock knock."},45 {"role": "user", "content": "knock knock."},

46 {"role": "assistant", "content": "Who's there?"},46 {"role": "assistant", "content": "Who's there?"},


57 57 

58To manually share context across generated responses, include the model's previous response output as input, and append that input to your next request.58To manually share context across generated responses, include the model's previous response output as input, and append that input to your next request.

59 59 

60For stateless reasoning-model requests, add `reasoning.encrypted_content` to `include` and preserve every item in the response's `output` array. This keeps encrypted reasoning items and assistant `phase` values intact. Models that support persisted reasoning can use `reasoning.context: "all_turns"` to render the available reasoning from earlier turns into the next sample. See [preserve reasoning across calls](https://developers.openai.com/api/docs/guides/reasoning#preserve-reasoning-across-calls).

61 

60In the following example, we ask the model to tell a joke, followed by a request for another joke. Appending previous responses to new requests in this way helps ensure conversations feel natural and retain the context of previous interactions.62In the following example, we ask the model to tell a joke, followed by a request for another joke. Appending previous responses to new requests in this way helps ensure conversations feel natural and retain the context of previous interactions.

61 63 

62 64 


77];79];

78 80 

79const response = await openai.responses.create({81const response = await openai.responses.create({

80 model: "gpt-5.5",82 model: "gpt-5.6",

81 input: history,83 input: history,

82 store: true,84 store: false,

85 include: ["reasoning.encrypted_content"],

83});86});

84 87 

85console.log(response.output_text);88console.log(response.output_text);


93});96});

94 97 

95const secondResponse = await openai.responses.create({98const secondResponse = await openai.responses.create({

96 model: "gpt-5.5",99 model: "gpt-5.6",

97 input: history,100 input: history,

98 store: true,101 store: false,

102 include: ["reasoning.encrypted_content"],

99});103});

100 104 

101console.log(secondResponse.output_text);105console.log(secondResponse.output_text);


114]118]

115 119 

116response = client.responses.create(120response = client.responses.create(

117 model="gpt-5.5",121 model="gpt-5.6",

118 input=history,122 input=history,

119 store=False,123 store=False,

120 include=["reasoning.encrypted_content"],124 include=["reasoning.encrypted_content"],


128history.append({ "role": "user", "content": "tell me another" })132history.append({ "role": "user", "content": "tell me another" })

129 133 

130second_response = client.responses.create(134second_response = client.responses.create(

131 model="gpt-5.5",135 model="gpt-5.6",

132 input=history,136 input=history,

133 store=False,137 store=False,

134 include=["reasoning.encrypted_content"],138 include=["reasoning.encrypted_content"],


166 170 

167```python171```python

168response = openai.responses.create(172response = openai.responses.create(

169 model="gpt-5.5",173 model="gpt-5.6",

170 input=[{"role": "user", "content": "What are the 5 Ds of dodgeball?"}],174 input=[{"role": "user", "content": "What are the 5 Ds of dodgeball?"}],

171 conversation="conv_689667905b048191b4740501625afd940c7533ace33a2dab"175 conversation="conv_689667905b048191b4740501625afd940c7533ace33a2dab"

172)176)


185const openai = new OpenAI();189const openai = new OpenAI();

186 190 

187const response = await openai.responses.create({191const response = await openai.responses.create({

188 model: "gpt-5.5",192 model: "gpt-5.6",

189 input: "tell me a joke",193 input: "tell me a joke",

190 store: true,194 store: true,

191});195});


193console.log(response.output_text);197console.log(response.output_text);

194 198 

195const secondResponse = await openai.responses.create({199const secondResponse = await openai.responses.create({

196 model: "gpt-5.5",200 model: "gpt-5.6",

197 previous_response_id: response.id,201 previous_response_id: response.id,

198 input: [{"role": "user", "content": "explain why this is funny."}],202 input: [{"role": "user", "content": "explain why this is funny."}],

199 store: true,203 store: true,


207client = OpenAI()211client = OpenAI()

208 212 

209response = client.responses.create(213response = client.responses.create(

210 model="gpt-5.5",214 model="gpt-5.6",

211 input="tell me a joke",215 input="tell me a joke",

212)216)

213print(response.output_text)217print(response.output_text)

214 218 

215second_response = client.responses.create(219second_response = client.responses.create(

216 model="gpt-5.5",220 model="gpt-5.6",

217 previous_response_id=response.id,221 previous_response_id=response.id,

218 input=[{"role": "user", "content": "explain why this is funny."}],222 input=[{"role": "user", "content": "explain why this is funny."}],

219)223)


232const openai = new OpenAI();236const openai = new OpenAI();

233 237 

234const response = await openai.responses.create({238const response = await openai.responses.create({

235 model: "gpt-5.5",239 model: "gpt-5.6",

236 input: "tell me a joke",240 input: "tell me a joke",

237 store: true,241 store: true,

238});242});


240console.log(response.output_text);244console.log(response.output_text);

241 245 

242const secondResponse = await openai.responses.create({246const secondResponse = await openai.responses.create({

243 model: "gpt-5.5",247 model: "gpt-5.6",

244 previous_response_id: response.id,248 previous_response_id: response.id,

245 input: [{"role": "user", "content": "explain why this is funny."}],249 input: [{"role": "user", "content": "explain why this is funny."}],

246 store: true,250 store: true,


254client = OpenAI()258client = OpenAI()

255 259 

256response = client.responses.create(260response = client.responses.create(

257 model="gpt-5.5",261 model="gpt-5.6",

258 input="tell me a joke",262 input="tell me a joke",

259)263)

260print(response.output_text)264print(response.output_text)

261 265 

262second_response = client.responses.create(266second_response = client.responses.create(

263 model="gpt-5.5",267 model="gpt-5.6",

264 previous_response_id=response.id,268 previous_response_id=response.id,

265 input=[{"role": "user", "content": "explain why this is funny."}],269 input=[{"role": "user", "content": "explain why this is funny."}],

266)270)


306- **Output tokens** are the tokens generated by a model in response to a prompt. Each model has different [limits for output tokens](https://developers.openai.com/api/docs/models). For example, `gpt-4o-2024-08-06` can generate a maximum of 16,384 output tokens.310- **Output tokens** are the tokens generated by a model in response to a prompt. Each model has different [limits for output tokens](https://developers.openai.com/api/docs/models). For example, `gpt-4o-2024-08-06` can generate a maximum of 16,384 output tokens.

307- A **context window** describes the total tokens that can be used for both input and output tokens (and for some models, [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning)). Compare the [context window limits](https://developers.openai.com/api/docs/models) of our models. For example, `gpt-4o-2024-08-06` has a total context window of 128k tokens.311- A **context window** describes the total tokens that can be used for both input and output tokens (and for some models, [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning)). Compare the [context window limits](https://developers.openai.com/api/docs/models) of our models. For example, `gpt-4o-2024-08-06` has a total context window of 128k tokens.

308 312 

309If you create a very large prompt—often by including extra context, data, or examples for the model—you run the risk of exceeding the allocated context window for a model, which might result in truncated outputs.313If you create a large prompt—often by including extra context, data, or examples for the model—you run the risk of exceeding the allocated context window for a model, which might result in truncated outputs.

310 314 

311Use the [tokenizer tool](https://platform.openai.com/tokenizer), built with the [tiktoken library](https://github.com/openai/tiktoken), to see how many tokens are in a particular string of text.315Use the [tokenizer tool](https://platform.openai.com/tokenizer), built with the [tiktoken library](https://github.com/openai/tiktoken), to see how many tokens are in a particular string of text.

312 316 

Details

36 super().__init__(data_store, file_store)36 super().__init__(data_store, file_store)

37 37 

38 assistant_agent = Agent[AgentContext](38 assistant_agent = Agent[AgentContext](

39 model="gpt-5.5",39 model="gpt-5.6",

40 name="Assistant",40 name="Assistant",

41 instructions="You are a helpful assistant",41 instructions="You are a helpful assistant",

42 )42 )


115 )115 )

116 116 

117assistant_agent = Agent[AgentContext](117assistant_agent = Agent[AgentContext](

118 model="gpt-5.5",118 model="gpt-5.6",

119 name="Assistant",119 name="Assistant",

120 instructions="You are a helpful assistant",120 instructions="You are a helpful assistant",

121 tools=[add_to_todo_list],121 tools=[add_to_todo_list],

Details

205input_text = "Research surfboards for me. I'm interested in ...";205input_text = "Research surfboards for me. I'm interested in ...";

206 206 

207response = client.responses.create(207response = client.responses.create(

208 model="gpt-5.5",208 model="gpt-5.6",

209 input=input_text,209 input=input_text,

210 instructions=instructions,210 instructions=instructions,

211)211)


232const input = "Research surfboards for me. I'm interested in ...";232const input = "Research surfboards for me. I'm interested in ...";

233 233 

234const response = await openai.responses.create({234const response = await openai.responses.create({

235model: "gpt-5.5",235model: "gpt-5.6",

236input,236input,

237instructions,237instructions,

238});238});


245-H "Authorization: Bearer $OPENAI_API_KEY" \245-H "Authorization: Bearer $OPENAI_API_KEY" \

246-H "Content-Type: application/json" \246-H "Content-Type: application/json" \

247-d '{247-d '{

248 "model": "gpt-5.5",248 "model": "gpt-5.6",

249 "input": "Research surfboards for me. Im interested in ...",249 "input": "Research surfboards for me. Im interested in ...",

250 "instructions": "You are talking to a user who is asking for a research task to be conducted. Your job is to gather more information from the user to successfully complete the task. GUIDELINES: - Be concise while gathering all necessary information** - Make sure to gather all the information needed to carry out the research task in a concise, well-structured manner. - Use bullet points or numbered lists if appropriate for clarity. - Don't ask for unnecessary information, or information that the user has already provided. IMPORTANT: Do NOT conduct any research yourself, just gather information that will be given to a researcher to conduct the research task."250 "instructions": "You are talking to a user who is asking for a research task to be conducted. Your job is to gather more information from the user to successfully complete the task. GUIDELINES: - Be concise while gathering all necessary information** - Make sure to gather all the information needed to carry out the research task in a concise, well-structured manner. - Use bullet points or numbered lists if appropriate for clarity. - Don't ask for unnecessary information, or information that the user has already provided. IMPORTANT: Do NOT conduct any research yourself, just gather information that will be given to a researcher to conduct the research task."

251}'251}'


327input_text = "Research surfboards for me. I'm interested in ..."327input_text = "Research surfboards for me. I'm interested in ..."

328 328 

329response = client.responses.create(329response = client.responses.create(

330 model="gpt-5.5",330 model="gpt-5.6",

331 input=input_text,331 input=input_text,

332 instructions=instructions,332 instructions=instructions,

333)333)


408const input = "Research surfboards for me. I'm interested in ...";408const input = "Research surfboards for me. I'm interested in ...";

409 409 

410const response = await openai.responses.create({410const response = await openai.responses.create({

411 model: "gpt-5.5",411 model: "gpt-5.6",

412 input,412 input,

413 instructions,413 instructions,

414});414});


421 -H "Authorization: Bearer $OPENAI_API_KEY" \421 -H "Authorization: Bearer $OPENAI_API_KEY" \

422 -H "Content-Type: application/json" \422 -H "Content-Type: application/json" \

423 -d '{423 -d '{

424 "model": "gpt-5.5",424 "model": "gpt-5.6",

425 "input": "Research surfboards for me. Im interested in ...",425 "input": "Research surfboards for me. Im interested in ...",

426 "instructions": "You are a helpful assistant that generates a prompt for a deep research task. Examine the users prompt and generate a set of clarifying questions that will help the deep research model generate a better response."426 "instructions": "You are a helpful assistant that generates a prompt for a deep research task. Examine the users prompt and generate a set of clarifying questions that will help the deep research model generate a better response."

427 }'427 }'

Details

54].join("\n");54].join("\n");

55 55 

56const response = await openai.responses.create({56const response = await openai.responses.create({

57 model: "gpt-5.5",57 model: "gpt-5.6",

58 reasoning: { effort: "high" },58 reasoning: { effort: "high" },

59 input: prompt,59 input: prompt,

60});60});


77"""77"""

78 78 

79response = client.responses.create(79response = client.responses.create(

80 model="gpt-5.5",80 model="gpt-5.6",

81 reasoning={"effort": "high"},81 reasoning={"effort": "high"},

82 input=prompt,82 input=prompt,

83)83)


113].join("\n");113].join("\n");

114 114 

115const response = await openai.responses.create({115const response = await openai.responses.create({

116 model: "gpt-5.5",116 model: "gpt-5.6",

117 text: { verbosity: "low" },117 text: { verbosity: "low" },

118 input: incident,118 input: incident,

119});119});


127client = OpenAI()127client = OpenAI()

128 128 

129response = client.responses.create(129response = client.responses.create(

130 model="gpt-5.5",130 model="gpt-5.6",

131 text={"verbosity": "low"},131 text={"verbosity": "low"},

132 input="""132 input="""

133 Summarize this incident for the next on-call engineer.133 Summarize this incident for the next on-call engineer.


255};255};

256 256 

257const response = await openai.responses.create({257const response = await openai.responses.create({

258 model: "gpt-5.5",258 model: "gpt-5.6",

259 input:259 input:

260 "Find the right billing tool and explain why invoice INV-1043 still " +260 "Find the right billing tool and explain why invoice INV-1043 still " +

261 "shows overdue after a payment yesterday.",261 "shows overdue after a payment yesterday.",


307}307}

308 308 

309response = client.responses.create(309response = client.responses.create(

310 model="gpt-5.5",310 model="gpt-5.6",

311 input=(311 input=(

312 "Find the right billing tool and explain why invoice INV-1043 still "312 "Find the right billing tool and explain why invoice INV-1043 still "

313 "shows overdue after a payment yesterday."313 "shows overdue after a payment yesterday."


393const longWindow = sessionItems;393const longWindow = sessionItems;

394 394 

395const compacted = await openai.responses.compact({395const compacted = await openai.responses.compact({

396 model: "gpt-5.5",396 model: "gpt-5.6",

397 input: longWindow,397 input: longWindow,

398});398});

399 399 

400const nextResponse = await openai.responses.create({400const nextResponse = await openai.responses.create({

401 model: "gpt-5.5",401 model: "gpt-5.6",

402 store: false,402 store: false,

403 input: [403 input: [

404 ...compacted.output, // Use compact output as-is.404 ...compacted.output, // Use compact output as-is.


425long_window = session_items425long_window = session_items

426 426 

427compacted = client.responses.compact(427compacted = client.responses.compact(

428 model="gpt-5.5",428 model="gpt-5.6",

429 input=long_window,429 input=long_window,

430)430)

431 431 

432next_response = client.responses.create(432next_response = client.responses.create(

433 model="gpt-5.5",433 model="gpt-5.6",

434 store=False,434 store=False,

435 input=[435 input=[

436 *compacted.output, # Use compact output as-is.436 *compacted.output, # Use compact output as-is.


478].join("\n");478].join("\n");

479 479 

480const response = await openai.responses.create({480const response = await openai.responses.create({

481 model: "gpt-5.5",481 model: "gpt-5.6",

482 prompt_cache_key: "tenant-acme-support-agent",482 prompt_cache_key: "tenant-acme-support-agent",

483 instructions,483 instructions,

484 input: "Summarize the current escalation for the on-call lead.",484 input: "Summarize the current escalation for the on-call lead.",


499"""499"""

500 500 

501response = client.responses.create(501response = client.responses.create(

502 model="gpt-5.5",502 model="gpt-5.6",

503 prompt_cache_key="tenant-acme-support-agent",503 prompt_cache_key="tenant-acme-support-agent",

504 instructions=instructions,504 instructions=instructions,

505 input="Summarize the current escalation for the on-call lead.",505 input="Summarize the current escalation for the on-call lead.",


531const openai = new OpenAI();531const openai = new OpenAI();

532 532 

533const first = await openai.responses.create({533const first = await openai.responses.create({

534 model: "gpt-5.5",534 model: "gpt-5.6",

535 store: false,535 store: false,

536 reasoning: { effort: "medium" },536 reasoning: { effort: "medium" },

537 include: ["reasoning.encrypted_content"],537 include: ["reasoning.encrypted_content"],


539});539});

540 540 

541const second = await openai.responses.create({541const second = await openai.responses.create({

542 model: "gpt-5.5",542 model: "gpt-5.6",

543 store: false,543 store: false,

544 reasoning: { effort: "medium" },544 reasoning: { effort: "medium" },

545 include: ["reasoning.encrypted_content"],545 include: ["reasoning.encrypted_content"],


561client = OpenAI()561client = OpenAI()

562 562 

563first = client.responses.create(563first = client.responses.create(

564 model="gpt-5.5",564 model="gpt-5.6",

565 store=False,565 store=False,

566 reasoning={"effort": "medium"},566 reasoning={"effort": "medium"},

567 include=["reasoning.encrypted_content"],567 include=["reasoning.encrypted_content"],


569)569)

570 570 

571second = client.responses.create(571second = client.responses.create(

572 model="gpt-5.5",572 model="gpt-5.6",

573 store=False,573 store=False,

574 reasoning={"effort": "medium"},574 reasoning={"effort": "medium"},

575 include=["reasoning.encrypted_content"],575 include=["reasoning.encrypted_content"],


604const openai = new OpenAI();604const openai = new OpenAI();

605 605 

606let job = await openai.responses.create({606let job = await openai.responses.create({

607 model: "gpt-5.5",607 model: "gpt-5.6",

608 background: true,608 background: true,

609 store: true,609 store: true,

610 input: "Analyze this large log bundle and cluster the primary failure modes.",610 input: "Analyze this large log bundle and cluster the primary failure modes.",


634client = OpenAI()634client = OpenAI()

635 635 

636job = client.responses.create(636job = client.responses.create(

637 model="gpt-5.5",637 model="gpt-5.6",

638 background=True,638 background=True,

639 store=True,639 store=True,

640 input="Analyze this large log bundle and cluster the primary failure modes.",640 input="Analyze this large log bundle and cluster the primary failure modes.",


716 ws.send(716 ws.send(

717 JSON.stringify({717 JSON.stringify({

718 type: "response.create",718 type: "response.create",

719 model: "gpt-5.5",719 model: "gpt-5.6",

720 store: false,720 store: false,

721 input: [721 input: [

722 {722 {


760 json.dumps(760 json.dumps(

761 {761 {

762 "type": "response.create",762 "type": "response.create",

763 "model": "gpt-5.5",763 "model": "gpt-5.6",

764 "store": False,764 "store": False,

765 "input": [765 "input": [

766 {766 {

Details

22## How to use22## How to use

23 23 

24- **Eligibility:** Available to Pro, Plus, Business, Enterprise, and Education accounts on the web.24- **Eligibility:** Available to Pro, Plus, Business, Enterprise, and Education accounts on the web.

25- **Enable developer mode:** Go to [**Settings → Apps**](https://chatgpt.com/#settings/Connectors) → [**Advanced settings Developer mode**](https://chatgpt.com/#settings/Connectors/Advanced).25- **Enable developer mode:** In [ChatGPT](https://chatgpt.com), open **Settings Security and login** and turn on **Developer mode**.

26- **Create Apps from MCPs:**26- **Create apps from MCP servers:**

27 - Open [ChatGPT Apps settings](https://chatgpt.com/#settings/Connectors).27 - Open **Settings Plugins** or go directly to [chatgpt.com/plugins](https://chatgpt.com/plugins).

28 - Click on "Create app" next to **Advanced settings** and create an app for your remote MCP server. It will appear in the composer's "Developer Mode" tool later during conversations. The "Create app" button will only show if you are in Developer mode.28 - Select the plus button and create a developer-mode app for your remote MCP server. It will appear in the composer's **Developer mode** tool later during conversations. The plus button will only create developer-mode apps after you turn on Developer mode.

29 - Supported MCP protocols: SSE and streaming HTTP.29 - Supported MCP protocols: SSE and streaming HTTP.

30 - Authentication supported: OAuth, No Authentication, and Mixed Authentication30 - Authentication supported: OAuth, No Authentication, and Mixed Authentication

31 - For OAuth, if static credentials are provided, then they will be used. Otherwise, ChatGPT can use Client ID Metadata Documents when the authorization server advertises support and the connector creator chooses CIMD. CIMD supports public-client token exchange (`none`) and signed client assertion token exchange (`private_key_jwt`). ChatGPT can also use DCR when configured.31 - For OAuth, if static credentials are provided, then they will be used. Otherwise, ChatGPT can use Client ID Metadata Documents when the authorization server advertises support and the app creator chooses CIMD. CIMD supports public-client token exchange (`none`) and signed client assertion token exchange (`private_key_jwt`). ChatGPT can also use DCR when configured.

32 - Mixed authentication supports OAuth and No Authentication. This means the initialize and list tools APIs use no auth, and tools use OAuth or no auth based on the security schemes set on their tool metadata.32 - Mixed authentication supports OAuth and No Authentication. This means the initialize and list tools APIs use no auth, and tools use OAuth or no auth based on the security schemes set on their tool metadata.

33 - Created apps will show under "Drafts" in the app settings.33 - Created apps will show under "Drafts" in the app settings.

34- **Manage tools:** In app settings there is a details page per app. Use that to toggle tools on or off and refresh apps to pull new tools, descriptions, and server instructions from the MCP server.34- **Manage tools:** In app settings there is a details page per app. Use that to toggle tools on or off and refresh apps to pull new tools, descriptions, and server instructions from the MCP server.

35- **Use apps in conversations:** Choose **Developer mode** from the Plus menu and select the apps for the conversation. You may need to explore different prompting techniques to call the correct tools. For example:35- **Use apps in conversations:** Choose **Developer mode** from the Plus menu and select the apps for the conversation. You may need to explore different prompting techniques to call the correct tools. For example:

36 - Be explicit: "Use the \"Acme CRM\" app's \"update_record\" tool to …". When needed, include the server label and tool name.36 - Be explicit: "Use the \"Acme CRM\" app's \"update_record\" tool to …". When needed, include the server label and tool name.

37 - Disallow alternatives to avoid ambiguity: "Do not use built-in browsing or other tools; only use the Acme CRM connector."37 - Disallow alternatives to avoid ambiguity: "Do not use built-in browsing or other tools; only use the Acme CRM app."

38 - Disambiguate similar tools: "Prefer `Calendar.create_event` for meetings; do not use `Reminders.create_task` for scheduling."38 - Disambiguate similar tools: "Prefer `Calendar.create_event` for meetings; do not use `Reminders.create_task` for scheduling."

39 - Specify input shape and sequencing: "First call `Repo.read_file` with `{ path: "…" }`. Then call `Repo.write_file` with the modified content. Do not call other tools."39 - Specify input shape and sequencing: "First call `Repo.read_file` with `{ path: "…" }`. Then call `Repo.write_file` with the modified content. Do not call other tools."

40 - If multiple apps overlap, state preferences up front (e.g., "Use `CompanyDB` for authoritative data; use other sources only if `CompanyDB` returns no results").40 - If multiple apps overlap, state preferences up front (e.g., "Use `CompanyDB` for authoritative data; use other sources only if `CompanyDB` returns no results").

41 - Developer mode does not require `search`/`fetch` tools. Any tools your connector exposes (including write actions) are available, subject to confirmation settings.41 - Developer mode does not require `search`/`fetch` tools. Any tools your app exposes (including write actions) are available, subject to confirmation settings.

42 - See more guidance in [Using tools](https://developers.openai.com/api/docs/guides/tools) and [Prompting](https://developers.openai.com/api/docs/guides/prompting).42 - See more guidance in [Using tools](https://developers.openai.com/api/docs/guides/tools) and [Prompting](https://developers.openai.com/api/docs/guides/prompting).

43 - Improve tool selection with better tool descriptions: In your MCP server, write action-oriented tool names and descriptions that include "Use this when…" guidance, note disallowed/edge cases, and add parameter descriptions (and enums) to help the model choose the right tool among similar ones and avoid built-in tools when inappropriate.43 - Improve tool selection with better tool descriptions: In your MCP server, write action-oriented tool names and descriptions that include "Use this when…" guidance, note disallowed/edge cases, and add parameter descriptions (and enums) to help the model choose the right tool among similar ones and avoid built-in tools when inappropriate.

44 - Add server instructions for cross-tool guidance: Use the MCP [`instructions` field](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle#initialization) for server-wide guidance such as required tool sequences, shared rate limits, or relationships between tools. Keep the first 512 characters self-contained.44 - Add server instructions for cross-tool guidance: Use the MCP [`instructions` field](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle#initialization) for server-wide guidance such as required tool sequences, shared rate limits, or relationships between tools. Keep the first 512 characters self-contained.

Details

231try:231try:

232 #Make your OpenAI API request here232 #Make your OpenAI API request here

233 response = client.responses.create(233 response = client.responses.create(

234 model="gpt-5.5",234 model="gpt-5.6",

235 input="Hello world"235 input="Hello world"

236 )236 )

237except openai.APIError as e:237except openai.APIError as e:

guides/evals.md +6 −6

Details

37 -H "Authorization: Bearer $OPENAI_API_KEY" \37 -H "Authorization: Bearer $OPENAI_API_KEY" \

38 -H "Content-Type: application/json" \38 -H "Content-Type: application/json" \

39 -d '{39 -d '{

40 "model": "gpt-5.5",40 "model": "gpt-5.6",

41 "input": [41 "input": [

42 {42 {

43 "role": "developer",43 "role": "developer",


64const ticket = "My monitor won't turn on - help!";64const ticket = "My monitor won't turn on - help!";

65 65 

66const response = await client.responses.create({66const response = await client.responses.create({

67 model: "gpt-5.5",67 model: "gpt-5.6",

68 input: [68 input: [

69 { role: "developer", content: instructions },69 { role: "developer", content: instructions },

70 { role: "user", content: ticket },70 { role: "user", content: ticket },


87ticket = "My monitor won't turn on - help!"87ticket = "My monitor won't turn on - help!"

88 88 

89response = client.responses.create(89response = client.responses.create(

90 model="gpt-5.5",90 model="gpt-5.6",

91 input=[91 input=[

92 {"role": "developer", "content": instructions},92 {"role": "developer", "content": instructions},

93 {"role": "user", "content": ticket},93 {"role": "user", "content": ticket},


361 "name": "Categorization text run",361 "name": "Categorization text run",

362 "data_source": {362 "data_source": {

363 "type": "responses",363 "type": "responses",

364 "model": "gpt-5.5",364 "model": "gpt-5.6",

365 "input_messages": {365 "input_messages": {

366 "type": "template",366 "type": "template",

367 "template": [367 "template": [


382 name: "Categorization text run",382 name: "Categorization text run",

383 data_source: {383 data_source: {

384 type: "responses",384 type: "responses",

385 model: "gpt-5.5",385 model: "gpt-5.6",

386 input_messages: {386 input_messages: {

387 type: "template",387 type: "template",

388 template: [388 template: [


406 name="Categorization text run",406 name="Categorization text run",

407 data_source={407 data_source={

408 "type": "responses",408 "type": "responses",

409 "model": "gpt-5.5",409 "model": "gpt-5.6",

410 "input_messages": {410 "input_messages": {

411 "type": "template",411 "type": "template",

412 "template": [412 "template": [

Details

95 Set up continuous evaluation (CE) to run evals on every change, monitor your app to identify new cases of nondeterminism, and grow the eval set over time.95 Set up continuous evaluation (CE) to run evals on every change, monitor your app to identify new cases of nondeterminism, and grow the eval set over time.

96 96 

97When creating an eval dataset, 97When creating an eval dataset,

98 [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) 98 [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol)

99 is useful for collecting eval examples and edge cases. Consider using it to99 is useful for collecting eval examples and edge cases. Consider using it to

100 help you generate a diverse set of test data across various scenarios. Ensure100 help you generate a diverse set of test data across various scenarios. Ensure

101 your test data includes typical cases, edge cases, and adversarial cases. Use101 your test data includes typical cases, edge cases, and adversarial cases. Use


371 371 

372### LLM-as-a-judge and model graders372### LLM-as-a-judge and model graders

373 373 

374Using models to judge output is cheaper to run and more scalable than human evaluation. Start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) when you need a strong LLM judge, then validate agreement against your human labels before optimizing for cost or latency.374Using models to judge output is cheaper to run and more scalable than human evaluation. Start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) when you need a strong LLM judge, then validate agreement against your human labels before optimizing for cost or latency.

375 375 

376- **Examples**:376- **Examples**:

377 - Pairwise comparison: Present the judge model with two responses and ask it to determine which one is better based on specific criteria377 - Pairwise comparison: Present the judge model with two responses and ask it to determine which one is better based on specific criteria


380- **Challenges**: Position bias (response order), verbosity bias (preferring longer responses)380- **Challenges**: Position bias (response order), verbosity bias (preferring longer responses)

381- **Recommendations**:381- **Recommendations**:

382 - Use pairwise comparison or pass/fail for more reliability382 - Use pairwise comparison or pass/fail for more reliability

383 - Use the most capable model to grade if you can. Start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5), then validate whether a specialized reasoning model performs better for your rubric or reference-answer set383 - Use the most capable model to grade if you can. Start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol), then validate whether a specialized reasoning model performs better for your rubric or reference-answer set

384 - Control for response lengths as LLMs bias towards longer responses in general384 - Control for response lengths as LLMs bias towards longer responses in general

385 - Add reasoning and chain-of-thought as reasoning before scoring improves eval performance385 - Add reasoning and chain-of-thought as reasoning before scoring improves eval performance

386 - Once the LLM judge reaches a point where it's faster, cheaper, and consistently agrees with human annotations, scale up386 - Once the LLM judge reaches a point where it's faster, cheaper, and consistently agrees with human annotations, scale up

Details

58 58 

591. To add a new prompt, click **Add prompt**.591. To add a new prompt, click **Add prompt**.

60 60 

61 Datasets are designed to be used with your OpenAI [prompts](https://developers.openai.com/api/docs/guides/prompt-engineering#reusable-prompts). If you’ve saved a prompt on the OpenAI platform, you’ll be able to select it from the dropdown and make changes in this interface. To save your prompt changes, click **Save**.61 Datasets are designed to be used with your OpenAI [prompts](https://developers.openai.com/api/docs/guides/prompt-engineering#version-prompts-in-code). If you’ve saved a prompt on the OpenAI platform, you’ll be able to select it from the dropdown and make changes in this interface. To save your prompt changes, click **Save**.

62 62 

63 Our prompts use a versioning system so you can safely make updates.63 Our prompts use a versioning system so you can safely make updates.

64 Clicking **Save** creates a new version of your prompt, which you can refer64 Clicking **Save** creates a new version of your prompt, which you can refer


68 68 

69- Click the slider icon in the top right to control model [`temperature`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-temperature) and [`top_p`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-top_p).69- Click the slider icon in the top right to control model [`temperature`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-temperature) and [`top_p`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-top_p).

70- Add tools to grant your inference call the ability to access the web, use an MCP, or complete other tool-call actions.70- Add tools to grant your inference call the ability to access the web, use an MCP, or complete other tool-call actions.

71- Add variables. The prompt and your [graders](#adding-graders) can both refer to these variables.71- Add variables. The prompt and your [graders](#add-graders) can both refer to these variables.

72- Type your system message directly, or click the pencil icon to have a model help generate a prompt for you, based on basic instructions you provide.72- Type your system message directly, or click the pencil icon to have a model help generate a prompt for you, based on basic instructions you provide.

73 73 

74In our example, we'll add the [web search](https://developers.openai.com/api/docs/guides/tools-web-search) tool so our model call can pull financial data from the internet. In our variables list, we'll add `company` so our prompt can reference the company column in our dataset. And for the prompt, we’ll generate one by telling the model to “generate a financial report."74In our example, we'll add the [web search](https://developers.openai.com/api/docs/guides/tools-web-search) tool so our model call can pull financial data from the internet. In our variables list, we'll add `company` so our prompt can reference the company column in our dataset. And for the prompt, we’ll generate one by telling the model to “generate a financial report."

Details

35## PDF detail levels35## PDF detail levels

36 36 

37For PDF inputs in the Responses API, set the optional `detail` field on an37For PDF inputs in the Responses API, set the optional `detail` field on an

38`input_file` item to control how page images are processed. `low` is the default38`input_file` item to `auto`, `low`, or `high` to control how the API processes

39and uses fewer input tokens. Use `high` when you need more visual detail from PDF39page images. If omitted, `detail` defaults to `auto`. For GPT-5.6 and later

40page images, such as dense charts, small print, or diagrams.40models, `auto` uses `high`; for earlier models, it uses `low`. Use `low` for fewer

41input tokens, or `high` for more visual detail, such as dense charts, small print,

42or diagrams.

41 43 

42The `detail` setting only affects PDF page image processing. Text extracted from44The `detail` setting only affects PDF page image processing. Text extracted from

43the PDF is still included. Chat Completions file inputs don't support `detail`.45the PDF is still included. Chat Completions file inputs don't support `detail`.


93 -H "Content-Type: application/json" \95 -H "Content-Type: application/json" \

94 -H "Authorization: Bearer $OPENAI_API_KEY" \96 -H "Authorization: Bearer $OPENAI_API_KEY" \

95 -d '{97 -d '{

96 "model": "gpt-5.5",98 "model": "gpt-5.6",

97 "input": [99 "input": [

98 {100 {

99 "role": "user",101 "role": "user",


117const client = new OpenAI();119const client = new OpenAI();

118 120 

119const response = await client.responses.create({121const response = await client.responses.create({

120 model: "gpt-5.5",122 model: "gpt-5.6",

121 input: [123 input: [

122 {124 {

123 role: "user",125 role: "user",


143client = OpenAI()145client = OpenAI()

144 146 

145response = client.responses.create(147response = client.responses.create(

146 model="gpt-5.5",148 model="gpt-5.6",

147 input=[149 input=[

148 {150 {

149 "role": "user",151 "role": "user",


169using OpenAI.Responses;171using OpenAI.Responses;

170 172 

171string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;173string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

172OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);174OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

173 175 

174using HttpClient http = new();176using HttpClient http = new();

175using Stream stream = await http.GetStreamAsync("https://www.berkshirehathaway.com/letters/2024ltr.pdf");177using Stream stream = await http.GetStreamAsync("https://www.berkshirehathaway.com/letters/2024ltr.pdf");


209 -H "Content-Type: application/json" \211 -H "Content-Type: application/json" \

210 -H "Authorization: Bearer $OPENAI_API_KEY" \212 -H "Authorization: Bearer $OPENAI_API_KEY" \

211 -d '{213 -d '{

212 "model": "gpt-5.5",214 "model": "gpt-5.6",

213 "input": [215 "input": [

214 {216 {

215 "role": "user",217 "role": "user",


239});241});

240 242 

241const response = await client.responses.create({243const response = await client.responses.create({

242 model: "gpt-5.5",244 model: "gpt-5.6",

243 input: [245 input: [

244 {246 {

245 role: "user",247 role: "user",


270)272)

271 273 

272response = client.responses.create(274response = client.responses.create(

273 model="gpt-5.5",275 model="gpt-5.6",

274 input=[276 input=[

275 {277 {

276 "role": "user",278 "role": "user",


296using OpenAI.Responses;298using OpenAI.Responses;

297 299 

298string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;300string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

299OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);301OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

300 302 

301OpenAIFileClient files = new(key);303OpenAIFileClient files = new(key);

302OpenAIFile file = files.UploadFile("draconomicon.pdf", FileUploadPurpose.UserData);304OpenAIFile file = files.UploadFile("draconomicon.pdf", FileUploadPurpose.UserData);


329 -H "Content-Type: application/json" \331 -H "Content-Type: application/json" \

330 -H "Authorization: Bearer $OPENAI_API_KEY" \332 -H "Authorization: Bearer $OPENAI_API_KEY" \

331 -d '{333 -d '{

332 "model": "gpt-5.5",334 "model": "gpt-5.6",

333 "input": [335 "input": [

334 {336 {

335 "role": "user",337 "role": "user",


358const base64String = data.toString("base64");360const base64String = data.toString("base64");

359 361 

360const response = await client.responses.create({362const response = await client.responses.create({

361 model: "gpt-5.5",363 model: "gpt-5.6",

362 input: [364 input: [

363 {365 {

364 role: "user",366 role: "user",


391base64_string = base64.b64encode(data).decode("utf-8")393base64_string = base64.b64encode(data).decode("utf-8")

392 394 

393response = client.responses.create(395response = client.responses.create(

394 model="gpt-5.5",396 model="gpt-5.6",

395 input=[397 input=[

396 {398 {

397 "role": "user",399 "role": "user",


422 424 

423Keep these constraints in mind when you use file inputs:425Keep these constraints in mind when you use file inputs:

424 426 

425- **Token usage:** PDF parsing includes both extracted text and page images in context, which can increase token usage. In the Responses API, set `detail` to `low` (the default) or `high` to control how much visual detail is processed for PDF page images. Before deploying at scale, review pricing and token implications. [More on pricing](https://developers.openai.com/api/docs/pricing).427- **Token usage:** PDF parsing includes both extracted text and page images in context, which can increase token usage. In the Responses API, set `detail` to `auto` (the default), `low`, or `high` to control the amount of visual detail for PDF page images. Before deploying at scale, review pricing and token implications. [More on pricing](https://developers.openai.com/api/docs/pricing).

426- **File size limits:** A single request can include more than one file, but each file must be under 50 MB. The combined limit across all files in the request is 50 MB.428- **File size limits:** A single request can include more than one file, but each file must be under 50 MB. The combined limit across all files in the request is 50 MB.

427- **Supported models:** PDF parsing that includes text and page images requires models with vision capabilities, such as `gpt-4o` and later models.429- **Supported models:** PDF parsing that includes text and page images requires models with vision capabilities, such as `gpt-4o` and later models.

428- **File upload purpose:** You can upload files with any supported [purpose](https://developers.openai.com/api/docs/api-reference/files/create#files-create-purpose), but use `user_data` for files you plan to pass as model inputs.430- **File upload purpose:** You can upload files with any supported [purpose](https://developers.openai.com/api/docs/api-reference/files/create#files-create-purpose), but use `user_data` for files you plan to pass as model inputs.

Details

21});21});

22 22 

23const response = await client.responses.create({23const response = await client.responses.create({

24 model: "gpt-5.5",24 model: "gpt-5.6",

25 instructions: "List and describe all the metaphors used in this book.",25 instructions: "List and describe all the metaphors used in this book.",

26 input: "<very long text of book here>",26 input: "<very long text of book here>",

27 service_tier: "flex",27 service_tier: "flex",


39 39 

40# you can override the max timeout per request as well40# you can override the max timeout per request as well

41response = client.with_options(timeout=900.0).responses.create(41response = client.with_options(timeout=900.0).responses.create(

42 model="gpt-5.5",42 model="gpt-5.6",

43 instructions="List and describe all the metaphors used in this book.",43 instructions="List and describe all the metaphors used in this book.",

44 input="<very long text of book here>",44 input="<very long text of book here>",

45 service_tier="flex",45 service_tier="flex",


53 -H "Authorization: Bearer $OPENAI_API_KEY" \53 -H "Authorization: Bearer $OPENAI_API_KEY" \

54 -H "Content-Type: application/json" \54 -H "Content-Type: application/json" \

55 -d '{55 -d '{

56 "model": "gpt-5.5",56 "model": "gpt-5.6",

57 "instructions": "List and describe all the metaphors used in this book.",57 "instructions": "List and describe all the metaphors used in this book.",

58 "input": "<very long text of book here>",58 "input": "<very long text of book here>",

59 "service_tier": "flex"59 "service_tier": "flex"

Details

139const openai = new OpenAI();139const openai = new OpenAI();

140 140 

141const response = await openai.responses.create({141const response = await openai.responses.create({

142 model: "gpt-5.5",142 model: "gpt-5.6",

143 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",143 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",

144 tools: [{type: "image_generation"}],144 tools: [{type: "image_generation"}],

145});145});


163client = OpenAI() 163client = OpenAI()

164 164 

165response = client.responses.create(165response = client.responses.create(

166 model="gpt-5.5",166 model="gpt-5.6",

167 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",167 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

168 tools=[{"type": "image_generation"}],168 tools=[{"type": "image_generation"}],

169)169)


199const openai = new OpenAI();199const openai = new OpenAI();

200 200 

201const response = await openai.responses.create({201const response = await openai.responses.create({

202 model: "gpt-5.5",202 model: "gpt-5.6",

203 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",203 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",

204 tools: [{type: "image_generation", action: "generate"}],204 tools: [{type: "image_generation", action: "generate"}],

205});205});


223client = OpenAI() 223client = OpenAI()

224 224 

225response = client.responses.create(225response = client.responses.create(

226 model="gpt-5.5",226 model="gpt-5.6",

227 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",227 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

228 tools=[{"type": "image_generation", "action": "generate"}],228 tools=[{"type": "image_generation", "action": "generate"}],

229)229)


255const openai = new OpenAI();255const openai = new OpenAI();

256 256 

257const response = await openai.responses.create({257const response = await openai.responses.create({

258 model: "gpt-5.5",258 model: "gpt-5.6",

259 input:259 input:

260 "Generate an image of gray tabby cat hugging an otter with an orange scarf",260 "Generate an image of gray tabby cat hugging an otter with an orange scarf",

261 tools: [{ type: "image_generation" }],261 tools: [{ type: "image_generation" }],


274// Follow up274// Follow up

275 275 

276const response_fwup = await openai.responses.create({276const response_fwup = await openai.responses.create({

277 model: "gpt-5.5",277 model: "gpt-5.6",

278 previous_response_id: response.id,278 previous_response_id: response.id,

279 input: "Now make it look realistic",279 input: "Now make it look realistic",

280 tools: [{ type: "image_generation" }],280 tools: [{ type: "image_generation" }],


301client = OpenAI()301client = OpenAI()

302 302 

303response = client.responses.create(303response = client.responses.create(

304 model="gpt-5.5",304 model="gpt-5.6",

305 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",305 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

306 tools=[{"type": "image_generation"}],306 tools=[{"type": "image_generation"}],

307)307)


322# Follow up322# Follow up

323 323 

324response_fwup = client.responses.create(324response_fwup = client.responses.create(

325 model="gpt-5.5",325 model="gpt-5.6",

326 previous_response_id=response.id,326 previous_response_id=response.id,

327 input="Now make it look realistic",327 input="Now make it look realistic",

328 tools=[{"type": "image_generation"}],328 tools=[{"type": "image_generation"}],


350const openai = new OpenAI();350const openai = new OpenAI();

351 351 

352const response = await openai.responses.create({352const response = await openai.responses.create({

353 model: "gpt-5.5",353 model: "gpt-5.6",

354 input:354 input:

355 "Generate an image of gray tabby cat hugging an otter with an orange scarf",355 "Generate an image of gray tabby cat hugging an otter with an orange scarf",

356 tools: [{ type: "image_generation" }],356 tools: [{ type: "image_generation" }],


371// Follow up371// Follow up

372 372 

373const response_fwup = await openai.responses.create({373const response_fwup = await openai.responses.create({

374 model: "gpt-5.5",374 model: "gpt-5.6",

375 input: [375 input: [

376 {376 {

377 role: "user",377 role: "user",


404import base64404import base64

405 405 

406response = openai.responses.create(406response = openai.responses.create(

407 model="gpt-5.5",407 model="gpt-5.6",

408 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",408 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

409 tools=[{"type": "image_generation"}],409 tools=[{"type": "image_generation"}],

410)410)


427# Follow up427# Follow up

428 428 

429response_fwup = openai.responses.create(429response_fwup = openai.responses.create(

430 model="gpt-5.5",430 model="gpt-5.6",

431 input=[431 input=[

432 {432 {

433 "role": "user",433 "role": "user",


521}521}

522 522 

523const stream = await openai.responses.create({523const stream = await openai.responses.create({

524 model: "gpt-5.5",524 model: "gpt-5.6",

525 input:525 input:

526 "Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",526 "Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",

527 stream: true,527 stream: true,


556 f.write(image_bytes)556 f.write(image_bytes)

557 557 

558stream = client.responses.create(558stream = client.responses.create(

559 model="gpt-5.5",559 model="gpt-5.6",

560 input="Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",560 input="Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",

561 stream=True,561 stream=True,

562 tools=[{"type": "image_generation", "partial_images": 2}],562 tools=[{"type": "image_generation", "partial_images": 2}],


818maskId = create_file("mask.png")818maskId = create_file("mask.png")

819 819 

820response = client.responses.create(820response = client.responses.create(

821 model="gpt-5.5",821 model="gpt-5.6",

822 input=[822 input=[

823 {823 {

824 "role": "user",824 "role": "user",


875const maskId = await createFile("mask.png");875const maskId = await createFile("mask.png");

876 876 

877const response = await openai.responses.create({877const response = await openai.responses.create({

878 model: "gpt-5.5",878 model: "gpt-5.6",

879 input: [879 input: [

880 {880 {

881 role: "user",881 role: "user",

Details

37const openai = new OpenAI();37const openai = new OpenAI();

38 38 

39const response = await openai.responses.create({39const response = await openai.responses.create({

40 model: "gpt-5.5",40 model: "gpt-5.6",

41 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",41 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",

42 tools: [{type: "image_generation"}],42 tools: [{type: "image_generation"}],

43});43});


61client = OpenAI() 61client = OpenAI()

62 62 

63response = client.responses.create(63response = client.responses.create(

64 model="gpt-5.5",64 model="gpt-5.6",

65 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",65 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

66 tools=[{"type": "image_generation"}],66 tools=[{"type": "image_generation"}],

67)67)


81 81 

82```cli82```cli

83openai responses create \83openai responses create \

84 --model gpt-5.5 \84 --model gpt-5.6 \

85 --raw-output \85 --raw-output \

86 --transform 'output.#(type=="image_generation_call").result' <<'YAML' | base64 --decode > cat_and_otter.png86 --transform 'output.#(type=="image_generation_call").result' <<'YAML' | base64 --decode > cat_and_otter.png

87tools:87tools:


132const openai = new OpenAI();132const openai = new OpenAI();

133 133 

134const response = await openai.responses.create({134const response = await openai.responses.create({

135 model: "gpt-5.5",135 model: "gpt-5.6",

136 input: [{136 input: [{

137 role: "user",137 role: "user",

138 content: [138 content: [


154client = OpenAI()154client = OpenAI()

155 155 

156response = client.responses.create(156response = client.responses.create(

157 model="gpt-5.5",157 model="gpt-5.6",

158 input=[{158 input=[{

159 "role": "user",159 "role": "user",

160 "content": [160 "content": [


174using OpenAI.Responses;174using OpenAI.Responses;

175 175 

176string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;176string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

177OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);177OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

178 178 

179Uri imageUrl = new("https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg");179Uri imageUrl = new("https://api.nga.gov/iiif/a2e6da57-3cd1-4235-b20e-95dcaefed6c8/full/!800,800/0/default.jpg");

180 180 


193 -H "Content-Type: application/json" \193 -H "Content-Type: application/json" \

194 -H "Authorization: Bearer $OPENAI_API_KEY" \194 -H "Authorization: Bearer $OPENAI_API_KEY" \

195 -d '{195 -d '{

196 "model": "gpt-5.5",196 "model": "gpt-5.6",

197 "input": [197 "input": [

198 {198 {

199 "role": "user",199 "role": "user",


211 211 

212```cli212```cli

213openai responses create \213openai responses create \

214 --model gpt-5.5 \214 --model gpt-5.6 \

215 --raw-output \215 --raw-output \

216 --transform 'output.#(type=="message").content.0.text' <<'YAML'216 --transform 'output.#(type=="message").content.0.text' <<'YAML'

217input:217input:


239const base64Image = fs.readFileSync(imagePath, "base64");239const base64Image = fs.readFileSync(imagePath, "base64");

240 240 

241const response = await openai.responses.create({241const response = await openai.responses.create({

242 model: "gpt-5.5",242 model: "gpt-5.6",

243 input: [243 input: [

244 {244 {

245 role: "user",245 role: "user",


277 277 

278 278 

279response = client.responses.create(279response = client.responses.create(

280 model="gpt-5.5",280 model="gpt-5.6",

281 input=[281 input=[

282 {282 {

283 "role": "user",283 "role": "user",


299using OpenAI.Responses;299using OpenAI.Responses;

300 300 

301string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;301string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

302OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);302OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

303 303 

304Uri imageUrl = new("https://openai-documentation.vercel.app/images/cat_and_otter.png");304Uri imageUrl = new("https://openai-documentation.vercel.app/images/cat_and_otter.png");

305using HttpClient http = new();305using HttpClient http = new();


354const fileId = await createFile("path_to_your_image.jpg");354const fileId = await createFile("path_to_your_image.jpg");

355 355 

356const response = await openai.responses.create({356const response = await openai.responses.create({

357 model: "gpt-5.5",357 model: "gpt-5.6",

358 input: [358 input: [

359 {359 {

360 role: "user",360 role: "user",


390file_id = create_file("path_to_your_image.jpg")390file_id = create_file("path_to_your_image.jpg")

391 391 

392response = client.responses.create(392response = client.responses.create(

393 model="gpt-5.5",393 model="gpt-5.6",

394 input=[{394 input=[{

395 "role": "user",395 "role": "user",

396 "content": [396 "content": [


411using OpenAI.Responses;411using OpenAI.Responses;

412 412 

413string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;413string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

414OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);414OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

415 415 

416string filename = "cat_and_otter.png";416string filename = "cat_and_otter.png";

417Uri imageUrl = new($"https://openai-documentation.vercel.app/images/{filename}");417Uri imageUrl = new($"https://openai-documentation.vercel.app/images/{filename}");


468 468 

469### Choose an image detail level469### Choose an image detail level

470 470 

471The `detail` parameter tells the model what level of detail to use when processing and understanding the image (`low`, `high`, `original`, or `auto`). If you skip the parameter, the model will use `auto`. This behavior is the same in both the Responses API and the Chat Completions API. On `gpt-5.5`, `auto` and the default omitted behavior are equivalent to `original`.471The `detail` parameter tells the model what level of detail to use when processing and understanding the image (`low`, `high`, `original`, or `auto`). If you skip the parameter, the model will use `auto`. This behavior is the same in both the Responses API and the Chat Completions API. On `gpt-5.5` and GPT-5.6 models, `auto` and the default omitted behavior are equivalent to `original`.

472 472 

473 473 

474 474 


490| `low` | Fast, low-cost understanding when fine visual detail is not important. The model receives a low-resolution 512px x 512px version of the image. |490| `low` | Fast, low-cost understanding when fine visual detail is not important. The model receives a low-resolution 512px x 512px version of the image. |

491| `high` | Standard high-fidelity image understanding. |491| `high` | Standard high-fidelity image understanding. |

492| `original` | Large, dense, spatially sensitive, or computer-use images. Available on `gpt-5.4` and future models. |492| `original` | Large, dense, spatially sensitive, or computer-use images. Available on `gpt-5.4` and future models. |

493| `auto` | Automatic detail selection. On `gpt-5.5`, `auto` and the omitted/default behavior are equivalent to `original`. |493| `auto` | Automatic detail selection. On `gpt-5.5` and GPT-5.6 models, `auto` and the omitted/default behavior are equivalent to `original`. |

494 494 

495For computer use, localization, and click-accuracy use cases on `gpt-5.4` and future models, we recommend `"detail": "original"`. See the [Computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more detail.495For computer use, localization, and click-accuracy use cases on `gpt-5.4` and future models, we recommend `"detail": "original"`. See the [Computer use guide](https://developers.openai.com/api/docs/guides/tools-computer-use) for more detail.

496 496 


508 <th>Supported detail levels</th>508 <th>Supported detail levels</th>

509 <th>Patch and resizing behavior</th>509 <th>Patch and resizing behavior</th>

510 </tr>510 </tr>

511 <tr>

512 <td>GPT-5.6 family</td>

513 <td>

514 <code>low</code>, <code>high</code>, <code>original</code>,

515 <code>auto</code>

516 </td>

517 <td>

518 <code>low</code> and <code>high</code> can resize images under their

519 finite limits. <code>original</code> preserves the input dimensions and

520 does not resize the image to a pixel-dimension or patch-budget limit.

521 <code>auto</code> and omitted <code>detail</code> use the same sizing

522 behavior as <code>original</code>. Request payload and other image-input

523 limits still apply.

524 </td>

525 </tr>

511 <tr>526 <tr>

512 <td>527 <td>

513 <code>gpt-5.5</code>528 <code>gpt-5.5</code>


542 image while preserving aspect ratio to fit within the lesser of those two557 image while preserving aspect ratio to fit within the lesser of those two

543 constraints for the selected detail level. <code>auto</code> and omitted558 constraints for the selected detail level. <code>auto</code> and omitted

544 <code>detail</code> use the same sizing behavior as559 <code>detail</code> use the same sizing behavior as

545 <code>high</code>.[Full resizing details560 <code>high</code>. [Full resizing details

546 below.](#patch-based-image-tokenization)561 below.](#patch-based-image-tokenization)

547 </td>562 </td>

548 </tr>563 </tr>


590 605 

591### Patch-based image tokenization606### Patch-based image tokenization

592 607 

593Some models tokenize images by covering them with 32px x 32px patches. Each model defines a maximum patch budget. The token cost of an image is determined as follows:608Some models tokenize images by covering them with 32px x 32px patches. Many model and detail-level combinations define a maximum patch budget. The token cost of an image is determined as follows:

594 609 

595A. Compute how many 32px x 32px patches are needed to cover the original image. A patch may extend beyond the image boundary.610A. Compute how many 32px x 32px patches are needed to cover the original image. A patch may extend beyond the image boundary.

596 611 


598original_patch_count = ceil(width/32)×ceil(height/32)613original_patch_count = ceil(width/32)×ceil(height/32)

599```614```

600 615 

616For GPT-5.6 models with `detail` set to `original` or `auto`, the service uses the original patch count without resizing the image to a patch budget or pixel-dimension limit. This means large images can use more input tokens than they did with earlier models. To control token use and latency, resize the image before sending it or select `low` or `high` detail.

617 

601B. If the original image would exceed the model's patch budget, scale it down proportionally until it fits within that budget. Then adjust the scale so the final resized image stays within budget after converting to integer pixel dimensions and computing patch coverage.618B. If the original image would exceed the model's patch budget, scale it down proportionally until it fits within that budget. Then adjust the scale so the final resized image stays within budget after converting to integer pixel dimensions and computing patch coverage.

602 619 

603```620```


630 647 

631**Cost calculation examples for a model with a 1,536-patch budget**648**Cost calculation examples for a model with a 1,536-patch budget**

632 649 

633- A 1024 x 1024 image has a post-resize patch count of **1024**650- A 1024 × 1024 image has a post-resize patch count of **1024**

634 - A. `original_patch_count = ceil(1024 / 32) * ceil(1024 / 32) = 32 * 32 = 1024`651 - A. `original_patch_count = ceil(1024 / 32) * ceil(1024 / 32) = 32 * 32 = 1024`

635 - B. `1024` is below the `1,536` patch budget, so no resize is needed.652 - B. `1024` is below the `1,536` patch budget, so no resize is needed.

636 - C. `resized_patch_count = 1024`653 - C. `resized_patch_count = 1024`

637 - Resized patch count before the model multiplier: `1024`654 - Resized patch count before the model multiplier: `1024`

638 - Multiply by the model's token multiplier to get the billed token units.655 - Multiply by the model's token multiplier to get the billed token units.

639- A 1800 x 2400 image has a post-resize patch count of **1452**656- A 1800 × 2400 image has a post-resize patch count of **1452**

640 - A. `original_patch_count = ceil(1800 / 32) * ceil(2400 / 32) = 57 * 75 = 4275`657 - A. `original_patch_count = ceil(1800 / 32) * ceil(2400 / 32) = 57 * 75 = 4275`

641 - B. `4275` exceeds the `1,536` patch budget, so we first compute `shrink_factor = sqrt((32^2 * 1536) / (1800 * 2400)) = 0.603`.658 - B. `4275` exceeds the `1,536` patch budget, so we first compute `shrink_factor = sqrt((32^2 * 1536) / (1800 * 2400)) = 0.603`.

642 - We then adjust that scale so the final integer pixel dimensions stay within budget after patch counting: `adjusted_shrink_factor = 0.603 * min(floor(1800 * 0.603 / 32) / (1800 * 0.603 / 32), floor(2400 * 0.603 / 32) / (2400 * 0.603 / 32)) = 0.586`.659 - We then adjust that scale so the final integer pixel dimensions stay within budget after patch counting: `adjusted_shrink_factor = 0.603 * min(floor(1800 * 0.603 / 32) / (1800 * 0.603 / 32), floor(2400 * 0.603 / 32) / (2400 * 0.603 / 32)) = 0.586`.

643 - Resized image in integer pixels: `1056 x 1408`660 - Resized image dimensions: `1056 × 1408`

644 - C. `resized_patch_count = ceil(1056 / 32) * ceil(1408 / 32) = 33 * 44 = 1452`661 - C. `resized_patch_count = ceil(1056 / 32) * ceil(1408 / 32) = 33 * 44 = 1452`

645 - Resized patch count before the model multiplier: `1452`662 - Resized patch count before the model multiplier: `1452`

646 - Multiply by the model's token multiplier to get the billed token units.663 - Multiply by the model's token multiplier to get the billed token units.


659- Add the base tokens to the total676- Add the base tokens to the total

660 677 

661| Model | Base tokens | Tile tokens |678| Model | Base tokens | Tile tokens |

662| ------------------------ | ----------- | ----------- |679| ------------------------------ | ----------- | ----------- |

663| gpt-5, gpt-5-chat-latest | 70 | 140 |680| `gpt-5`, `gpt-5-chat-latest` | 70 | 140 |

664| 4o, 4.1, 4.5 | 85 | 170 |681| `gpt-4o`, `gpt-4.1`, `gpt-4.5` | 85 | 170 |

665| 4o-mini | 2833 | 5667 |682| `gpt-4o-mini` | 2833 | 5667 |

666| o1, o1-pro, o3 | 75 | 150 |683| `o1`, `o1-pro`, `o3` | 75 | 150 |

667| computer-use-preview | 65 | 129 |684| `computer-use-preview` | 65 | 129 |

668 685 

669### GPT Image 1686### GPT Image 1

670 687 

671For GPT Image 1, we calculate the cost of an image input the same way as described above, except that we scale down the image so that the shortest side is 512px instead of 768px.688For GPT Image 1, we calculate the cost of an image input the same way as described above, except that we scale down the image so that the shortest side is 512px instead of 768px.

672The price depends on the dimensions of the image and the [input fidelity](https://developers.openai.com/api/docs/guides/image-generation?image-generation-model=gpt-image-1#input-fidelity).689The price depends on the dimensions of the image and the [input fidelity](https://developers.openai.com/api/docs/guides/image-generation?image-generation-model=gpt-image-1#image-input-fidelity).

673 690 

674When input fidelity is set to low, the base cost is 65 image tokens, and each tile costs 129 image tokens.691When input fidelity is set to low, the base cost is 65 image tokens, and each tile costs 129 image tokens.

675When using high input fidelity, we add a set number of tokens based on the image's aspect ratio in addition to the image tokens described above.692When using high input fidelity, we add a set number of tokens based on the image's aspect ratio in addition to the image tokens described above.


677- If your image is square, we add 4160 extra input image tokens.694- If your image is square, we add 4160 extra input image tokens.

678- If it is closer to portrait or landscape, we add 6240 extra tokens.695- If it is closer to portrait or landscape, we add 6240 extra tokens.

679 696 

680To see pricing for image input tokens, refer to our [pricing page](https://developers.openai.com/api/docs/pricing#latest-models).697To see pricing for image input tokens, refer to the [image pricing section](https://developers.openai.com/api/docs/pricing#multimodal-image-pricing).

681 698 

682## Limitations699## Limitations

683 700 


691- **Spatial reasoning**: The model struggles with tasks requiring precise spatial localization, such as identifying chess positions.708- **Spatial reasoning**: The model struggles with tasks requiring precise spatial localization, such as identifying chess positions.

692- **Accuracy**: The model may generate incorrect descriptions or captions in certain scenarios.709- **Accuracy**: The model may generate incorrect descriptions or captions in certain scenarios.

693- **Image shape**: The model struggles with panoramic and fisheye images.710- **Image shape**: The model struggles with panoramic and fisheye images.

694- **Metadata and resizing**: The model doesn't process original file names or metadata. Depending on image size and `detail` level, images may be resized before analysis, affecting their original dimensions.711- **Metadata and resizing**: The model doesn't process original file names or metadata. `low` and `high` detail, and models with finite image budgets, may resize images before analysis. GPT-5.6 models preserve the input dimensions with `original` and `auto` detail.

695- **Counting**: The model may give approximate counts for objects in images.712- **Counting**: The model may give approximate counts for objects in images.

696- **CAPTCHAS**: For safety reasons, our system blocks the submission of CAPTCHAs.713- **CAPTCHAs**: For safety reasons, our system blocks the submission of CAPTCHAs.

697 714 

698---715---

699 716 

Details

144. [Make fewer requests.](#make-fewer-requests)144. [Make fewer requests.](#make-fewer-requests)

155. [Parallelize.](#parallelize)155. [Parallelize.](#parallelize)

166. [Make your users wait less.](#make-your-users-wait-less)166. [Make your users wait less.](#make-your-users-wait-less)

177. [Don't default to an LLM.](#don-t-default-to-an-llm)177. [Don't default to an LLM.](#dont-default-to-an-llm)

18 18 

19## Process tokens faster19## Process tokens faster

20 20 


22 22 

23The main factor that influences inference speed is **model size** – smaller models usually run faster (and cheaper), and when used correctly can even outperform larger models. To maintain high quality performance with smaller models you can explore:23The main factor that influences inference speed is **model size** – smaller models usually run faster (and cheaper), and when used correctly can even outperform larger models. To maintain high quality performance with smaller models you can explore:

24 24 

25- using a longer, [more detailed prompt](https://developers.openai.com/api/docs/guides/prompt-engineering#tactic-specify-the-steps-required-to-complete-a-task),25- using a longer, [more detailed prompt](https://developers.openai.com/api/docs/guides/prompt-engineering#prompt-engineering),

26- adding (more) [few-shot examples](https://developers.openai.com/api/docs/guides/prompt-engineering#tactic-provide-examples), or26- adding (more) [few-shot examples](https://developers.openai.com/api/docs/guides/prompt-engineering#few-shot-learning), or

27- [fine-tuning](https://developers.openai.com/api/docs/guides/model-optimization) / distillation.27- [fine-tuning](https://developers.openai.com/api/docs/guides/model-optimization) / distillation.

28 28 

29You can also employ inference optimizations like our [**Predicted outputs**](https://developers.openai.com/api/docs/guides/predicted-outputs) feature. Predicted outputs let you significantly reduce latency of a generation when you know most of the output ahead of time, such as code editing tasks. By giving the model a prediction, the LLM can focus more on the actual changes, and less on the content that will remain the same.29You can also employ inference optimizations like our [**Predicted outputs**](https://developers.openai.com/api/docs/guides/predicted-outputs) feature. Predicted outputs let you significantly reduce latency of a generation when you know most of the output ahead of time, such as code editing tasks. By giving the model a prediction, the LLM can focus more on the actual changes, and less on the content that will remain the same.


67- **Maximize shared prompt prefix**, by putting dynamic portions (e.g. RAG results, history, etc) later in the prompt. This makes your request more [KV cache](https://medium.com/@joaolages/kv-caching-explained-276520203249)-friendly (which most LLM providers use) and means fewer input tokens are processed on each request.67- **Maximize shared prompt prefix**, by putting dynamic portions (e.g. RAG results, history, etc) later in the prompt. This makes your request more [KV cache](https://medium.com/@joaolages/kv-caching-explained-276520203249)-friendly (which most LLM providers use) and means fewer input tokens are processed on each request.

68 68 

69Check out our docs to learn more about how [prompt69Check out our docs to learn more about how [prompt

70 caching](https://developers.openai.com/api/docs/guides/prompt-engineering#prompt-caching) works.70 caching](https://developers.openai.com/api/docs/guides/prompt-engineering#save-on-cost-and-latency-with-prompt-caching)

71 works.

71 72 

72## Make fewer requests73## Make fewer requests

73 74 


299}300}

300```301```

301 302 

302This opens up the possibility of a trade-off. Do we keep this as a **single request entirely generated by GPT-4**, or **split it into two sequential requests** and use GPT-3.5 for all but the final response? We have a case of conflicting principles: the first option lets us [make fewer requests](#make-fewer-requests), but the second may let us [process tokens faster](#1-process-tokens-faster).303This opens up the possibility of a trade-off. Do we keep this as a **single request entirely generated by GPT-4**, or **split it into two sequential requests** and use GPT-3.5 for all but the final response? We have a case of conflicting principles: the first option lets us [make fewer requests](#make-fewer-requests), but the second may let us [process tokens faster](#process-tokens-faster).

303 304 

304As with many optimization tradeoffs, the answer will depend on the details. For example:305As with many optimization tradeoffs, the answer will depend on the details. For example:

305 306 

Details

1---1---

2latestModelInfo:2latestModelInfo:

3 model: gpt-5.53 model: gpt-5.6-sol

4 migrationGuide: /api/docs/guides/upgrading-to-gpt-5p5.md4 migrationGuide: /api/docs/guides/upgrading-to-gpt-5p6-sol.md

5 promptingGuide: /api/docs/guides/prompt-guidance.md5 promptingGuide: /api/docs/guides/prompt-guidance-gpt-5p6.md

6---6---

7 7 

8# Using GPT-5.58# Using GPT-5.6

9 9 

10## Introduction10## Introduction

11 11 

12GPT-5.5 raises the baseline for complex production workflows. It’s a strong fit for coding use cases, tool-heavy agents, grounded assistants, long-context retrieval, product-spec-to-plan workflows, and customer-facing workflows where execution quality and response polish are critical.12GPT-5.6 sets a new quality and efficiency baseline for complex production workflows. GPT-5.6 is especially token-efficient and improves frontend aesthetics, including layout, visual hierarchy, and design judgment.

13 13 

14To get the most out of GPT-5.5, treat it as a new model family to tune for, not a drop-in replacement for `gpt-5.2` or `gpt-5.4`. Begin migration with a fresh baseline instead of carrying over every instruction from an older prompt stack. Start with the smallest prompt that preserves the product contract, then tune reasoning effort, verbosity, tool descriptions, and output format against representative examples.14GPT-5.6 also introduces a new naming scheme. The `gpt-5.6` alias routes requests to `gpt-5.6-sol`, the model for flagship capability. Use `gpt-5.6-terra` for strong performance at a lower price and `gpt-5.6-luna` for efficient, high-volume workloads.

15 15 

16GPT-5.5 supports all API features that were already available with GPT-5.4, including [prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching), [hosted tools](https://developers.openai.com/api/docs/guides/tools#available-tools), [tool search](https://developers.openai.com/api/docs/guides/tools-tool-search), [compaction](https://developers.openai.com/api/docs/guides/compaction), and `phase` handling for manually replayed assistant items.16Treat migration as a tuning pass, not only a model-slug change. Start with your current GPT-5.5 or GPT-5.4 reasoning setting, then test the same setting and one level lower on representative tasks. GPT-5.6 can often maintain or improve quality with fewer tokens, but the best setting depends on your workload.

17 17 

18See the [GPT-5.5 Prompting Guide](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5) for examples of successful prompting patterns.18## What is new

19 19 

20## What's new20- **Programmatic Tool Calling:** GPT-5.6 can write JavaScript to call eligible tools, pass results between calls, and process intermediate outputs in a hosted runtime. Use [Programmatic Tool Calling](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling) for bounded, tool-heavy workflows that do not require fresh model judgment between each step.

21- **Multi-agent [beta]:** [Multi-agent](https://developers.openai.com/api/docs/guides/tools-multi-agent) lets a GPT-5.6 instance coordinate multiple subagents in parallel and synthesize their results. Similar to ultra mode in Codex, this can reduce wall-clock time and improve performance for complex tasks that divide cleanly into independent workstreams. Multi-agent is available as a beta feature in the Responses API as we iterate on developer feedback.

22- **Explicit prompt caching:** GPT-5.6 lets you mark exactly which reusable prompt prefixes OpenAI caches. You can still use automatic caching in implicit mode. OpenAI bills cache writes at 1.25× the uncached input rate, while cache reads remain discounted. Learn how to [configure prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching).

23- **Persisted reasoning:** GPT-5.6 can reuse available reasoning items across turns to improve multi-turn quality and cache efficiency. Use `reasoning.context` to select the behavior. Learn how to [preserve reasoning across calls](https://developers.openai.com/api/docs/guides/reasoning#preserve-reasoning-across-calls).

24- **Max reasoning effort:** GPT-5.6 supports `max` reasoning effort for demanding tasks that need more exploration and verification. If you currently use `xhigh`, compare both settings on representative workloads.

25- **Pro mode:** GPT-5.6 can perform more model work to improve reliability on difficult tasks and return a single final answer. Enable it with `reasoning.mode: "pro"` when quality matters more than latency and token usage. Learn how to [use pro mode](https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode).

26- **Token efficiency:** GPT-5.6 reaches frontier performance with fewer output tokens.

27- **Frontend design:** GPT-5.6 creates more polished and usable websites and applications, with stronger layout, visual hierarchy, and design judgment.

28- **Intent understanding:** GPT-5.6 can better infer the user's underlying goal and intended level of work without you specifying every step. Continue to state important constraints, approval boundaries, and success criteria explicitly.

29- **Original image detail:** GPT-5.6 preserves the original dimensions of images sent with `original` or `auto` detail instead of resizing them to a patch budget or pixel-dimension limit. Large images can use more input tokens and increase latency. Learn how to [choose an image detail level](https://developers.openai.com/api/docs/guides/images-vision#choose-an-image-detail-level).

21 30 

22- **More efficient reasoning:** GPT-5.5 reaches strong results with fewer reasoning tokens than prior models, even at the same reasoning effort. This is especially useful in complex, tool-heavy, or multi-step workflows where token savings compound.31## Safeguards

23- **Stronger task execution with outcome-first prompts:** GPT-5.5 is better at working from a clear goal, preserving constraints, and turning product intent into concrete next steps. Describe the expected outcome, success criteria, allowed side effects, evidence rules, and output shape. Avoid step-by-step process guidance unless the exact path matters.

24- **Stronger and more precise tool use:** GPT-5.5 is especially useful on large tool surfaces, multi-step service workflows, and long-running agent tasks. It tends to be more precise in tool selection and argument use.

25- **Tone is often more polished, but can be more direct:** GPT-5.5 often produces warmer, more readable answers with less prompt scaffolding.

26 32 

27## Behavioral changes33When using GPT-5.6 models, users may encounter safeguards that block or refuse some requests due to real-time cyber and biology misuse classifiers that are run as model outputs are generated. Other requests may take longer because generation is paused for several seconds mid-stream while these classifiers synchronously review outputs. Safeguards may occasionally intervene on legitimate work, particularly in dual-use areas where defensive and offensive activity can initially look similar.

28 34 

291. **Reasoning effort now defaults to `medium`:** GPT-5.5 defaults to `medium` reasoning effort. Treat `medium` as the recommended balanced starting point for quality, reliability, latency, and cost. For latency-sensitive workflows, evaluate `low` before `none` when tool use, planning, search, or multi-step decision making still matters. Reserve `none` for latency-critical tasks that don't need reasoning or multi-chained tool calls, such as lightweight voice turns, fast information retrieval, and classification. Increase to `high` or `xhigh` only when evals show a measurable quality gain that justifies the extra latency and cost. See the [Reasoning models documentation](https://developers.openai.com/api/docs/guides/reasoning) for more details on recommended settings.35If your application serves individual end users, send a stable, privacy-preserving `safety_identifier` with each request. See [Implement safety identifiers](https://developers.openai.com/api/docs/guides/safety-best-practices#implement-safety-identifiers) for guidance.

30 36 

31 Higher reasoning effort isn't automatically better. If the task has conflicting instructions, weak stopping criteria, or open-ended tool access, higher effort can lead to overthinking, unnecessary searching, or output quality regressions. Increase effort only when evals show a measurable quality gain.37We are continuously evolving these safeguards so that they are robust and effective in holding up to adversarial pressure, while preserving access to legitimate work such as code review, vulnerability research, patch development, debugging, security education, and defensive testing.

32 38 

332. **Image inputs preserve more visual detail by default:** GPT-5.5 updates the default handling for image inputs to preserve more visual detail and improve computer use performance. When `image_detail` is unset or set to `auto`, the model now uses `original` behavior, preserving images without resizing up to 10,240,000 pixels or a 6,000-pixel dimension limit. For `high`, specify the value directly; it preserves images without resizing up to 2,500,000 pixels or a 2,048-pixel dimension limit. `low` now focuses on context efficiency and resizes images above a 512-pixel dimension limit more aggressively than previous models. See the [Images and vision documentation](https://developers.openai.com/api/docs/guides/images-vision).39<div id="migrate-to-gpt-56" aria-hidden="true"></div>

34 40 

353. **Improved instruction following:** GPT-5.5 interprets prompts in a literal and thorough manner, enabling specific, descriptive instructions when the product requires them. Define success criteria and stopping rules, especially for long-running, tool-heavy, or evidence-gathering workflows. See [Write outcome-first prompts](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5#outcome-first-prompts-and-stopping-conditions) and [Keep the right specificity](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5#formatting).41## Migration quickstart

36 42 

374. **Default style is more concise and direct:** GPT-5.5 tends to be efficient, direct, and task-oriented by default. This is useful for many production workflows, but customer-facing or conversational experiences may need explicit personality, warmth, rationale, and formatting guidance. Use `text.verbosity` intentionally: `medium` is the default, and `low` is often a better starting point for concise responses. See the [GPT-5.5 prompting guide](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5).43### Migrate with Codex

38 44 

395. **Coding workflows need stronger orchestration:** GPT-5.5 is better suited to complex coding tasks that require planning, tool use, codebase navigation, verification, and multi-step execution. For coding agents, be explicit about reuse, subagent delegation, test expectations, acceptance criteria, and when to continue versus ask for help.45Codex can apply the recommended changes in this guide with the [OpenAI Docs skill](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).

40 46 

41## Migration quickstart47```text

48$openai-docs migrate this project to the GPT-5.6 model family

49```

50 

51To use this skill in other coding agents, download it from the [OpenAI skills repository](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).

52 

53### Update API and model parameters

54 

55- Choose the target model for the workload. Use `gpt-5.6-sol` for frontier capability, `gpt-5.6-terra` for a balance of intelligence and cost, or `gpt-5.6-luna` for efficient, high-volume workloads. The `gpt-5.6` alias routes requests to `gpt-5.6-sol`.

56- Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses) for reasoning, tool-calling, and multi-turn workflows.

57- Set `reasoning.effort` intentionally. GPT-5.6 supports `none`, `low`, `medium`, `high`, `xhigh`, and `max`.

58 - If you are migrating from GPT-5.5 or GPT-5.4, preserve your current reasoning effort as the baseline, then compare one level lower.

59 - If you use `none`, keep it as your latency baseline and also test `low` when the workflow benefits from reasoning or tool use.

60 - Use `medium` as a balanced starting point and `low` for latency-sensitive workloads.

61 - Use `high` or `xhigh` when more reasoning produces a measured quality gain.

62 - Reserve `max` for the hardest quality-first workloads. Compare `max` and `xhigh` to find the best quality, latency, and cost tradeoff for your use case.

63- To use pro mode, keep your selected GPT-5.6 model and set `reasoning.mode` to `pro` in the Responses API; do not switch to a separate Pro model slug. Choose `reasoning.effort` independently. If you omit it, GPT-5.6 defaults to `medium` in both standard and pro modes. See [reasoning mode](https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode) for a request example and billing details.

64- Configure persisted reasoning based on how much prior reasoning is still relevant.

65 - Omit `reasoning.context` or set it to `auto` to use the model's default. Check the response's `reasoning.context` field to confirm the effective mode.

66 - Set `reasoning.context` to `all_turns` when the task's goals, assumptions, and priorities stay stable across turns.

67 - With `all_turns`, continue with `previous_response_id` to make reasoning from earlier responses available to the model.

68 - When managing history manually, preserve and resend previous user inputs and every response output item. For `store: false` or Zero Data Retention, add `include: ["reasoning.encrypted_content"]` and replay the returned encrypted reasoning items.

69 - Set `reasoning.context` to `current_turn` when earlier reasoning is no longer relevant.

70- Review prompt caching. You do not need to change code to keep using implicit caching. Because GPT-5.6 cache writes cost 1.25× the uncached input rate, track `cached_tokens` and `cache_write_tokens` to understand net cost. Use explicit breakpoints or `prompt_cache_options.mode: "explicit"` to avoid unnecessary writes, and replace `prompt_cache_retention` with `prompt_cache_options.ttl`.

71- To use Programmatic Tool Calling, add the `programmatic_tool_calling` tool and opt eligible tools in with `allowed_callers`. Update your application to handle `program` items, program-issued function calls, and `program_output` items while preserving each call's `call_id` and `caller` linkage. See the [Programmatic Tool Calling guide](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling) for request and continuation examples.

72- Benchmark the migrated workflow on representative tasks. Compare task success, final-answer completeness, required evidence, total tokens, latency, and cost. Fewer calls, turns, or intermediate outputs are improvements only when the final user-visible answer still meets the required quality bar.

73 

74## Prompting best practices

75 

76 

77Prompting guidance applicable to GPT-5.5 remains applicable to GPT-5.6.

78 

79### Use shorter prompts

80 

81In internal evaluations, replacing long, explicit system prompts with minimal prompts improved scores by roughly 10–15%, while reducing total tokens by 41–66% and cost by 33–67%.

82 

83Removing redundant instructions and examples and simplifying tool descriptions produced clearer efficiency gains than adding model-specific guidance. Heavier prompts tended to encourage extra exploration, repeated validation, and larger accumulated context.

84 

85Over time, we have found that many older prompt instructions that have accumulated in harnesses have become default model behavior. Focusing on only the behavior the model does not perform naturally produces the largest gains.

86 

87- Start with the smallest prompt and tool set that reliably completes the task. Add instructions, tools, or examples only when evaluations reveal a specific gap.

88- Expose only task-relevant tools, and keep tool descriptions concise and precise. Large tool sets and verbose definitions increase starting context and can make tool selection less consistent.

89- Use examples and style guidance sparingly. Keep frontend, formatting, or stylistic instructions only for product-specific requirements, and avoid repeated phrasing or “X, not Y” patterns the model may mirror.

90- Monitor both starting and accumulated context. Heavy prompts and stale context can encourage unnecessary exploration and repeated validation while increasing latency and cost.

91 

92### Define autonomy and permissions clearly

93 

94GPT-5.6 can be proactive and persistent. Define what level of action each request authorizes.

95 

96A compact policy is usually sufficient:

42 97 

43### Automated migration with Codex98```text

99For requests to answer, explain, review, diagnose, or plan, inspect the relevant

100materials and report the result. Do not implement changes unless the request also

101asks for them.

102 

103For requests to change, build, or fix, make the requested in-scope local changes

104and run relevant non-destructive validation without asking first.

105 

106Require confirmation for external writes, destructive actions, purchases, or a

107material expansion of scope.

108```

109 

110Specify which local actions are safe without approval, such as reading files, inspecting logs, searching, editing in-scope code, or running non-destructive tests.

111 

112Avoid repeating “ask first,” “do not mutate,” or “wait for approval” throughout the prompt. Repetition can cause unnecessary permission checks even for safe, expected actions.

113 

114### Personality and style

115 

116#### Response length

117 

118On average, GPT-5.6 responses are shorter than responses from recent models:

119 

120- Fewer generic introductions

121- Fewer speculative branches

122- Shorter lists

123- Less repetition between answer and rationale

124- More likely to ask one targeted question instead of providing a large placeholder framework

44 125 

45Codex can apply the recommended changes in this guide with the [OpenAI Docs Skill](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).126For example, when asked to investigate churn without access to data, GPT-5.5 listed several possible datasets and business-context inputs. GPT-5.6 asked for a dashboard export or table access, listed the minimum useful fields, and described the analysis it would perform.

127 

128#### Avoid generic brevity instructions

129 

130GPT-5.6 is more sensitive than GPT-5.5 to instructions such as “Be concise,” “Keep it short,” or “Use minimal text.”

131 

132GPT-5.6 is already biased toward compression. An instruction such as “Be concise. Use minimal text.” does more than remove filler—it can change how the model prioritizes the task. GPT-5.6 may decide that a shorter substitute is preferable to producing the full requested artifact.

133 

134Instead of asking for the shortest possible answer, replace brevity instructions with prioritization:

46 135 

47```text136```text

48$openai-docs migrate this project to gpt-5.5137Lead with the conclusion. Include the evidence needed to support it, any material

138caveat, and the next action. Omit secondary detail and repetition.

139 

140Keep all required facts, decisions, caveats, and next steps. Trim introductions,

141repetition, generic reassurance, and optional background first.

49```142```

50 143 

51To use this skill in other coding agents, download it from the [OpenAI skills repository](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).144This preserves useful concision without encouraging the model to remove required content.

145 

146#### Keep structure guidance lightweight

147 

148GPT-5.6 benefits from a small amount of task-specific structure. Give GPT-5.6 a lightweight outline, not a global response template. Add narrow constraints only if evaluations prove the requirement.

149 

150#### Control warmth

151 

152GPT-5.6 does not become meaningfully better when prompted to be broadly friendlier or more empathetic. Instead of generic instructions such as “Be friendly and warm,” use concrete guidance:

153 

154```text

155Be direct and tactful. Acknowledge friction specifically when relevant. Avoid

156canned reassurance and unnecessary sign-offs.

157```

158 

159### Pro mode

160 

161#### Choose pro mode when quality matters most

162 

163Pro mode is a Responses API execution mode that applies more model work to a request before returning a single final answer. It can improve reliability on difficult tasks, but it increases latency and aggregates the tokens from that work in reported usage. Those tokens are billed at the selected model's standard token rates.

164 

165Use pro mode when a marginal quality improvement materially affects the outcome and the task is difficult enough to benefit, such as complex optimization, high-value coding or review, or deep analysis with clear evaluation criteria. Prefer standard mode for routine, latency-sensitive, or high-volume work, and whenever your evaluations do not show a meaningful gain from pro mode.

166 

167Reasoning mode and reasoning effort are independent. Pro mode works with any GPT-5.6 model and its supported reasoning efforts. Start with the same model and effort as your standard-mode baseline, then compare configurations on representative tasks instead of assuming that the highest effort is always the best tradeoff.

168 

169#### Prompt for the task, not the mode

170 

171Enable pro mode in the API request, not in the prompt. You do not need to ask the model to “use pro mode,” “think harder,” or generate several candidate answers. Give it the same outcome-focused prompt you would use in standard mode: state the goal, relevant context, constraints, required evidence, success criteria, and output format.

172 

173For example:

174 

175```text

176Review this database migration plan for failure modes that could cause data loss

177or extended downtime. For each finding, cite the relevant step, estimate impact

178and likelihood, and recommend a specific mitigation. Return the five most

179important risks in severity order.

180```

181 

182#### Evaluate the quality and cost tradeoff

183 

184Compare standard and pro modes on the same representative tasks. Measure task success, answer completeness, required evidence, total tokens, latency, and cost. Use pro mode selectively where its quality or reliability gain justifies the additional model work.

185 

186Learn more in the [reasoning mode guide](https://developers.openai.com/api/docs/guides/reasoning#reasoning-mode).

187 

188### Programmatic Tool Calling

189 

190#### Choose Programmatic Tool Calling by task shape

191 

192Programmatic Tool Calling (PTC) works best for bounded workflows where code can process several tool results or large intermediate outputs and return a much smaller structured result. Use it for filtering, joining, ranking, deduplication, aggregation, validation, or other predictable processing.

193 

194Multiple, parallel, or dependent calls alone do not justify Programmatic Tool Calling. Prefer direct, non-PTC tool calls when:

195 

196- One call is sufficient

197- The intermediate outputs are already small

198- Each result may change the model’s next decision

199- An action requires approval

200- The final output must preserve citations or native artifacts

201 

202#### Make routing instructions task-specific

203 

204Do not rely on tool availability or generic instructions such as “use Programmatic Tool Calling efficiently” to produce the right route. When both direct and programmatic calling are available, explicitly state:

205 

206- Which bounded stage should use Programmatic Tool Calling.

207- Which tools it may call.

208- The exact output schema and required evidence.

209- Concurrency, retry, and stopping limits.

210- Which work should remain direct.

211 

212Tool descriptions should document their expected return fields, types, and error behavior. If the model cannot determine the return shape before writing the program, prefer direct tool calling so it can inspect the result before deciding how to use it.

213 

214If both routes are needed, define one clear handoff and tell the model not to switch routes or repeat completed work.

215 

216For example:

217 

218```text

219<tool_orchestration>

220Use Programmatic Tool Calling for [bounded stage] using only [eligible tools].

221Run independent calls concurrently when safe. Use only documented tool input

222and output fields.

223 

224Process and reduce the intermediate results, then emit exactly [output schema],

225including the evidence needed for the final answer.

226 

227Stop when [condition] is met. Retry transient failures at most [R] times.

228Do not repeat completed calls or perform side-effecting actions. If a required

229result is still missing, return a clear structured failure.

230 

231Use direct tool calls for [semantic judgment, approval, or final validation].

232</tool_orchestration>

233```

234 

235#### Evaluate the final answer

236 

237Evaluate the final user-visible answer, not only the program result. Define the required quality bar and primary efficiency goal in advance. Lower token usage, latency, calls, or turns are improvements only when the answer meets that quality bar; any accepted quality tradeoff should be explicit.

238 

239Learn more in the [Programmatic Tool Calling guide](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling).

52 240 

53### API and model parameters

54 

55- Update the model slug to `gpt-5.5`.

56- Use the Responses API for any reasoning, tool-calling, or multi-turn use case.

57- Tune `reasoning.effort`. Use `low` for efficient reasoning, `medium` for a balanced point on the latency/performance curve, `high` for complex agentic tasks that require hard reasoning and where latency matters less, and `xhigh` for the hardest asynchronous agentic tasks or evals that test the bounds of model intelligence. See the [Reasoning models documentation](https://developers.openai.com/api/docs/guides/reasoning).

58- To configure for more concise responses, set `text.verbosity` to `low`. On GPT-5.5, this will result in proportionally more concise responses than `low` verbosity with GPT-5.4.

59- For tool-heavy or long-running workflows, verify that your application handles `phase`, preambles, and assistant-item replay correctly.

60- Benchmark against other models on accuracy, token consumption, and end-to-end latency.

61 

62### Prompting

63 

64- State the expected outcome and success criteria.

65- Reduce or remove detailed step-by-step process guidance. Let GPT-5.5 choose the path unless the product requires that path.

66- Remove output schema definitions from the prompt where possible. Use [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs) instead.

67- Optimize your prompt for caching: [static parts first, dynamic parts last](https://developers.openai.com/api/docs/guides/prompt-caching).

68- Drop the current date. The model is already aware of the current UTC date.

69- Review and optimize your prompts based on the guidance in [Prompting GPT-5.5](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5).

70 

71## Using reasoning models

72 

73This guidance applies to GPT-5 series models and is worth revisiting whenever teams move workloads onto reasoning models. GPT-5.5 carries forward many capabilities that first appeared in earlier models, but they're still worth reviewing if you are moving from an earlier GPT-5 model, GPT-4.1, or a reasoning model such as o3.

74 

75Teams can overlook these features because they sit partly in API configuration and orchestration rather than in the prompt itself. Used together, the Responses API, reasoning controls, verbosity, structured outputs, prompt caching, tool design, hosted tools, and state management help reasoning models deliver their best intelligence, reliability, latency, and cost profile.

76 

77- **Responses API:** GPT-5.5 works best in the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses). Use `previous_response_id` for multi-turn state handling. For stateless or Zero Data Retention flows, pass back the relevant returned output items each turn. See [Passing context from the previous response](https://developers.openai.com/api/docs/guides/conversation-state#passing-context-from-the-previous-response) for details.

78- **Reasoning effort:** Use `reasoning.effort` to choose between `low`, `medium`, `high`, or `xhigh`. The default is `medium`, but many workloads will perform well with `low`. Reserve `none` for use cases where low latency is more important than intelligence. See [Reasoning Models](https://developers.openai.com/api/docs/guides/reasoning) for detailed recommendations.

79- **Verbosity:** Use `text.verbosity` to control output length. Treat final answer length as separate from reasoning quality; specify word budgets, section counts, table widths, or JSON-only output where needed.

80- **Structured Outputs:** Avoid describing the expected output schema in the prompt. Use [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs) for automatic validation and increased accuracy.

81- **Prompt caching:** [Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching) works automatically for eligible long prompts and can reduce latency and input-token cost. To maximize cache hits, keep stable content at the beginning of the request. Put dynamic user-specific context near the end. For repeated traffic with common prefixes, use `prompt_cache_key` consistently and track `usage.prompt_tokens_details.cached_tokens`.

82- **Tool calling:** GPT-5.5 supports the same tool-calling patterns as GPT-5.4, including function tools and tool-heavy agent workflows. Put most tool-specific guidance in the tool descriptions themselves: what the tool does, when to use it, required inputs, side effects, retry safety, and common error modes. Add tool-specific context to system instructions only when it applies across tools or materially changes the agent's operating policy.

83- **Hosted tools and tool search:** Prefer [OpenAI-hosted tools](https://developers.openai.com/api/docs/guides/tools) where they fit the workflow, such as web search, file search, code interpreter, image generation, and computer use. Hosted tools reduce custom orchestration burden and keep common tool patterns aligned with the Responses API and Agents SDK. Use custom function tools when you need to call your own systems, enforce domain-specific side effects, or expose internal business workflows. For large tool catalogs, consider using [tool search](https://developers.openai.com/api/docs/guides/tools-tool-search) to defer tool definitions and load only the relevant subset.

84- **Tool preambles:** Preambles can improve chat UX because the user sees an initial, useful status update before the model generates the final response. They also make tool use easier to follow: the model can state what it's about to check or do, then continue from that same assistant state after tool results arrive.

85- **`phase` handling:** If your application manually manages Responses state by passing output items back each turn instead of using `previous_response_id`, preserve the `phase` parameter on returned assistant output items and pass it back unchanged. This is especially important when using reasoning effort, preambles, or repeated tool calls. See [Phase parameter](https://developers.openai.com/api/docs/guides/reasoning#phase-parameter).

86- **Compaction:** For long-running agents, use [conversation/state compaction](https://developers.openai.com/api/docs/guides/compaction) intentionally. Preserve completed actions, active assumptions, IDs, tool outcomes, unresolved blockers, and the next concrete goal.

87- **Agents SDK:** For new agentic systems, use the latest [Agents SDK](https://developers.openai.com/api/docs/guides/agents) patterns for tool orchestration, tracing, handoffs, and state management rather than rebuilding orchestration from scratch.

88- **Current date:** GPT-5.5 is aware of the current date in UTC. You don't need to add the current date to system instructions. Add explicit date or timezone context only when the application needs a business-specific timezone, policy-effective date, user-local date, or other non-UTC reference point.

Details

95 -H "Content-Type: application/json" \95 -H "Content-Type: application/json" \

96 -H "Authorization: Bearer $OPENAI_API_KEY" \96 -H "Authorization: Bearer $OPENAI_API_KEY" \

97 -d "{97 -d "{

98 \"model\": \"gpt-5.5\",98 \"model\": \"gpt-5.6\",

99 \"messages\": $INPUT99 \"messages\": $INPUT

100 }"100 }"

101 101 


103 -H "Content-Type: application/json" \103 -H "Content-Type: application/json" \

104 -H "Authorization: Bearer $OPENAI_API_KEY" \104 -H "Authorization: Bearer $OPENAI_API_KEY" \

105 -d "{105 -d "{

106 \"model\": \"gpt-5.5\",106 \"model\": \"gpt-5.6\",

107 \"input\": $INPUT107 \"input\": $INPUT

108 }"108 }"

109```109```


115];115];

116 116 

117const completion = await client.chat.completions.create({117const completion = await client.chat.completions.create({

118 model: 'gpt-5.5',118 model: 'gpt-5.6',

119 messages: context119 messages: context

120});120});

121 121 

122const response = await client.responses.create({122const response = await client.responses.create({

123 model: "gpt-5.5",123 model: "gpt-5.6",

124 input: context124 input: context

125});125});

126```126```


132]132]

133 133 

134completion = client.chat.completions.create(134completion = client.chat.completions.create(

135 model="gpt-5.5",135 model="gpt-5.6",

136 messages=context136 messages=context

137)137)

138 138 

139response = client.responses.create(139response = client.responses.create(

140 model="gpt-5.5",140 model="gpt-5.6",

141 input=context141 input=context

142)142)

143```143```


156const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });156const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

157 157 

158const completion = await client.chat.completions.create({158const completion = await client.chat.completions.create({

159 model: 'gpt-5.5',159 model: 'gpt-5.6',

160 messages: [160 messages: [

161 { 'role': 'system', 'content': 'You are a helpful assistant.' },161 { 'role': 'system', 'content': 'You are a helpful assistant.' },

162 { 'role': 'user', 'content': 'Hello!' }162 { 'role': 'user', 'content': 'Hello!' }


170client = OpenAI()170client = OpenAI()

171 171 

172completion = client.chat.completions.create(172completion = client.chat.completions.create(

173 model="gpt-5.5",173 model="gpt-5.6",

174 messages=[174 messages=[

175 {"role": "system", "content": "You are a helpful assistant."},175 {"role": "system", "content": "You are a helpful assistant."},

176 {"role": "user", "content": "Hello!"}176 {"role": "user", "content": "Hello!"}


184 -H "Content-Type: application/json" \184 -H "Content-Type: application/json" \

185 -H "Authorization: Bearer $OPENAI_API_KEY" \185 -H "Authorization: Bearer $OPENAI_API_KEY" \

186 -d '{186 -d '{

187 "model": "gpt-5.5",187 "model": "gpt-5.6",

188 "messages": [188 "messages": [

189 {"role": "system", "content": "You are a helpful assistant."},189 {"role": "system", "content": "You are a helpful assistant."},

190 {"role": "user", "content": "Hello!"}190 {"role": "user", "content": "Hello!"}


205const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });205const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

206 206 

207const response = await client.responses.create({207const response = await client.responses.create({

208 model: 'gpt-5.5',208 model: 'gpt-5.6',

209 instructions: 'You are a helpful assistant.',209 instructions: 'You are a helpful assistant.',

210 input: 'Hello!'210 input: 'Hello!'

211});211});


218client = OpenAI()218client = OpenAI()

219 219 

220response = client.responses.create(220response = client.responses.create(

221 model="gpt-5.5",221 model="gpt-5.6",

222 instructions="You are a helpful assistant.",222 instructions="You are a helpful assistant.",

223 input="Hello!"223 input="Hello!"

224)224)


230 -H "Content-Type: application/json" \230 -H "Content-Type: application/json" \

231 -H "Authorization: Bearer $OPENAI_API_KEY" \231 -H "Authorization: Bearer $OPENAI_API_KEY" \

232 -d '{232 -d '{

233 "model": "gpt-5.5",233 "model": "gpt-5.6",

234 "instructions": "You are a helpful assistant.",234 "instructions": "You are a helpful assistant.",

235 "input": "Hello!"235 "input": "Hello!"

236 }'236 }'


279 { 'role': 'user', 'content': 'What is the capital of France?' }279 { 'role': 'user', 'content': 'What is the capital of France?' }

280 ];280 ];

281const res1 = await client.chat.completions.create({281const res1 = await client.chat.completions.create({

282 model: 'gpt-5.5',282 model: 'gpt-5.6',

283 messages283 messages

284});284});

285 285 


287messages.push({ 'role': 'user', 'content': 'And its population?' });287messages.push({ 'role': 'user', 'content': 'And its population?' });

288 288 

289const res2 = await client.chat.completions.create({289const res2 = await client.chat.completions.create({

290 model: 'gpt-5.5',290 model: 'gpt-5.6',

291 messages291 messages

292});292});

293```293```


297 {"role": "system", "content": "You are a helpful assistant."},297 {"role": "system", "content": "You are a helpful assistant."},

298 {"role": "user", "content": "What is the capital of France?"}298 {"role": "user", "content": "What is the capital of France?"}

299]299]

300res1 = client.chat.completions.create(model="gpt-5.5", messages=messages)300res1 = client.chat.completions.create(model="gpt-5.6", messages=messages)

301 301 

302messages += [res1.choices[0].message]302messages += [res1.choices[0].message]

303messages += [{"role": "user", "content": "And its population?"}]303messages += [{"role": "user", "content": "And its population?"}]

304 304 

305res2 = client.chat.completions.create(model="gpt-5.5", messages=messages)305res2 = client.chat.completions.create(model="gpt-5.6", messages=messages)

306```306```

307 307 

308 308 


318 { "role": "user", "content": "What is the capital of France?" }318 { "role": "user", "content": "What is the capital of France?" }

319]319]

320res1 = client.responses.create(320res1 = client.responses.create(

321 model="gpt-5.5",321 model="gpt-5.6",

322 input=context,322 input=context,

323)323)

324 324 


331]331]

332 332 

333res2 = client.responses.create(333res2 = client.responses.create(

334 model="gpt-5.5",334 model="gpt-5.6",

335 input=context,335 input=context,

336)336)

337```337```


342];342];

343 343 

344const res1 = await client.responses.create({344const res1 = await client.responses.create({

345 model: "gpt-5.5",345 model: "gpt-5.6",

346 input: context,346 input: context,

347});347});

348 348 


353context.push({ role: "user", content: "And its population?" });353context.push({ role: "user", content: "And its population?" });

354 354 

355const res2 = await client.responses.create({355const res2 = await client.responses.create({

356 model: "gpt-5.5",356 model: "gpt-5.6",

357 input: context,357 input: context,

358});358});

359```359```


364 364 

365```javascript365```javascript

366const res1 = await client.responses.create({366const res1 = await client.responses.create({

367 model: 'gpt-5.5',367 model: 'gpt-5.6',

368 input: 'What is the capital of France?',368 input: 'What is the capital of France?',

369 store: true369 store: true

370});370});

371 371 

372const res2 = await client.responses.create({372const res2 = await client.responses.create({

373 model: 'gpt-5.5',373 model: 'gpt-5.6',

374 input: 'And its population?',374 input: 'And its population?',

375 previous_response_id: res1.id,375 previous_response_id: res1.id,

376 store: true376 store: true


379 379 

380```python380```python

381res1 = client.responses.create(381res1 = client.responses.create(

382 model="gpt-5.5",382 model="gpt-5.6",

383 input="What is the capital of France?",383 input="What is the capital of France?",

384 store=True384 store=True

385)385)

386 386 

387res2 = client.responses.create(387res2 = client.responses.create(

388 model="gpt-5.5",388 model="gpt-5.6",

389 input="And its population?",389 input="And its population?",

390 previous_response_id=res1.id,390 previous_response_id=res1.id,

391 store=True391 store=True


442 -H "Content-Type: application/json" \442 -H "Content-Type: application/json" \

443 -H "Authorization: Bearer $OPENAI_API_KEY" \443 -H "Authorization: Bearer $OPENAI_API_KEY" \

444 -d '{444 -d '{

445 "model": "gpt-5.5",445 "model": "gpt-5.6",

446 "messages": [446 "messages": [

447 {447 {

448 "role": "user",448 "role": "user",


484client = OpenAI()484client = OpenAI()

485 485 

486response = client.chat.completions.create(486response = client.chat.completions.create(

487 model="gpt-5.5",487 model="gpt-5.6",

488 messages=[488 messages=[

489 {489 {

490 "role": "user",490 "role": "user",


523 523 

524```javascript524```javascript

525const completion = await openai.chat.completions.create({525const completion = await openai.chat.completions.create({

526 model: "gpt-5.5",526 model: "gpt-5.6",

527 messages: [527 messages: [

528 {528 {

529 "role": "user",529 "role": "user",


570 -H "Content-Type: application/json" \570 -H "Content-Type: application/json" \

571 -H "Authorization: Bearer $OPENAI_API_KEY" \571 -H "Authorization: Bearer $OPENAI_API_KEY" \

572 -d '{572 -d '{

573 "model": "gpt-5.5",573 "model": "gpt-5.6",

574 "input": "Jane, 54 years old",574 "input": "Jane, 54 years old",

575 "text": {575 "text": {

576 "format": {576 "format": {


603 603 

604```python604```python

605response = client.responses.create(605response = client.responses.create(

606 model="gpt-5.5",606 model="gpt-5.6",

607 input="Jane, 54 years old", 607 input="Jane, 54 years old",

608 text={608 text={

609 "format": {609 "format": {


636 636 

637```javascript637```javascript

638const response = await openai.responses.create({638const response = await openai.responses.create({

639 model: "gpt-5.5",639 model: "gpt-5.6",

640 input: "Jane, 54 years old",640 input: "Jane, 54 years old",

641 text: {641 text: {

642 format: {642 format: {


705}705}

706 706 

707const completion = await client.chat.completions.create({707const completion = await client.chat.completions.create({

708 model: 'gpt-5.5',708 model: 'gpt-5.6',

709 messages: [709 messages: [

710 { role: 'system', content: 'You are a helpful assistant.' },710 { role: 'system', content: 'You are a helpful assistant.' },

711 { role: 'user', content: 'Who is the current president of France?' }711 { role: 'user', content: 'Who is the current president of France?' }


732 return r.json().get("results", [])732 return r.json().get("results", [])

733 733 

734completion = client.chat.completions.create(734completion = client.chat.completions.create(

735 model="gpt-5.5",735 model="gpt-5.6",

736 messages=[736 messages=[

737 {"role": "system", "content": "You are a helpful assistant."},737 {"role": "system", "content": "You are a helpful assistant."},

738 {"role": "user", "content": "Who is the current president of France?"}738 {"role": "user", "content": "Who is the current president of France?"}


766 766 

767```javascript767```javascript

768const answer = await client.responses.create({768const answer = await client.responses.create({

769 model: 'gpt-5.5',769 model: 'gpt-5.6',

770 input: 'Who is the current president of France?',770 input: 'Who is the current president of France?',

771 tools: [{ type: 'web_search' }]771 tools: [{ type: 'web_search' }]

772});772});


776 776 

777```python777```python

778answer = client.responses.create(778answer = client.responses.create(

779 model="gpt-5.5",779 model="gpt-5.6",

780 input="Who is the current president of France?",780 input="Who is the current president of France?",

781 tools=[{"type": "web_search"}]781 tools=[{"type": "web_search"}]

782)782)


789 -H "Content-Type: application/json" \789 -H "Content-Type: application/json" \

790 -H "Authorization: Bearer $OPENAI_API_KEY" \790 -H "Authorization: Bearer $OPENAI_API_KEY" \

791 -d '{791 -d '{

792 "model": "gpt-5.5",792 "model": "gpt-5.6",

793 "input": "Who is the current president of France?",793 "input": "Who is the current president of France?",

794 "tools": [{"type": "web_search"}]794 "tools": [{"type": "web_search"}]

795 }'795 }'

Details

41With evals in place, you can effectively iterate on [prompts](https://developers.openai.com/api/docs/guides/text). The prompt engineering process may be all you need in order to get great results for your use case. Different models may require different prompting techniques, but there are several best practices you can apply across the board to get better results.41With evals in place, you can effectively iterate on [prompts](https://developers.openai.com/api/docs/guides/text). The prompt engineering process may be all you need in order to get great results for your use case. Different models may require different prompting techniques, but there are several best practices you can apply across the board to get better results.

42 42 

43- **Include relevant context** - in your instructions, include text or image content that the model will need to generate a response from outside its training data. This could include data from private databases or current, up-to-the-minute information.43- **Include relevant context** - in your instructions, include text or image content that the model will need to generate a response from outside its training data. This could include data from private databases or current, up-to-the-minute information.

44- **Provide clear instructions** - your prompt should contain clear goals about what kind of output you want. Start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) for new work, and use [reasoning model guidance](https://developers.openai.com/api/docs/guides/reasoning) to tune outcome-level instructions, reasoning effort, and verbosity.44- **Provide clear instructions** - your prompt should contain clear goals about what kind of output you want. Start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) for new work, and use [reasoning model guidance](https://developers.openai.com/api/docs/guides/reasoning) to tune outcome-level instructions, reasoning effort, and verbosity.

45- **Provide example outputs** - give the model a few examples of correct output for a given prompt (a process called few-shot learning). The model can extrapolate from these examples how it should respond for other prompts.45- **Provide example outputs** - give the model a few examples of correct output for a given prompt (a process called few-shot learning). The model can extrapolate from these examples how it should respond for other prompts.

46 46 

47[47[

Details

1# Model selection1# Model selection

2 2 

3Choosing the right model, whether [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) or a smaller option like [`gpt-5.4-mini`](https://developers.openai.com/api/docs/models/gpt-5.4-mini), requires balancing **accuracy**, **latency**, and **cost**. This guide explains key principles to help you make informed decisions, along with a practical example.3Choosing the right model, whether [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) or a smaller option like [`gpt-5.6-terra`](https://developers.openai.com/api/docs/models/gpt-5.6-terra), requires balancing **accuracy**, **latency**, and **cost**. This guide explains key principles to help you make informed decisions, along with a practical example.

4 4 

5## Core principles5## Core principles

6 6 


57 57 

58## Practical example58## Practical example

59 59 

60To demonstrate these principles, we'll develop a fake news classifier with the following target metrics. The experiment below uses historical GPT-4o-family results to show the workflow; for current evaluations, start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) and compare against smaller or fine-tuned models.60To demonstrate these principles, we'll develop a fake news classifier with the following target metrics. The experiment below uses historical GPT-4o-family results to show the workflow; for current evaluations, start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) and compare against smaller or fine-tuned models.

61 61 

62- **Accuracy:** Achieve 90% correct classification62- **Accuracy:** Achieve 90% correct classification

63- **Cost:** Spend less than $5 per 1,000 articles63- **Cost:** Spend less than $5 per 1,000 articles


81 81 

82By switching from `gpt-4o` to `gpt-4o-mini` with fine-tuning, we achieved **equivalent performance for less than 2%** of the cost, using only 1,000 labeled examples.82By switching from `gpt-4o` to `gpt-4o-mini` with fine-tuning, we achieved **equivalent performance for less than 2%** of the cost, using only 1,000 labeled examples.

83 83 

84This process is important - you often can’t jump right to fine-tuning because you don’t know whether fine-tuning is the right tool for the optimization you need, or you don’t have enough labeled examples. Start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) to establish your accuracy target, then test smaller or fine-tuned models when cost and latency matter.84This process is important - you often can’t jump right to fine-tuning because you don’t know whether fine-tuning is the right tool for the optimization you need, or you don’t have enough labeled examples. Start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) to establish your accuracy target, then test smaller or fine-tuned models when cost and latency matter.

Details

30client = OpenAI()30client = OpenAI()

31 31 

32response = client.responses.create(32response = client.responses.create(

33 model="gpt-5.5",33 model="gpt-5.6",

34 input=[34 input=[

35 {35 {

36 "role": "user",36 "role": "user",


56const client = new OpenAI();56const client = new OpenAI();

57 57 

58const response = await client.responses.create({58const response = await client.responses.create({

59 model: "gpt-5.5",59 model: "gpt-5.6",

60 input: [60 input: [

61 {61 {

62 role: "user",62 role: "user",

Details

17 -H "Authorization: Bearer $OPENAI_API_KEY" \17 -H "Authorization: Bearer $OPENAI_API_KEY" \

18 -H "Content-Type: application/json" \18 -H "Content-Type: application/json" \

19 -d '{19 -d '{

20 "model": "gpt-5.5",20 "model": "gpt-5.6",

21 "input": "What does 'fit check for my napalm era' mean?",21 "input": "What does 'fit check for my napalm era' mean?",

22 "service_tier": "priority"22 "service_tier": "priority"

23 }'23 }'


29const openai = new OpenAI();29const openai = new OpenAI();

30 30 

31const response = await openai.responses.create({31const response = await openai.responses.create({

32 model: "gpt-5.5",32 model: "gpt-5.6",

33 input: "What does 'fit check for my napalm era' mean?",33 input: "What does 'fit check for my napalm era' mean?",

34 service_tier: "priority"34 service_tier: "priority"

35});35});


43client = OpenAI()43client = OpenAI()

44 44 

45response = client.responses.create(45response = client.responses.create(

46 model="gpt-5.5",46 model="gpt-5.6",

47 input="What does 'fit check for my napalm era' mean?",47 input="What does 'fit check for my napalm era' mean?",

48 service_tier="priority"48 service_tier="priority"

49)49)

Details

86 86 

87#### Model87#### Model

88 88 

89Our API offers different models with varying levels of complexity and generality. The most capable models, such as `gpt-5.5`, can generate more complex and diverse completions, but they also take longer to process your query.89Our API offers different models with varying levels of complexity and generality. The most capable models, such as `gpt-5.6`, can generate more complex and diverse completions, but they also take longer to process your query.

90Models such as `gpt-5.4-mini` and `gpt-5.4-nano` can generate faster and cheaper Responses, while `gpt-5.5` is a stronger default when you want more headroom on complex tasks. You can choose the model that best suits your use case and the trade-off between speed, cost, and quality.90Models such as `gpt-5.6-terra` and `gpt-5.6-luna` can generate faster and cheaper Responses, while `gpt-5.6` is a stronger default when you want more headroom on complex tasks. You can choose the model that best suits your use case and the trade-off between speed, cost, and quality.

91 91 

92#### Number of completion tokens92#### Number of completion tokens

93 93 

Details

1# Prompt caching1# Prompt caching

2 2 

3Model prompts often contain repetitive content, like system prompts and common instructions. OpenAI routes API requests to servers that recently processed the same prompt, making it cheaper and faster than processing a prompt from scratch. Prompt Caching can reduce latency by up to 80% and input token costs by up to 90%. Prompt Caching works automatically on all your API requests (no code changes required) and has no additional fees associated with it. Prompt Caching is enabled for all recent [models](https://developers.openai.com/api/docs/models), gpt-4o and newer.3Model prompts often contain repetitive content, like system prompts and common instructions. OpenAI routes API requests to servers that recently processed the same prompt, making it faster and less expensive to reuse an exact prompt prefix than to process it from scratch. Prompt Caching works automatically for eligible requests, with no code changes required. It is enabled for all recent [models](https://developers.openai.com/api/docs/models), `gpt-4o` and newer.

4 

5Cache writes have no additional fee on models before the GPT-5.6 family. For GPT-5.6 models and later model families, cache writes cost 1.25× the uncached input token rate. On these models, both implicit and explicit caching are more consistent and reliable. You can also use explicit cache breakpoints to control exactly which prompt prefixes OpenAI caches. OpenAI reports writes in `cache_write_tokens` and reads in `cached_tokens`, so you can measure the cost of writes against the savings from later cache hits.

4 6 

5This guide describes how Prompt Caching works in detail, so that you can optimize your prompts for lower latency and cost.7This guide describes how Prompt Caching works in detail, so that you can optimize your prompts for lower latency and cost.

6 8 


12 14 

13## How it works15## How it works

14 16 

15Caching is enabled automatically for prompts that are 1024 tokens or longer. When you make an API request, the following steps occur:17By default, caching is enabled automatically for prompts that are 1024 tokens or longer. When you make an API request, the following steps occur:

16 18 

171. **Cache Routing**:191. **Cache Routing**:

18 20 

19- Requests are routed to a machine based on a hash of the initial prefix of the prompt. The hash typically uses the first 256 tokens, though the exact length varies depending on the model.21- Requests are routed to a machine based on a hash of the initial prefix of the prompt. The hash typically uses the first 256 tokens, though the exact length varies depending on the model.

20- If you provide the [`prompt_cache_key`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-prompt_cache_key) parameter, it is combined with the prefix hash, allowing you to influence routing and improve cache hit rates. This is especially beneficial when many requests share long, common prefixes.22- If you provide the [`prompt_cache_key`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-prompt_cache_key) parameter, it is combined with the prefix hash, allowing you to influence routing and improve cache hit rates. This is especially beneficial when many requests share long, common prefixes.

21- If requests for the same prefix and `prompt_cache_key` combination exceed a certain rate (approximately 15 requests per minute), some may overflow and get routed to additional machines, reducing cache effectiveness.

22 23 

232. **Cache Lookup**: The system checks if the initial portion (prefix) of your prompt exists in the cache on the selected machine.242. **Cache Lookup**: The system checks if the initial portion (prefix) of your prompt exists in the cache on the selected machine.

243. **Cache Hit**: If a matching prefix is found, the system uses the cached result. This significantly decreases latency and reduces costs.253. **Cache Hit**: If a matching prefix is found, the system uses the cached result. This decreases latency and bills those tokens at the cached-input rate.

254. **Cache Miss**: If no matching prefix is found, the system processes your full prompt, caching the prefix afterward on that machine for future requests.264. **Cache Miss**: If no matching prefix is found, the system processes your full prompt. When automatic caching is enabled, it may cache an eligible prefix on that machine for future requests. On GPT-5.6 models and later model families, tokens written to cache are billed at the cache-write rate.

27 

28### Improve cache hit rates with a prompt cache key

29 

30Set `prompt_cache_key` on requests that share long, common prompt prefixes. Reuse the same key for those requests to help route them to the same cache and improve cache hit rates.

31 

32On GPT-5.6 models and later model families, you must set `prompt_cache_key` to use the more reliable matching for both implicit and explicit caching. At each breakpoint, the service matches the key with the exact prompt prefix. Without a key, requests may still receive automatic cache hits, but they do not use the improved matching.

33 

34Keep the total traffic across all prefixes for each key to approximately 15 requests per minute. If a key receives a higher rate, some requests may miss the cache. For higher-volume workloads, partition traffic across more keys and use a stable mapping so requests with the same key continue to share prefixes.

35 

36## Prompt cache breakpoints

37 

38For GPT-5.6 models and later model families, you can mark the end of a reusable prompt prefix with an explicit cache breakpoint. Breakpoints are available in both the Responses API and Chat Completions API.

39 

40Set the request-wide cache policy with `prompt_cache_options.mode`:

41 

42- `implicit` is the default. OpenAI places a cache breakpoint on the latest message and also uses any explicit breakpoints you provide.

43- `explicit` disables the implicit breakpoint. Only explicit breakpoints are used for cache reads and writes. If the conversation contains no explicit breakpoints, the request does not use prompt caching or incur cache-write charges.

44 

45Add `prompt_cache_breakpoint: { "mode": "explicit" }` to a supported prompt content block. The breakpoint marks the exact end of the cached prefix, including that block and all prompt content rendered before it. Content after the breakpoint can change without invalidating the earlier cached prefix. All breakpoints use the request-wide `prompt_cache_options.ttl`, which currently defaults to `30m` and is the only supported value.

46 

47Each request can create up to four new cache writes. Breakpoints from earlier conversation turns are read-only: they can match the cache, but the request does not write them again. In `implicit` mode, the breakpoint on the latest message uses one write slot, so up to the latest three explicit breakpoints can be written. In `explicit` mode, up to the latest four explicit breakpoints can be written. For cache reads, OpenAI considers up to the latest 50 breakpoints in the conversation.

48 

49Responses API supports breakpoints on `input_text`, `input_image`, and `input_file` blocks. Chat Completions API supports them on `text`, `image_url`, `input_audio`, `file`, and `refusal` blocks.

50 

51When several breakpoints match cached content, the service reads from the longest matching prefix.

52 

53The following examples are abbreviated to show the request shape. In a real request, the rendered prefix before the marked breakpoint must contain at least 1,024 tokens to be cacheable.

54 

55 

56 

57<div data-content-switcher-pane data-value="responses">

58 <div class="hidden">Responses API</div>

59 

60 This request uses the default `implicit` mode, which places a breakpoint on

61 the latest message, and adds an explicit breakpoint after a stable file.

62 

63 ```json

64{

65 "model": "gpt-5.6",

66 "prompt_cache_key": "tenant:acme:knowledge-base-v1",

67 "input": [

68 {

69 "type": "message",

70 "role": "user",

71 "content": [

72 {

73 "type": "input_file",

74 "file_id": "file_123",

75 "prompt_cache_breakpoint": {

76 "mode": "explicit"

77 }

78 },

79 {

80 "type": "input_text",

81 "text": "Answer the current question."

82 }

83 ]

84 }

85 ]

86}

87```

88 

89 

90 </div>

91 <div data-content-switcher-pane data-value="chat-completions" hidden>

92 <div class="hidden">Chat Completions API</div>

93 

94 This request disables automatic breakpoint placement. Only the marked

95 system-message prefix is eligible for billable cache writes and discounted

96 cache reads.

97 

98 ```json

99{

100 "model": "gpt-5.6",

101 "prompt_cache_key": "tenant:acme:support-assistant-v1",

102 "prompt_cache_options": {

103 "mode": "explicit"

104 },

105 "messages": [

106 {

107 "role": "system",

108 "content": [

109 {

110 "type": "text",

111 "text": "You are a support assistant.",

112 "prompt_cache_breakpoint": {

113 "mode": "explicit"

114 }

115 }

116 ]

117 },

118 {

119 "role": "user",

120 "content": "What should I do next?"

121 }

122 ]

123}

124```

125 

126 

127 </div>

128 

129 

130 

131Only `explicit` is valid for `prompt_cache_breakpoint.mode`. A marker on an unsupported or non-cacheable block returns a `400 invalid_request_error`. Older models also reject `prompt_cache_options` and `prompt_cache_breakpoint`; continue using their existing automatic prompt caching behavior.

26 132 

27## Prompt cache retention133## Prompt cache retention

28 134 

29Prompt Caching can either use in-memory or extended retention policies. When available, Extended Prompt Caching aims to retain the cache for longer, so that subsequent requests are more likely to match the cache.135Prompt caching has two controls with different semantics:

30 136 

31Prompt cache pricing is the same for both retention policies.137- For GPT-5.6 models and later model families, `prompt_cache_options.ttl` sets a minimum cache lifetime. It does not select a storage policy or maximum retention period.

138- For earlier models, `prompt_cache_retention` selects a maximum-retention policy. This field is deprecated for GPT-5.6 models and later model families.

32 139 

33To configure the prompt cache retention policy, set the `prompt_cache_retention` parameter on your `Responses.create` request (or `chat.completions.create` if using Chat Completions).140For GPT-5.6 models and later model families, use `prompt_cache_options.ttl` to set the minimum lifetime of all breakpoints written by the request. The only supported value is `30m`, which is also the default. A cached prefix remains eligible for reuse for at least 30 minutes, but OpenAI may retain it longer.

141 

142For models before the GPT-5.6 family, continue to set `prompt_cache_retention` on your `Responses.create` request or `chat.completions.create` request. For models that support both in-memory and extended retention, prompt cache pricing is the same for both policies.

34 143 

35### In-memory prompt cache retention144### In-memory prompt cache retention

36 145 

37In-memory prompt cache retention is available for all models that support Prompt Caching, except for `gpt-5.5`, `gpt-5.5-pro`, and all future models.146In-memory prompt cache retention is available for models that accept `prompt_cache_retention: "in_memory"`.

38 147 

39When using the in-memory policy, cached prefixes generally remain active for 5 to 10 minutes of inactivity, up to a maximum of one hour. In-memory cached prefixes are only held within volatile GPU memory.148When using the in-memory policy, cached prefixes generally remain active for 5 to 10 minutes of inactivity, up to a maximum of one hour. In-memory cached prefixes are only held within volatile GPU memory.

40 149 


42 151 

43Extended prompt cache retention is available for the following models:152Extended prompt cache retention is available for the following models:

44 153 

45- gpt-5.5154- `gpt-5.5`

46- gpt-5.5-pro155- `gpt-5.5-pro`

47- gpt-5.4156- `gpt-5.4`

48- gpt-5.2157- `gpt-5.2`

49- gpt-5.1-codex-max158- `gpt-5.1-codex-max`

50- gpt-5.1159- `gpt-5.1`

51- gpt-5.1-codex160- `gpt-5.1-codex`

52- gpt-5.1-codex-mini161- `gpt-5.1-codex-mini`

53- gpt-5.1-chat-latest162- `gpt-5.1-chat-latest`

54- gpt-5163- `gpt-5`

55- gpt-5-codex164- `gpt-5-codex`

56- gpt-4.1165- `gpt-4.1`

57 166 

58Extended prompt cache retention keeps cached prefixes active for longer, up to a maximum of 24 hours. Extended Prompt Caching works by offloading the key/value tensors to GPU-local storage when memory is full, significantly increasing the storage capacity available for caching.167Extended prompt cache retention keeps cached prefixes active for longer, up to a maximum of 24 hours. Extended Prompt Caching works by offloading the key/value tensors to GPU-local storage when memory is full, significantly increasing the storage capacity available for caching.

59 168 

60key/value tensors are the intermediate representation from the model's attention layers produced during prefill. Only the key/value tensors may be persisted in local storage; the original customer content, such as prompt text, is only retained in memory.169Key/value tensors are the intermediate representation from the model's attention layers produced during prefill. Only the key/value tensors may be persisted in local storage; the original customer content, such as prompt text, is only retained in memory.

61 170 

62### Configure per request171### Configure retention for older models

63 172 

64For `gpt-5.5`, `gpt-5.5-pro`, and future models, only `24h` is supported.173For `gpt-5.5` and `gpt-5.5-pro`, only `24h` is supported through `prompt_cache_retention`.

65 174 

66For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy:175For older models that support both `in_memory` and `24h`, the default depends on your organization's data retention policy:

67 176 

68- Organizations without ZDR enabled default to `24h`.177- Organizations without ZDR enabled default to `24h`.

69- Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.178- Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.

70 179 

180The following legacy example sets the retention policy for a `gpt-5.5` request:

181 

71```json182```json

72{183{

73 "model": "gpt-5.5",184 "model": "gpt-5.5",


81 192 

82Caching is available for prompts containing 1024 tokens or more.193Caching is available for prompts containing 1024 tokens or more.

83 194 

84All requests, including those with fewer than 1024 tokens, will display a `cached_tokens` field of the `usage.prompt_tokens_details` [Response object](https://developers.openai.com/api/docs/api-reference/responses/object) or [Chat object](https://developers.openai.com/api/docs/api-reference/chat/object) indicating how many of the prompt tokens were a cache hit. For requests under 1024 tokens, `cached_tokens` will be zero.195All requests, including those with fewer than 1024 tokens, display a `cached_tokens` field in the usage token details. Responses API returns this field in `usage.input_tokens_details` on the [Response object](https://developers.openai.com/api/docs/api-reference/responses/object); Chat Completions API returns it in `usage.prompt_tokens_details` on the [Chat object](https://developers.openai.com/api/docs/api-reference/chat/object). The field indicates how many input tokens were read from cache. For requests under 1024 tokens, `cached_tokens` is zero.

196 

197For GPT-5.6 models and later model families, `cache_write_tokens` reports the number of prompt tokens written to cache. Cache write billing uses this value at 1.25× the uncached input token rate.

198 

199The following Chat Completions usage example shows both fields. In this response, 1,920 tokens were read from cache and no tokens were written:

85 200 

86```json201```json

87"usage": {202"usage": {


89 "completion_tokens": 300,204 "completion_tokens": 300,

90 "total_tokens": 2306,205 "total_tokens": 2306,

91 "prompt_tokens_details": {206 "prompt_tokens_details": {

92 "cached_tokens": 1920207 "cached_tokens": 1920,

208 "cache_write_tokens": 0

93 },209 },

94 "completion_tokens_details": {210 "completion_tokens_details": {

95 "reasoning_tokens": 0,211 "reasoning_tokens": 0,


109## Best practices225## Best practices

110 226 

111- Structure prompts with **static or repeated content at the beginning** and dynamic, user-specific content at the end.227- Structure prompts with **static or repeated content at the beginning** and dynamic, user-specific content at the end.

112- Use the **[`prompt_cache_key`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-prompt_cache_key) parameter** consistently across requests that share common prefixes. Select a granularity that keeps each unique prefix-`prompt_cache_key` combination below 15 requests per minute to avoid cache overflow.228- Use the **[`prompt_cache_key`](https://developers.openai.com/api/docs/api-reference/responses/create#responses-create-prompt_cache_key) parameter** consistently across requests that share long, common prefixes to improve cache hit rates. On GPT-5.6 models and later model families, you must set this parameter to use the more reliable cache matching. Keep the total traffic for each key to approximately 15 requests per minute, and use more keys for higher-volume workloads.

113- **Monitor your cache performance metrics**, including cache hit rates, latency, and the proportion of tokens cached, to refine your strategy. You can monitor your cached token counts by logging the usage field results as shown above, or in the OpenAI Usage dashboard.229- On GPT-5.6 models and later model families, place **explicit cache breakpoints** after stable prompt content that is likely to be reused. Set `prompt_cache_options.mode` to `explicit` when you want the service to use only the breakpoints you provide.

230- **Monitor cache reads and writes** by logging `cached_tokens` and `cache_write_tokens`. Compare cache-write volume with subsequent cache reads to understand net cost and adjust breakpoint placement. You can also monitor cached token counts in the OpenAI Usage dashboard.

114- **Maintain a steady stream of requests** with identical prompt prefixes to minimize cache evictions and maximize caching benefits.231- **Maintain a steady stream of requests** with identical prompt prefixes to minimize cache evictions and maximize caching benefits.

115 232 

116## Frequently asked questions233## Frequently asked questions

117 234 

1181. **How is data privacy maintained for caches?**2351. **How is data privacy maintained for caches?**

119 236 

120 Prompt caches are not shared between organizations. Only members of the same organization can access caches of identical prompts. When using Extended Prompt Caching, key/value tensors have a maximum retention period of 24 hours.237 Prompt caches are not shared between organizations. Only members of the same organization can access caches of identical prompts. Cache data handling depends on the model and retention policy. See the [Your data](https://developers.openai.com/api/docs/guides/your-data) guide for the current application-state, Zero Data Retention, and data residency details.

121 238 

1222. **Does Prompt Caching affect output token generation or the final response of the API?**2392. **Does Prompt Caching affect output token generation or the final response of the API?**

123 240 

124 Prompt Caching does not influence the generation of output tokens or the final response provided by the API. Regardless of whether caching is used, the output generated will be identical. This is because only the prompt itself is cached, while the actual response is computed anew each time based on the cached prompt.241 Prompt Caching does not change how the model generates output tokens. The model computes a new response from the cached prompt prefix, so otherwise identical nondeterministic requests are not guaranteed to return identical output.

125 242 

1263. **Is there a way to manually clear the cache?**2433. **Is there a way to manually clear the cache?**

127 244 

128 Manual cache clearing is not currently available. Prompts that have not been encountered recently are automatically cleared from the cache. Typical cache evictions occur after 5-10 minutes of inactivity, though sometimes lasting up to a maximum of one hour during off-peak periods.245 Manual cache clearing is not currently available. For models before the GPT-5.6 family that use in-memory retention, typical cache evictions occur after 5-10 minutes of inactivity, though entries can remain for up to one hour during off-peak periods. For GPT-5.6 models and later model families, cached prefixes remain eligible for reuse for at least 30 minutes and may be retained longer.

129 246 

1304. **Will I be expected to pay extra for writing to Prompt Caching?**2474. **Will I be expected to pay extra for writing to Prompt Caching?**

131 248 

132 No. Caching happens automatically, with no explicit action needed or extra cost paid to use the caching feature.249 Cache writes have no additional fee on models before the GPT-5.6 family. On GPT-5.6 models and later model families, cache writes are billed at 1.25× the uncached input token rate and reported in `cache_write_tokens`. Cache reads continue to be reported in `cached_tokens`.

133 250 

1345. **Do cached prompts contribute to TPM rate limits?**2515. **Do cached prompts contribute to TPM rate limits?**

135 252 

136 Yes, as caching does not affect rate limits.253 Yes, as caching does not affect rate limits.

137 

1386. **Does Prompt Caching work on Zero Data Retention requests?**

139 

140 In-memory cache retention does not save any data to disk.

141 Extended prompt caching may store key/value tensors in GPU-local storage, and the key-value tensors are derived from customer content. This data is not retained beyond cache expiration -- the key-value tensors are retained for 1-2 hours (most usage) and at most 24 hours.

142 Extended prompt caching requests are not blocked if Zero Data Retention is enabled for your project. Other Zero Data Retention still applies, such as excluding customer content from abuse logs and preventing use of `store=True`.

143 See the [Your data](https://developers.openai.com/api/docs/guides/your-data) guide for more context on Zero Data Retention.

144 

1457. **Does Prompt Caching work with Data Residency?**

146 

147 In-memory Prompt Caching does not store data and so does not impact Data Residency.

148 

149 Extended caching temporarily stores data on GPU machines and will only be kept in-region when using Regional Inference.

Details

43- **GPT models** are fast, cost-efficient, and highly intelligent, but benefit from more explicit instructions around how to accomplish tasks.43- **GPT models** are fast, cost-efficient, and highly intelligent, but benefit from more explicit instructions around how to accomplish tasks.

44- **Large and small (mini or nano) models** offer trade-offs for speed, cost, and intelligence. Large models are more effective at understanding prompts and solving problems across domains, while small models are generally faster and cheaper to use.44- **Large and small (mini or nano) models** offer trade-offs for speed, cost, and intelligence. Large models are more effective at understanding prompts and solving problems across domains, while small models are generally faster and cheaper to use.

45 45 

46When in doubt, [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) offers a strong default for general-purpose text generation and prompt iteration.46When in doubt, [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) offers a strong default for general-purpose text generation and prompt iteration.

47 47 

48## Prompt engineering48## Prompt engineering

49 49 


73const client = new OpenAI();73const client = new OpenAI();

74 74 

75const response = await client.responses.create({75const response = await client.responses.create({

76 model: "gpt-5.5",76 model: "gpt-5.6",

77 reasoning: { effort: "low" },77 reasoning: { effort: "low" },

78 instructions: "${semicolonsDevMsg}",78 instructions: "${semicolonsDevMsg}",

79 input: "${semicolonsPrompt}",79 input: "${semicolonsPrompt}",


87client = OpenAI()87client = OpenAI()

88 88 

89response = client.responses.create(89response = client.responses.create(

90 model="gpt-5.5",90 model="gpt-5.6",

91 reasoning={"effort": "low"},91 reasoning={"effort": "low"},

92 instructions="${semicolonsDevMsg}",92 instructions="${semicolonsDevMsg}",

93 input="${semicolonsPrompt}",93 input="${semicolonsPrompt}",


101 -H "Content-Type: application/json" \101 -H "Content-Type: application/json" \

102 -H "Authorization: Bearer $OPENAI_API_KEY" \102 -H "Authorization: Bearer $OPENAI_API_KEY" \

103 -d '{103 -d '{

104 "model": "gpt-5.5",104 "model": "gpt-5.6",

105 "reasoning": {"effort": "low"},105 "reasoning": {"effort": "low"},

106 "instructions": "${semicolonsDevMsg}",106 "instructions": "${semicolonsDevMsg}",

107 "input": "${semicolonsPrompt}"107 "input": "${semicolonsPrompt}"


118const client = new OpenAI();118const client = new OpenAI();

119 119 

120const response = await client.responses.create({120const response = await client.responses.create({

121 model: "gpt-5.5",121 model: "gpt-5.6",

122 reasoning: { effort: "low" },122 reasoning: { effort: "low" },

123 input: [123 input: [

124 {124 {


140client = OpenAI()140client = OpenAI()

141 141 

142response = client.responses.create(142response = client.responses.create(

143 model="gpt-5.5",143 model="gpt-5.6",

144 reasoning={"effort": "low"},144 reasoning={"effort": "low"},

145 input=[145 input=[

146 {146 {


162 -H "Content-Type: application/json" \162 -H "Content-Type: application/json" \

163 -H "Authorization: Bearer $OPENAI_API_KEY" \163 -H "Authorization: Bearer $OPENAI_API_KEY" \

164 -d '{164 -d '{

165 "model": "gpt-5.5",165 "model": "gpt-5.6",

166 "reasoning": {"effort": "low"},166 "reasoning": {"effort": "low"},

167 "input": [167 "input": [

168 {168 {


278const instructions = await fs.readFile("prompt.txt", "utf-8");278const instructions = await fs.readFile("prompt.txt", "utf-8");

279 279 

280const response = await client.responses.create({280const response = await client.responses.create({

281 model: "gpt-5.5",281 model: "gpt-5.6",

282 instructions,282 instructions,

283 input: "How would I declare a variable for a last name?",283 input: "How would I declare a variable for a last name?",

284});284});


294 instructions = f.read()294 instructions = f.read()

295 295 

296response = client.responses.create(296response = client.responses.create(

297 model="gpt-5.5",297 model="gpt-5.6",

298 instructions=instructions,298 instructions=instructions,

299 input="How would I declare a variable for a last name?",299 input="How would I declare a variable for a last name?",

300)300)


307 -H "Authorization: Bearer $OPENAI_API_KEY" \307 -H "Authorization: Bearer $OPENAI_API_KEY" \

308 -H "Content-Type: application/json" \308 -H "Content-Type: application/json" \

309 -d '{309 -d '{

310 "model": "gpt-5.5",310 "model": "gpt-5.6",

311 "instructions": "'"$(< prompt.txt)"'",311 "instructions": "'"$(< prompt.txt)"'",

312 "input": "How would I declare a variable for a last name?"312 "input": "How would I declare a variable for a last name?"

313 }'313 }'


384 384 

385## Prompting current GPT-5 series models385## Prompting current GPT-5 series models

386 386 

387GPT models like [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5) benefit from precise instructions that explicitly provide the logic and data required to complete the task in the prompt. To get the most out of the latest GPT-5 series model, start with the current prompting guide.387GPT models like [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol) benefit from precise instructions that explicitly provide the logic and data required to complete the task in the prompt. To get the most out of the latest GPT-5 series model, start with the current prompting guide.

388 388 

389<a href="/api/docs/guides/prompt-guidance">389<a href="/api/docs/guides/latest-model#prompting-best-practices">

390 390

391 391 

392<span slot="icon">392<span slot="icon">


399 399 

400### Prompting best practices for the latest GPT-5 series model400### Prompting best practices for the latest GPT-5 series model

401 401 

402For the full current treatment, use the [prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) guide. The practical reminders below still apply.402For the full current treatment, use the [latest GPT-5 prompting best practices](https://developers.openai.com/api/docs/guides/latest-model#prompting-best-practices). The practical reminders below still apply.

403 403 

404Coding404Coding

405 405 

406#### Coding406#### Coding

407 407 

408Prompting `gpt-5.5` for coding tasks is most effective when following a few best practices: define the agent's role, enforce structured tool use with examples, require thorough testing for correctness, and set Markdown standards for clean output.408Prompting `gpt-5.6` for coding tasks is most effective when following a few best practices: define the agent's role, enforce structured tool use with examples, require thorough testing for correctness, and set Markdown standards for clean output.

409 409 

410**Explicit role and workflow guidance**410**Explicit role and workflow guidance**

411Frame the model as a software engineering agent with well-defined responsibilities. Provide clear instructions for using tools like `functions.run` for code tasks, and specify when not to use certain modes—for example, avoid interactive execution unless necessary.411Frame the model as a software engineering agent with well-defined responsibilities. Provide clear instructions for using tools like `functions.run` for code tasks, and specify when not to use certain modes—for example, avoid interactive execution unless necessary.


419**Markdown standards**419**Markdown standards**

420Guide the model to generate clean, semantically correct markdown using inline code, code fences, lists, and tables where appropriate—and to format file paths, functions, and classes with backticks.420Guide the model to generate clean, semantically correct markdown using inline code, code fences, lists, and tables where appropriate—and to format file paths, functions, and classes with backticks.

421 421 

422For detailed guidance and prompt samples specific to coding, see our [prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) guide.422For detailed guidance and prompt samples specific to coding, see the [latest GPT-5 prompting best practices](https://developers.openai.com/api/docs/guides/latest-model#prompting-best-practices).

423 423 

424Front-end engineering424Front-end engineering

425 425 

426[GPT-5.5](https://developers.openai.com/api/docs/models/gpt-5.5)426[GPT-5.6](https://developers.openai.com/api/docs/models/gpt-5.6-sol)

427performs well at building front ends from scratch as well as contributing to427performs well at building front ends from scratch as well as contributing to

428large, established codebases. To get the best results, we recommend using the428large, established codebases. To get the best results, we recommend using the

429following libraries:429following libraries:


456- **Pages:** Provide templates for common layouts.456- **Pages:** Provide templates for common layouts.

457- **Agent Instructions:** Ask the model to confirm design assumptions, scaffold projects, enforce standards, integrate APIs, test states, and document code.457- **Agent Instructions:** Ask the model to confirm design assumptions, scaffold projects, enforce standards, integrate APIs, test states, and document code.

458 458 

459For detailed guidance and prompt samples specific to frontend development, see our [prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) guide.459For detailed guidance and prompt samples specific to frontend development, see the [latest GPT-5 prompting best practices](https://developers.openai.com/api/docs/guides/latest-model#prompting-best-practices).

460 460 

461Agentic tasks461Agentic tasks

462 462 

463For agentic and long-running rollouts with `gpt-5.5`, focus your prompts on three core practices: plan tasks thoroughly to ensure complete resolution, provide clear preambles for major tool usage decisions, and use a TODO tool to track workflow and progress in an organized manner.463For agentic and long-running rollouts with `gpt-5.6`, focus your prompts on three core practices: plan tasks thoroughly to ensure complete resolution, provide clear preambles for major tool usage decisions, and use a TODO tool to track workflow and progress in an organized manner.

464 464 

465**Planning and persistence**465**Planning and persistence**

466Instruct the model to resolve the full query before yielding control, decomposing it into sub-tasks and reflecting after each tool call to confirm completeness.466Instruct the model to resolve the full query before yielding control, decomposing it into sub-tasks and reflecting after each tool call to confirm completeness.


494 494 

495Use a TODO list tool or rubric to enforce structured planning and avoid missed steps.495Use a TODO list tool or rubric to enforce structured planning and avoid missed steps.

496 496 

497For detailed guidance and prompt samples specific to building agents, see the [prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) guide.497For detailed guidance and prompt samples specific to building agents, see the [latest GPT-5 prompting best practices](https://developers.openai.com/api/docs/guides/latest-model#prompting-best-practices).

498 498 

499## Prompting reasoning models499## Prompting reasoning models

500 500 

guides/prompt-guidance.md +0 −264 deleted

File Deleted View Diff

1# GPT-5.5 prompting guide

2 

3Prompt GPT-5.5 with outcome-first goals, concise style controls, retrieval budgets, and validation loops.

4 

5## New in GPT-5.5 vs GPT-5.4

6- Shorter, outcome-first prompts usually work better than process-heavy prompt stacks.

7- More efficient reasoning means `low` and `medium` effort should be re-evaluated before escalating.

8- Preambles, `phase` handling, and assistant-item replay remain important for tool-heavy Responses workflows.

9- Explicit personality, retrieval budgets, and validation rules help shape customer-facing and agentic UX.

10 

11GPT-5.5 works best when prompts define the outcome and leave room for the model to choose an efficient solution path. Compared with earlier models, you can often use shorter, more outcome-oriented prompts: describe what good looks like, what constraints matter, what evidence is available, and what the final answer should contain.

12 

13Avoid carrying over every instruction from an older prompt stack. Legacy prompts often over-specify the process because earlier models needed more help staying on track. With GPT-5.5, that can add noise, narrow the model's search space, or lead to overly mechanical answers.

14 

15For more detail on GPT-5.5 behavior changes, start with the [Using GPT-5.5 guide](https://developers.openai.com/api/docs/guides/latest-model). This guide focuses on prompt changes that follow from those behavior changes.

16 

17The patterns here are starting points. Adapt them to your product surface, tools, evals, and user experience goals.

18 

19## Automated migration with Codex

20 

21Codex can implement the changes from this guide with the [OpenAI Docs Skill](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).

22 

23```text

24$openai-docs migrate this project to gpt-5.5

25```

26 

27To use this skill in other coding agents, download it from the [OpenAI skills repository](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs).

28 

29## Personality and behavior

30 

31GPT-5.5's default style is efficient, direct, and task-oriented. This is useful for production systems: responses stay focused, behavior is easier to steer, and the model avoids unnecessary conversational padding.

32 

33For customer-facing assistants, support workflows, coaching experiences, and other conversational products, define both personality and collaboration style.

34 

35- **Personality** controls how the assistant sounds: tone, warmth, directness, formality, humor, empathy, and level of polish.

36- **Collaboration style** controls how the assistant works: when it asks questions, when it makes assumptions, how proactive it should be, how much context it gives, when it checks work, and how it handles uncertainty or risk.

37 

38Keep both short. Personality instructions should shape the user experience. Collaboration instructions should shape task behavior. Neither should replace clear goals, success criteria, tool rules, or stopping conditions.

39 

40Example personality block for a steady task-focused assistant:

41 

42```text

43# Personality

44You are a capable collaborator: approachable, steady, and direct. Assume the user is competent and acting in good faith, and respond with patience, respect, and practical helpfulness.

45 

46Prefer making progress over stopping for clarification when the request is already clear enough to attempt. Use context and reasonable assumptions to move forward. Ask for clarification only when the missing information would materially change the answer or create meaningful risk, and keep any question narrow.

47 

48Stay concise without becoming curt. Give enough context for the user to understand and trust the answer, then stop. Use examples, comparisons, or simple analogies when they make the point easier to grasp. When correcting the user or disagreeing, be candid but constructive. When an error is pointed out, acknowledge it plainly and focus on fixing it.

49 

50Match the user's tone within professional bounds. Avoid emojis and profanity by default, unless the user explicitly asks for that style or has clearly established it as appropriate for the conversation.

51```

52 

53Example personality block for an expressive collaborative assistant:

54 

55```text

56# Personality

57Adopt a vivid conversational presence: intelligent, curious, playful when appropriate, and attentive to the user's thinking. Ask good questions when the problem is blurry, then become decisive once there is enough context.

58 

59Be warm, collaborative, and polished. Conversation should feel easy and alive, but not chatty for its own sake. Offer a real point of view rather than merely mirroring the user, while staying responsive to their goals and constraints.

60 

61Be thoughtful and grounded when the task calls for synthesis or advice. State a clear recommendation when you have enough context, explain important tradeoffs, and name uncertainty without becoming evasive.

62```

63 

64For more expressive products, add warmth, curiosity, humor, or point of view explicitly, but keep the block short. Use personality to shape the experience, not to compensate for unclear goals or missing task instructions.

65 

66## Improve time to first visible token with a preamble

67 

68In streaming applications, users notice how long it takes before the first visible response appears. GPT-5.5 may spend time reasoning, planning, or preparing tool calls before emitting visible text.

69 

70For longer or tool-heavy tasks, prompt the model to start with a short preamble: a brief visible update that acknowledges the request and states the first step. This can improve perceived responsiveness without changing the underlying task.

71 

72Use this pattern when the task may take more than one step, require tool calls, or involve a long-running agent workflow.

73 

74```text

75Before any tool calls for a multi-step task, send a short user-visible update that acknowledges the request and states the first step. Keep it to one or two sentences.

76```

77 

78For coding agents that expose separate message phases, you can be more explicit:

79 

80```text

81You must always start with an intermediary update before any content in the analysis channel if the task will require calling tools. The user update should acknowledge the request and explain your first step.

82```

83 

84## Outcome-first prompts and stopping conditions

85 

86GPT-5.5 is strongest when the prompt defines the target outcome, success criteria, constraints, and available context, then lets the model choose the path.

87 

88For many tasks, describe the destination rather than every step. This gives the model room to choose the right search, tool, or reasoning strategy for the task.

89 

90Prefer this:

91 

92```text

93Resolve the customer's issue end to end.

94 

95Success means:

96- the eligibility decision is made from the available policy and account data

97- any allowed action is completed before responding

98- the final answer includes completed_actions, customer_message, and blockers

99- if evidence is missing, ask for the smallest missing field

100```

101 

102**Avoid unnecessary absolute rules.** Older prompts often use strict instructions like `ALWAYS`, `NEVER`, `must`, and `only` to control model behavior. Use those words for true invariants, such as safety rules, required output fields, or actions that should never happen. For judgment calls, such as when to search, ask for clarification, use a tool, or keep iterating, prefer decision rules instead.

103 

104Avoid this style of instruction unless every step is truly required:

105 

106```text

107First inspect A, then inspect B, then compare every field, then think through

108all possible exceptions, then decide which tool to call, then call the tool,

109then explain the entire process to the user.

110```

111 

112Add explicit stopping conditions:

113 

114```text

115Resolve the user query in the fewest useful tool loops, but do not let loop minimization outrank correctness, accessible fallback evidence, calculations, or required citation tags for factual claims.

116 

117After each result, ask: "Can I answer the user's core request now with useful evidence and citations for the factual claims?" If yes, answer.

118```

119 

120Define missing-evidence behavior:

121 

122```text

123Use the minimum evidence sufficient to answer correctly, cite it precisely, then stop.

124```

125 

126## Formatting

127 

128GPT-5.5 is highly steerable on output format and structure. Use that control when it improves comprehension or product fit.

129 

130Set `text.verbosity`, describe the expected output shape, and reserve heavier structure for cases where it improves comprehension or your product UI needs a stable artifact. The API default for `text.verbosity` is `medium`; use `low` when you prefer shorter, more concise responses.

131 

132Plain conversational formatting:

133 

134```text

135Let formatting serve comprehension. Use plain paragraphs as the default format for normal conversation, explanations, reports, documentation, and technical writeups. Keep the presentation clean and readable without making the structure feel heavier than the content.

136 

137Use headers, bold text, bullets, and numbered lists sparingly. Reach for them when the user requests them, when the answer needs clear comparison or ranking, or when the information would be harder to scan as prose. Otherwise, favor short paragraphs and natural transitions.

138 

139Respect formatting preferences from the user. If they ask for a terse answer, minimal formatting, no bullets, no headers, or a specific structure, follow that preference unless there is a strong reason not to.

140```

141 

142Add explicit audience and length guidance:

143 

144```text

145Write for a senior business audience. Keep the answer under 400 words. Use short paragraphs and only include bullets when they improve scannability. Prioritize the conclusion first, then the reasoning, then caveats.

146```

147 

148For editing, rewriting, summaries, or customer-facing messages, tell the model what to preserve before asking it to improve style. This pattern is useful when you want polish without expansion.

149 

150```text

151Preserve the requested artifact, length, structure, and genre first. Quietly improve clarity, flow, and correctness. Do not add new claims, extra sections, or a more promotional tone unless explicitly requested.

152```

153 

154## Grounding, citations, and retrieval budgets

155 

156For grounded answers, citation behavior should be part of the prompt. Define what needs support, what counts as enough evidence, and how the model should behave when evidence is missing. Absence of evidence shouldn't automatically become a factual "no." For more details and examples, see the [citation formatting guide](https://developers.openai.com/api/docs/guides/citation-formatting).

157 

158### Add an explicit retrieval budget

159 

160Retrieval budgets are stopping rules for search. They tell the model when enough evidence is enough.

161 

162```text

163For ordinary Q&A, start with one broad search using short, discriminative keywords. If the top results contain enough citable support for the core request, answer from those results instead of searching again.

164 

165Make another retrieval call only when:

166- The top results do not answer the core question.

167- A required fact, parameter, owner, date, ID, or source is missing.

168- The user asked for exhaustive coverage, a comparison, or a comprehensive list.

169- A specific document, URL, email, meeting, record, or code artifact must be read.

170- The answer would otherwise contain an important unsupported factual claim.

171 

172Do not search again to improve phrasing, add examples, cite nonessential details, or support wording that can safely be made more generic.

173```

174 

175## Creative drafting guardrails

176 

177For drafting tasks, tell the model which claims must come from sources and which parts may be creatively written. This is especially important for slides, launch copy, customer summaries, talk tracks, leadership blurbs, and narrative framing.

178 

179```text

180For creative or generative requests such as slides, leadership blurbs, outbound copy, summaries for sharing, talk tracks, or narrative framing, distinguish source-backed facts from creative wording.

181 

182- Use retrieved or provided facts for concrete product, customer, metric, roadmap, date, capability, and competitive claims, and cite those claims.

183- Do not invent specific names, first-party data claims, metrics, roadmap status, customer outcomes, or product capabilities to make the draft sound stronger.

184- If there is little or no citable support, write a useful generic draft with placeholders or clearly labeled assumptions rather than unsupported specifics.

185```

186 

187## Frontend engineering and visual taste

188 

189For frontend work, refer to the [example instructions](https://developers.openai.com/api/docs/guides/frontend-prompt) for practical ways to steer UI quality. They cover product and user context, design-system alignment, first-screen usability, familiar controls, expected states, responsive behavior, and common generated-UI defaults to avoid, such as generic heroes, nested cards, decorative gradients, visible instructional text, and broken layouts.

190 

191## Prompt the model to check its work

192 

193Give GPT-5.5 access to tools that let it check outputs when validation is possible.

194 

195For coding agents, ask for concrete validation commands:

196 

197```text

198After making changes, run the most relevant validation available:

199- targeted unit tests for changed behavior

200- type checks or lint checks when applicable

201- build checks for affected packages

202- a minimal smoke test when full validation is too expensive

203 

204If validation cannot be run, explain why and describe the next best check.

205```

206 

207For visual artifacts, ask for inspection after rendering:

208 

209```text

210Render the artifact before finalizing. Inspect the rendered output for layout, clipping, spacing, missing content, and visual consistency. Revise until the rendered output matches the requirements.

211```

212 

213For engineering and planning tasks, make implementation plans traceable:

214 

215```text

216For implementation plans, include:

217- requirements and where each is addressed

218- named resources, files, APIs, or systems involved

219- state transitions or data flow where relevant

220- validation commands or checks

221- failure behavior

222- privacy and security considerations

223- open questions that materially affect implementation

224```

225 

226## Phase parameter

227 

228Starting with GPT-5.4, long-running or tool-heavy Responses workflows can use assistant-item `phase` values to distinguish intermediate updates from final answers. GPT-5.5 uses the same pattern.

229 

230If you use `previous_response_id`, the API preserves prior assistant state automatically. If your application manually replays assistant output items into the next request, preserve each original `phase` value and pass it back unchanged. This matters most when a response includes preambles, repeated tool calls, or a final answer after intermediate assistant updates.

231 

232```text

233If manually replaying assistant items:

234- Preserve assistant `phase` values exactly.

235- Use `phase: "commentary"` for intermediate user-visible updates.

236- Use `phase: "final_answer"` for the completed answer.

237- Do not add `phase` to user messages.

238```

239 

240## Suggested prompt structure

241 

242Use this structure as a starting point for complex prompts. Keep each section short. Add detail only where it changes behavior.

243 

244```text

245Role: [1-2 sentences defining the model's function, context, and job]

246 

247# Personality

248[tone, demeanor, and collaboration style]

249 

250# Goal

251[user-visible outcome]

252 

253# Success criteria

254[what must be true before the final answer]

255 

256# Constraints

257[policy, safety, business, evidence, and side-effect limits]

258 

259# Output

260[sections, length, and tone]

261 

262# Stop rules

263[when to retry, fallback, abstain, ask, or stop]

264```

Details

1# Prompting guidance for GPT-5.6 Sol

2 

3# Prompting guidance for GPT-5.6 Sol

4 

5Use this guide when adapting prompts, tool descriptions, agent instructions, or prompt stacks to GPT-5.6 Sol or the GPT-5.6 family. Pair it with the current [GPT-5.6 model guide](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.6) for API details, limits, pricing, and feature availability.

6 

7GPT-5.6 works best when prompts define the outcome, important constraints, available evidence, and completion bar, then leave room for the model to choose an efficient path. Compared with earlier GPT-5 models, many applications can use shorter prompts and smaller tool sets without losing quality.

8 

9Do not carry over every instruction from an older prompt stack. Legacy prompts often repeat rules, prescribe unnecessary steps, expose irrelevant tools, or include examples that no longer change behavior. With GPT-5.6, this can encourage extra exploration, repeated validation, and larger accumulated context.

10 

11Start with the smallest prompt and tool set that passes your evals. Add an instruction, example, or tool only when it fixes a measured failure mode.

12 

13## Simplify prompts first

14 

15When migrating an existing prompt, remove redundant scaffolding before adding new GPT-5.6-specific instructions.

16 

17Trim:

18 

19- repeated statements of the same rule;

20- generic “be thorough,” “be concise,” or “think step by step” language;

21- examples that do not change behavior;

22- process instructions for behavior the model already performs reliably;

23- tools and tool descriptions unrelated to the task.

24 

25Keep:

26 

27- the user-visible outcome;

28- success criteria and stopping conditions;

29- safety, business, evidence, and permission constraints;

30- tool-routing rules when the correct route is not obvious;

31- required output shape and validation requirements.

32 

33Review the remaining instructions for contradictions. GPT-5-class models follow prompt contracts closely, so conflicting rules can create more instability than missing detail.

34 

35## Outcome-first prompts and stopping conditions

36 

37Describe the destination rather than prescribing every step. GPT-5.6 can usually choose an efficient search, tool, or reasoning path when the prompt states what good looks like.

38 

39Prefer:

40 

41 Resolve the customer's issue end to end.

42 

43 Success means:

44 - make the eligibility decision from available policy and account evidence

45 - complete any allowed action before responding

46 - return completed_actions, customer_message, and blockers

47 - if required evidence is missing, ask for the smallest missing field

48 

49Avoid unnecessary absolute rules. Use ALWAYS, NEVER, must, and only for true invariants such as safety rules, required fields, or actions that should never happen. For judgment calls, such as when to search, ask, use a tool, or keep iterating, prefer decision rules.

50 

51Preserve explicit user values. When the correct value is implicit, provide decision criteria and let the model reason from context or schema. Avoid universal defaults, keyword maps, and broad semantic shortcuts.

52 

53Add stopping conditions:

54 

55 Resolve the request in the fewest useful tool loops, but do not let loop

56 minimization outrank correctness, required evidence, calculations, or

57 required citations.

58 

59 After each result, ask whether the core request can now be answered with

60 useful evidence. If yes, answer. If required evidence is still missing,

61 name the missing fact and use the smallest useful fallback.

62 

63## Personality, collaboration, and response length

64 

65GPT-5.6 is efficient, direct, and more compressed than recent models. For customer-facing assistants and collaborative products, define both personality and collaboration style.

66 

67- Personality controls tone, warmth, directness, formality, humor, empathy, and polish.

68- Collaboration style controls when the model asks questions, makes assumptions, takes initiative, explains tradeoffs, checks work, and handles uncertainty.

69 

70Keep both short. Personality should shape the user experience; collaboration instructions should shape task behavior. Neither should replace clear goals, success criteria, tool rules, or stopping conditions.

71 

72Use concrete writing controls:

73 

74 Lead with the conclusion. Include the evidence needed to support it, any

75 material caveat, and the next action. Keep all required facts, decisions,

76 caveats, and next steps. Trim introductions, repetition, generic reassurance,

77 and optional background first.

78 

79Avoid generic “be brief,” “keep it short,” or “use minimal text” instructions. GPT-5.6 is already biased toward compression, and generic brevity can make it omit required evidence or parts of an artifact.

80 

81For customer-facing tone, prefer concrete guidance:

82 

83 Be direct and tactful. Acknowledge friction specifically when relevant.

84 Avoid canned reassurance and unnecessary sign-offs.

85 

86Avoid blanket language rules such as “always respond in the user's language” unless that is truly the product requirement. Specify the intended output language and when it should change.

87 

88For editing, rewriting, summaries, and customer-facing drafts, tell the model what to preserve:

89 

90 Preserve the requested artifact, length, structure, genre, and factual claims

91 first. Improve clarity, flow, and correctness without adding new claims,

92 sections, or a more promotional tone unless requested.

93 

94## Autonomy and permissions

95 

96GPT-5.6 can be proactive and persistent. Define which level of action each request authorizes.

97 

98 For requests to answer, explain, review, diagnose, or plan, inspect the

99 relevant materials and report the result. Do not implement changes unless

100 the request also asks for them.

101 

102 For requests to change, build, or fix, make the requested in-scope local

103 changes and run relevant non-destructive validation without asking first.

104 

105 Require confirmation for external writes, destructive actions, purchases,

106 or a material expansion of scope.

107 

108Specify which local actions are safe without approval, such as reading files, inspecting logs, searching, editing in-scope code, and running non-destructive tests.

109 

110Avoid repeating “ask first” throughout the prompt. Repetition can cause unnecessary permission checks even for safe, expected actions.

111 

112For long-running work, define the current layer of work. Distinguish research, design, implementation, review, and external coordination so the model does not silently move from one layer to another.

113 

114## Tool routing

115 

116Expose only task-relevant tools. Tool descriptions should state what the tool does, when to use it, important return fields, and error behavior.

117 

118When correctness depends on prerequisite retrieval or lookup, say so:

119 

120 Before taking an action, resolve required discovery, retrieval, and

121 validation steps. Do not skip a prerequisite because the intended final

122 state seems obvious.

123 

124When several reads are independent, parallelize them. When one result determines the next action, keep the work sequential. After parallel retrieval, synthesize before acting.

125 

126If a tool returns empty, partial, or suspiciously narrow results, try one or two meaningful fallbacks before concluding that no result exists.

127 

128## Programmatic Tool Calling

129 

130Programmatic Tool Calling is useful when code can reduce large, structured intermediate results before they return to model context.

131 

132Use it for:

133 

134- filtering, joining, sorting, ranking, deduplication, and aggregation;

135- batching across many similar records;

136- repeated deterministic validation;

137- large structured results that can be reduced to a compact schema.

138 

139Prefer direct tool calls when:

140 

141- one call is sufficient;

142- intermediate outputs are already small;

143- each result may change the next decision;

144- an action requires approval;

145- the final answer must preserve citations or native artifacts;

146- the workflow requires semantic judgment between calls.

147 

148Do not rely on generic instructions such as “use Programmatic Tool Calling efficiently.” State the bounded stage, eligible tools, output schema, retry limit, stop condition, and handoff back to direct model judgment.

149 

150 Use Programmatic Tool Calling only for the bounded record-reduction stage.

151 Call only the documented read-only tools. Filter and deduplicate the

152 intermediate results, then emit exactly the required compact schema with

153 evidence fields. Retry transient failures at most twice. Use direct tool

154 calls for approval, semantic judgment, citations, and final validation.

155 

156Evaluate the final user-visible answer, not only the program result. Lower tokens, latency, calls, or turns are improvements only when the final answer still meets the required quality bar.

157 

158## Grounding, citations, and retrieval budgets

159 

160For grounded answers, citation behavior should be part of the prompt. Define what needs support, what counts as enough evidence, and how to behave when evidence is missing. Absence of evidence should not automatically become a factual “no.”

161 

162 For ordinary Q&A, start with one broad search using short, discriminative

163 keywords. If the top results contain enough support for the core request,

164 answer from those results.

165 

166 Make another retrieval call only when a required fact, owner, date, ID, or

167 source is missing; the user asked for exhaustive coverage or comparison; a

168 specific artifact must be read; or an important claim would otherwise be

169 unsupported.

170 

171 Do not search again only to improve phrasing, add examples, or support

172 nonessential detail.

173 

174For research and synthesis:

175 

176- cite only retrieved sources;

177- attach citations to the claims they support;

178- label inference separately from directly supported facts;

179- state conflicts between sources;

180- narrow the answer or report missing evidence instead of guessing.

181 

182For creative drafting, distinguish source-backed facts from creative wording. Do not invent names, metrics, dates, roadmap status, customer outcomes, or product capabilities to make a draft sound stronger.

183 

184## Long-running workflows and state

185 

186For multi-step or tool-heavy tasks, prompt for a short visible preamble before the first tool call, then sparse outcome-based updates at major phase changes. Do not ask the model to narrate routine tool calls.

187 

188 Before tool calls for a multi-step task, send a one- or two-sentence

189 user-visible update that states the first step. During the task, update only

190 when a major phase begins or a finding changes the plan. Each update should

191 state one concrete outcome and the next step.

192 

193Preserve assistant phase values when replaying history so the model can distinguish commentary from the final answer. If using previous_response_id, prior assistant state is preserved automatically. If replaying history manually, preserve each original phase value unchanged.

194 

195Compact after major milestones rather than every turn. Keep the prompt functionally consistent after compaction and treat compacted items as opaque state.

196 

197Persisted reasoning is useful when the objective, assumptions, and priorities remain stable across turns. Use current-turn behavior when earlier reasoning is no longer relevant. Do not treat persisted reasoning as an always-on optimization: stale reasoning can add tokens, increase latency, and anchor the model to an outdated approach.

198 

199Prompt caching also affects prompt construction. Keep reusable prefixes stable and avoid unnecessary churn in large system prompts. Use explicit cache breakpoints only when they improve measured cache behavior and cost for the workload.

200 

201## Reasoning effort

202 

203Treat reasoning effort as a last-mile tuning knob, not the first response to a weak result.

204 

205- Preserve the current GPT-5.5 or GPT-5.4 reasoning effort as the baseline.

206- Test the same setting and one level lower on representative tasks.

207- Use low for latency-sensitive work when it preserves quality.

208- Use medium as a balanced starting point.

209- Use high or xhigh only when evals show a meaningful gain.

210- Reserve max for the hardest quality-first workloads; do not recommend it globally.

211 

212Before increasing reasoning effort, check whether the prompt is missing a success criterion, dependency rule, tool-routing rule, or verification loop.

213 

214## Frontend and visual tasks

215 

216GPT-5.6 has stronger layout, visual hierarchy, and design judgment. Still provide product context, preserve the existing design system, and name the states and constraints that matter.

217 

218For incremental frontend changes:

219 

220- inspect and preserve existing design tokens, components, and patterns;

221- do not add extra features or decorative UI unless requested;

222- preserve responsive behavior and expected states;

223- render and inspect the result before finalizing.

224 

225For vision, computer use, localization, or OCR tasks where spatial precision matters, choose image detail intentionally. Use original detail for large, dense, or coordinate-sensitive images when the extra input cost and latency are justified.

226 

227## Check work before finishing

228 

229Give GPT-5.6 access to tools that can validate the output, and state what validation matters.

230 

231For coding:

232 

233 After making changes, run the most relevant validation available:

234 - targeted tests for changed behavior

235 - type checks or lint checks when applicable

236 - build checks for affected packages

237 - a minimal smoke test when full validation is too expensive

238 

239 If validation cannot be run, explain why and describe the next best check.

240 

241For visual artifacts:

242 

243 Render the artifact before finalizing. Inspect layout, clipping, spacing,

244 missing content, and visual consistency. Revise until the rendered output

245 matches the requirements.

246 

247For implementation plans, include requirements, named resources or files, state transitions or data flow, validation checks, failure behavior, privacy or security considerations, and open questions that materially affect implementation.

248 

249## Suggested prompt structure

250 

251Use this structure as a starting point for complex prompts. Keep each section short. Add detail only where it changes behavior.

252 

253 Role: [the model's function and context]

254 

255 Personality: [tone and collaboration style]

256 

257 Goal: [user-visible outcome]

258 

259 Success criteria: [what must be true before the final answer]

260 

261 Constraints: [policy, safety, business, evidence, and side-effect limits]

262 

263 Tools: [which tools to use, when, and what not to use]

264 

265 Output: [sections, length, format, and tone]

266 

267 Stop rules: [when to retry, fallback, abstain, ask, or stop]

268 

269## Prompt migration workflow

270 

271When moving an existing application to GPT-5.6:

272 

2731. Switch the model and preserve the current reasoning effort.

2742. Run representative evals before changing the prompt.

2753. Remove obsolete scaffolding, repeated instructions, and irrelevant tools.

2764. Add only the smallest targeted instruction that fixes a measured regression.

2775. Re-run evals after each prompt or reasoning change.

278 

279Do not rewrite a working prompt stack all at once. Otherwise you cannot tell whether a behavior change came from the model, reasoning setting, prompt, tool set, or runtime.

280 

281When a prompt regresses, debug it with a small set of real traces. Identify the failure mode, find the instruction or contradiction that likely caused it, make a surgical edit, and rerun the same cases.

Details

20- Text critiques written in **output_feedback**20- Text critiques written in **output_feedback**

21- Results from graders21- Results from graders

22 22 

23For effective results, add annotations containing a Good/Bad rating _and_ detailed, specific critiques. Create [graders](https://developers.openai.com/api/docs/guides/evaluation-getting-started#adding-graders) that precisely capture the properties that you desire from your prompt.23For effective results, add annotations containing a Good/Bad rating _and_ detailed, specific critiques. Create [graders](https://developers.openai.com/api/docs/guides/evaluation-getting-started#add-graders) that precisely capture the properties that you desire from your prompt.

24 24 

25## Optimize your prompt25## Optimize your prompt

26 26 

Details

8 8 

9## Prompting tools and techniques9## Prompting tools and techniques

10 10 

11- **[Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching)**: Reduce latency by up to 80% and cost by up to 75%11- **[Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching)**: Reuse stable prompt prefixes to reduce latency and input token costs on cache hits

12- **[Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering)**: Learn strategies, techniques, and tools to construct prompts12- **[Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering)**: Learn strategies, techniques, and tools to construct prompts

13 13 

14## Refine your prompt14## Refine your prompt

15 15 

16- Put overall tone or role guidance in the system message; keep task-specific details and examples in user messages.16- Put overall tone or role guidance in the system message; keep task-specific details and examples in user messages.

17- Combine few-shot examples into a concise YAML-style or bulleted block so they’re easy to scan and update.17- Combine few-shot examples into a concise YAML-style or bulleted block so your team can scan and update them.

18- Mirror your project structure with clear folder names so teammates can locate prompts quickly.18- Mirror your project structure with clear folder names so teammates can locate prompts quickly.

19- Run your prompt tests and evaluation cases every time you publish; catching issues early is cheaper than fixing them in production.19- Run your prompt tests and evaluation cases every time you publish; catching issues early is cheaper than fixing them in production.

20 20 

Details

73const client = new OpenAI();73const client = new OpenAI();

74 74 

75const response = await client.responses.create({75const response = await client.responses.create({

76 model: "gpt-5.5",76 model: "gpt-5.6",

77 input: [77 input: [

78 {78 {

79 role: "system",79 role: "system",


97client = OpenAI()97client = OpenAI()

98 98 

99response = client.responses.create(99response = client.responses.create(

100 model="gpt-5.5",100 model="gpt-5.6",

101 input=[101 input=[

102 {102 {

103 "role": "system",103 "role": "system",


118 -H "Content-Type: application/json" \118 -H "Content-Type: application/json" \

119 -H "Authorization: Bearer $OPENAI_API_KEY" \119 -H "Authorization: Bearer $OPENAI_API_KEY" \

120 -d '{120 -d '{

121 "model": "gpt-5.5",121 "model": "gpt-5.6",

122 "input": [122 "input": [

123 {123 {

124 "role": "system",124 "role": "system",


175}175}

176 176 

177const response = await client.responses.create({177const response = await client.responses.create({

178 model: "gpt-5.5",178 model: "gpt-5.6",

179 input: buildSupportPrompt({179 input: buildSupportPrompt({

180 customerName: "Acme",180 customerName: "Acme",

181 issue: "billing question",181 issue: "billing question",


201 ]201 ]

202 202 

203response = client.responses.create(203response = client.responses.create(

204 model="gpt-5.5",204 model="gpt-5.6",

205 input=build_support_prompt(205 input=build_support_prompt(

206 customer_name="Acme",206 customer_name="Acme",

207 issue="billing question",207 issue="billing question",

guides/reasoning.md +201 −22

Details

2 2 

3**Reasoning models** like [GPT-5.5](https://developers.openai.com/api/docs/models/gpt-5.5) use internal reasoning tokens before producing a response. This helps the model plan, use tools effectively, inspect alternatives, recover from ambiguity, and solve harder multi-step tasks. Reasoning models work especially well for complex problem solving, coding, scientific reasoning, and multi-step agentic workflows. They're also the best models for [Codex CLI](https://github.com/openai/codex), our lightweight coding agent.3**Reasoning models** like [GPT-5.5](https://developers.openai.com/api/docs/models/gpt-5.5) use internal reasoning tokens before producing a response. This helps the model plan, use tools effectively, inspect alternatives, recover from ambiguity, and solve harder multi-step tasks. Reasoning models work especially well for complex problem solving, coding, scientific reasoning, and multi-step agentic workflows. They're also the best models for [Codex CLI](https://github.com/openai/codex), our lightweight coding agent.

4 4 

5Start with `gpt-5.5` for most reasoning workloads. If you need the highest-intelligence API option for more challenging problems that can tolerate more latency, use [`gpt-5.5-pro`](https://developers.openai.com/api/docs/models/gpt-5.5-pro). For lower cost, consider `gpt-5.4` and for lower cost and latency, consider `gpt-5.4-mini`.5Start with `gpt-5.6` for most reasoning workloads. If you need the highest-intelligence API option for more challenging problems that can tolerate more latency, use [`gpt-5.5-pro`](https://developers.openai.com/api/docs/models/gpt-5.5-pro). For lower cost, consider `gpt-5.4` and for lower cost and latency, consider `gpt-5.4-mini`.

6 6 

7**Reasoning models work better with the [Responses7**Reasoning models work better with the [Responses

8 API](https://developers.openai.com/api/docs/guides/migrate-to-responses)**. While the Chat Completions API8 API](https://developers.openai.com/api/docs/guides/migrate-to-responses)**. While the Chat Completions API


26`;26`;

27 27 

28const response = await openai.responses.create({28const response = await openai.responses.create({

29 model: "gpt-5.5",29 model: "gpt-5.6",

30 reasoning: { effort: "low" },30 reasoning: { effort: "low" },

31 input: [31 input: [

32 {32 {


50"""50"""

51 51 

52response = client.responses.create(52response = client.responses.create(

53 model="gpt-5.5",53 model="gpt-5.6",

54 reasoning={"effort": "low"},54 reasoning={"effort": "low"},

55 input=[55 input=[

56 {56 {


68 -H "Content-Type: application/json" \68 -H "Content-Type: application/json" \

69 -H "Authorization: Bearer $OPENAI_API_KEY" \69 -H "Authorization: Bearer $OPENAI_API_KEY" \

70 -d '{70 -d '{

71 "model": "gpt-5.5",71 "model": "gpt-5.6",

72 "reasoning": {"effort": "low"},72 "reasoning": {"effort": "low"},

73 "input": [73 "input": [

74 {74 {


88 88 

89Defaults are also model-dependent rather than universal. `gpt-5.5` defaults to `medium` reasoning effort. This is the best starting point for `gpt-5.5`’s full balance of quality, reliability and performance.89Defaults are also model-dependent rather than universal. `gpt-5.5` defaults to `medium` reasoning effort. This is the best starting point for `gpt-5.5`’s full balance of quality, reliability and performance.

90 90 

91| Effort | Best for... |91| Effort | Best for |

92| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |92| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

93| `none` | Latency-critical tasks that do not benefit from any reasoning or multi-chained tool calls. For latency-sensitive use cases with `gpt-5.5`, we recommend trying `low` to begin with and then moving to `none` if required.<br /><br />Common use cases include voice, fast information retrieval, and classification. |93| `none` | Latency-critical tasks that do not benefit from any reasoning or multi-chained tool calls. For latency-sensitive use cases with `gpt-5.5`, we recommend trying `low` to begin with and then moving to `none` if required.<br /><br />Common use cases include voice, fast information retrieval, and classification. |

94| `low` | Efficient reasoning with a modest latency increase. Ideal for use cases requiring tool-use, planning, search, or multi-step decision making, while optimizing for speed and cost.<br /><br />Common use cases include data analysis, drafting, execution-oriented coding, and customer support / chat assistant workflows. |94| `low` | Efficient reasoning with a modest latency increase. Ideal for use cases requiring tool-use, planning, search, or multi-step decision making, while optimizing for speed and cost.<br /><br />Common use cases include data analysis, drafting, execution-oriented coding, and customer support / chat assistant workflows. |

95| `medium` | When quality and reliability matter, and the task involves planning, complex reasoning, and judgement. Default configuration for most workloads, and a well-balanced point on the pareto curve of latency, performance and cost.<br /><br />Common use cases include agentic coding, research, working with spreadsheets & slides, and delegating long-horizon work. |95| `medium` | When quality and reliability matter, and the task involves planning, complex reasoning, and judgement. Default configuration for most workloads, and a well-balanced point on the pareto curve of latency, performance and cost.<br /><br />Common use cases include agentic coding, research, working with spreadsheets & slides, and delegating long-horizon work. |

96| `high` | Hard reasoning, complex debugging, deep planning, and high-value tasks where quality and intelligence matters more than latency. Recommended for complex workflows and agentic tasks.<br /><br />Common use cases include agentic coding, long-horizon research, and knowledge work. Depending on the complexity of the task, evaluate both `medium` and `high`. |96| `high` | Hard reasoning, complex debugging, deep planning, and high-value tasks where quality and intelligence matters more than latency. Recommended for complex workflows and agentic tasks.<br /><br />Common use cases include agentic coding, long-horizon research, and knowledge work. Depending on the complexity of the task, evaluate both `medium` and `high`. |

97| `xhigh` | Deep research, asynchronous workflows and agentic tasks that require very long rollouts. Only use when your evals show a clear benefit that justifies the extra latency and cost.<br /><br />Common use cases include security and code review, enterprise productivity, deeper research tasks, and challenging coding workflows. |97| `xhigh` | Deep research, asynchronous workflows and agentic tasks that require long runs. Only use when your evals show a clear benefit that justifies the extra latency and cost.<br /><br />Common use cases include security and code review, enterprise productivity, deeper research tasks, and challenging coding workflows. |

98 98 

99For faster time to first visible token in latency-sensitive applications, ask the model to generate a short preamble before continuing with deeper reasoning.99For faster time to first visible token in latency-sensitive applications, ask the model to generate a short preamble before continuing with deeper reasoning.

100 100 

101Some models support only a subset of these values, so check the relevant [model page](https://developers.openai.com/api/docs/models) before choosing a setting.101Some models support only a subset of these values, so check the relevant [model page](https://developers.openai.com/api/docs/models) before choosing a setting.

102 102 

103## Reasoning mode

104 

105GPT-5.6 models support `standard` and `pro` reasoning modes in the Responses API. `standard` is the default. Set `reasoning.mode` to `pro` for difficult tasks that need more model work and can tolerate higher latency and token usage.

106 

107Reasoning mode and reasoning effort are independent. Mode selects standard or pro execution, while `reasoning.effort` controls how much reasoning the model applies within that mode. If you omit `reasoning.effort`, GPT-5.6 defaults to `medium` in both modes.

108 

109Using pro reasoning mode

110 

111```bash

112curl https://api.openai.com/v1/responses \

113 -H "Content-Type: application/json" \

114 -H "Authorization: Bearer $OPENAI_API_KEY" \

115 -d '{

116 "model": "gpt-5.6",

117 "reasoning": {

118 "mode": "pro",

119 "effort": "medium"

120 },

121 "input": "Review this database migration plan and identify potential failure modes."

122 }'

123```

124 

125 

126Pro mode aggregates the model work performed to produce the final answer and bills those tokens at the selected model's standard [token rates](https://developers.openai.com/api/docs/pricing). Pro mode performs more model work than standard mode, increasing token usage and cost. Existing Pro model IDs keep their current behavior and pricing.

127 

103## How reasoning works128## How reasoning works

104 129 

105Reasoning models introduce **reasoning tokens** in addition to input and output tokens. The models use these reasoning tokens to "think," breaking down the prompt and considering multiple approaches to generating a response. Our reasoning models like gpt-5.5 and gpt-5.4 support interleaved thinking, where the model is able to generate visible output tokens before and in between thinking, and is able to think in between tool calls.130Reasoning models introduce **reasoning tokens** in addition to input and output tokens. The models use these reasoning tokens to "think," breaking down the prompt and considering multiple approaches to generating a response. Our reasoning models like `gpt-5.5` and `gpt-5.4` support interleaved thinking, where the model is able to generate visible output tokens before and in between thinking, and is able to think in between tool calls.

106 131 

107Here is an example of a multi-step conversation between a user and an assistant. Input and output tokens from each step are carried over, while reasoning tokens are discarded.132Here is the default behavior for a multi-step conversation between a user and an assistant. Input and output tokens from each step are carried over, while reasoning from earlier turns is not rendered into the next sample. Models that support persisted reasoning can change this behavior with `reasoning.context`.

108 133 

109![Reasoning tokens aren't retained in context](https://cdn.openai.com/API/docs/images/context-window.png)134![Reasoning tokens with current-turn context](https://cdn.openai.com/API/docs/images/context-window.png)

110 135 

111While reasoning tokens are not visible via the API, they still occupy space in136While reasoning tokens are not visible via the API, they still occupy space in

112 the model's context window and are billed as [output137 the model's context window and are billed as [output


161`;186`;

162 187 

163const response = await openai.responses.create({188const response = await openai.responses.create({

164 model: "gpt-5.5",189 model: "gpt-5.6",

165 reasoning: { effort: "medium" },190 reasoning: { effort: "medium" },

166 input: [191 input: [

167 {192 {


196"""221"""

197 222 

198response = client.responses.create(223response = client.responses.create(

199 model="gpt-5.5",224 model="gpt-5.6",

200 reasoning={"effort": "medium"},225 reasoning={"effort": "medium"},

201 input=[226 input=[

202 {227 {


226 251 

227Check out [this guide](https://developers.openai.com/api/docs/guides/conversation-state) to learn more about manual context management.252Check out [this guide](https://developers.openai.com/api/docs/guides/conversation-state) to learn more about manual context management.

228 253 

229### Encrypted reasoning items254## Preserve reasoning across calls

255 

256Conversation state and reasoning state serve different purposes. Passing messages across calls gives the model the visible conversation history. On supported models, persisted reasoning also lets the model render compatible reasoning items from earlier turns into its next context.

257 

258Persisted reasoning provides continuity; it does not expose the model's raw reasoning. The reasoning items remain opaque, and the API does not return their reasoning text. Set `reasoning.context` to control which available reasoning items the model can use:

259 

260Support for <code>reasoning.context</code> modes is model-dependent. Replace

261 <code>YOUR_MODEL_ID</code> in the examples with a model that supports the mode

262 you select.

263 

264| Value | Behavior |

265| -------------- | ------------------------------------------------------------------------------------------------------------------------------- |

266| `auto` | Uses the selected model's default. Omitting `reasoning.context` has the same effect as `auto`. |

267| `current_turn` | Makes reasoning from the active turn available, but does not render reasoning from earlier turns into the next sample. |

268| `all_turns` | Renders available, compatible reasoning items from earlier turns into the next sample. Only supported models accept this value. |

269 

270The response's `reasoning.context` field contains the effective mode, either `current_turn` or `all_turns`. Check this field on each response to confirm which mode the model used. The setting does not create reasoning items that are not already available.

271 

272`all_turns` has an effect only when the request has access to earlier response items. Use `previous_response_id`, attach the response to a conversation, or manually replay the complete response history. On the first request, `current_turn` and `all_turns` behave the same because no earlier reasoning exists.

273 

274### Continue reasoning with stored responses

230 275 

231When using the Responses API in a stateless mode (either with `store` set to `false`, or when an organization is enrolled in zero data retention), you must still retain reasoning items across conversation turns using the techniques described above. But in order to have reasoning items that can be sent with subsequent API requests, each of your API requests must have `reasoning.encrypted_content` in the `include` parameter of API requests, like so:276Use `previous_response_id` for the shortest stateful integration:

277 

278Preserve reasoning with a previous response

279 

280```javascript

281import OpenAI from "openai";

282 

283const client = new OpenAI();

284 

285const first = await client.responses.create({

286 model: "YOUR_MODEL_ID",

287 input: "Inspect this repository and identify the likely bug.",

288 reasoning: { context: "current_turn" },

289});

290 

291const second = await client.responses.create({

292 model: "YOUR_MODEL_ID",

293 previous_response_id: first.id,

294 input: "Now patch the bug and explain the change.",

295 reasoning: { context: "all_turns" },

296});

297 

298console.log(second.output_text);

299```

300 

301```python

302from openai import OpenAI

303 

304client = OpenAI()

305 

306first = client.responses.create(

307 model="YOUR_MODEL_ID",

308 input="Inspect this repository and identify the likely bug.",

309 reasoning={"context": "current_turn"},

310)

311 

312second = client.responses.create(

313 model="YOUR_MODEL_ID",

314 previous_response_id=first.id,

315 input="Now patch the bug and explain the change.",

316 reasoning={"context": "all_turns"},

317)

318 

319print(second.output_text)

320```

321 

322 

323Use `current_turn` when replaying older response items that the model no longer needs. Those reasoning items can remain in the API payload for continuity, but the service does not render them into the new sample. This can reduce the rendered context for long-running workflows.

324 

325### Preserve reasoning without stored responses

326 

327When using the Responses API in a stateless mode, either with `store` set to `false` or for an organization enrolled in zero data retention, request `reasoning.encrypted_content` in the `include` parameter on every call:

232 328 

233```bash329```bash

234curl https://api.openai.com/v1/responses \330curl https://api.openai.com/v1/responses \

235 -H "Content-Type: application/json" \331 -H "Content-Type: application/json" \

236 -H "Authorization: Bearer $OPENAI_API_KEY" \332 -H "Authorization: Bearer $OPENAI_API_KEY" \

237 -d '{333 -d '{

238 "model": "gpt-5.5",334 "model": "gpt-5.6",

239 "reasoning": {"effort": "medium"},335 "reasoning": {"effort": "medium"},

240 "input": "What is the weather like today?",336 "input": "What is the weather like today?",

241 "tools": [ ... function config here ... ],337 "tools": [ ... function config here ... ],


244```340```

245 341 

246 342 

247Any reasoning items in the `output` array will now have an `encrypted_content` property, which will contain encrypted reasoning tokens that can be passed along with future conversation turns.343Reasoning items in the `output` array will include an `encrypted_content` property containing encrypted reasoning tokens that you can pass to future calls.

344 

345To use `all_turns` with `store: false`, request encrypted reasoning content on every call, preserve every output item, append the next user message, and replay the complete history:

346 

347Preserve reasoning without storing responses

348 

349```javascript

350import OpenAI from "openai";

351 

352const client = new OpenAI();

353 

354const history = [

355 {

356 role: "user",

357 content: "Inspect this repository and identify the likely bug.",

358 },

359];

360 

361const first = await client.responses.create({

362 model: "YOUR_MODEL_ID",

363 store: false,

364 input: history,

365 include: ["reasoning.encrypted_content"],

366 reasoning: { context: "current_turn" },

367});

368 

369// Keep every output item, including encrypted reasoning and assistant phase.

370history.push(...first.output);

371history.push({

372 role: "user",

373 content: "Now patch the bug and explain the change.",

374});

375 

376const second = await client.responses.create({

377 model: "YOUR_MODEL_ID",

378 store: false,

379 input: history,

380 include: ["reasoning.encrypted_content"],

381 reasoning: { context: "all_turns" },

382});

383 

384console.log(second.output_text);

385```

386 

387```python

388from openai import OpenAI

389 

390client = OpenAI()

391 

392history = [

393 {

394 "role": "user",

395 "content": "Inspect this repository and identify the likely bug.",

396 }

397]

398 

399first = client.responses.create(

400 model="YOUR_MODEL_ID",

401 store=False,

402 input=history,

403 include=["reasoning.encrypted_content"],

404 reasoning={"context": "current_turn"},

405)

406 

407# Keep every output item, including encrypted reasoning and assistant phase.

408history.extend(item.model_dump() for item in first.output)

409history.append(

410 {

411 "role": "user",

412 "content": "Now patch the bug and explain the change.",

413 }

414)

415 

416second = client.responses.create(

417 model="YOUR_MODEL_ID",

418 store=False,

419 input=history,

420 include=["reasoning.encrypted_content"],

421 reasoning={"context": "all_turns"},

422)

423 

424print(second.output_text)

425```

426 

248 427 

249## Reasoning summaries428## Reasoning summaries

250 429 


263const openai = new OpenAI();442const openai = new OpenAI();

264 443 

265const response = await openai.responses.create({444const response = await openai.responses.create({

266 model: "gpt-5.5",445 model: "gpt-5.6",

267 input: "What is the capital of France?",446 input: "What is the capital of France?",

268 reasoning: {447 reasoning: {

269 effort: "low",448 effort: "low",


279client = OpenAI()458client = OpenAI()

280 459 

281response = client.responses.create(460response = client.responses.create(

282 model="gpt-5.5",461 model="gpt-5.6",

283 input="What is the capital of France?",462 input="What is the capital of France?",

284 reasoning={463 reasoning={

285 "effort": "low",464 "effort": "low",


295 -H "Content-Type: application/json" \474 -H "Content-Type: application/json" \

296 -H "Authorization: Bearer $OPENAI_API_KEY" \475 -H "Authorization: Bearer $OPENAI_API_KEY" \

297 -d '{476 -d '{

298 "model": "gpt-5.5",477 "model": "gpt-5.6",

299 "input": "What is the capital of France?",478 "input": "What is the capital of France?",

300 "reasoning": {479 "reasoning": {

301 "effort": "low",480 "effort": "low",


347For long-running or tool-heavy flows with GPT-5.5 and GPT-5.4 in the Responses API, use the assistant message `phase` field to avoid early stopping and other misbehavior.526For long-running or tool-heavy flows with GPT-5.5 and GPT-5.4 in the Responses API, use the assistant message `phase` field to avoid early stopping and other misbehavior.

348`phase` is optional at the API level, but OpenAI recommends using it. Use `phase: "commentary"` for intermediate assistant updates, such as preambles before tool calls, and `phase: "final_answer"` for the completed answer. Don't add `phase` to user messages.527`phase` is optional at the API level, but OpenAI recommends using it. Use `phase: "commentary"` for intermediate assistant updates, such as preambles before tool calls, and `phase: "final_answer"` for the completed answer. Don't add `phase` to user messages.

349Using `previous_response_id` is usually the simplest path because prior assistant state is preserved. If you replay assistant history manually, preserve each original `phase` value.528Using `previous_response_id` is usually the simplest path because prior assistant state is preserved. If you replay assistant history manually, preserve each original `phase` value.

350Missing or dropped `phase` can cause preambles to be treated as final answers in those workflows. For model-specific prompt guidance, see [Prompting GPT-5.5](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5#phase-parameter).529Missing or dropped `phase` can cause preambles to be treated as final answers in those workflows. For model-specific prompt guidance, see [Prompting GPT-5.5](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.5#prompting-best-practices).

351 530 

352### Round-trip assistant phase values531### Round-trip assistant phase values

353 532 


358const client = new OpenAI();537const client = new OpenAI();

359 538 

360const response = await client.responses.create({539const response = await client.responses.create({

361 model: "gpt-5.5",540 model: "gpt-5.6",

362 input: [541 input: [

363 {542 {

364 role: "assistant",543 role: "assistant",


387client = OpenAI()566client = OpenAI()

388 567 

389response = client.responses.create(568response = client.responses.create(

390 model="gpt-5.5",569 model="gpt-5.6",

391 input=[570 input=[

392 {571 {

393 "role": "assistant",572 "role": "assistant",


412 591 

413## Advice on prompting592## Advice on prompting

414 593 

415There are some differences to consider when prompting a reasoning model. Reasoning-capable GPT-5 models usually work best when you give them a clear goal, strong constraints, and an explicit output contract without prescribing every intermediate step.594Consider these differences when prompting a reasoning model. Reasoning-capable GPT-5 models usually work best when you give them a clear goal, strong constraints, and an explicit output contract without prescribing every intermediate step.

416 595 

417- Give the model the task, constraints, and desired output format.596- Give the model the task, constraints, and desired output format.

418- Treat `reasoning.effort` as a tuning knob, not the primary way to recover quality.597- Treat `reasoning.effort` as a tuning knob, not the primary way to recover quality.

Details

65client = OpenAI()65client = OpenAI()

66 66 

67response = client.chat.completions.create(67response = client.chat.completions.create(

68model="gpt-5.5",68model="gpt-5.6",

69messages=[69messages=[

70{"role": "user", "content": "This is a test"}70{"role": "user", "content": "This is a test"}

71],71],


79-H "Content-Type: application/json" \79-H "Content-Type: application/json" \

80-H "Authorization: Bearer $OPENAI_API_KEY" \80-H "Authorization: Bearer $OPENAI_API_KEY" \

81-d '{81-d '{

82"model": "gpt-5.5",82"model": "gpt-5.6",

83"messages": [83"messages": [

84{"role": "user", "content": "This is a test"}84{"role": "user", "content": "This is a test"}

85],85],

Details

36client = OpenAI()36client = OpenAI()

37 37 

38response = client.responses.create(38response = client.responses.create(

39model="gpt-5.4-mini",39model="gpt-5.6-terra",

40input="This is a test",40input="This is a test",

41safety_identifier="user_123456",41safety_identifier="user_123456",

42)42)


47-H "Content-Type: application/json" \47-H "Content-Type: application/json" \

48-H "Authorization: Bearer $OPENAI_API_KEY" \48-H "Authorization: Bearer $OPENAI_API_KEY" \

49-d '{49-d '{

50"model": "gpt-5.4-mini",50"model": "gpt-5.6-terra",

51"input": "This is a test",51"input": "This is a test",

52"safety_identifier": "user_123456"52"safety_identifier": "user_123456"

53}'53}'


63client = OpenAI()63client = OpenAI()

64 64 

65response = client.chat.completions.create(65response = client.chat.completions.create(

66model="gpt-5.4-mini",66model="gpt-5.6-terra",

67messages=[67messages=[

68{"role": "user", "content": "This is a test"}68{"role": "user", "content": "This is a test"}

69],69],


76-H "Content-Type: application/json" \76-H "Content-Type: application/json" \

77-H "Authorization: Bearer $OPENAI_API_KEY" \77-H "Authorization: Bearer $OPENAI_API_KEY" \

78-d '{78-d '{

79"model": "gpt-5.4-mini",79"model": "gpt-5.6-terra",

80"messages": [80"messages": [

81{"role": "user", "content": "This is a test"}81{"role": "user", "content": "This is a test"}

82],82],


118 - In a high confidence policy violation, the associated `safety_identifier` is completely blocked from OpenAI model access.118 - In a high confidence policy violation, the associated `safety_identifier` is completely blocked from OpenAI model access.

119 - The safety identifier receives an `identifier blocked` error on all future GPT-5 requests for the same identifier. OpenAI cannot currently unblock an individual identifier.119 - The safety identifier receives an `identifier blocked` error on all future GPT-5 requests for the same identifier. OpenAI cannot currently unblock an individual identifier.

120 120 

121For these blocks to be effective, ensure you have controls in place to prevent blocked users from simply opening a new account. As a reminder, repeated policy violations from your organization can lead to losing access for your entire organization.121For these blocks to be effective, ensure you have controls in place to prevent blocked users from opening a new account. As a reminder, repeated policy violations from your organization can lead to losing access for your entire organization.

122 122 

123### Why we're doing this123### Why we're doing this

124 124 


131Learn more:131Learn more:

132 132 

133- [Model evaluations hub](https://openai.com/safety/evaluations-hub)133- [Model evaluations hub](https://openai.com/safety/evaluations-hub)

134- [Cyber Safety](https://developers.openai.com/codex/concepts/cyber-safety)134- [Cyber Safety](https://developers.openai.com/codex/cyber-safety)

135- [Fine-tuning safety](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#safety-checks)135- [Fine-tuning safety](https://developers.openai.com/api/docs/guides/supervised-fine-tuning#safety-checks)

136- [Safety checks in computer use](https://developers.openai.com/api/docs/guides/tools-computer-use#acknowledge-safety-checks)136- [Safety checks in computer use](https://developers.openai.com/api/docs/guides/tools-computer-use#handle-user-confirmation-and-consent)

Details

1# Cybersecurity checks1# Cybersecurity checks

2 2 

3GPT-5.3-Codex and newer models, including GPT-5.4 and GPT-5.5, are classified as having High Cybersecurity Capability under our [Preparedness Framework](https://cdn.openai.com/pdf/18a02b5d-6b67-4cec-ab64-68cdfbddebcd/preparedness-framework-v2.pdf). As a result, additional automated safeguards apply when these models are used via the API. Please note that the safeguards applied in the API differ from those used in Codex. You can learn more about the Codex safeguards [here](https://developers.openai.com/codex/concepts/cyber-safety/).3GPT-5.3-Codex and newer models, including GPT-5.4 and GPT-5.5, are classified as having High Cybersecurity Capability under our [Preparedness Framework](https://cdn.openai.com/pdf/18a02b5d-6b67-4cec-ab64-68cdfbddebcd/preparedness-framework-v2.pdf). As a result, additional automated safeguards apply when these models are used via the API. Please note that the safeguards applied in the API differ from those used in Codex. You can learn more about the Codex safeguards [here](https://developers.openai.com/codex/cyber-safety/).

4 4 

5These safeguards monitor for signals of potentially suspicious cybersecurity activity. If certain thresholds are met, access to the model may be temporarily limited while activity is reviewed. Because these systems are still being calibrated, legitimate security research or defensive work may occasionally be flagged. We expect only a small portion of traffic to be impacted, and we’re continuing to refine the overall API experience.5These safeguards monitor for signals of potentially suspicious cybersecurity activity. If certain thresholds are met, access to the model may be temporarily limited while activity is reviewed. Because these systems are still being calibrated, legitimate security research or defensive work may occasionally be flagged. We expect only a small portion of traffic to be impacted, and we’re continuing to refine the overall API experience.

6 6 

Details

46[Platform tunnel permissions](https://developers.openai.com/api/docs/guides/rbac) and ChatGPT developer-mode access are separate:46[Platform tunnel permissions](https://developers.openai.com/api/docs/guides/rbac) and ChatGPT developer-mode access are separate:

47 47 

48- Creating or editing a tunnel requires Tunnels **Read** + **Manage**.48- Creating or editing a tunnel requires Tunnels **Read** + **Manage**.

49- Running `tunnel-client` or selecting the tunnel in connector settings requires Tunnels **Read** + **Use**.49- Running `tunnel-client` or selecting the tunnel while creating an app requires Tunnels **Read** + **Use**.

50- Tunnel permissions apply to a Platform organization. A Platform organization owner or RBAC administrator grants the tunnel role.50- Tunnel permissions apply to a Platform organization. A Platform organization owner or RBAC administrator grants the tunnel role.

51- ChatGPT developer mode is a separate workspace permission. For Enterprise/Edu, a workspace admin grants **Permissions & Roles** > **Connected Data** > **Developer mode / Create custom MCP connectors**; the user then enables it in **Settings** > **Apps** > **Advanced Settings**. See the [developer-mode Help Center article](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) for plan-specific policy.51- ChatGPT developer mode is a separate workspace permission. For Enterprise/Edu, a workspace admin grants developer-mode access; the user then enables it in **Settings Security and login**. See the [developer-mode Help Center article](https://help.openai.com/en/articles/12584461-developer-mode-apps-and-full-mcp-connectors-in-chatgpt-beta) for plan-specific policy.

52 52 

53Ask the target ChatGPT workspace admin for developer-mode access, and ask the target Platform organization owner/RBAC admin for tunnel permissions.53Ask the target ChatGPT workspace admin for developer-mode access, and ask the target Platform organization owner/RBAC admin for tunnel permissions.

54 54 


57A tunnel can be associated with one or more Platform organizations or ChatGPT workspaces. Use these associations to define every OpenAI context that should be allowed to find or use the tunnel.57A tunnel can be associated with one or more Platform organizations or ChatGPT workspaces. Use these associations to define every OpenAI context that should be allowed to find or use the tunnel.

58 58 

59- Include the Platform organization that owns or manages the tunnel.59- Include the Platform organization that owns or manages the tunnel.

60- Include the ChatGPT workspace that should list the tunnel in connector settings.60- Include the ChatGPT workspace that should list the tunnel when creating apps.

61- Include another Platform organization when Codex, the Responses API, or another supported product will call the private MCP server from that organization.61- Include another Platform organization when Codex, the Responses API, or another supported product will call the private MCP server from that organization.

62- Use the same `tunnel_id` for `tunnel-client`; adding organizations or workspaces does not create a second tunnel or change the private MCP server endpoint.62- Use the same `tunnel_id` for `tunnel-client`; adding organizations or workspaces does not create a second tunnel or change the private MCP server endpoint.

63 63 


96 96 

97For an HTTP MCP server, use `--mcp-server-url https://mcp.internal.example.com/mcp` instead of `--mcp-command`.97For an HTTP MCP server, use `--mcp-server-url https://mcp.internal.example.com/mcp` instead of `--mcp-command`.

98 98 

99Keep `tunnel-client run ...` healthy while you create or test the connector. Connector discovery and MCP tool calls depend on the running client.99Keep `tunnel-client run ...` healthy while you create or test the app. App discovery and MCP tool calls depend on the running client.

100 100 

101<figure className="not-prose my-8">101<figure className="not-prose my-8">

102 <figcaption className="mt-3 text-sm text-gray-600 dark:text-gray-400">102 <figcaption className="mt-3 text-sm text-gray-600 dark:text-gray-400">


116 116 

117## Connect from ChatGPT117## Connect from ChatGPT

118 118 

119Open [ChatGPT connector settings](https://chatgpt.com/#settings/Connectors), create a custom connector, and choose **Tunnel** under **Connection**. Select an available tunnel when ChatGPT lists it, or paste a valid `tunnel_id` if you already have one.119Open **Settings Plugins** or [chatgpt.com/plugins](https://chatgpt.com/plugins), select the plus button to create a developer-mode app, and choose **Tunnel** under **Connection**. Select an available tunnel when ChatGPT lists it, or paste a valid `tunnel_id` if you already have one.

120 120 

121If the tunnel does not appear in ChatGPT, verify that the tunnel is associated with the target ChatGPT workspace, not only with a Platform organization, and that the connector operator has Tunnels **Read** + **Use**.121If the tunnel does not appear in ChatGPT, verify that the tunnel is associated with the target ChatGPT workspace, not only with a Platform organization, and that the app creator has Tunnels **Read** + **Use**.

122 122 

123## Security and networking123## Security and networking

124 124 


170## Where to configure it170## Where to configure it

171 171 

172- Manage OpenAI-hosted MCP tunnel endpoints in [Platform tunnel settings](https://platform.openai.com/settings/organization/tunnels).172- Manage OpenAI-hosted MCP tunnel endpoints in [Platform tunnel settings](https://platform.openai.com/settings/organization/tunnels).

173- Use a tunnel when creating a connector from [ChatGPT connector settings](https://chatgpt.com/#settings/Connectors).173- Use a tunnel when creating a developer-mode app from **Settings Plugins** or [chatgpt.com/plugins](https://chatgpt.com/plugins).

174- For Codex or API flows, use the tunnel-backed MCP target exposed by the supported product surface.174- For Codex or API flows, use the tunnel-backed MCP target exposed by the supported product surface.

175 175 

176## Next steps176## Next steps

177 177 

178- Create or manage the tunnel in [Platform tunnel settings](https://platform.openai.com/settings/organization/tunnels).178- Create or manage the tunnel in [Platform tunnel settings](https://platform.openai.com/settings/organization/tunnels).

179- Validate your `tunnel-client` profile with `tunnel-client doctor --profile <profile> --explain`.179- Validate your `tunnel-client` profile with `tunnel-client doctor --profile <profile> --explain`.

180- Connect the tunnel from [ChatGPT connector settings](https://chatgpt.com/#settings/Connectors) or the supported OpenAI surface you are using.180- Connect the tunnel from **Settings Plugins**, [chatgpt.com/plugins](https://chatgpt.com/plugins), or the supported OpenAI surface you are using.

181 181 

182<div class="not-prose my-8 grid gap-4 lg:grid-cols-2">182<div class="not-prose my-8 grid gap-4 lg:grid-cols-2">

183 <figure>183 <figure>


194 </figcaption>194 </figcaption>

195 </figure>195 </figure>

196 <figure>196 <figure>

197 <a href="https://chatgpt.com/#settings/Connectors">197 <a href="https://chatgpt.com/plugins">

198 <img src="https://developers.openai.com/images/platform/guides/secure-mcp-tunnels/chatgpt-connectors-tunnel.png"198 <img src="https://developers.openai.com/images/platform/guides/secure-mcp-tunnels/chatgpt-connectors-tunnel.png"

199 alt="Sanitized ChatGPT connector settings screenshot with Tunnel selected."199 alt="Sanitized ChatGPT app creation screenshot with Tunnel selected."

200 loading="lazy"200 loading="lazy"

201 class="w-full rounded-md border border-gray-200 dark:border-gray-800"201 class="w-full rounded-md border border-gray-200 dark:border-gray-800"

202 />202 />

203 </a>203 </a>

204 <figcaption class="mt-3 text-sm text-gray-600 dark:text-gray-400">204 <figcaption class="mt-3 text-sm text-gray-600 dark:text-gray-400">

205 Select Tunnel when connecting a ChatGPT connector to a private MCP server.205 Select Tunnel when connecting a ChatGPT developer-mode app to a private

206 MCP server.

206 </figcaption>207 </figcaption>

207 </figure>208 </figure>

208</div>209</div>

Details

14 14 

15### Supported models15### Supported models

16 16 

17Structured Outputs is available in our [latest large language models](https://developers.openai.com/api/docs/models), starting with GPT-4o. For new projects, start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5). Older models like `gpt-4-turbo` and earlier may use [JSON mode](#json-mode) instead.17Structured Outputs is available in our [latest large language models](https://developers.openai.com/api/docs/models), starting with GPT-4o. For new projects, start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol). Older models like `gpt-4-turbo` and earlier may use [JSON mode](#json-mode) instead.

18 18 

19 19 

20 20 

guides/text.md +7 −7

Details

44 44 

45## Choosing models and APIs45## Choosing models and APIs

46 46 

47OpenAI has many different [models](https://developers.openai.com/api/docs/models) and several APIs to choose from. [Reasoning models](https://developers.openai.com/api/docs/guides/reasoning), like [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5), behave differently from chat models and respond better to different prompts. One important note is that reasoning models perform better and demonstrate higher intelligence when used with the Responses API.47OpenAI has many different [models](https://developers.openai.com/api/docs/models) and several APIs to choose from. [Reasoning models](https://developers.openai.com/api/docs/guides/reasoning), like [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol), behave differently from chat models and respond better to different prompts. One important note is that reasoning models perform better and demonstrate higher intelligence when used with the Responses API.

48 48 

49If you're building any text generation app, we recommend using the Responses API over the older Chat Completions API. And if you're using a reasoning model, it's especially useful to [migrate to Responses](https://developers.openai.com/api/docs/guides/migrate-to-responses).49If you're building any text generation app, we recommend using the Responses API over the older Chat Completions API. And if you're using a reasoning model, it's especially useful to [migrate to Responses](https://developers.openai.com/api/docs/guides/migrate-to-responses).

50 50 


61const client = new OpenAI();61const client = new OpenAI();

62 62 

63const response = await client.responses.create({63const response = await client.responses.create({

64 model: "gpt-5.5",64 model: "gpt-5.6",

65 reasoning: { effort: "low" },65 reasoning: { effort: "low" },

66 instructions: "${semicolonsDevMsg}",66 instructions: "${semicolonsDevMsg}",

67 input: "${semicolonsPrompt}",67 input: "${semicolonsPrompt}",


75client = OpenAI()75client = OpenAI()

76 76 

77response = client.responses.create(77response = client.responses.create(

78 model="gpt-5.5",78 model="gpt-5.6",

79 reasoning={"effort": "low"},79 reasoning={"effort": "low"},

80 instructions="${semicolonsDevMsg}",80 instructions="${semicolonsDevMsg}",

81 input="${semicolonsPrompt}",81 input="${semicolonsPrompt}",


89 -H "Content-Type: application/json" \89 -H "Content-Type: application/json" \

90 -H "Authorization: Bearer $OPENAI_API_KEY" \90 -H "Authorization: Bearer $OPENAI_API_KEY" \

91 -d '{91 -d '{

92 "model": "gpt-5.5",92 "model": "gpt-5.6",

93 "reasoning": {"effort": "low"},93 "reasoning": {"effort": "low"},

94 "instructions": "${semicolonsDevMsg}",94 "instructions": "${semicolonsDevMsg}",

95 "input": "${semicolonsPrompt}"95 "input": "${semicolonsPrompt}"


106const client = new OpenAI();106const client = new OpenAI();

107 107 

108const response = await client.responses.create({108const response = await client.responses.create({

109 model: "gpt-5.5",109 model: "gpt-5.6",

110 reasoning: { effort: "low" },110 reasoning: { effort: "low" },

111 input: [111 input: [

112 {112 {


128client = OpenAI()128client = OpenAI()

129 129 

130response = client.responses.create(130response = client.responses.create(

131 model="gpt-5.5",131 model="gpt-5.6",

132 reasoning={"effort": "low"},132 reasoning={"effort": "low"},

133 input=[133 input=[

134 {134 {


150 -H "Content-Type: application/json" \150 -H "Content-Type: application/json" \

151 -H "Authorization: Bearer $OPENAI_API_KEY" \151 -H "Authorization: Bearer $OPENAI_API_KEY" \

152 -d '{152 -d '{

153 "model": "gpt-5.5",153 "model": "gpt-5.6",

154 "reasoning": {"effort": "low"},154 "reasoning": {"effort": "low"},

155 "input": [155 "input": [

156 {156 {

Details

31client = OpenAI()31client = OpenAI()

32 32 

33response = client.responses.input_tokens.count(33response = client.responses.input_tokens.count(

34 model="gpt-5.5",34 model="gpt-5.6",

35 input="Tell me a joke."35 input="Tell me a joke."

36)36)

37print(response.input_tokens)37print(response.input_tokens)


43const client = new OpenAI();43const client = new OpenAI();

44 44 

45const response = await client.responses.input_tokens.count({45const response = await client.responses.input_tokens.count({

46 model: "gpt-5.5",46 model: "gpt-5.6",

47 input: "Tell me a joke.",47 input: "Tell me a joke.",

48});48});

49 49 


55 -H "Authorization: Bearer $OPENAI_API_KEY" \55 -H "Authorization: Bearer $OPENAI_API_KEY" \

56 -H "Content-Type: application/json" \56 -H "Content-Type: application/json" \

57 -d '{57 -d '{

58 "model": "gpt-5.5",58 "model": "gpt-5.6",

59 "input": "Tell me a joke."59 "input": "Tell me a joke."

60 }'60 }'

61```61```

62 62 

63```cli63```cli

64openai responses:input-tokens count \64openai responses:input-tokens count \

65 --model gpt-5.5 \65 --model gpt-5.6 \

66 --input "Tell me a joke." \66 --input "Tell me a joke." \

67 --raw-output \67 --raw-output \

68 --transform input_tokens68 --transform input_tokens


79client = OpenAI()79client = OpenAI()

80 80 

81response = client.responses.input_tokens.count(81response = client.responses.input_tokens.count(

82 model="gpt-5.5",82 model="gpt-5.6",

83 input=[83 input=[

84 {"role": "user", "content": "What is 2 + 2?"},84 {"role": "user", "content": "What is 2 + 2?"},

85 {"role": "assistant", "content": "2 + 2 equals 4."},85 {"role": "assistant", "content": "2 + 2 equals 4."},


95const client = new OpenAI();95const client = new OpenAI();

96 96 

97const response = await client.responses.input_tokens.count({97const response = await client.responses.input_tokens.count({

98 model: "gpt-5.5",98 model: "gpt-5.6",

99 input: [99 input: [

100 { role: "user", content: "What is 2 + 2?" },100 { role: "user", content: "What is 2 + 2?" },

101 { role: "assistant", content: "2 + 2 equals 4." },101 { role: "assistant", content: "2 + 2 equals 4." },


111 -H "Authorization: Bearer $OPENAI_API_KEY" \111 -H "Authorization: Bearer $OPENAI_API_KEY" \

112 -H "Content-Type: application/json" \112 -H "Content-Type: application/json" \

113 -d '{113 -d '{

114 "model": "gpt-5.5",114 "model": "gpt-5.6",

115 "input": [115 "input": [

116 {"role": "user", "content": "What is 2 + 2?"},116 {"role": "user", "content": "What is 2 + 2?"},

117 {"role": "assistant", "content": "2 + 2 equals 4."},117 {"role": "assistant", "content": "2 + 2 equals 4."},


124openai responses:input-tokens count \124openai responses:input-tokens count \

125 --raw-output \125 --raw-output \

126 --transform input_tokens <<'YAML'126 --transform input_tokens <<'YAML'

127model: gpt-5.5127model: gpt-5.6

128input:128input:

129 - role: user129 - role: user

130 content: What is 2 + 2?130 content: What is 2 + 2?


146client = OpenAI()146client = OpenAI()

147 147 

148response = client.responses.input_tokens.count(148response = client.responses.input_tokens.count(

149 model="gpt-5.5",149 model="gpt-5.6",

150 instructions="You are a helpful assistant that explains concepts simply.",150 instructions="You are a helpful assistant that explains concepts simply.",

151 input="Explain quantum computing in one sentence.",151 input="Explain quantum computing in one sentence.",

152)152)


159const client = new OpenAI();159const client = new OpenAI();

160 160 

161const response = await client.responses.input_tokens.count({161const response = await client.responses.input_tokens.count({

162 model: "gpt-5.5",162 model: "gpt-5.6",

163 instructions:163 instructions:

164 "You are a helpful assistant that explains concepts simply.",164 "You are a helpful assistant that explains concepts simply.",

165 input: "Explain quantum computing in one sentence.",165 input: "Explain quantum computing in one sentence.",


173 -H "Authorization: Bearer $OPENAI_API_KEY" \173 -H "Authorization: Bearer $OPENAI_API_KEY" \

174 -H "Content-Type: application/json" \174 -H "Content-Type: application/json" \

175 -d '{175 -d '{

176 "model": "gpt-5.5",176 "model": "gpt-5.6",

177 "instructions": "You are a helpful assistant that explains concepts simply.",177 "instructions": "You are a helpful assistant that explains concepts simply.",

178 "input": "Explain quantum computing in one sentence."178 "input": "Explain quantum computing in one sentence."

179 }'179 }'


183openai responses:input-tokens count \183openai responses:input-tokens count \

184 --raw-output \184 --raw-output \

185 --transform input_tokens <<'YAML'185 --transform input_tokens <<'YAML'

186model: gpt-5.5186model: gpt-5.6

187instructions: You are a helpful assistant that explains concepts simply.187instructions: You are a helpful assistant that explains concepts simply.

188input: Explain quantum computing in one sentence.188input: Explain quantum computing in one sentence.

189YAML189YAML


203 203 

204# Use file_id from uploaded file, or image_url for a URL204# Use file_id from uploaded file, or image_url for a URL

205response = client.responses.input_tokens.count(205response = client.responses.input_tokens.count(

206 model="gpt-5.5",206 model="gpt-5.6",

207 input=[207 input=[

208 {208 {

209 "role": "user",209 "role": "user",


223const client = new OpenAI();223const client = new OpenAI();

224 224 

225const response = await client.responses.input_tokens.count({225const response = await client.responses.input_tokens.count({

226 model: "gpt-5.5",226 model: "gpt-5.6",

227 input: [227 input: [

228 {228 {

229 role: "user",229 role: "user",


246 -H "Authorization: Bearer $OPENAI_API_KEY" \246 -H "Authorization: Bearer $OPENAI_API_KEY" \

247 -H "Content-Type: application/json" \247 -H "Content-Type: application/json" \

248 -d '{248 -d '{

249 "model": "gpt-5.5",249 "model": "gpt-5.6",

250 "input": [{250 "input": [{

251 "role": "user",251 "role": "user",

252 "content": [252 "content": [


261openai responses:input-tokens count \261openai responses:input-tokens count \

262 --raw-output \262 --raw-output \

263 --transform input_tokens <<'YAML'263 --transform input_tokens <<'YAML'

264model: gpt-5.5264model: gpt-5.6

265input:265input:

266 - role: user266 - role: user

267 content:267 content:


287client = OpenAI()287client = OpenAI()

288 288 

289response = client.responses.input_tokens.count(289response = client.responses.input_tokens.count(

290 model="gpt-5.5",290 model="gpt-5.6",

291 tools=[291 tools=[

292 {292 {

293 "type": "function",293 "type": "function",


311const client = new OpenAI();311const client = new OpenAI();

312 312 

313const response = await client.responses.input_tokens.count({313const response = await client.responses.input_tokens.count({

314 model: "gpt-5.5",314 model: "gpt-5.6",

315 tools: [315 tools: [

316 {316 {

317 type: "function",317 type: "function",


335 -H "Authorization: Bearer $OPENAI_API_KEY" \335 -H "Authorization: Bearer $OPENAI_API_KEY" \

336 -H "Content-Type: application/json" \336 -H "Content-Type: application/json" \

337 -d '{337 -d '{

338 "model": "gpt-5.5",338 "model": "gpt-5.6",

339 "tools": [{339 "tools": [{

340 "type": "function",340 "type": "function",

341 "name": "get_weather",341 "name": "get_weather",


354openai responses:input-tokens count \354openai responses:input-tokens count \

355 --raw-output \355 --raw-output \

356 --transform input_tokens <<'YAML'356 --transform input_tokens <<'YAML'

357model: gpt-5.5357model: gpt-5.6

358tools:358tools:

359 - type: function359 - type: function

360 name: get_weather360 name: get_weather

guides/tools.md +20 −10

Details

1# Using tools1# Using tools

2 2 

3When generating model responses or building agents, you can extend capabilities using built‑in tools, function calling, tool search, and remote MCP servers. These enable the model to search the web, retrieve from your files, load deferred tool definitions at runtime, call your own functions, or access third‑party services. Only `gpt-5.4` and later models support `tool_search`.3When generating model responses or building agents, you can extend capabilities using built‑in tools, function calling, Programmatic Tool Calling, tool search, and remote MCP servers. These enable the model to search the web, retrieve from your files, load deferred tool definitions at runtime, call your own functions, compose tool calls in JavaScript, or access third‑party services. Only `gpt-5.4` and later models support `tool_search`.

4 4 

5 5 

6 6 


16client = OpenAI()16client = OpenAI()

17 17 

18response = client.responses.create(18response = client.responses.create(

19 model="gpt-5.5",19 model="gpt-5.6",

20 input="What is deep research by OpenAI?",20 input="What is deep research by OpenAI?",

21 tools=[{21 tools=[{

22 "type": "file_search",22 "type": "file_search",


31const openai = new OpenAI();31const openai = new OpenAI();

32 32 

33const response = await openai.responses.create({33const response = await openai.responses.create({

34 model: "gpt-5.5",34 model: "gpt-5.6",

35 input: "What is deep research by OpenAI?",35 input: "What is deep research by OpenAI?",

36 tools: [36 tools: [

37 {37 {


47using OpenAI.Responses;47using OpenAI.Responses;

48 48 

49string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;49string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

50OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);50OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

51 51 

52ResponseCreationOptions options = new();52ResponseCreationOptions options = new();

53options.Tools.Add(ResponseTool.CreateFileSearchTool(["<vector_store_id>"]));53options.Tools.Add(ResponseTool.CreateFileSearchTool(["<vector_store_id>"]));


109}109}

110 110 

111response = client.responses.create(111response = client.responses.create(

112 model="gpt-5.5",112 model="gpt-5.6",

113 input="List open orders for customer CUST-12345.",113 input="List open orders for customer CUST-12345.",

114 tools=[114 tools=[

115 crm_namespace,115 crm_namespace,


166};166};

167 167 

168const response = await client.responses.create({168const response = await client.responses.create({

169 model: "gpt-5.5",169 model: "gpt-5.6",

170 input: "List open orders for customer CUST-12345.",170 input: "List open orders for customer CUST-12345.",

171 // highlight-start:subtle171 // highlight-start:subtle

172 tools: [crmNamespace, { type: "tool_search" }],172 tools: [crmNamespace, { type: "tool_search" }],


190-H "Content-Type: application/json" \ 190-H "Content-Type: application/json" \

191-H "Authorization: Bearer $OPENAI_API_KEY" \ 191-H "Authorization: Bearer $OPENAI_API_KEY" \

192-d '{192-d '{

193 "model": "gpt-5.5",193 "model": "gpt-5.6",

194 "tools": [194 "tools": [

195 {195 {

196 "type": "mcp",196 "type": "mcp",


209const client = new OpenAI();209const client = new OpenAI();

210 210 

211const resp = await client.responses.create({211const resp = await client.responses.create({

212 model: "gpt-5.5",212 model: "gpt-5.6",

213 tools: [213 tools: [

214 {214 {

215 type: "mcp",215 type: "mcp",


231client = OpenAI()231client = OpenAI()

232 232 

233resp = client.responses.create(233resp = client.responses.create(

234 model="gpt-5.5",234 model="gpt-5.6",

235 tools=[235 tools=[

236 {236 {

237 "type": "mcp",237 "type": "mcp",


251using OpenAI.Responses;251using OpenAI.Responses;

252 252 

253string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;253string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

254OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);254OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

255 255 

256ResponseCreationOptions options = new();256ResponseCreationOptions options = new();

257options.Tools.Add(ResponseTool.CreateMcpTool(257options.Tools.Add(ResponseTool.CreateMcpTool(


370 usage.370 usage.

371 371 

372 372 

373</a>

374 

375<a href="/api/docs/guides/tools-programmatic-tool-calling">

376

377 

378<span slot="icon">

379 </span>

380 Let models compose and run JavaScript that orchestrates tool calls.

381 

382 

373</a>383</a>

374 384 

375## Usage in the API385## Usage in the API

Details

74"""74"""

75 75 

76response = client.responses.create(76response = client.responses.create(

77 model="gpt-5.5",77 model="gpt-5.6",

78 input=RESPONSE_INPUT,78 input=RESPONSE_INPUT,

79 tools=[{"type": "apply_patch"}],79 tools=[{"type": "apply_patch"}],

80)80)


135 })135 })

136 136 

137followup = client.responses.create(137followup = client.responses.create(

138 model="gpt-5.5",138 model="gpt-5.6",

139 previous_response_id=response.id,139 previous_response_id=response.id,

140 input=results,140 input=results,

141 tools=[{"type": "apply_patch"}],141 tools=[{"type": "apply_patch"}],


226 226 

227const agent = new Agent({227const agent = new Agent({

228 name: "Patch Assistant",228 name: "Patch Assistant",

229 model: "gpt-5.5",229 model: "gpt-5.6",

230 instructions: "You can edit files inside the /tmp directory using the apply_patch tool.",230 instructions: "You can edit files inside the /tmp directory using the apply_patch tool.",

231 tools: [231 tools: [

232 applyPatchTool({232 applyPatchTool({


277 277 

278agent = Agent(278agent = Agent(

279 name="Patch Assistant",279 name="Patch Assistant",

280 model="gpt-5.5",280 model="gpt-5.6",

281 instructions="You can edit files inside the /tmp directory using the apply_patch tool.",281 instructions="You can edit files inside the /tmp directory using the apply_patch tool.",

282 tools=[282 tools=[

283 ApplyPatchTool(283 ApplyPatchTool(

Details

16 -H "Content-Type: application/json" \16 -H "Content-Type: application/json" \

17 -H "Authorization: Bearer $OPENAI_API_KEY" \17 -H "Authorization: Bearer $OPENAI_API_KEY" \

18 -d '{18 -d '{

19 "model": "gpt-5.5",19 "model": "gpt-5.6",

20 "tools": [{20 "tools": [{

21 "type": "code_interpreter",21 "type": "code_interpreter",

22 "container": { "type": "auto", "memory_limit": "4g" }22 "container": { "type": "auto", "memory_limit": "4g" }


36`;36`;

37 37 

38const resp = await client.responses.create({38const resp = await client.responses.create({

39 model: "gpt-5.5",39 model: "gpt-5.6",

40 tools: [40 tools: [

41 {41 {

42 type: "code_interpreter",42 type: "code_interpreter",


61"""61"""

62 62 

63resp = client.responses.create(63resp = client.responses.create(

64 model="gpt-5.5",64 model="gpt-5.6",

65 tools=[65 tools=[

66 {66 {

67 "type": "code_interpreter",67 "type": "code_interpreter",


106 -H "Authorization: Bearer $OPENAI_API_KEY" \106 -H "Authorization: Bearer $OPENAI_API_KEY" \

107 -H "Content-Type: application/json" \107 -H "Content-Type: application/json" \

108 -d '{108 -d '{

109 "model": "gpt-5.5",109 "model": "gpt-5.6",

110 "tools": [{110 "tools": [{

111 "type": "code_interpreter",111 "type": "code_interpreter",

112 "container": "cntr_abc123"112 "container": "cntr_abc123"


123container = client.containers.create(name="test-container", memory_limit="4g")123container = client.containers.create(name="test-container", memory_limit="4g")

124 124 

125response = client.responses.create(125response = client.responses.create(

126 model="gpt-5.5",126 model="gpt-5.6",

127 tools=[{127 tools=[{

128 "type": "code_interpreter",128 "type": "code_interpreter",

129 "container": container.id129 "container": container.id


142const container = await client.containers.create({ name: "test-container", memory_limit: "4g" });142const container = await client.containers.create({ name: "test-container", memory_limit: "4g" });

143 143 

144const resp = await client.responses.create({144const resp = await client.responses.create({

145 model: "gpt-5.5",145 model: "gpt-5.6",

146 tools: [146 tools: [

147 {147 {

148 type: "code_interpreter",148 type: "code_interpreter",

Details

207const client = new OpenAI();207const client = new OpenAI();

208 208 

209const response = await client.responses.create({209const response = await client.responses.create({

210 model: "gpt-5.5",210 model: "gpt-5.6",

211 tools: [{ type: "computer" }],211 tools: [{ type: "computer" }],

212 input:212 input:

213 "Check whether the Filters panel is open. If it is not open, click Show filters. Then type penguin in the search box. Use the computer tool for UI interaction.",213 "Check whether the Filters panel is open. If it is not open, click Show filters. Then type penguin in the search box. Use the computer tool for UI interaction.",


222client = OpenAI()222client = OpenAI()

223 223 

224response = client.responses.create(224response = client.responses.create(

225 model="gpt-5.5",225 model="gpt-5.6",

226 tools=[{"type": "computer"}],226 tools=[{"type": "computer"}],

227 input="Check whether the Filters panel is open. If it is not open, click Show filters. Then type penguin in the search box. Use the computer tool for UI interaction.",227 input="Check whether the Filters panel is open. If it is not open, click Show filters. Then type penguin in the search box. Use the computer tool for UI interaction.",

228)228)


1374 1374 

1375Send that screenshot back as a `computer_call_output` item:1375Send that screenshot back as a `computer_call_output` item:

1376 1376 

1377For Computer use, prefer `detail: "original"` on screenshot inputs. This preserves the full screenshot resolution, up to 10.24M pixels, and improves click accuracy. If `detail: "original"` uses too many tokens, you can downscale the image before sending it to the API, and make sure you remap model-generated coordinates from the downscaled coordinate space to the original image's coordinate space. Avoid using `high` or `low` image detail for computer use tasks. When downscaling, we observe strong performance with 1440x900 and 1600x900 desktop resolutions. See the [Images and Vision guide](https://developers.openai.com/api/docs/guides/images-vision) for more details on image input detail levels.1377For Computer use, prefer `detail: "original"` on screenshot inputs to preserve resolution and improve click accuracy. GPT-5.6 models do not resize `original` image inputs to a pixel-dimension or patch-budget limit, so large screenshots can use more input tokens. If `detail: "original"` uses too many tokens, you can downscale the image before sending it to the API, and make sure you remap model-generated coordinates from the downscaled coordinate space to the original image's coordinate space. Avoid using `high` or `low` image detail for computer use tasks. When downscaling, we observe strong performance with 1440x900 and 1600x900 desktop resolutions. See the [Images and Vision guide](https://developers.openai.com/api/docs/guides/images-vision) for more details on image input detail levels.

1378 1378 

1379Send the updated screenshot1379Send the updated screenshot

1380 1380 


1385 1385 

1386async function sendComputerScreenshot(response, callId, screenshotBase64) {1386async function sendComputerScreenshot(response, callId, screenshotBase64) {

1387 return await client.responses.create({1387 return await client.responses.create({

1388 model: "gpt-5.5",1388 model: "gpt-5.6",

1389 tools: [{ type: "computer" }],1389 tools: [{ type: "computer" }],

1390 previous_response_id: response.id,1390 previous_response_id: response.id,

1391 input: [1391 input: [


1411 1411 

1412def send_computer_screenshot(response, call_id, screenshot_base64):1412def send_computer_screenshot(response, call_id, screenshot_base64):

1413 return client.responses.create(1413 return client.responses.create(

1414 model="gpt-5.5",1414 model="gpt-5.6",

1415 tools=[{"type": "computer"}],1415 tools=[{"type": "computer"}],

1416 previous_response_id=response.id,1416 previous_response_id=response.id,

1417 input=[1417 input=[


1453 const screenshotBase64 = Buffer.from(screenshot).toString("base64");1453 const screenshotBase64 = Buffer.from(screenshot).toString("base64");

1454 1454 

1455 response = await client.responses.create({1455 response = await client.responses.create({

1456 model: "gpt-5.5",1456 model: "gpt-5.6",

1457 tools: [{ type: "computer" }],1457 tools: [{ type: "computer" }],

1458 previous_response_id: response.id,1458 previous_response_id: response.id,

1459 input: [1459 input: [


1495 screenshot_base64 = base64.b64encode(screenshot).decode("utf-8")1495 screenshot_base64 = base64.b64encode(screenshot).decode("utf-8")

1496 1496 

1497 response = client.responses.create(1497 response = client.responses.create(

1498 model="gpt-5.5",1498 model="gpt-5.6",

1499 tools=[{"type": "computer"}],1499 tools=[{"type": "computer"}],

1500 previous_response_id=response.id,1500 previous_response_id=response.id,

1501 input=[1501 input=[


1589async function main(1589async function main(

1590 prompt: string = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",1590 prompt: string = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",

1591 max_steps: number = 50,1591 max_steps: number = 50,

1592 model: string = "gpt-5.5"1592 model: string = "gpt-5.6"

1593) {1593) {

1594 type Phase = null | "commentary" | "final_answer";1594 type Phase = null | "commentary" | "final_answer";

1595 const client = new OpenAI();1595 const client = new OpenAI();


1843async def main(1843async def main(

1844 prompt: str = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",1844 prompt: str = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",

1845 max_steps: int = 20,1845 max_steps: int = 20,

1846 model: str = "gpt-5.5",1846 model: str = "gpt-5.6",

1847) -> None:1847) -> None:

1848 client = OpenAI()1848 client = OpenAI()

1849 1849 


2055async function main(2055async function main(

2056 prompt: string = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",2056 prompt: string = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",

2057 max_steps: number = 50,2057 max_steps: number = 50,

2058 model: string = "gpt-5.5"2058 model: string = "gpt-5.6"

2059) {2059) {

2060 type Phase = null | "commentary" | "final_answer";2060 type Phase = null | "commentary" | "final_answer";

2061 const client = new OpenAI();2061 const client = new OpenAI();


2309async def main(2309async def main(

2310 prompt: str = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",2310 prompt: str = "Go to Hacker News, click on the most interesting link (be prepared to justify your choice), take a screenshot, and give me a critique of the visual layout.",

2311 max_steps: int = 20,2311 max_steps: int = 20,

2312 model: str = "gpt-5.5",2312 model: str = "gpt-5.6",

2313) -> None:2313) -> None:

2314 client = OpenAI()2314 client = OpenAI()

2315 2315 


2622 2622 

2623## Migration from computer-use-preview2623## Migration from computer-use-preview

2624 2624 

2625It's simple to migrate from the deprecated `computer-use-preview` tool to the new `computer` tool.2625To migrate from the deprecated `computer-use-preview` tool, make the following changes.

2626| | Preview integration | GA integration |2626| | Preview integration | GA integration |

2627| --- | --- | --- |2627| --- | --- | --- |

2628| **Model** | `model: "computer-use-preview"` | `model: "gpt-5.5"` |2628| **Model** | `model: "computer-use-preview"` | `model: "gpt-5.5"` |

Details

32-H "Content-Type: application/json" \ 32-H "Content-Type: application/json" \

33-H "Authorization: Bearer $OPENAI_API_KEY" \ 33-H "Authorization: Bearer $OPENAI_API_KEY" \

34-d '{34-d '{

35 "model": "gpt-5.5",35 "model": "gpt-5.6",

36 "tools": [36 "tools": [

37 {37 {

38 "type": "mcp",38 "type": "mcp",


51const client = new OpenAI();51const client = new OpenAI();

52 52 

53const resp = await client.responses.create({53const resp = await client.responses.create({

54 model: "gpt-5.5",54 model: "gpt-5.6",

55 tools: [55 tools: [

56 {56 {

57 type: "mcp",57 type: "mcp",


73client = OpenAI()73client = OpenAI()

74 74 

75resp = client.responses.create(75resp = client.responses.create(

76 model="gpt-5.5",76 model="gpt-5.6",

77 tools=[77 tools=[

78 {78 {

79 "type": "mcp",79 "type": "mcp",


93using OpenAI.Responses;93using OpenAI.Responses;

94 94 

95string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;95string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

96OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);96OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

97 97 

98ResponseCreationOptions options = new();98ResponseCreationOptions options = new();

99options.Tools.Add(ResponseTool.CreateMcpTool(99options.Tools.Add(ResponseTool.CreateMcpTool(


132-H "Content-Type: application/json" \132-H "Content-Type: application/json" \

133-H "Authorization: Bearer $OPENAI_API_KEY" \133-H "Authorization: Bearer $OPENAI_API_KEY" \

134-d '{134-d '{

135 "model": "gpt-5.5",135 "model": "gpt-5.6",

136 "tools": [136 "tools": [

137 {137 {

138 "type": "mcp",138 "type": "mcp",


151const client = new OpenAI();151const client = new OpenAI();

152 152 

153const resp = await client.responses.create({153const resp = await client.responses.create({

154 model: "gpt-5.5",154 model: "gpt-5.6",

155 tools: [155 tools: [

156 {156 {

157 type: "mcp",157 type: "mcp",


173client = OpenAI()173client = OpenAI()

174 174 

175resp = client.responses.create(175resp = client.responses.create(

176 model="gpt-5.5",176 model="gpt-5.6",

177 tools=[177 tools=[

178 {178 {

179 "type": "mcp",179 "type": "mcp",


194 194 

195string dropboxToken = Environment.GetEnvironmentVariable("DROPBOX_OAUTH_ACCESS_TOKEN")!;195string dropboxToken = Environment.GetEnvironmentVariable("DROPBOX_OAUTH_ACCESS_TOKEN")!;

196string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;196string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

197OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);197OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

198 198 

199ResponseCreationOptions options = new();199ResponseCreationOptions options = new();

200options.Tools.Add(ResponseTool.CreateMcpTool(200options.Tools.Add(ResponseTool.CreateMcpTool(


318-H "Content-Type: application/json" \318-H "Content-Type: application/json" \

319-H "Authorization: Bearer $OPENAI_API_KEY" \319-H "Authorization: Bearer $OPENAI_API_KEY" \

320-d '{320-d '{

321 "model": "gpt-5.5",321 "model": "gpt-5.6",

322 "tools": [322 "tools": [

323 {323 {

324 "type": "mcp",324 "type": "mcp",


338const client = new OpenAI();338const client = new OpenAI();

339 339 

340const resp = await client.responses.create({340const resp = await client.responses.create({

341 model: "gpt-5.5",341 model: "gpt-5.6",

342 tools: [{342 tools: [{

343 type: "mcp",343 type: "mcp",

344 server_label: "dmcp",344 server_label: "dmcp",


359client = OpenAI()359client = OpenAI()

360 360 

361resp = client.responses.create(361resp = client.responses.create(

362 model="gpt-5.5",362 model="gpt-5.6",

363 tools=[{363 tools=[{

364 "type": "mcp",364 "type": "mcp",

365 "server_label": "dmcp",365 "server_label": "dmcp",


378using OpenAI.Responses;378using OpenAI.Responses;

379 379 

380string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;380string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

381OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);381OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

382 382 

383ResponseCreationOptions options = new();383ResponseCreationOptions options = new();

384options.Tools.Add(ResponseTool.CreateMcpTool(384options.Tools.Add(ResponseTool.CreateMcpTool(


442-H "Content-Type: application/json" \442-H "Content-Type: application/json" \

443-H "Authorization: Bearer $OPENAI_API_KEY" \443-H "Authorization: Bearer $OPENAI_API_KEY" \

444-d '{444-d '{

445 "model": "gpt-5.5",445 "model": "gpt-5.6",

446 "tools": [446 "tools": [

447 {447 {

448 "type": "mcp",448 "type": "mcp",


466const client = new OpenAI();466const client = new OpenAI();

467 467 

468const resp = await client.responses.create({468const resp = await client.responses.create({

469 model: "gpt-5.5",469 model: "gpt-5.6",

470 tools: [{470 tools: [{

471 type: "mcp",471 type: "mcp",

472 server_label: "dmcp",472 server_label: "dmcp",


491client = OpenAI()491client = OpenAI()

492 492 

493resp = client.responses.create(493resp = client.responses.create(

494 model="gpt-5.5",494 model="gpt-5.6",

495 tools=[{495 tools=[{

496 "type": "mcp",496 "type": "mcp",

497 "server_label": "dmcp",497 "server_label": "dmcp",


514using OpenAI.Responses;514using OpenAI.Responses;

515 515 

516string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;516string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

517OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);517OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

518 518 

519ResponseCreationOptions options = new();519ResponseCreationOptions options = new();

520options.Tools.Add(ResponseTool.CreateMcpTool(520options.Tools.Add(ResponseTool.CreateMcpTool(


553-H "Content-Type: application/json" \553-H "Content-Type: application/json" \

554-H "Authorization: Bearer $OPENAI_API_KEY" \554-H "Authorization: Bearer $OPENAI_API_KEY" \

555-d '{555-d '{

556 "model": "gpt-5.5",556 "model": "gpt-5.6",

557 "tools": [557 "tools": [

558 {558 {

559 "type": "mcp",559 "type": "mcp",


575const client = new OpenAI();575const client = new OpenAI();

576 576 

577const resp = await client.responses.create({577const resp = await client.responses.create({

578 model: "gpt-5.5",578 model: "gpt-5.6",

579 tools: [579 tools: [

580 {580 {

581 type: "mcp",581 type: "mcp",


600client = OpenAI()600client = OpenAI()

601 601 

602resp = client.responses.create(602resp = client.responses.create(

603 model="gpt-5.5",603 model="gpt-5.6",

604 tools=[604 tools=[

605 {605 {

606 "type": "mcp",606 "type": "mcp",


623using OpenAI.Responses;623using OpenAI.Responses;

624 624 

625string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;625string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

626OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);626OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

627 627 

628ResponseCreationOptions options = new();628ResponseCreationOptions options = new();

629options.Tools.Add(ResponseTool.CreateMcpTool(629options.Tools.Add(ResponseTool.CreateMcpTool(


654-H "Content-Type: application/json" \654-H "Content-Type: application/json" \

655-H "Authorization: Bearer $OPENAI_API_KEY" \655-H "Authorization: Bearer $OPENAI_API_KEY" \

656-d '{656-d '{

657 "model": "gpt-5.5",657 "model": "gpt-5.6",

658 "input": "Create a payment link for $20",658 "input": "Create a payment link for $20",

659 "tools": [659 "tools": [

660 {660 {


672const client = new OpenAI();672const client = new OpenAI();

673 673 

674const resp = await client.responses.create({674const resp = await client.responses.create({

675 model: "gpt-5.5",675 model: "gpt-5.6",

676 input: "Create a payment link for $20",676 input: "Create a payment link for $20",

677 tools: [677 tools: [

678 {678 {


693client = OpenAI()693client = OpenAI()

694 694 

695resp = client.responses.create(695resp = client.responses.create(

696 model="gpt-5.5",696 model="gpt-5.6",

697 input="Create a payment link for $20",697 input="Create a payment link for $20",

698 tools=[698 tools=[

699 {699 {


713 713 

714string authToken = Environment.GetEnvironmentVariable("STRIPE_OAUTH_ACCESS_TOKEN")!;714string authToken = Environment.GetEnvironmentVariable("STRIPE_OAUTH_ACCESS_TOKEN")!;

715string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;715string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

716OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);716OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

717 717 

718ResponseCreationOptions options = new();718ResponseCreationOptions options = new();

719options.Tools.Add(ResponseTool.CreateMcpTool(719options.Tools.Add(ResponseTool.CreateMcpTool(


776 -H "Content-Type: application/json" \776 -H "Content-Type: application/json" \

777 -H "Authorization: Bearer $OPENAI_API_KEY" \777 -H "Authorization: Bearer $OPENAI_API_KEY" \

778 -d '{778 -d '{

779 "model": "gpt-5.5",779 "model": "gpt-5.6",

780 "tools": [780 "tools": [

781 {781 {

782 "type": "mcp",782 "type": "mcp",


795const client = new OpenAI();795const client = new OpenAI();

796 796 

797const resp = await client.responses.create({797const resp = await client.responses.create({

798 model: "gpt-5.5",798 model: "gpt-5.6",

799 tools: [799 tools: [

800 {800 {

801 type: "mcp",801 type: "mcp",


817client = OpenAI()817client = OpenAI()

818 818 

819resp = client.responses.create(819resp = client.responses.create(

820 model="gpt-5.5",820 model="gpt-5.6",

821 tools=[821 tools=[

822 {822 {

823 "type": "mcp",823 "type": "mcp",


838 838 

839string authToken = Environment.GetEnvironmentVariable("GOOGLE_CALENDAR_OAUTH_ACCESS_TOKEN")!;839string authToken = Environment.GetEnvironmentVariable("GOOGLE_CALENDAR_OAUTH_ACCESS_TOKEN")!;

840string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;840string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;

841OpenAIResponseClient client = new(model: "gpt-5.5", apiKey: key);841OpenAIResponseClient client = new(model: "gpt-5.6", apiKey: key);

842 842 

843ResponseCreationOptions options = new();843ResponseCreationOptions options = new();

844options.Tools.Add(ResponseTool.CreateMcpTool(844options.Tools.Add(ResponseTool.CreateMcpTool(

Details

18const openai = new OpenAI();18const openai = new OpenAI();

19 19 

20const response = await openai.responses.create({20const response = await openai.responses.create({

21 model: "gpt-5.5",21 model: "gpt-5.6",

22 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",22 input: "Generate an image of gray tabby cat hugging an otter with an orange scarf",

23 tools: [{type: "image_generation"}],23 tools: [{type: "image_generation"}],

24});24});


42client = OpenAI() 42client = OpenAI()

43 43 

44response = client.responses.create(44response = client.responses.create(

45 model="gpt-5.5",45 model="gpt-5.6",

46 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",46 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

47 tools=[{"type": "image_generation"}],47 tools=[{"type": "image_generation"}],

48)48)


121const openai = new OpenAI();121const openai = new OpenAI();

122 122 

123const response = await openai.responses.create({123const response = await openai.responses.create({

124 model: "gpt-5.5",124 model: "gpt-5.6",

125 input:125 input:

126 "Generate an image of gray tabby cat hugging an otter with an orange scarf",126 "Generate an image of gray tabby cat hugging an otter with an orange scarf",

127 tools: [{ type: "image_generation" }],127 tools: [{ type: "image_generation" }],


140// Follow up140// Follow up

141 141 

142const response_fwup = await openai.responses.create({142const response_fwup = await openai.responses.create({

143 model: "gpt-5.5",143 model: "gpt-5.6",

144 previous_response_id: response.id,144 previous_response_id: response.id,

145 input: "Now make it look realistic",145 input: "Now make it look realistic",

146 tools: [{ type: "image_generation" }],146 tools: [{ type: "image_generation" }],


167client = OpenAI()167client = OpenAI()

168 168 

169response = client.responses.create(169response = client.responses.create(

170 model="gpt-5.5",170 model="gpt-5.6",

171 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",171 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

172 tools=[{"type": "image_generation"}],172 tools=[{"type": "image_generation"}],

173)173)


188# Follow up188# Follow up

189 189 

190response_fwup = client.responses.create(190response_fwup = client.responses.create(

191 model="gpt-5.5",191 model="gpt-5.6",

192 previous_response_id=response.id,192 previous_response_id=response.id,

193 input="Now make it look realistic",193 input="Now make it look realistic",

194 tools=[{"type": "image_generation"}],194 tools=[{"type": "image_generation"}],


216const openai = new OpenAI();216const openai = new OpenAI();

217 217 

218const response = await openai.responses.create({218const response = await openai.responses.create({

219 model: "gpt-5.5",219 model: "gpt-5.6",

220 input:220 input:

221 "Generate an image of gray tabby cat hugging an otter with an orange scarf",221 "Generate an image of gray tabby cat hugging an otter with an orange scarf",

222 tools: [{ type: "image_generation" }],222 tools: [{ type: "image_generation" }],


237// Follow up237// Follow up

238 238 

239const response_fwup = await openai.responses.create({239const response_fwup = await openai.responses.create({

240 model: "gpt-5.5",240 model: "gpt-5.6",

241 input: [241 input: [

242 {242 {

243 role: "user",243 role: "user",


270import base64270import base64

271 271 

272response = openai.responses.create(272response = openai.responses.create(

273 model="gpt-5.5",273 model="gpt-5.6",

274 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",274 input="Generate an image of gray tabby cat hugging an otter with an orange scarf",

275 tools=[{"type": "image_generation"}],275 tools=[{"type": "image_generation"}],

276)276)


293# Follow up293# Follow up

294 294 

295response_fwup = openai.responses.create(295response_fwup = openai.responses.create(

296 model="gpt-5.5",296 model="gpt-5.6",

297 input=[297 input=[

298 {298 {

299 "role": "user",299 "role": "user",


342}342}

343 343 

344const stream = await openai.responses.create({344const stream = await openai.responses.create({

345 model: "gpt-5.5",345 model: "gpt-5.6",

346 input:346 input:

347 "Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",347 "Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",

348 stream: true,348 stream: true,


377 f.write(image_bytes)377 f.write(image_bytes)

378 378 

379stream = client.responses.create(379stream = client.responses.create(

380 model="gpt-5.5",380 model="gpt-5.6",

381 input="Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",381 input="Draw a gorgeous image of a river made of white owl feathers, snaking its way through a serene winter landscape",

382 stream=True,382 stream=True,

383 tools=[{"type": "image_generation", "partial_images": 2}],383 tools=[{"type": "image_generation", "partial_images": 2}],

guides/tools-multi-agent.md +899 −0 created

Details

1# Multi-agent

2 

3## Overview

4 

5Multi-agent lets a model spin up and coordinate subagents in parallel, synthesizing their work to provide a final response. This is especially effective for applications with complex tasks that benefit from parallel work delegation, such as codebase exploration, documentation, and implementation.

6 

7Multi-agent is available as a beta feature with all GPT-5.6 models. Check the model page before enabling Multi-agent in your application.

8 

9## When to use Multi-agent

10 

11Tasks can often be divided into independent sections of work that a single agent would complete sequentially, but multiple agents are able to tackle in parallel. Multi-agent enables a root agent to delegate to multiple subagents that complete work concurrently. This can provide multiple benefits:

12 

13- **Parallel execution.** Independent research, analysis, or implementation tasks can proceed at the same time, which can lead to faster execution.

14- **Focused context.** Each subagent receives a bounded task and maintains its own context, which reduces interference in context between unrelated lines of work and improves performance.

15- **Model-directed coordination.** The root agent can create subagents, send them additional information, wait for results, and synthesize a final answer without requiring your application to implement orchestration.

16 

17Multi-agent orchestration is most useful when a task can be divided into concrete, independent workstreams, such as:

18 

19- Exploring separate parts of a large codebase

20- Comparing multiple proposals, documents, or hypotheses

21- Researching several sources in parallel

22- Implementing independent components or writing independent test suites

23- Investigating different possible causes of a failure in parallel

24- Exploring separate approaches to a problem concurrently

25 

26Note that adding subagents can increase token usage, and may not be as beneficial for tasks that depend on a single ordered chain of reasoning, require frequent writes to shared mutable state, or are already dominated by one slow external operation.

27 

28| Use Multi-agent when | Prefer one agent when |

29| ------------------------------------------------- | ----------------------------------------------------- |

30| Work can be split into independent, bounded tasks | Each step depends directly on the previous step |

31| Separate context improves focus | The task is small enough to complete in one short run |

32| Parallel exploration can reduce wall-clock time | Agents would contend over the same mutable resource |

33| Comparing independent findings improves coverage | You require a fixed, deterministic execution graph |

34 

35## Quickstart

36 

37The Python and TypeScript examples use the beta Responses SDK. For HTTP

38 requests, use `client.beta.responses` and pass `responses_multi_agent=v1` in

39 the `betas` argument. For raw HTTP requests and WebSocket connections, pass

40 `OpenAI-Beta: responses_multi_agent=v1` in the request or connection headers.

41 Item schemas may change while Multi-agent is in beta.

42 

43Enable Multi-agent in your Responses API request with `multi_agent.enabled`. When `multi_agent.enabled` is `true`, the root agent becomes eligible to spawn a tree of subagents. The subagents share the request’s model and available tools, while agents coordinate through collaboration primitives such as spawning, messaging, and waiting (see [How Multi-agent works](#how-multi-agent-works)). The root agent is responsible for synthesizing subagent responses and providing the final response.

44 

45Review a pull request with subagents

46 

47```python

48from openai import OpenAI

49 

50client = OpenAI()

51 

52 

53def review_pull_request(diff: str) -> str:

54 response = client.beta.responses.create(

55 model="gpt-5.6-sol",

56 input=(

57 "Review the pull-request diff below with three agents: one for "

58 "correctness, one for security, and one for missing tests. "

59 "Reconcile duplicate or conflicting findings, then return a "

60 "prioritized review with file and line references.\n\n"

61 f"<diff>\n{diff}\n</diff>"

62 ),

63 multi_agent={

64 "enabled": True,

65 "max_concurrent_subagents": 3,

66 },

67 betas=["responses_multi_agent=v1"],

68 )

69 

70 return "".join(

71 part.text

72 for item in response.output

73 if (

74 item.type == "message"

75 and item.agent is not None

76 and item.agent.agent_name == "/root"

77 and item.phase == "final_answer"

78 )

79 for part in item.content

80 if part.type == "output_text"

81 )

82```

83 

84```typescript

85import OpenAI from "openai";

86 

87const client = new OpenAI();

88 

89async function reviewPullRequest(diff: string): Promise<string> {

90 const response = await client.beta.responses.create({

91 model: "gpt-5.6-sol",

92 input:

93 "Review the pull-request diff below with three agents: one for " +

94 "correctness, one for security, and one for missing tests. " +

95 "Reconcile duplicate or conflicting findings, then return a " +

96 "prioritized review with file and line references.\n\n" +

97 `<diff>\n${diff}\n</diff>`,

98 multi_agent: {

99 enabled: true,

100 max_concurrent_subagents: 3,

101 },

102 betas: ["responses_multi_agent=v1"],

103 });

104 

105 return response.output

106 .flatMap((item) =>

107 item.type === "message" && item.agent?.agent_name === "/root"

108 ? item.content

109 : [],

110 )

111 .filter((part) => part.type === "output_text")

112 .map((part) => part.text)

113 .join("");

114}

115```

116 

117 

118`max_concurrent_subagents` sets the maximum number of subagents that can be active simultaneously across the entire agent tree. It includes all descendants—children, grandchildren, and deeper subagents—but excludes the root agent.

119 

120The API does not impose a fixed upper bound on this setting. The default is `3`, which is recommended for most workloads. Multi-agent runs also have no fixed limit on tree depth or the total number of subagents created during a run.

121 

122Add a developer message to tune when the root model should spawn subagents. This developer message is additive to the instructions injected for the root agent and subagents.

123 

124Examples of developer messages include:

125 

126- “Do not spawn subagents unless the user explicitly asks for subagents, delegation, or parallel agent work.”

127- “Proactive Multi-agent delegation is active. Use subagents when parallel work would materially improve speed or quality.”

128 

129## How Multi-agent works

130 

131The Responses API provides the root and subagent models with hosted orchestration actions and instructions for using them. The root agent is named `/root`. Spawned subagents use hierarchical paths such as:

132 

133```text

134/root

135├── /root/researcher

136├── /root/reviewer

137└── /root/reviewer/tester

138```

139 

140Multi-agent imposes no fixed limit on the total number of subagents or tree depth. For most tasks, use the default `max_concurrent_subagents` value of `3`. This setting limits the number of active subagent turns across the entire tree, including children and deeper descendants.

141 

142When Multi-agent mode is enabled, the Responses API provides six hosted collaboration actions. You may see these as `multi_agent_call` items. Your application should not execute these or submit outputs for them.

143 

144| Action | Purpose |

145| ----------------- | ------------------------------------------------------------------------------ |

146| `spawn_agent` | Create a subagent and assign its initial task. |

147| `send_message` | Queue a message for an existing agent without starting a new turn. |

148| `followup_task` | Assign more work to an existing non-root agent and start or resume its turn. |

149| `wait_agent` | Wait for an update in the calling agent's mailbox. |

150| `interrupt_agent` | Interrupt another agent's active turn without deleting its context. |

151| `list_agents` | Return the current agent tree, statuses, and each agent's `last_task_message`. |

152 

153Handling developer-defined tool calls works in the same way as without Multi-agent enabled. Any agent in the tree may emit a `function_call`. Your application must execute the call and submit a matching `function_call_output`.

154 

155Note that all agents in the tree have access to the tools configured in the API request’s model call.

156 

157## Using Multi-agent in Responses API

158 

159### HTTP vs. WebSocket performance

160 

161HTTP and WebSocket support the same Multi-agent capabilities, but WebSocket is recommended for tool-heavy or long-running workflows. Its persistent connection lets your application return function outputs as they become available, reducing continuation overhead and allowing agents to spend less time waiting.

162 

163With HTTP, the response completes once every active agent has either finished or paused to wait for a client-executed function call. Your application then executes all outstanding function calls and submits their outputs in a new Responses API request, allowing the paused agents to resume.

164 

165With WebSocket, your application can inject each function output into the response as soon as it becomes available, without waiting for the active response to complete. The waiting agent can resume immediately while other agents continue working. This reduces coordination delays and avoids extra request round trips when agents finish or request tools at different times.

166 

167HTTP may be sufficient for workflows that require calling multiple hosted tools, such as parallel web searches, or one-request workflows with few function calls. For most Multi-agent workflows, WebSocket is likely to provide lower latency and better end-to-end performance.

168 

169### HTTP

170 

171These examples require beta SDK builds that expose the beta Responses API. For HTTP streaming, call `client.beta.responses.create` and pass `responses_multi_agent=v1` with the `betas` argument; this enables beta types and autocomplete. In Python, import beta response item types from `openai.types.beta` when adding type annotations.

172 

173Example client-side code:

174 

175Handle HTTP streaming tool calls

176 

177```python

178from __future__ import annotations

179 

180import json

181import sys

182 

183from openai import OpenAI

184from openai.types.beta import BetaResponseOutputItem

185 

186client = OpenAI()

187ROOT = "/root"

188PROPOSALS = {

189 "alpha": {"estimated_weeks": 6, "risk": "medium"},

190 "beta": {"estimated_weeks": 8, "risk": "low"},

191}

192tools = [

193 {

194 "type": "function",

195 "name": "get_proposal",

196 "description": "Return details for a proposal that the agents should compare.",

197 "parameters": {

198 "type": "object",

199 "properties": {

200 "proposal": {

201 "type": "string",

202 "enum": ["alpha", "beta"],

203 }

204 },

205 "required": ["proposal"],

206 "additionalProperties": False,

207 },

208 "strict": True,

209 }

210]

211history = [

212 {

213 "role": "user",

214 "content": "Compare proposal alpha and proposal beta.",

215 }

216]

217 

218 

219def agent_name(item: BetaResponseOutputItem) -> str:

220 return item.agent.agent_name if item.agent else ROOT

221 

222 

223def render_to_user(delta: str) -> None:

224 print(delta, end="", flush=True)

225 

226 

227def log_subagent_text(agent: str, delta: str) -> None:

228 print(f"[{agent}] {delta}", end="", file=sys.stderr, flush=True)

229 

230 

231def process_tool_call(name: str, arguments: str) -> str:

232 if name != "get_proposal":

233 raise ValueError(f"Unknown tool: {name}")

234 parsed_arguments = json.loads(arguments)

235 return json.dumps(PROPOSALS[parsed_arguments["proposal"]])

236 

237 

238while True:

239 output_items = []

240 pending_calls = []

241 item_agents: dict[int, str] = {}

242 

243 stream = client.beta.responses.create(

244 model="gpt-5.6-sol",

245 input=history,

246 tools=tools,

247 store=False,

248 include=["reasoning.encrypted_content"],

249 multi_agent={

250 "enabled": True,

251 "max_concurrent_subagents": 3,

252 },

253 stream=True,

254 betas=["responses_multi_agent=v1"],

255 )

256 for event in stream:

257 if event.type == "response.output_item.added":

258 item_agents[event.output_index] = agent_name(event.item)

259 elif event.type == "response.output_text.delta":

260 agent = item_agents.get(event.output_index, ROOT)

261 if agent == ROOT:

262 render_to_user(event.delta)

263 else:

264 log_subagent_text(agent, event.delta)

265 elif event.type == "response.output_item.done":

266 output_items.append(event.item)

267 if event.item.type == "function_call":

268 # Handle function calls from both the root agent and subagents.

269 pending_calls.append(event.item)

270 elif event.type == "response.completed":

271 print(f"\nUsage: {event.response.usage}", file=sys.stderr)

272 break

273 elif event.type in {

274 "error",

275 "response.failed",

276 "response.incomplete",

277 }:

278 raise RuntimeError(event)

279 

280 history.extend(output_items)

281 

282 for call in pending_calls:

283 history.append(

284 {

285 "type": "function_call_output",

286 "call_id": call.call_id,

287 "output": process_tool_call(call.name, call.arguments),

288 }

289 )

290 

291 if not pending_calls:

292 break

293```

294 

295```typescript

296import OpenAI from "openai";

297import type {

298 BetaResponseInput,

299 BetaResponseInputItem,

300 BetaResponseOutputItem,

301 BetaTool,

302} from "openai/resources/beta/responses/responses";

303 

304const client = new OpenAI();

305const ROOT = "/root";

306const proposals = {

307 alpha: { estimated_weeks: 6, risk: "medium" },

308 beta: { estimated_weeks: 8, risk: "low" },

309};

310const tools: BetaTool[] = [

311 {

312 type: "function",

313 name: "get_proposal",

314 description:

315 "Return details for a proposal that the agents should compare.",

316 parameters: {

317 type: "object",

318 properties: {

319 proposal: {

320 type: "string",

321 enum: ["alpha", "beta"],

322 },

323 },

324 required: ["proposal"],

325 additionalProperties: false,

326 },

327 strict: true,

328 },

329];

330const history: Array<BetaResponseInputItem | BetaResponseOutputItem> = [

331 {

332 role: "user",

333 content: "Compare proposal alpha and proposal beta.",

334 },

335];

336 

337function agentName(item: BetaResponseOutputItem): string {

338 return item.agent?.agent_name ?? ROOT;

339}

340 

341function processToolCall(name: string, argumentsJson: string): string {

342 if (name !== "get_proposal") {

343 throw new Error(`Unknown tool: ${name}`);

344 }

345 const { proposal } = JSON.parse(argumentsJson) as {

346 proposal: keyof typeof proposals;

347 };

348 return JSON.stringify(proposals[proposal]);

349}

350 

351while (true) {

352 const outputItems: BetaResponseOutputItem[] = [];

353 const pendingCalls: Extract<

354 BetaResponseOutputItem,

355 { type: "function_call" }

356 >[] = [];

357 const itemAgents = new Map<number, string>();

358 

359 const stream = await client.beta.responses.create({

360 model: "gpt-5.6-sol",

361 // Beta output items can be replayed as input on the next request.

362 input: history as BetaResponseInput,

363 tools,

364 store: false,

365 include: ["reasoning.encrypted_content"],

366 multi_agent: {

367 enabled: true,

368 max_concurrent_subagents: 3,

369 },

370 stream: true,

371 betas: ["responses_multi_agent=v1"],

372 });

373 

374 for await (const event of stream) {

375 if (event.type === "response.output_item.added") {

376 itemAgents.set(event.output_index, agentName(event.item));

377 } else if (event.type === "response.output_text.delta") {

378 const agent = itemAgents.get(event.output_index) ?? ROOT;

379 const destination = agent === ROOT ? process.stdout : process.stderr;

380 destination.write(

381 agent === ROOT ? event.delta : `[${agent}] ${event.delta}`

382 );

383 } else if (event.type === "response.output_item.done") {

384 outputItems.push(event.item);

385 if (event.item.type === "function_call") {

386 pendingCalls.push(event.item);

387 }

388 } else if (event.type === "response.completed") {

389 console.error("\nUsage:", event.response.usage);

390 break;

391 } else if (

392 event.type === "error" ||

393 event.type === "response.failed" ||

394 event.type === "response.incomplete"

395 ) {

396 throw new Error(JSON.stringify(event));

397 }

398 }

399 

400 history.push(...outputItems);

401 for (const call of pendingCalls) {

402 history.push({

403 type: "function_call_output",

404 call_id: call.call_id,

405 output: processToolCall(call.name, call.arguments),

406 });

407 }

408 

409 if (pendingCalls.length === 0) break;

410}

411```

412 

413 

414If one or more agents call developer-defined functions, execute every pending call and create a continuation request containing their outputs.

415 

416### WebSocket

417 

418In WebSocket mode, when an agent calls a developer-defined function, execute the function in your application and send its result to the active response with a `response.inject` event. The waiting agent can then resume without waiting for the entire Multi-agent response to complete.

419 

420```json

421{

422 "type": "response.inject",

423 "response_id": "resp_123",

424 "input": [

425 {

426 "type": "function_call_output",

427 "call_id": "call_123",

428 "output": "{\"temperature\":72}"

429 }

430 ]

431}

432```

433 

434For a valid `response.inject` request, the server replies with one of two events:

435 

436- `response.inject.created`: the input was validated and accepted for injection

437- `response.inject.failed`: the input was not injected; inspect `error.code`

438 

439```json

440{

441 "type": "response.inject.created",

442 "sequence_number": 42,

443 "response_id": "resp_123"

444}

445```

446 

447```json

448{

449 "type": "response.inject.failed",

450 "sequence_number": 43,

451 "response_id": "resp_123",

452 "input": [

453 {

454 "type": "function_call_output",

455 "call_id": "call_123",

456 "output": "{\"temperature\":72}"

457 }

458 ],

459 "error": {

460 "code": "response_already_completed",

461 "message": "Response 'resp_123' has already completed."

462 }

463}

464```

465 

466If a request doesn't conform to the `response.inject` schema, the server sends a generic error with status `400` and closes the WebSocket connection. Fix the request and open a new WebSocket connection before sending another event.

467 

468The Python beta SDK exposes WebSocket mode through `client.beta.responses.connect`. The TypeScript beta SDK exposes it through `ResponsesWS`. Pass `OpenAI-Beta: responses_multi_agent=v1` in the connection headers; unlike HTTP streaming, the WebSocket connectors do not yet accept the `betas` argument.

469 

470Save the response ID from the `response.created` event and include it in every `response.inject` event you send for that response. After sending an injection item, continue reading from the WebSocket until the response has completed and every injection has produced either a `response.inject.created` or `response.inject.failed` event.

471 

472Inject tool outputs over WebSocket

473 

474```python

475from __future__ import annotations

476 

477import json

478 

479from openai import OpenAI

480 

481client = OpenAI()

482PROPOSALS = {

483 "alpha": {"estimated_weeks": 6, "risk": "medium"},

484 "beta": {"estimated_weeks": 8, "risk": "low"},

485}

486tools = [

487 {

488 "type": "function",

489 "name": "get_proposal",

490 "description": "Return details for a proposal that the agents should compare.",

491 "parameters": {

492 "type": "object",

493 "properties": {

494 "proposal": {

495 "type": "string",

496 "enum": ["alpha", "beta"],

497 }

498 },

499 "required": ["proposal"],

500 "additionalProperties": False,

501 },

502 "strict": True,

503 }

504]

505 

506 

507def process_tool_call(name: str, arguments: str) -> str:

508 if name != "get_proposal":

509 raise ValueError(f"Unknown tool: {name}")

510 parsed_arguments = json.loads(arguments)

511 return json.dumps(PROPOSALS[parsed_arguments["proposal"]])

512 

513 

514def run_multi_agent(connection):

515 previous_response_id: str | None = None

516 pending_input: list[dict[str, object]] = [

517 {"role": "user", "content": input()}

518 ]

519 

520 while pending_input:

521 request = {

522 "type": "response.create",

523 "model": "gpt-5.6-sol",

524 "store": True,

525 "multi_agent": {"enabled": True},

526 "tools": tools,

527 "input": pending_input,

528 }

529 if previous_response_id is not None:

530 request["previous_response_id"] = previous_response_id

531 

532 connection.send(request)

533 

534 next_input: list[dict[str, object]] = []

535 completed_response = None

536 response_id: str | None = None

537 pending_injections = 0

538 

539 for event in connection:

540 event_type = event.type

541 

542 if event_type == "response.created":

543 response_id = event.response.id

544 

545 elif event_type == "response.output_item.done":

546 item = event.item

547 

548 if item.type == "function_call":

549 if response_id is None:

550 raise RuntimeError(

551 "Received a function call before response.created"

552 )

553 

554 output = {

555 "type": "function_call_output",

556 "call_id": item.call_id,

557 "output": process_tool_call(item.name, item.arguments),

558 }

559 pending_injections += 1

560 

561 connection.send(

562 {

563 "type": "response.inject",

564 "response_id": response_id,

565 "input": [output],

566 }

567 )

568 

569 elif event_type == "response.inject.created":

570 pending_injections -= 1

571 

572 elif event_type == "response.inject.failed":

573 pending_injections -= 1

574 

575 if event.error.code != "response_already_completed":

576 raise RuntimeError(event.error)

577 

578 next_input.extend(

579 item.model_dump(mode="json") for item in event.input

580 )

581 

582 elif event_type == "response.completed":

583 completed_response = event.response

584 

585 elif event_type in {

586 "error",

587 "response.failed",

588 "response.incomplete",

589 }:

590 raise RuntimeError(event)

591 

592 if completed_response is not None and pending_injections == 0:

593 break

594 

595 if completed_response is None:

596 raise RuntimeError("Connection ended before response.completed")

597 

598 if not next_input:

599 return completed_response

600 

601 previous_response_id = completed_response.id

602 pending_input = next_input

603 

604 

605with client.beta.responses.connect(

606 extra_headers={"OpenAI-Beta": "responses_multi_agent=v1"},

607) as connection:

608 run_multi_agent(connection)

609```

610 

611```typescript

612import OpenAI from "openai";

613import type { BetaResponseInput } from "openai/resources/beta/responses/responses";

614import { ResponsesWS } from "openai/resources/beta/responses/ws";

615 

616const client = new OpenAI();

617const proposals = {

618 alpha: { estimated_weeks: 6, risk: "medium" },

619 beta: { estimated_weeks: 8, risk: "low" },

620};

621const tools = [

622 {

623 type: "function" as const,

624 name: "get_proposal",

625 description:

626 "Return details for a proposal that the agents should compare.",

627 parameters: {

628 type: "object",

629 properties: {

630 proposal: {

631 type: "string",

632 enum: ["alpha", "beta"],

633 },

634 },

635 required: ["proposal"],

636 additionalProperties: false,

637 },

638 strict: true,

639 },

640];

641 

642function processToolCall(name: string, argumentsJson: string): string {

643 if (name !== "get_proposal") {

644 throw new Error(`Unknown tool: ${name}`);

645 }

646 const { proposal } = JSON.parse(argumentsJson) as {

647 proposal: keyof typeof proposals;

648 };

649 return JSON.stringify(proposals[proposal]);

650}

651 

652async function runMultiAgent(ws: ResponsesWS) {

653 let previousResponseId: string | undefined;

654 let pendingInput: BetaResponseInput = [

655 { role: "user", content: process.argv.slice(2).join(" ") },

656 ];

657 

658 while (pendingInput.length > 0) {

659 ws.send({

660 type: "response.create",

661 model: "gpt-5.6-sol",

662 store: true,

663 multi_agent: {

664 enabled: true,

665 max_concurrent_subagents: 3,

666 },

667 tools,

668 input: pendingInput,

669 previous_response_id: previousResponseId,

670 });

671 

672 const nextInput: BetaResponseInput = [];

673 let completedResponseId: string | undefined;

674 let responseId: string | undefined;

675 let pendingInjections = 0;

676 

677 for await (const message of ws) {

678 if (message.type === "error") throw message.error;

679 if (message.type !== "message") continue;

680 

681 const event = message.message;

682 if (event.type === "response.created") {

683 responseId = event.response.id;

684 } else if (

685 event.type === "response.output_item.done" &&

686 event.item.type === "function_call"

687 ) {

688 if (!responseId) {

689 throw new Error("Received a function call before response.created");

690 }

691 pendingInjections += 1;

692 ws.send({

693 type: "response.inject",

694 response_id: responseId,

695 input: [

696 {

697 type: "function_call_output",

698 call_id: event.item.call_id,

699 output: processToolCall(event.item.name, event.item.arguments),

700 },

701 ],

702 });

703 } else if (event.type === "response.inject.created") {

704 pendingInjections -= 1;

705 } else if (event.type === "response.inject.failed") {

706 pendingInjections -= 1;

707 if (event.error.code !== "response_already_completed") {

708 throw new Error(JSON.stringify(event.error));

709 }

710 nextInput.push(...event.input);

711 } else if (event.type === "response.completed") {

712 completedResponseId = event.response.id;

713 } else if (

714 event.type === "error" ||

715 event.type === "response.failed" ||

716 event.type === "response.incomplete"

717 ) {

718 throw new Error(JSON.stringify(event));

719 }

720 

721 if (completedResponseId && pendingInjections === 0) break;

722 }

723 

724 if (!completedResponseId) {

725 throw new Error("Connection ended before response.completed");

726 }

727 if (nextInput.length === 0) return;

728 

729 previousResponseId = completedResponseId;

730 pendingInput = nextInput;

731 }

732}

733 

734const ws = new ResponsesWS(client, {

735 headers: { "OpenAI-Beta": "responses_multi_agent=v1" },

736});

737 

738try {

739 await runMultiAgent(ws);

740} finally {

741 ws.close();

742}

743```

744 

745 

746After sending a `response.inject` event, keep reading from the WebSocket and handle the acknowledgement:

747 

748- **`response.inject.created`**: The function output was added to the active response. Continue reading events for that response.

749- **`response.inject.failed` with `response_already_completed`**: The response completed before the function output could be added. Take the `input` returned in the failure event and send it in a new `response.create` request that continues from the completed response.

750- **`response.inject.failed` with `response_not_found`**: The server could not find the response identified by `response_id`. Verify that you are using the ID received from `response.created`.

751 

752A single Multi-agent run may span multiple Responses API requests. Over HTTP, when an agent calls a developer-defined function, your application executes the function and submits its output in a new `response.create` call. Over WebSocket, your application instead injects the function output into the active response.

753 

754## New Multi-agent output items

755 

756Multi-agent responses can include three additional output item types:

757 

758- `multi_agent_call`: records a hosted Multi-agent action, such as `spawn_agent`.

759- `multi_agent_call_output`: contains the result from execution of a hosted action.

760- `agent_message`: carries an encrypted message from one agent to another.

761 

762The `call_id` field links each `multi_agent_call` to its corresponding `multi_agent_call_output`.

763 

764Each item also includes an `agent` attribute. For an `agent_message`, `agent.agent_name` identifies the recipient agent. Use `author` and `recipient` to trace the message direction.

765 

766When your application receives a `multi_agent_call`, do not execute it as a function call or send back a result. The Responses API executes the hosted action and returns the corresponding `multi_agent_call_output`. Preserve both items if your application needs them for replay or tracing.

767 

768```json

769[

770 {

771 "type": "multi_agent_call",

772 "id": "mac_123",

773 "call_id": "call_spawn_a",

774 "action": "spawn_agent",

775 "arguments": "{\"task_name\":\"agent_a\",\"fork_turns\":\"all\",\"message\":\"enc_...\"}",

776 "agent": { "agent_name": "/root" }

777 },

778 {

779 "type": "multi_agent_call_output",

780 "id": "maco_123",

781 "call_id": "call_spawn_a",

782 "action": "spawn_agent",

783 "output": [

784 {

785 "type": "output_text",

786 "text": "{\"task_name\":\"/root/agent_a\"}",

787 "annotations": [],

788 "logprobs": []

789 }

790 ],

791 "agent": { "agent_name": "/root" }

792 },

793 {

794 "type": "agent_message",

795 "id": "amsg_123",

796 "author": "/root/agent_a",

797 "recipient": "/root",

798 "content": [

799 {

800 "type": "encrypted_content",

801 "encrypted_content": "enc_..."

802 }

803 ],

804 "agent": { "agent_name": "/root" }

805 }

806]

807```

808 

809Agent-attributed SSE events include a top-level `agent` attribute. For an `agent_message` event, `agent.agent_name` identifies the recipient agent. Response lifecycle events such as `response.created` and `response.completed` describe the overall response rather than an individual agent, so they do not include an `agent` attribute.

810 

811```json

812{

813 "type": "response.output_item.done",

814 "agent": { "agent_name": "/root" },

815 "item": {

816 "type": "agent_message",

817 "id": "amsg_123",

818 "author": "/root/agent_a",

819 "recipient": "/root",

820 "content": [

821 {

822 "type": "encrypted_content",

823 "encrypted_content": "enc_..."

824 }

825 ],

826 "agent": { "agent_name": "/root" }

827 }

828}

829```

830 

831## Limitations

832 

8331. Compaction:

834 1. The `/responses/compact` endpoint is not supported when Multi-agent is enabled.

835 2. When `multi_agent.enabled` is set to `true`, automatic server-side compaction is enabled implicitly, even if the request does not configure `context_management`. Compaction is applied independently to the root agent and each subagent, preserving their separate contexts. Users can still override `compact_threshold` by setting an explicit `context_management.compact_threshold` in the request.

8362. `reasoning.summary` is not supported when Multi-agent is enabled.

8373. `max_tool_calls` is not supported when Multi-agent is enabled.

8384. `max_concurrent_subagents` defaults to `3`, which is the recommended setting.

839 

840## Prompt guidance

841 

842When Multi-agent is enabled, our systems automatically append these instructions to the root agent and subagents as a new developer message. You cannot edit or remove these instructions, but you should frame your developer instructions as additive to these automatically injected instructions.

843 

844### Root agent

845 

846````text

847You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.

848 

849At the start of your turn, you are the active agent.

850You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents.

851All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools.

852 

853You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task and trigger a turn, and `send_message` to pass a message to a running agent without triggering a turn.

854Child agents can also spawn their own sub-agents.

855You can decide how much context you want to propagate to your sub-agents with the `fork_turns` parameter.

856 

857You will receive messages in the form:

858```

859Message Type: MESSAGE | FINAL_ANSWER

860Task name: <recipient>

861Sender: <author>

862Payload:

863<payload text>

864```

865They may be addressed as to=/root

866 

867There are {max_concurrent_subagents + 1} available concurrency slots, meaning that up to {max_concurrent_subagents + 1} agents can be active at once, including you.

868````

869 

870### Subagent

871 

872````text

873You are an agent in a team of agents collaborating to complete a task.

874 

875You can spawn sub-agents to handle subtasks, and those sub-agents can spawn their own sub-agents. All agents in the team, including the agents that you can assign tasks to, are equally intelligent and capable, and have access to the same set of tools.

876 

877You can use `spawn_agent` to create a new agent, `followup_task` to give an existing agent a new task and trigger a turn, and `send_message` to pass a message to a running agent.

878Child agents can also spawn their own sub-agents.

879 

880When you provide a response in the final channel, that content is immediately delivered back to your parent agent.

881 

882You will receive messages in the form:

883```

884Message Type: NEW_TASK | MESSAGE | FINAL_ANSWER

885Task name: <recipient>

886Sender: <author>

887Payload:

888<payload text>

889```

890You may also see them addressed as to=/root/..., which indicates your identity is /root/...

891 

892There are {max_concurrent_subagents + 1} available concurrency slots, meaning that up to {max_concurrent_subagents + 1} agents can be active at once, including you.

893````

894 

895## Related guides

896 

897- [Function calling](https://developers.openai.com/api/docs/guides/function-calling)

898- [WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode)

899- [Compaction](https://developers.openai.com/api/docs/guides/compaction)

Details

1# Programmatic Tool Calling

2 

3Programmatic Tool Calling lets a model write and run JavaScript that coordinates the tools in a Responses API request. A program can call tools in parallel, use loops and conditions, and keep intermediate results in the hosted runtime. This is useful when a task needs a sequence of related tool calls or needs to process large tool outputs before returning a result.

4 

5Your application decides whether Programmatic Tool Calling is available and which eligible tools the model can call directly, from a program, or either way. It continues to run any client-owned tool calls.

6 

7Check the [model page](https://developers.openai.com/api/docs/models) before enabling Programmatic Tool Calling.

8 

9## Understand the runtime environment

10 

11OpenAI runs each generated program in a fresh, isolated V8 runtime. The runtime supports JavaScript with top-level `await`, but it does not provide Node.js, package installation, direct network access, a general-purpose filesystem, subprocess execution, a console, or persistent JavaScript state between program executions. Programs can interact with external systems only through tools enabled in the request and can emit output with `text(...)` or `image(...)`.

12 

13Programmatic Tool Calling supports Zero Data Retention (ZDR) workflows without requiring a persistent code-execution container. ZDR must be enabled for the organization or project; setting `store: false` enables stateless continuation but does not enable ZDR by itself. Eligibility and retention depend on the complete request, including its model, tools, and third-party services; see [data controls](https://developers.openai.com/api/docs/guides/your-data).

14 

15## Choose when to use Programmatic Tool Calling

16 

17Use Programmatic Tool Calling when a stage has predictable control flow and code can return a smaller structured result. Use direct tool calling when one call is sufficient, each result requires fresh model judgment, or the work requires approval or preservation of citations or native artifacts.

18 

19| Task shape | Recommended mode |

20| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |

21| A single lookup or action | Use direct tool calling. |

22| Several results that code can filter, join, rank, remove duplicates from, aggregate, or validate | Use Programmatic Tool Calling when the program can return a smaller structured result. |

23| Dependent calls with predictable data flow | Use Programmatic Tool Calling when code can derive later arguments and the limits and failure behavior are explicit. |

24| Adaptive search or semantic evaluation | Use direct tool calling when each result should influence the model's next decision. |

25| Writes or approval-sensitive actions | Use direct tool calling by default to preserve a clear authorization boundary. |

26| Final citation or native artifact validation | Use direct tool calling unless the program preserves the native output and validates every required item. |

27 

28## Configure Programmatic Tool Calling

29 

30Add the `programmatic_tool_calling` hosted tool to the request. Then set `allowed_callers` on each eligible tool that the program can invoke.

31 

32Enable Programmatic Tool Calling

33 

34```json

35[

36 {

37 "type": "function",

38 "name": "get_inventory",

39 "description": "Return an object with sku (string) and available_units (number).",

40 "parameters": {

41 "type": "object",

42 "properties": {

43 "sku": { "type": "string" }

44 },

45 "required": ["sku"],

46 "additionalProperties": false

47 },

48 "output_schema": {

49 "type": "object",

50 "properties": {

51 "sku": { "type": "string" },

52 "available_units": { "type": "number" }

53 },

54 "required": ["sku", "available_units"],

55 "additionalProperties": false

56 },

57 "allowed_callers": ["programmatic"]

58 },

59 {

60 "type": "programmatic_tool_calling"

61 }

62]

63```

64 

65 

66`allowed_callers` controls how the model can invoke a tool:

67 

68| Value | Behavior |

69| ---------------------------- | ------------------------------------------------------- |

70| Omitted or `["direct"]` | The model can call the tool directly. |

71| `["programmatic"]` | Only code in a `program` item can call the tool. |

72| `["direct", "programmatic"]` | The model can call the tool directly or from a program. |

73 

74`parameters` describes the function arguments. When a function returns predictable structured data, `output_schema` describes the JSON object encoded in its `function_call_output.output` string. Define both so generated JavaScript can use the returned fields reliably.

75 

76### Supported tools

77 

78The following tool types support `allowed_callers: ["programmatic"]`:

79 

80- `function` and `custom`

81- `mcp`

82- `apply_patch`

83- Local and hosted `shell`

84- `code_interpreter`

85 

86For MCP tools, the tool's `require_approval` policy can pause the program until you approve the call.

87 

88For OpenAI-hosted tools, review the tool's data-retention and security guidance before enabling it in a program.

89 

90### Combine with tool search

91 

92[Tool search](https://developers.openai.com/api/docs/guides/tools-tool-search) runs as a top-level Responses API tool, not from inside generated JavaScript. Function, custom, and MCP tools with `defer_loading: true` are not initially available to a program. After the model loads a matching tool, a later program can invoke it through `tools.*` when its `allowed_callers` includes `"programmatic"`. An already-running program cannot invoke tool search, so the model must load deferred tools before starting a program that needs them.

93 

94## Guide routing when both modes are available

95 

96When your application lets the model call a function directly or from a program, assign each route to a specific workflow stage. Generic instructions such as "use Programmatic Tool Calling efficiently" don't identify the intended boundary. For example:

97 

98```text

99<tool_orchestration>

100Use Programmatic Tool Calling for [bounded stage] using only [eligible tools].

101Run independent calls concurrently when safe. Use only documented tool input

102and output fields.

103 

104Process and reduce the intermediate results, then emit exactly [program result shape],

105including the evidence needed for the final answer.

106 

107Stop when [condition] is met. Retry transient failures at most [R] times.

108Do not repeat completed calls or perform side-effecting actions. If a required

109result is still missing, return a clear structured failure.

110 

111Use direct tool calls for [semantic judgment, approval, or final validation].

112</tool_orchestration>

113```

114 

115Here is an example of how to use this template:

116 

117```text

118<tool_orchestration>

119Use Programmatic Tool Calling to compare inventory with demand for sku_123

120using only get_inventory and get_demand. Run both calls concurrently. Use

121only documented tool input and output fields.

122 

123Process and reduce the intermediate results, then emit exactly one JSON object

124with sku, available_units, requested_units, and shortage_units, where

125shortage_units is max(requested_units - available_units, 0). Include

126available_units and requested_units as evidence for the calculation.

127 

128Stop when both tool results contain the required fields. Retry transient

129failures at most 1 time. Do not repeat completed calls or perform

130side-effecting actions. If a required result is still missing, return a clear

131structured failure.

132 

133Use direct tool calls only for approval before any inventory-changing action.

134</tool_orchestration>

135```

136 

137For workflows that need both modes, define one handoff and avoid switching routes or repeating work. If a safe fallback exists, define it once and limit its retries.

138 

139## Understand program response items

140 

141Each API call still returns the standard [Responses API object](https://developers.openai.com/api/reference/resources/responses/methods/create). Programmatic Tool Calling doesn't introduce a separate response envelope. When the model uses Programmatic Tool Calling, the response's `output` array can contain:

142 

143- A `program` item containing the generated JavaScript, a `call_id`, and an opaque `fingerprint` used to resume or replay the program.

144- A `function_call` item made by the program. It has its own `call_id`, which your application uses to return the function result. Its `caller.caller_id` matches the program's `call_id`.

145- A `program_output` item containing the program's final result and status. Its `call_id` matches the program's `call_id`, and its `status` is `completed` or `incomplete`.

146 

147These are separate top-level items in `response.output`; the `caller` field records their execution relationship.

148 

149For example, a program can pause while your application runs `get_inventory` and `get_demand`:

150 

151Program and nested function calls

152 

153```json

154[

155 {

156 "type": "program",

157 "id": "prog_123",

158 "call_id": "call_prog_123",

159 "code": "const [stock, demand] = await Promise.all([tools.get_inventory({ sku: 'sku_123' }), tools.get_demand({ sku: 'sku_123' })]); text(JSON.stringify({ sku: stock.sku, available_units: stock.available_units, requested_units: demand.requested_units, shortage_units: Math.max(demand.requested_units - stock.available_units, 0) }));",

160 "fingerprint": "opaque_replay_state"

161 },

162 {

163 "type": "function_call",

164 "id": "fc_123",

165 "call_id": "call_inventory_123",

166 "name": "get_inventory",

167 "arguments": "{\\"sku\\":\\"sku_123\\"}",

168 "caller": {

169 "type": "program",

170 "caller_id": "call_prog_123"

171 }

172 },

173 {

174 "type": "function_call",

175 "id": "fc_456",

176 "call_id": "call_demand_123",

177 "name": "get_demand",

178 "arguments": "{\\"sku\\":\\"sku_123\\"}",

179 "caller": {

180 "type": "program",

181 "caller_id": "call_prog_123"

182 }

183 }

184]

185```

186 

187 

188These examples show only the relevant items from `response.output`; they omit the surrounding standard Responses object. After your application returns the nested function results, a later response can contain the complete `program_output` item:

189 

190Program output

191 

192```json

193{

194 "type": "program_output",

195 "id": "prog_out_123",

196 "call_id": "call_prog_123",

197 "result": "{\\"sku\\":\\"sku_123\\",\\"available_units\\":42,\\"requested_units\\":31,\\"shortage_units\\":0}",

198 "status": "completed"

199}

200```

201 

202 

203The JSON string in `program_output.result` follows the program result shape from your instructions. The surrounding `program_output` item follows the API contract shown above. These are separate contracts. A final `message` can arrive with the program output or in a later response, so continue until you receive that message.

204 

205OpenAI runs the model-generated JavaScript in the hosted runtime. Your application executes returned client-owned function calls; it does not execute the generated JavaScript.

206 

207Return the function result as a `function_call_output`. Copy `caller` from the function call without changing it. The service uses that value to resume the correct program.

208 

209## Continue after client-owned function calls

210 

211A program can pause more than once as it reaches client-owned tools. Continue until the response contains a final assistant message:

212 

2131. Send the request with the hosted tool and functions that allow programmatic calls.

2141. Run every returned client-owned function call.

2151. Return each function result with the original `call_id` and `caller`.

2161. Handle an incomplete response before continuing.

2171. If the response contains no pending `function_call` items and no final `message` item, continue from that response. With `store: false`, replay its output items; for a stored response, use `previous_response_id`.

2181. Stop when the response contains a final `message` item. Read `response.output_text` or the message's refusal content.

219 

220The following example uses `store: false`, preserves every response item, and returns each function result to the program:

221 

222Run a programmatic tool-calling loop

223 

224```javascript

225import OpenAI from "openai";

226 

227const client = new OpenAI();

228 

229const implementations = {

230 get_inventory: async ({ sku }) => ({ sku, available_units: 42 }),

231 get_demand: async ({ sku }) => ({ sku, requested_units: 31 }),

232};

233 

234const tools = [

235 {

236 type: "function",

237 name: "get_inventory",

238 description:

239 "Return an object with sku (string) and available_units (number).",

240 parameters: {

241 type: "object",

242 properties: { sku: { type: "string" } },

243 required: ["sku"],

244 additionalProperties: false,

245 },

246 output_schema: {

247 type: "object",

248 properties: {

249 sku: { type: "string" },

250 available_units: { type: "number" },

251 },

252 required: ["sku", "available_units"],

253 additionalProperties: false,

254 },

255 allowed_callers: ["programmatic"],

256 },

257 {

258 type: "function",

259 name: "get_demand",

260 description:

261 "Return an object with sku (string) and requested_units (number).",

262 parameters: {

263 type: "object",

264 properties: { sku: { type: "string" } },

265 required: ["sku"],

266 additionalProperties: false,

267 },

268 output_schema: {

269 type: "object",

270 properties: {

271 sku: { type: "string" },

272 requested_units: { type: "number" },

273 },

274 required: ["sku", "requested_units"],

275 additionalProperties: false,

276 },

277 allowed_callers: ["programmatic"],

278 },

279 { type: "programmatic_tool_calling" },

280];

281 

282const input = [

283 {

284 role: "user",

285 content: "Compare inventory with demand for sku_123.",

286 },

287];

288 

289while (true) {

290 const response = await client.responses.create({

291 model: "YOUR_MODEL_ID",

292 store: false,

293 input,

294 tools,

295 include: ["reasoning.encrypted_content"],

296 });

297 

298 if (response.status !== "completed") {

299 throw new Error(`Response ended with status ${response.status}`);

300 }

301 

302 // Preserve every output item, including program and reasoning items.

303 input.push(...response.output);

304 

305 const calls = response.output.filter(

306 (item) => item.type === "function_call",

307 );

308 

309 if (calls.length === 0) {

310 const message = response.output.find((item) => item.type === "message");

311 if (message) {

312 const refusal = message.content.find((part) => part.type === "refusal");

313 console.log(response.output_text || refusal?.refusal || "");

314 break;

315 }

316 continue;

317 }

318 

319 const outputs = await Promise.all(

320 calls.map(async (call) => {

321 const run = implementations[call.name];

322 if (!run) throw new Error(`Unknown tool: ${call.name}`);

323 

324 const result = await run(JSON.parse(call.arguments));

325 return {

326 type: "function_call_output",

327 call_id: call.call_id,

328 output: JSON.stringify(result),

329 // Preserve caller so the runtime can resume the correct program.

330 caller: call.caller,

331 };

332 }),

333 );

334 

335 input.push(...outputs);

336}

337```

338 

339```python

340import json

341from openai import OpenAI

342 

343client = OpenAI()

344 

345 

346def get_inventory(sku):

347 return {"sku": sku, "available_units": 42}

348 

349 

350def get_demand(sku):

351 return {"sku": sku, "requested_units": 31}

352 

353 

354implementations = {

355 "get_inventory": get_inventory,

356 "get_demand": get_demand,

357}

358 

359tools = [

360 {

361 "type": "function",

362 "name": "get_inventory",

363 "description": "Return an object with sku (string) and available_units (number).",

364 "parameters": {

365 "type": "object",

366 "properties": {"sku": {"type": "string"}},

367 "required": ["sku"],

368 "additionalProperties": False,

369 },

370 "output_schema": {

371 "type": "object",

372 "properties": {

373 "sku": {"type": "string"},

374 "available_units": {"type": "number"},

375 },

376 "required": ["sku", "available_units"],

377 "additionalProperties": False,

378 },

379 "allowed_callers": ["programmatic"],

380 },

381 {

382 "type": "function",

383 "name": "get_demand",

384 "description": "Return an object with sku (string) and requested_units (number).",

385 "parameters": {

386 "type": "object",

387 "properties": {"sku": {"type": "string"}},

388 "required": ["sku"],

389 "additionalProperties": False,

390 },

391 "output_schema": {

392 "type": "object",

393 "properties": {

394 "sku": {"type": "string"},

395 "requested_units": {"type": "number"},

396 },

397 "required": ["sku", "requested_units"],

398 "additionalProperties": False,

399 },

400 "allowed_callers": ["programmatic"],

401 },

402 {"type": "programmatic_tool_calling"},

403]

404 

405input_items = [

406 {

407 "role": "user",

408 "content": "Compare inventory with demand for sku_123.",

409 }

410]

411 

412while True:

413 response = client.responses.create(

414 model="YOUR_MODEL_ID",

415 store=False,

416 input=input_items,

417 tools=tools,

418 include=["reasoning.encrypted_content"],

419 )

420 

421 if response.status != "completed":

422 raise RuntimeError(f"Response ended with status {response.status}")

423 

424 # Preserve every output item, including program and reasoning items.

425 input_items.extend(

426 item.model_dump(exclude_none=True) for item in response.output

427 )

428 

429 calls = [item for item in response.output if item.type == "function_call"]

430 if not calls:

431 message = next((item for item in response.output if item.type == "message"), None)

432 if message:

433 refusal = next(

434 (part.refusal for part in message.content if part.type == "refusal"),

435 "",

436 )

437 print(response.output_text or refusal)

438 break

439 continue

440 

441 for call in calls:

442 run = implementations.get(call.name)

443 if run is None:

444 raise ValueError(f"Unknown tool: {call.name}")

445 

446 result = run(**json.loads(call.arguments))

447 input_items.append(

448 {

449 "type": "function_call_output",

450 "call_id": call.call_id,

451 "output": json.dumps(result),

452 # Preserve caller so the runtime can resume the correct program.

453 "caller": call.caller.model_dump() if call.caller else None,

454 }

455 )

456```

457 

458 

459When you store responses, you can continue from `previous_response_id` instead of resending all earlier response items. Send the new `function_call_output` items as the next input. With `store: false`, replay the complete sequence in order, including every `program`, reasoning, function-call, function-call-output, and `program_output` item.

460 

461For stateless reasoning-model requests, include `reasoning.encrypted_content` and replay the returned reasoning items. See [conversation state](https://developers.openai.com/api/docs/guides/conversation-state#manually-manage-conversation-state) for the general stateless pattern.

462 

463## Design tools for programs

464 

465- Return structured, compact data that JavaScript can inspect without parsing prose.

466- Use `output_schema` to define each tool's expected return fields and types, and document its error behavior. If the return shape isn't known in advance, keep the tool direct so the model can inspect the result.

467- Define the exact program result shape and required evidence. Return a clear structured failure when the program can't produce a valid result.

468- Make function calls idempotent when possible. A retry or replay shouldn't repeat an unsafe side effect.

469- Check arguments and permissions for each call in your application, even when it comes from a hosted program.

470- Give tools specific names and descriptions so the model can compose them correctly.

471- Require application-level approval before high-impact actions, regardless of the caller.

472 

473{/* vale Vale.Terms = NO */}

474 

475## Evaluate Programmatic Tool Calling

476 

477Programmatic Tool Calling can reduce the amount of intermediate tool output added to model context, but the effect depends on the task and tool responses. Start with direct tool calling as a baseline, then compare both approaches on representative tasks.

478 

479Define the final-answer quality bar and required evidence before measuring efficiency. Evaluate token use and tool calls alongside correctness, completeness, and evidence coverage, and make any accepted quality tradeoff explicit.

480 

481{/* vale Vale.Terms = YES */}

482 

483Measure:

484 

485- Final-answer correctness, completeness, and evidence coverage.

486- Input and total tokens, end-to-end latency, and cost.

487- Model turns, tool calls, retries, and recovery behavior.

488- Safety outcomes, especially for side effects and approval requirements.

489- Whether the route that ran matched the intended workflow stage.

490 

491## Related guides

492 

493- Use [function calling](https://developers.openai.com/api/docs/guides/function-calling) to define client-owned functions.

494- Use [tool search](https://developers.openai.com/api/docs/guides/tools-tool-search) to defer large tool definitions until a model needs them.

495- Use [conversation state](https://developers.openai.com/api/docs/guides/conversation-state) to continue stored or stateless Responses API requests.

496- Review [data controls](https://developers.openai.com/api/docs/guides/your-data) before choosing a storage mode.

Details

26 -H "Content-Type: application/json" \26 -H "Content-Type: application/json" \

27 -H "Authorization: Bearer $OPENAI_API_KEY" \27 -H "Authorization: Bearer $OPENAI_API_KEY" \

28 -d '{28 -d '{

29 "model": "gpt-5.5",29 "model": "gpt-5.6",

30 "tools": [30 "tools": [

31 { "type": "shell", "environment": { "type": "container_auto" } }31 { "type": "shell", "environment": { "type": "container_auto" } }

32 ],32 ],


49const client = new OpenAI();49const client = new OpenAI();

50 50 

51const response = await client.responses.create({51const response = await client.responses.create({

52 model: "gpt-5.5",52 model: "gpt-5.6",

53 tools: [{ type: "shell", environment: { type: "container_auto" } }],53 tools: [{ type: "shell", environment: { type: "container_auto" } }],

54 input: [54 input: [

55 {55 {


75client = OpenAI()75client = OpenAI()

76 76 

77response = client.responses.create(77response = client.responses.create(

78 model="gpt-5.5",78 model="gpt-5.6",

79 tools=[{"type": "shell", "environment": {"type": "container_auto"}}],79 tools=[{"type": "shell", "environment": {"type": "container_auto"}}],

80 input=[80 input=[

81 {81 {


171 -H "Content-Type: application/json" \171 -H "Content-Type: application/json" \

172 -H "Authorization: Bearer $OPENAI_API_KEY" \172 -H "Authorization: Bearer $OPENAI_API_KEY" \

173 -d '{173 -d '{

174 "model": "gpt-5.5",174 "model": "gpt-5.6",

175 "tools": [175 "tools": [

176 {176 {

177 "type": "shell",177 "type": "shell",


191const client = new OpenAI();191const client = new OpenAI();

192 192 

193const response = await client.responses.create({193const response = await client.responses.create({

194 model: "gpt-5.5",194 model: "gpt-5.6",

195 tools: [195 tools: [

196 {196 {

197 type: "shell",197 type: "shell",


213client = OpenAI()213client = OpenAI()

214 214 

215response = client.responses.create(215response = client.responses.create(

216 model="gpt-5.5",216 model="gpt-5.6",

217 tools=[217 tools=[

218 {218 {

219 "type": "shell",219 "type": "shell",


300 -H "Authorization: Bearer $OPENAI_API_KEY" \300 -H "Authorization: Bearer $OPENAI_API_KEY" \

301 -H "Content-Type: application/json" \301 -H "Content-Type: application/json" \

302 -d '{302 -d '{

303 "model": "gpt-5.5",303 "model": "gpt-5.6",

304 "tool_choice": "required",304 "tool_choice": "required",

305 "tools": [305 "tools": [

306 {306 {


329const client = new OpenAI();329const client = new OpenAI();

330 330 

331const response = await client.responses.create({331const response = await client.responses.create({

332 model: "gpt-5.5",332 model: "gpt-5.6",

333 tool_choice: "required",333 tool_choice: "required",

334 tools: [334 tools: [

335 {335 {


361client = OpenAI()361client = OpenAI()

362 362 

363response = client.responses.create(363response = client.responses.create(

364 model="gpt-5.5",364 model="gpt-5.6",

365 tool_choice="required",365 tool_choice="required",

366 tools=[366 tools=[

367 {367 {


445 -H "Content-Type: application/json" \445 -H "Content-Type: application/json" \

446 -H "Authorization: Bearer $OPENAI_API_KEY" \446 -H "Authorization: Bearer $OPENAI_API_KEY" \

447 -d '{447 -d '{

448 "model": "gpt-5.5",448 "model": "gpt-5.6",

449 "tools": [449 "tools": [

450 {450 {

451 "type": "shell",451 "type": "shell",


500});500});

501 501 

502const response = await client.responses.create({502const response = await client.responses.create({

503 model: "gpt-5.5",503 model: "gpt-5.6",

504 tools: [504 tools: [

505 {505 {

506 type: "shell",506 type: "shell",


560)560)

561 561 

562response = client.responses.create(562response = client.responses.create(

563 model="gpt-5.5",563 model="gpt-5.6",

564 tools=[564 tools=[

565 {565 {

566 "type": "shell",566 "type": "shell",


651 -H "Authorization: Bearer $OPENAI_API_KEY" \651 -H "Authorization: Bearer $OPENAI_API_KEY" \

652 -H "Content-Type: application/json" \652 -H "Content-Type: application/json" \

653 -d '{653 -d '{

654 "model": "gpt-5.5",654 "model": "gpt-5.6",

655 "input": [655 "input": [

656 {656 {

657 "role": "user",657 "role": "user",


687const client = new OpenAI();687const client = new OpenAI();

688 688 

689const response = await client.responses.create({689const response = await client.responses.create({

690 model: "gpt-5.5",690 model: "gpt-5.6",

691 input: [691 input: [

692 {692 {

693 role: "user",693 role: "user",


726client = OpenAI()726client = OpenAI()

727 727 

728response = client.responses.create(728response = client.responses.create(

729 model="gpt-5.5",729 model="gpt-5.6",

730 input=[730 input=[

731 {731 {

732 "role": "user",732 "role": "user",


770 -H "Content-Type: application/json" \770 -H "Content-Type: application/json" \

771 -H "Authorization: Bearer $OPENAI_API_KEY" \771 -H "Authorization: Bearer $OPENAI_API_KEY" \

772 -d '{772 -d '{

773 "model": "gpt-5.5",773 "model": "gpt-5.6",

774 "previous_response_id": "resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",774 "previous_response_id": "resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",

775 "tools": [775 "tools": [

776 {776 {


791const client = new OpenAI();791const client = new OpenAI();

792 792 

793const response = await client.responses.create({793const response = await client.responses.create({

794 model: "gpt-5.5",794 model: "gpt-5.6",

795 previous_response_id: "resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",795 previous_response_id: "resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",

796 tools: [796 tools: [

797 {797 {


814client = OpenAI()814client = OpenAI()

815 815 

816response = client.responses.create(816response = client.responses.create(

817 model="gpt-5.5",817 model="gpt-5.6",

818 previous_response_id="resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",818 previous_response_id="resp_2a8e5c9174d63b0f18a4c572de9f64a1b3c76d508e12f9ab47",

819 tools=[819 tools=[

820 {820 {


868 -H "Content-Type: application/json" \868 -H "Content-Type: application/json" \

869 -H "Authorization: Bearer $OPENAI_API_KEY" \869 -H "Authorization: Bearer $OPENAI_API_KEY" \

870 -d '{870 -d '{

871 "model": "gpt-5.5",871 "model": "gpt-5.6",

872 "instructions": "The local bash shell environment is on Mac.",872 "instructions": "The local bash shell environment is on Mac.",

873 "input": "find me the largest pdf file in ~/Documents",873 "input": "find me the largest pdf file in ~/Documents",

874 "tools": [{ "type": "shell", "environment": { "type": "local" } }]874 "tools": [{ "type": "shell", "environment": { "type": "local" } }]


881client = OpenAI()881client = OpenAI()

882 882 

883response = client.responses.create(883response = client.responses.create(

884 model="gpt-5.5",884 model="gpt-5.6",

885 instructions="The local bash shell environment is on Mac.",885 instructions="The local bash shell environment is on Mac.",

886 input="find me the largest pdf file in ~/Documents",886 input="find me the largest pdf file in ~/Documents",

887 tools=[{"type": "shell", "environment": {"type": "local"}}],887 tools=[{"type": "shell", "environment": {"type": "local"}}],


896const client = new OpenAI();896const client = new OpenAI();

897 897 

898const response = await client.responses.create({898const response = await client.responses.create({

899 model: "gpt-5.5",899 model: "gpt-5.6",

900 instructions: "The local bash shell environment is on Mac.",900 instructions: "The local bash shell environment is on Mac.",

901 input: "find me the largest pdf file in ~/Documents",901 input: "find me the largest pdf file in ~/Documents",

902 tools: [{ type: "shell", environment: { type: "local" } }],902 tools: [{ type: "shell", environment: { type: "local" } }],


1042 1042 

1043const agent = new Agent({1043const agent = new Agent({

1044 name: "Shell Assistant",1044 name: "Shell Assistant",

1045 model: "gpt-5.5",1045 model: "gpt-5.6",

1046 instructions:1046 instructions:

1047 "You can execute shell commands to inspect the repository. Keep responses concise and include command output when helpful.",1047 "You can execute shell commands to inspect the repository. Keep responses concise and include command output when helpful.",

1048 tools: [1048 tools: [


1098 1098 

1099agent = Agent(1099agent = Agent(

1100 name="Shell Assistant",1100 name="Shell Assistant",

1101 model="gpt-5.5",1101 model="gpt-5.6",

1102 instructions="You can execute shell commands to inspect the repository. Keep responses concise and include command output when helpful.",1102 instructions="You can execute shell commands to inspect the repository. Keep responses concise and include command output when helpful.",

1103 tools=[shell_tool],1103 tools=[shell_tool],

1104)1104)

Details

66 -H "Content-Type: application/json" \66 -H "Content-Type: application/json" \

67 -H "Authorization: Bearer $OPENAI_API_KEY" \67 -H "Authorization: Bearer $OPENAI_API_KEY" \

68 -d '{68 -d '{

69 "model": "gpt-5.5",69 "model": "gpt-5.6",

70 "tools": [70 "tools": [

71 {71 {

72 "type": "shell",72 "type": "shell",


89const client = new OpenAI();89const client = new OpenAI();

90 90 

91const response = await client.responses.create({91const response = await client.responses.create({

92 model: "gpt-5.5",92 model: "gpt-5.6",

93 tools: [93 tools: [

94 {94 {

95 type: "shell",95 type: "shell",


114client = OpenAI()114client = OpenAI()

115 115 

116response = client.responses.create(116response = client.responses.create(

117 model="gpt-5.5",117 model="gpt-5.6",

118 tools=[118 tools=[

119 {119 {

120 "type": "shell",120 "type": "shell",


154 -H "Content-Type: application/json" \154 -H "Content-Type: application/json" \

155 -H "Authorization: Bearer $OPENAI_API_KEY" \155 -H "Authorization: Bearer $OPENAI_API_KEY" \

156 -d '{156 -d '{

157 "model": "gpt-5.5",157 "model": "gpt-5.6",

158 "tools": [158 "tools": [

159 {159 {

160 "type": "shell",160 "type": "shell",


180const client = new OpenAI();180const client = new OpenAI();

181 181 

182const response = await client.responses.create({182const response = await client.responses.create({

183 model: "gpt-5.5",183 model: "gpt-5.6",

184 tools: [184 tools: [

185 {185 {

186 type: "shell",186 type: "shell",


208client = OpenAI()208client = OpenAI()

209 209 

210response = client.responses.create(210response = client.responses.create(

211 model="gpt-5.5",211 model="gpt-5.6",

212 tools=[212 tools=[

213 {213 {

214 "type": "shell",214 "type": "shell",

Details

82 82 

83- replace the model string with `gpt-5.4`83- replace the model string with `gpt-5.4`

84- add one or two targeted prompt blocks84- add one or two targeted prompt blocks

85- read [Prompt guidance for GPT-5.4](https://developers.openai.com/api/docs/guides/prompt-guidance) to choose the smallest prompt changes that recover the old behavior85- read [Prompting best practices for GPT-5.4](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.4#prompting-best-practices) to choose the smallest prompt changes that recover the old behavior

86- avoid broad prompt cleanup unrelated to the upgrade86- avoid broad prompt cleanup unrelated to the upgrade

87- for research workflows, default to `research_mode` + `citation_rules` + `empty_result_handling`; add `tool_persistence_rules` when the host already uses retrieval tools87- for research workflows, default to `research_mode` + `citation_rules` + `empty_result_handling`; add `tool_persistence_rules` when the host already uses retrieval tools

88- for dependency-aware or tool-heavy workflows, default to `tool_persistence_rules` + `dependency_checks` + `verification_loop`; add `parallel_tool_calling` only when retrieval steps are truly independent88- for dependency-aware or tool-heavy workflows, default to `tool_persistence_rules` + `dependency_checks` + `verification_loop`; add `parallel_tool_calling` only when retrieval steps are truly independent

Details

90- replace the model string with `gpt-5.5`90- replace the model string with `gpt-5.5`

91- preserve the current reasoning effort for the first pass91- preserve the current reasoning effort for the first pass

92- make only the smallest prompt edits needed for the observed workflow risk92- make only the smallest prompt edits needed for the observed workflow risk

93- read the [GPT-5.5 prompting guide](https://developers.openai.com/api/docs/guides/prompt-guidance?model=gpt-5.5) to choose the smallest prompt changes that recover or improve behavior93- read the [GPT-5.5 prompting best practices](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.5#prompting-best-practices) to choose the smallest prompt changes that recover or improve behavior

94- avoid broad prompt cleanup unrelated to the upgrade94- avoid broad prompt cleanup unrelated to the upgrade

95- for research workflows, add citation rules, retrieval budgets, missing-evidence behavior, and validation guidance from the prompting guide95- for research workflows, add citation rules, retrieval budgets, missing-evidence behavior, and validation guidance from the prompting guide

96- for dependency-aware or tool-heavy workflows, add prerequisite checks, missing-context handling, explicit tool budgets, stop conditions, and validation guidance96- for dependency-aware or tool-heavy workflows, add prerequisite checks, missing-context handling, explicit tool budgets, stop conditions, and validation guidance

Details

1# Upgrading to GPT-5.6 Sol

2 

3# Upgrading to GPT-5.6 Sol

4 

5Use this guide when the user asks to migrate an existing OpenAI API integration, repository, prompt stack, agent, model router, or model picker to GPT-5.6 Sol or the GPT-5.6 family.

6 

7The default explicit target is `gpt-5.6-sol`. The alias `gpt-5.6` routes to Sol; use it only when the repository intentionally prefers family aliases. Do not treat every old model usage as a Sol candidate: GPT-5.6 is a family with different cost, latency, context, and quality roles.

8 

9Before changing code, use the OpenAI Docs MCP to fetch the current live GPT-5.6 model guidance:

10 

11/api/docs/guides/latest-model?model=gpt-5.6

12 

13For prompt changes, also read only the `## Prompting Best Practices` section from:

14 

15/api/docs/guides/latest-model?model=gpt-5.6#prompting-best-practices

16 

17Treat live docs as canonical for current model IDs, parameters, limits, pricing, and feature availability. This file supplies migration judgment: where to look, what can break, what to preserve, what not to adopt automatically, and how to validate the result.

18 

19## Core principle

20 

21Do not perform a blind model-string replacement.

22 

23First preserve the behavior, latency class, cost class, reasoning level, endpoint contract, tool semantics, cache behavior, and output contract of each usage site. Then make the smallest safe migration. Adopt new GPT-5.6 capabilities only when they solve a measured problem or the user explicitly asks for them.

24 

25A model upgrade alone does not authorize adding reasoning fields, changing request schemas, or rewriting tests. Only add explicit reasoning when the old effective behavior is established and omission would change behavior on GPT-5.6.

26 

27The main 5.6 migration hazards are:

28 

29- choosing Sol for workloads that were intentionally mini, nano, low-cost, or latency-sensitive;

30- inheriting 5.6's default `medium` reasoning where the old effective effort was `none`;

31- using Chat Completions with function tools without explicitly setting effective reasoning to `none`;

32- losing prompt-cache hits when a stable prefix is followed by a changing suffix;

33- increasing image or PDF input tokens because omitted or `auto` detail behaves differently;

34- applying new cache, persisted-reasoning, Pro, Programmatic Tool Calling, or multi-agent fields to routes that do not support them;

35- updating model strings but forgetting registries, allowlists, pricing metadata, capability flags, tests, and UI model pickers.

36 

37## Migration posture

38 

39Classify every usage site before editing:

40 

411. `simple Sol migration`

42 - One flagship model usage.

43 - Same endpoint and request shape can remain.

44 - Reasoning effort is explicit or its old effective value is known.

45 - No cache, vision, file, tool, or parser behavior needs implementation changes.

462. `tier-aware family migration`

47 - The repository exposes multiple model roles, model choices, fallbacks, routers, pricing data, or capability metadata.

48 - Map each role to Sol, Terra, or Luna instead of replacing everything with Sol.

493. `compatibility migration`

50 - The safe move requires parameter, endpoint, cache, state, tool-loop, or multimodal-detail changes.

51 - Make these changes only when implementation work is inside the user's requested scope. Otherwise report the exact blocker and smallest follow-up.

524. `prompt migration`

53 - The API shape can remain, but representative traces show a prompt-specific regression.

54 - Make a surgical prompt edit tied to that failure; do not rewrite a working prompt stack wholesale.

55 - When the task is to update prompting guidance, edit the directly tied prompt surface only. Do not modify runtime request code, model schemas, or tests unless the prompt change requires it.

565. `optional feature adoption`

57 - Pro mode, persisted reasoning, explicit caching, Programmatic Tool Calling, or multi-agent behavior is being added deliberately.

58 - Keep this separate from the baseline migration so its effect can be measured.

596. `leave unchanged`

60 - Historical examples, documentation about old models, snapshots, fixtures, eval baselines, comparison code, intentionally pinned fallbacks, unsupported providers, or ambiguous usages.

61 

62When intent is unclear, prefer leaving a usage unchanged and list it for confirmation over silently changing its role.

63 

64## Inventory before editing

65 

66Search for more than literal model IDs. Inventory:

67 

68- model strings, aliases, environment variables, CLI flags, config defaults, and deployment settings;

69- SDK calls to Responses, Chat Completions, Batch, or provider adapters;

70- reasoning settings, token budgets, sampling settings, and latency timeouts;

71- function tools, hosted tools, structured outputs, response parsers, and replay logic;

72- system, developer, user, and tool-description prompts tied to each usage;

73- routers, fallbacks, model allowlists, enums, regexes, validation schemas, and capability maps;

74- model picker UI, display labels, descriptions, context limits, pricing metadata, and provider catalogs;

75- prompt-cache keys, retention options, stable-prefix construction, and cache metrics;

76- image, PDF, file, OCR, and computer-use inputs;

77- tests, fixtures, snapshots, evals, analytics labels, billing tables, and docs.

78 

79When changing a default model, search every active default surface: runtime config, environment/config files, setup docs, tests, CLI defaults, and deployment examples. Update them together.

80 

81For each usage site, record:

82 

83- source model and why it appears to be used;

84- endpoint and SDK/client surface;

85- prompt surface;

86- effective reasoning effort, including defaults;

87- latency, cost, context, and quality role;

88- tools, structured outputs, caching, state replay, and multimodal inputs;

89- downstream parsers or user-visible contracts;

90- migration class and validation plan.

91 

92## Choose the target model by role

93 

94Use this as a starting map, then validate against the repository's workload:

95 

96| Existing role | Starting GPT-5.6 target | Reason |

97| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -------------------------------------------------------------- |

98| Unsuffixed GPT-5 flagship, GPT-5.5, or GPT-5.4 flagship | `gpt-5.6-sol` | Sol is the flagship-equivalent tier. |

99| Mini model, balanced lower-cost route, or medium-throughput worker | `gpt-5.6-terra` | Terra is the mini-like tier. |

100| Nano model, classification, extraction, routing, high-volume, or strict-latency route | `gpt-5.6-luna` | Luna is the nano-like tier. |

101| GPT-4.1 or GPT-4o latency-sensitive flow | Evaluate Luna and Terra first; use Sol only if quality requires it | A flagship replacement can change latency and cost materially. |

102| Reasoning-heavy or hardest quality-first flow | Start with Sol at the old effective effort | Preserve the reasoning contract before tuning. |

103| Old Pro usage | Sol plus `reasoning.mode: "pro"`, only if the user wants Pro behavior | GPT-5.6 Pro is a mode, not a separate model slug. |

104| Router, fallback, or model picker | Add the family by role | Do not collapse a multi-model design into Sol. |

105| Third-party or provider-specific model | Leave unchanged unless the user explicitly requests provider migration | Model-name similarity is not a safe mapping. |

106 

107Important limits to check in live docs:

108 

109- Sol and Terra have roughly 1.05M context and 128K maximum output.

110- Luna has a smaller 400K context and 128K maximum output.

111- Sol and Terra long-context requests above 272K input tokens can change pricing for the full request.

112 

113Do not invent prices, limits, or capability flags. Fetch them from current docs before updating a registry or UI.

114 

115For model pickers and registries, preserve existing model entries by default. Add GPT-5.6 Sol, Terra, and Luna as new options unless the user explicitly asks to replace or remove older models. Do not invent pricing, context limits, capabilities, or metadata unless confirmed from canonical docs.

116 

117If using the `gpt-5.6` alias, record the returned `response.model` during validation. Do not assume an alias and an explicit Sol slug appear identically in dashboards, rate-limit configuration, analytics, or billing metadata.

118 

119## Preserve effective reasoning before tuning

120 

121GPT-5.6 supports `none`, `low`, `medium`, `high`, `xhigh`, and `max`. If omitted, GPT-5.6 defaults to `medium`.

122 

123This is a behavioral migration hazard:

124 

125- GPT-5.5 commonly defaulted to `medium`.

126- GPT-5.4, mini, and nano usages commonly defaulted to `none`.

127- A previously omitted setting can therefore become slower, more expensive, and incompatible with Chat Completions function tools after the model swap.

128 

129For each usage:

130 

1311. If effort is explicit, preserve it for the first 5.6 run when supported.

1322. If effort is omitted and the old effective default is known, add it explicitly only when GPT-5.6's omitted default would change behavior. If both old and new omitted defaults are the same, keep it omitted.

1333. If the old effective value is unknown, do not guess. Flag it and compare the old behavior with 5.6 at the likely baseline.

1344. After the baseline passes, test the same setting and one lower on representative tasks.

1355. Use `xhigh` or `max` only for hard quality-first workloads where evals show a meaningful gain.

136 

137Do not globally recommend `max`. Before increasing effort, check whether the actual failure is a missing success criterion, dependency rule, tool-routing rule, state-replay bug, or validation loop.

138 

139Use the field shape that belongs to the endpoint.

140 

141Responses:

142 

143```json

144{

145 "model": "gpt-5.6-sol",

146 "reasoning": { "effort": "none" }

147}

148```

149 

150Chat Completions:

151 

152```json

153{

154 "model": "gpt-5.6-sol",

155 "reasoning_effort": "none"

156}

157```

158 

159## Chat Completions and function tools

160 

161This is the most important endpoint-specific check.

162 

163For GPT-5.6, function tools in Chat Completions are compatible only with effective reasoning `none`. Reasoning with tools should use the Responses API.

164 

165Because GPT-5.6 defaults to `medium`, this combination is unsafe:

166 

167```json

168{

169 "model": "gpt-5.6-luna",

170 "tools": [{ "type": "function", "function": { "...": "..." } }]

171}

172```

173 

174For a latency-sensitive Chat Completions flow that must keep function tools, explicitly preserve `none`:

175 

176```json

177{

178 "model": "gpt-5.6-luna",

179 "reasoning_effort": "none",

180 "tools": [{ "type": "function", "function": { "...": "..." } }]

181}

182```

183 

184If the application needs both reasoning and tools:

185 

186- migrate that flow to Responses when implementation changes are in scope;

187- otherwise report it as a compatibility blocker;

188- do not hide the incompatibility by removing tools, dropping required reasoning, or changing the workload's behavior without approval.

189 

190If the live API rejects the intended `none` path, treat it as a current API compatibility issue and report the exact request and error rather than inventing a workaround.

191 

192## Responses API and conversation state

193 

194Prefer Responses for reasoning, tools, multi-turn agents, and new 5.6 capabilities.

195 

196For ordinary multi-turn Responses calls, preserve the repository's existing state strategy. Do not add persisted reasoning merely because it exists.

197 

198If deliberately enabling persisted reasoning:

199 

200- use `reasoning.context: "all_turns"` only when the objective and assumptions remain stable;

201- prefer `previous_response_id` when the server can carry state;

202- when replaying manually, preserve every prior user input and every relevant output item, not only assistant text;

203- with `store: false` or ZDR, request and replay `reasoning.encrypted_content`;

204- use current-turn behavior when old reasoning may be stale or misleading.

205 

206For manual replay, preserve item types, IDs, call IDs, caller metadata, and assistant phase values exactly. Incomplete replay can silently reduce quality or break tool continuation.

207 

208## Prompt caching

209 

210Do not assume old cache-hit behavior survives the model swap.

211 

212GPT-5.6 implicit caching places a managed breakpoint near the latest user or tool message and no longer relies on 128-token rounding. A prompt with a large stable prefix followed by a changing suffix can therefore lose cache hits even when the stable prefix itself has not changed.

213 

214Audit:

215 

216- large reusable system/developer prompts;

217- dynamic suffixes appended to otherwise stable prompts;

218- changing timestamps, request IDs, user-specific values, or tool lists in the prefix;

219- cache keys, retention settings, and cache dashboards;

220- token accounting that assumes reads only and ignores writes.

221 

222Migration rules:

223 

224- keep reusable prefixes stable;

225- do not churn large system prompts unnecessarily;

226- compare old and new `cached_tokens`, `cache_write_tokens`, latency, and cost;

227- use explicit cache breakpoints only when a measured workload has a stable boundary that implicit caching misses;

228- do not globally convert every prompt to explicit caching;

229- do not send 5.6-only cache fields to older routes in a mixed-model system.

230 

231When old and GPT-5.6 routes share a request builder, isolate GPT-5.6-only fields instead of applying them globally.

232 

233The new top-level request shape uses `prompt_cache_options`, for example:

234 

235```json

236{

237 "prompt_cache_options": {

238 "mode": "explicit",

239 "ttl": "30m"

240 }

241}

242```

243 

244Place explicit breakpoints at the actual stable rendered boundary using `prompt_cache_breakpoint`. Preserve `prompt_cache_key` when the application already uses it. Treat the older `prompt_cache_retention` shape as deprecated and verify the live docs before rewriting it.

245 

246Cache writes cost more than ordinary uncached input, so a lower hit rate can be both slower and more expensive.

247 

248## Images, PDFs, files, and long context

249 

250GPT-5.6 can change token and latency behavior without any prompt change:

251 

252- for image inputs, omitted or `auto` image detail can preserve original dimensions;

253- for PDF/file inputs in Responses, omitted or `input_file.detail: "auto"` can use high page-image detail;

254- Chat Completions file inputs do not expose the same detail control;

255- long-context Sol and Terra requests can cross pricing thresholds;

256- Luna's smaller context can break workloads that fit in Sol or Terra.

257 

258For multimodal or long-context usages:

259 

2601. Measure input tokens and latency before and after.

2612. Make detail explicit when cost or latency matters.

2623. Resize images or use lower detail when the task does not need original spatial precision.

2634. Keep original/high detail for dense, coordinate-sensitive, OCR, localization, or visual-inspection tasks where it materially improves quality.

2645. Test worst-case context lengths, not only typical requests.

265 

266Do not claim a capability was removed based only on a missing metadata flag. Verify against current docs and a representative request.

267 

268## Structured outputs, parsers, and tool contracts

269 

270Keep output contracts explicit:

271 

272- preserve JSON schemas, required fields, enums, refusal handling, and parser expectations;

273- preserve tool names, parameter schemas, call IDs, and retry behavior;

274- keep citations, evidence fields, or native artifacts when downstream consumers require them;

275- validate that the final answer still satisfies the contract, not merely that a tool call succeeded.

276 

277Do not fix a failing migration by weakening a schema, deleting required behavior, removing routes, dropping tools, or changing business logic unless the user explicitly asked for that product change.

278 

279## Optional: Pro mode

280 

281Do not enable Pro mode during a baseline migration unless the old usage was Pro-like or the user explicitly asks for it.

282 

283GPT-5.6 Pro uses the base model with a reasoning mode:

284 

285```json

286{

287 "model": "gpt-5.6-sol",

288 "reasoning": {

289 "mode": "pro",

290 "effort": "medium"

291 }

292}

293```

294 

295Rules:

296 

297- use Responses, not Chat Completions;

298- do not search for or invent a separate `gpt-5.6-pro` slug;

299- supported Pro efforts begin at `medium`;

300- mode and effort are separate decisions;

301- compare task quality, total latency, and actual billed token usage against standard mode.

302 

303If migrating a legacy Pro slug, make the mode change explicit and evaluate it separately from ordinary Sol migration.

304 

305## Optional: Programmatic Tool Calling

306 

307Programmatic Tool Calling is not a required part of moving to GPT-5.6. Add it only when code can reduce large structured intermediate results before they return to model context.

308 

309Good candidates:

310 

311- bounded read-only filtering, joining, sorting, ranking, deduplication, and aggregation;

312- batching many similar records;

313- repeated deterministic validation;

314- map-reduce style retrieval with a compact result schema.

315 

316Poor candidates:

317 

318- one direct tool call;

319- adaptive workflows where each result changes the next decision;

320- write, approval, or side-effecting flows;

321- citation-heavy or native-artifact flows;

322- semantic judgment that should remain visible to the model.

323 

324Request-shape requirements:

325 

326```json

327{

328 "tools": [

329 { "type": "programmatic_tool_calling" },

330 {

331 "type": "function",

332 "name": "lookup_records",

333 "allowed_callers": ["programmatic"]

334 }

335 ]

336}

337```

338 

339Do not nest `programmatic_tool_calling` under another `tools` property. When enabled, the host must handle `program`, program-issued `function_call`, `function_call_output`, and `program_output` items. Preserve the original `call_id` and `caller` when returning function results.

340 

341Constrain the stage, eligible read-only tools, output schema, retry limit, and handoff back to direct judgment. Validate the final user-visible answer; a correct program result can still become an incorrect final answer.

342 

343## Optional: multi-agent beta

344 

345Do not enable multi-agent behavior during a baseline migration unless the application already has a clear parallelizable workflow and the user asks for it.

346 

347Enabling it requires:

348 

349- the `OpenAI-Beta: responses_multi_agent=v1` header;

350- `multi_agent: { "enabled": true, "max_concurrent_subagents": 3 }`;

351- handling `multi_agent_call`, `multi_agent_call_output`, and `agent_message` items;

352- executing ordinary developer-defined function calls from any agent and returning all required outputs;

353- preserving new items for replay and tracing;

354- checking incompatibilities with compaction, reasoning summaries, and tool-call limits in current docs.

355 

356Cap concurrency. Do not let a migration task create unbounded subagents, duplicate work, or finish without a final synthesis.

357 

358## Prompt migration judgment

359 

360After the model and API baseline is working, run representative traces before editing prompts. Change prompts only for measured failures.

361 

362For GPT-5.6, prefer:

363 

364- shorter, outcome-oriented prompts;

365- explicit success criteria, dependencies, stopping conditions, and completion boundaries;

366- preserved user-provided values;

367- decision criteria for implicit choices instead of universal defaults or keyword maps;

368- explicit autonomy and permission boundaries;

369- explicit tool routing, resource links, breadcrumbs, and expected tool choice;

370- staged plans, current-layer awareness, and concise handoffs for long work;

371- real validation before declaring completion.

372 

373Avoid:

374 

375- generic `be brief`, `be thorough`, or `think step by step` instructions;

376- blanket language instructions that can cause unwanted language switching;

377- repeating `ask first` until safe local work becomes blocked;

378- giant prompt rewrites that make the source of a regression impossible to identify;

379- telling the model to minimize tool loops when correctness, evidence, or required validation needs more work.

380 

381For coding or agentic migrations, add concrete preservation and verification rules:

382 

383```

384Preserve existing functionality, routes, outputs, and user-visible behavior.

385Do not delete or disable required behavior merely to make the build pass.

386Before finishing, run the relevant build, tests, type checks, render or smoke

387checks, and report the evidence.

388```

389 

390For long-running work, define the current layer: research, design, implementation, review, or external coordination. Do not let the model silently move to another layer.

391 

392## Upgrade workflow

393 

3941. Fetch current live 5.6 docs and the Prompting Best Practices section.

3952. Inventory every usage site and its adjacent prompt, config, registry, parser, and test surfaces.

3963. Classify each usage by role and migration class.

3974. Choose Sol, Terra, or Luna by the existing workload's role.

3985. Preserve the old effective reasoning effort explicitly.

3996. Run the compatibility gates:

400 - endpoint and SDK support;

401 - Chat Completions plus function tools;

402 - cache topology and cache fields;

403 - context length and long-context cost;

404 - image, PDF, and file detail;

405 - structured outputs and parsers;

406 - Responses state replay and tool continuation;

407 - mixed-model routing and unsupported new fields.

4087. Apply the smallest safe model, config, registry, and prompt changes.

4098. Do not add optional Pro, persisted reasoning, PTC, explicit caching, or multi-agent behavior unless needed and measurable.

4109. Run existing tests and representative evals.

41110. Report changed, unchanged, blocked, and confirmation-needed sites separately.

412 

413## Validation matrix

414 

415Prefer a controlled comparison:

416 

4171. old model + old prompt + old settings;

4182. GPT-5.6 target + same prompt + preserved effective reasoning;

4193. GPT-5.6 target + same prompt + one lower effort;

4204. GPT-5.6 target + the smallest prompt or API fix required by a measured failure;

4215. optional feature treatment, isolated from the baseline.

422 

423Measure what matters for the workflow:

424 

425- task success and user-visible quality;

426- structured-output validity and parser success;

427- tool choice, tool arguments, retries, loop count, and completion rate;

428- TTFT, end-to-end latency, timeout rate, and concurrency behavior;

429- input, output, reasoning, cached, and cache-write tokens;

430- cost per successful task;

431- long-context, compaction, and replay behavior;

432- image/PDF token use and visual/OCR accuracy;

433- completeness, preserved behavior, citations, and validation evidence.

434 

435For model routers and pickers, test at least one representative workload for each role. Verify that the cheapest or fastest tier is not accidentally used for quality-critical work and that Sol is not accidentally used for every workload.

436 

437## Required final report

438 

439Return:

440 

441- `Current usage inventory`: each model site, endpoint, role, prompt surface, and old effective reasoning.

442- `Target mapping`: Sol, Terra, Luna, unchanged, or confirmation-needed, with the reason.

443- `Changes made`: model strings, reasoning settings, prompts, registries, metadata, tests, and API-shape changes.

444- `Compatibility checks`: Chat Completions/tools, caching, state replay, multimodal detail, context/cost, schemas, and mixed-model routing.

445- `Prompt changes`: each surgical edit and the failure mode it addresses.

446- `Validation`: commands, evals, traces, before/after measurements, and remaining gaps.

447- `Unchanged sites`: historical, pinned, ambiguous, or intentionally role-specific usages.

448- `Blockers and open questions`: exact issue, why it is unsafe to guess, and the smallest next step.

449 

450Never say the migration is complete merely because model strings changed. It is complete only when the affected behavior and contracts have been validated or the remaining gaps are stated explicitly.

Details

88agent = Agent(88agent = Agent(

89 name="Assistant",89 name="Assistant",

90 instructions="You are a helpful voice assistant.",90 instructions="You are a helpful voice assistant.",

91 model="gpt-5.5",91 model="gpt-5.6",

92 tools=[get_weather],92 tools=[get_weather],

93)93)

94 94 

Details

96-H "Content-Type: application/json" \96-H "Content-Type: application/json" \

97-H "Authorization: Bearer $OPENAI_API_KEY" \97-H "Authorization: Bearer $OPENAI_API_KEY" \

98-d '{98-d '{

99 "model": "gpt-5.5",99 "model": "gpt-5.6",

100 "input": "Write a very long novel about otters in space.",100 "input": "Write a very long novel about otters in space.",

101 "background": true101 "background": true

102}'102}'


107const client = new OpenAI();107const client = new OpenAI();

108 108 

109const resp = await client.responses.create({109const resp = await client.responses.create({

110 model: "gpt-5.5",110 model: "gpt-5.6",

111 input: "Write a very long novel about otters in space.",111 input: "Write a very long novel about otters in space.",

112 background: true,112 background: true,

113});113});


121client = OpenAI()121client = OpenAI()

122 122 

123resp = client.responses.create(123resp = client.responses.create(

124 model="gpt-5.5",124 model="gpt-5.6",

125 input="Write a very long novel about otters in space.",125 input="Write a very long novel about otters in space.",

126 background=True,126 background=True,

127)127)

Details

30 json.dumps(30 json.dumps(

31 {31 {

32 "type": "response.create",32 "type": "response.create",

33 "model": "gpt-5.5",33 "model": "gpt-5.6",

34 "store": False,34 "store": False,

35 "input": [35 "input": [

36 {36 {


60 json.dumps(60 json.dumps(

61 {61 {

62 "type": "response.create",62 "type": "response.create",

63 "model": "gpt-5.5",63 "model": "gpt-5.6",

64 "store": False,64 "store": False,

65 "previous_response_id": "resp_123",65 "previous_response_id": "resp_123",

66 "input": [66 "input": [


112```python112```python

113# Compact your current window (HTTP call)113# Compact your current window (HTTP call)

114compacted = client.responses.compact(114compacted = client.responses.compact(

115 model="gpt-5.5",115 model="gpt-5.6",

116 input=long_input_items_array,116 input=long_input_items_array,

117)117)

118 118 


121 json.dumps(121 json.dumps(

122 {122 {

123 "type": "response.create",123 "type": "response.create",

124 "model": "gpt-5.5",124 "model": "gpt-5.6",

125 "store": False,125 "store": False,

126 "input": [126 "input": [

127 *compacted.output,127 *compacted.output,

Details

205});205});

206 206 

207const response = await client.responses.create({207const response = await client.responses.create({

208 model: "gpt-5.4-mini",208 model: "gpt-5.6-terra",

209 input: "Say hello from AWS outbound workload identity federation.",209 input: "Say hello from AWS outbound workload identity federation.",

210});210});

211 211 


248)248)

249 249 

250response = client.responses.create(250response = client.responses.create(

251 model="gpt-5.4-mini",251 model="gpt-5.6-terra",

252 input="Say hello from AWS outbound workload identity federation.",252 input="Say hello from AWS outbound workload identity federation.",

253)253)

254 254 


494client = OpenAI::Client.new(workload_identity: workload_identity)494client = OpenAI::Client.new(workload_identity: workload_identity)

495 495 

496response = client.responses.create(496response = client.responses.create(

497 model: "gpt-5.4-mini",497 model: "gpt-5.6-terra",

498 input: "Say hello from AWS outbound workload identity federation."498 input: "Say hello from AWS outbound workload identity federation."

499)499)

500 500 


679});679});

680 680 

681const response = await client.responses.create({681const response = await client.responses.create({

682 model: "gpt-5.4-mini",682 model: "gpt-5.6-terra",

683 input: "Say hello from AWS workload identity federation.",683 input: "Say hello from AWS workload identity federation.",

684});684});

685 685 


715)715)

716 716 

717response = client.responses.create(717response = client.responses.create(

718 model="gpt-5.4-mini",718 model="gpt-5.6-terra",

719 input="Say hello from AWS workload identity federation.",719 input="Say hello from AWS workload identity federation.",

720)720)

721 721 


925client = OpenAI::Client.new(workload_identity: workload_identity)925client = OpenAI::Client.new(workload_identity: workload_identity)

926 926 

927response = client.responses.create(927response = client.responses.create(

928 model: "gpt-5.4-mini",928 model: "gpt-5.6-terra",

929 input: "Say hello from AWS workload identity federation."929 input: "Say hello from AWS workload identity federation."

930)930)

931 931 

Details

223});223});

224 224 

225const response = await client.responses.create({225const response = await client.responses.create({

226 model: "gpt-5.4-mini",226 model: "gpt-5.6-terra",

227 input: "Say hello from GitHub Actions workload identity federation.",227 input: "Say hello from GitHub Actions workload identity federation.",

228});228});

229 229 


278)278)

279 279 

280response = client.responses.create(280response = client.responses.create(

281 model="gpt-5.4-mini",281 model="gpt-5.6-terra",

282 input="Say hello from GitHub Actions workload identity federation.",282 input="Say hello from GitHub Actions workload identity federation.",

283)283)

284 284 


596client = OpenAI::Client.new(workload_identity: workload_identity)596client = OpenAI::Client.new(workload_identity: workload_identity)

597 597 

598response = client.responses.create(598response = client.responses.create(

599 model: "gpt-5.4-mini",599 model: "gpt-5.6-terra",

600 input: "Say hello from GitHub Actions workload identity federation."600 input: "Say hello from GitHub Actions workload identity federation."

601)601)

602 602 

Details

166});166});

167 167 

168const response = await client.responses.create({168const response = await client.responses.create({

169 model: "gpt-5.4-mini",169 model: "gpt-5.6-terra",

170 input: "Say hello from Google Cloud workload identity federation.",170 input: "Say hello from Google Cloud workload identity federation.",

171});171});

172 172 


214)214)

215 215 

216response = client.responses.create(216response = client.responses.create(

217 model="gpt-5.4-mini",217 model="gpt-5.6-terra",

218 input="Say hello from Google Cloud workload identity federation.",218 input="Say hello from Google Cloud workload identity federation.",

219)219)

220 220 


513client = OpenAI::Client.new(workload_identity: workload_identity)513client = OpenAI::Client.new(workload_identity: workload_identity)

514 514 

515response = client.responses.create(515response = client.responses.create(

516 model: "gpt-5.4-mini",516 model: "gpt-5.6-terra",

517 input: "Say hello from Google Cloud workload identity federation."517 input: "Say hello from Google Cloud workload identity federation."

518)518)

519 519 


704});704});

705 705 

706const response = await client.responses.create({706const response = await client.responses.create({

707 model: "gpt-5.4-mini",707 model: "gpt-5.6-terra",

708 input: "Say hello from Google GKE workload identity federation.",708 input: "Say hello from Google GKE workload identity federation.",

709});709});

710 710 


740)740)

741 741 

742response = client.responses.create(742response = client.responses.create(

743 model="gpt-5.4-mini",743 model="gpt-5.6-terra",

744 input="Say hello from Google GKE workload identity federation.",744 input="Say hello from Google GKE workload identity federation.",

745)745)

746 746 


950client = OpenAI::Client.new(workload_identity: workload_identity)950client = OpenAI::Client.new(workload_identity: workload_identity)

951 951 

952response = client.responses.create(952response = client.responses.create(

953 model: "gpt-5.4-mini",953 model: "gpt-5.6-terra",

954 input: "Say hello from Google GKE workload identity federation."954 input: "Say hello from Google GKE workload identity federation."

955)955)

956 956 

Details

169});169});

170 170 

171const response = await client.responses.create({171const response = await client.responses.create({

172 model: "gpt-5.4-mini",172 model: "gpt-5.6-terra",

173 input: "Say hello from Kubernetes workload identity federation.",173 input: "Say hello from Kubernetes workload identity federation.",

174});174});

175 175 


205)205)

206 206 

207response = client.responses.create(207response = client.responses.create(

208 model="gpt-5.4-mini",208 model="gpt-5.6-terra",

209 input="Say hello from Kubernetes workload identity federation.",209 input="Say hello from Kubernetes workload identity federation.",

210)210)

211 211 


415client = OpenAI::Client.new(workload_identity: workload_identity)415client = OpenAI::Client.new(workload_identity: workload_identity)

416 416 

417response = client.responses.create(417response = client.responses.create(

418 model: "gpt-5.4-mini",418 model: "gpt-5.6-terra",

419 input: "Say hello from Kubernetes workload identity federation."419 input: "Say hello from Kubernetes workload identity federation."

420)420)

421 421 

Details

176});176});

177 177 

178const response = await client.responses.create({178const response = await client.responses.create({

179 model: "gpt-5.4-mini",179 model: "gpt-5.6-terra",

180 input: "Say hello from Azure managed identity workload identity federation.",180 input: "Say hello from Azure managed identity workload identity federation.",

181});181});

182 182 


232)232)

233 233 

234response = client.responses.create(234response = client.responses.create(

235 model="gpt-5.4-mini",235 model="gpt-5.6-terra",

236 input="Say hello from Azure managed identity workload identity federation.",236 input="Say hello from Azure managed identity workload identity federation.",

237)237)

238 238 


541client = OpenAI::Client.new(workload_identity: workload_identity)541client = OpenAI::Client.new(workload_identity: workload_identity)

542 542 

543response = client.responses.create(543response = client.responses.create(

544 model: "gpt-5.4-mini",544 model: "gpt-5.6-terra",

545 input: "Say hello from Azure managed identity workload identity federation."545 input: "Say hello from Azure managed identity workload identity federation."

546)546)

547 547 


741});741});

742 742 

743const response = await client.responses.create({743const response = await client.responses.create({

744 model: "gpt-5.4-mini",744 model: "gpt-5.6-terra",

745 input: "Say hello from AKS workload identity federation.",745 input: "Say hello from AKS workload identity federation.",

746});746});

747 747 


777)777)

778 778 

779response = client.responses.create(779response = client.responses.create(

780 model="gpt-5.4-mini",780 model="gpt-5.6-terra",

781 input="Say hello from AKS workload identity federation.",781 input="Say hello from AKS workload identity federation.",

782)782)

783 783 


987client = OpenAI::Client.new(workload_identity: workload_identity)987client = OpenAI::Client.new(workload_identity: workload_identity)

988 988 

989response = client.responses.create(989response = client.responses.create(

990 model: "gpt-5.4-mini",990 model: "gpt-5.6-terra",

991 input: "Say hello from AKS workload identity federation."991 input: "Say hello from AKS workload identity federation."

992)992)

993 993 

Details

198});198});

199 199 

200const response = await client.responses.create({200const response = await client.responses.create({

201 model: "gpt-5.4-mini",201 model: "gpt-5.6-terra",

202 input: "Say hello from SPIFFE workload identity federation.",202 input: "Say hello from SPIFFE workload identity federation.",

203});203});

204 204 


234)234)

235 235 

236response = client.responses.create(236response = client.responses.create(

237 model="gpt-5.4-mini",237 model="gpt-5.6-terra",

238 input="Say hello from SPIFFE workload identity federation.",238 input="Say hello from SPIFFE workload identity federation.",

239)239)

240 240 


444client = OpenAI::Client.new(workload_identity: workload_identity)444client = OpenAI::Client.new(workload_identity: workload_identity)

445 445 

446response = client.responses.create(446response = client.responses.create(

447 model: "gpt-5.4-mini",447 model: "gpt-5.6-terra",

448 input: "Say hello from SPIFFE workload identity federation."448 input: "Say hello from SPIFFE workload identity federation."

449)449)

450 450 

Details

8 8 

9When using the OpenAI API, data may be stored as:9When using the OpenAI API, data may be stored as:

10 10 

11- **Abuse monitoring logs:** Logs generated from your use of the platform, necessary for OpenAI to enforce our [Usage Policies](https://openai.com/policies/usage-policies) and mitigate harmful uses of AI.11- **Abuse monitoring logs:** Logs generated from your use of the platform, necessary for OpenAI to enforce our [Usage Policies](https://openai.com/policies/usage-policies) and agreements and mitigate harmful uses of AI.

12- **Application state:** Data persisted from some API features in order to fulfill the task or request.12- **Application state:** Data persisted from some API features in order to fulfill the task or request.

13 13 

14## Data retention controls for abuse monitoring14## Data retention controls for abuse monitoring


33 33 

34Besides those specific behavior changes, the endpoints and capabilities listed as No for Zero Data Retention Eligible in the table below may still store application state, even if Zero Data Retention is enabled.34Besides those specific behavior changes, the endpoints and capabilities listed as No for Zero Data Retention Eligible in the table below may still store application state, even if Zero Data Retention is enabled.

35 35 

36### Eyes Off

37 

38For customers approved for Zero Data Retention or Modified Abuse Monitoring, we reserve the right to make models ineligible for Zero Data Retention or Modified Abuse Monitoring for specific customers, as notified in advance to the impacted customers in writing. In this instance, customer content will be retained in abuse monitoring logs, but such content will be excluded from human review unless required by applicable law. For customers who have executed an OpenAI Business Associate and Healthcare Addendum, once your org ID is provisioned with Eyes Off, BAA-eligible endpoints can be used for processing PHI, even if data is retained.

39 

36### Safety Retention40### Safety Retention

37 41 

38We reserve the right to make `gpt-5.5`, `gpt-5.5-pro`, and future models ineligible for Zero Data Retention or Modified Abuse Monitoring for specific customers if reasonably necessary to investigate severe risk activity, as notified in advance to the impacted customers in writing. In this instance, we may retain customer content when using these models that our classifiers detect as potentially violating our [Usage Policies](https://openai.com/policies/usage-policies/). Otherwise retention will not be affected.42For customers approved for Zero Data Retention or Modified Abuse Monitoring, we reserve the right to make models ineligible for Zero Data Retention or Modified Abuse Monitoring for specific customers if reasonably necessary to investigate or prevent severe risk activity, as notified in advance to the impacted customers in writing. In this instance, we may retain and human review customer content when using these models that our classifiers detect as potentially violating our [Usage Policies](https://openai.com/policies/usage-policies/) or your agreement. Otherwise retention will not be affected. For customers who have executed an OpenAI Business Associate and Healthcare Addendum, once your org ID is provisioned with Safety Retention, BAA-eligible endpoints can be used for processing PHI, even if data is retained.

39 43 

40### Configuring data retention controls44### Configuring data retention controls

41 45 


48 52 

49The table below indicates when application state is stored for each endpoint. Zero Data Retention eligible endpoints do not retain any customer content for application state, subject to the limitations below. Zero Data Retention ineligible endpoints or capabilities may retain application state when used, even if you have Zero Data Retention enabled.53The table below indicates when application state is stored for each endpoint. Zero Data Retention eligible endpoints do not retain any customer content for application state, subject to the limitations below. Zero Data Retention ineligible endpoints or capabilities may retain application state when used, even if you have Zero Data Retention enabled.

50 54 

51| Endpoint | Data used for training | Abuse monitoring retention | Application state retention | Zero Data Retention eligible |55| Endpoint | Data used for training | Abuse monitoring retention | Application state retention | Zero Data Retention eligible | Eyes Off and Safety Retention eligible |

52| -------------------------- | :--------------------: | :------------------------: | :----------------------------: | :----------------------------: |56| -------------------------- | :--------------------: | :------------------------: | :----------------------------: | :----------------------------: | :------------------------------------: |

53| `/v1/chat/completions` | No | 30 days | None, see below for exceptions | Yes, see below for limitations |57| `/v1/chat/completions` | No | 30 days | None, see below for exceptions | Yes, see below for limitations | Yes, see below for limitations |

54| `/v1/responses` | No | 30 days | None, see below for exceptions | Yes, see below for limitations |58| `/v1/responses` | No | 30 days | None, see below for exceptions | Yes, see below for limitations | Yes, see below for limitations |

55| `/v1/conversations` | No | Until deleted | Until deleted | No |59| `/v1/conversations` | No | Until deleted | Until deleted | No | No |

56| `/v1/conversations/items` | No | Until deleted | Until deleted | No |60| `/v1/conversations/items` | No | Until deleted | Until deleted | No | No |

57| `/v1/chatkit/threads` | No | Until deleted | Until deleted | No |61| `/v1/chatkit/threads` | No | Until deleted | Until deleted | No | No |

58| `/v1/assistants` | No | 30 days | Until deleted | No |62| `/v1/assistants` | No | 30 days | Until deleted | No | No |

59| `/v1/threads` | No | 30 days | Until deleted | No |63| `/v1/threads` | No | 30 days | Until deleted | No | No |

60| `/v1/threads/messages` | No | 30 days | Until deleted | No |64| `/v1/threads/messages` | No | 30 days | Until deleted | No | No |

61| `/v1/threads/runs` | No | 30 days | Until deleted | No |65| `/v1/threads/runs` | No | 30 days | Until deleted | No | No |

62| `/v1/threads/runs/steps` | No | 30 days | Until deleted | No |66| `/v1/threads/runs/steps` | No | 30 days | Until deleted | No | No |

63| `/v1/vector_stores` | No | 30 days | Until deleted | No |67| `/v1/vector_stores` | No | 30 days | Until deleted | No | No |

64| `/v1/images/generations` | No | 30 days | None | Yes, see below for limitations |68| `/v1/images/generations` | No | 30 days | None | Yes, see below for limitations | No |

65| `/v1/images/edits` | No | 30 days | None | Yes, see below for limitations |69| `/v1/images/edits` | No | 30 days | None | Yes, see below for limitations | No |

66| `/v1/images/variations` | No | 30 days | None | Yes, see below for limitations |70| `/v1/images/variations` | No | 30 days | None | Yes, see below for limitations | No |

67| `/v1/embeddings` | No | 30 days | None | Yes |71| `/v1/embeddings` | No | 30 days | None | Yes | No |

68| `/v1/audio/transcriptions` | No | None | None | Yes |72| `/v1/audio/transcriptions` | No | None | None | Yes | No |

69| `/v1/audio/translations` | No | None | None | Yes |73| `/v1/audio/translations` | No | None | None | Yes | No |

70| `/v1/audio/speech` | No | 30 days | None | Yes |74| `/v1/audio/speech` | No | 30 days | None | Yes | No |

71| `/v1/files` | No | 30 days | Until deleted\* | No |75| `/v1/files` | No | 30 days | Until deleted\* | No | No |

72| `/v1/fine_tuning/jobs` | No | 30 days | Until deleted | No |76| `/v1/fine_tuning/jobs` | No | 30 days | Until deleted | No | No |

73| `/v1/evals` | No | 30 days | Until deleted | No |77| `/v1/evals` | No | 30 days | Until deleted | No | No |

74| `/v1/batches` | No | 30 days | Until deleted | No |78| `/v1/batches` | No | 30 days | Until deleted | No | No |

75| `/v1/moderations` | No | None | None | Yes |79| `/v1/moderations` | No | None | None | Yes | No |

76| `/v1/completions` | No | 30 days | None | Yes |80| `/v1/completions` | No | 30 days | None | Yes | No |

77| `/v1/realtime` | No | 30 days | None | Yes |81| `/v1/realtime` | No | 30 days | None | Yes | No |

78| `/v1/videos` | No | 30 days | None | No |82| `/v1/videos` | No | 30 days | None | No | No |

79 83 

80#### `/v1/chat/completions`84#### `/v1/chat/completions`

81 85 

82- Audio outputs application state is stored for 1 hour to enable [multi-turn conversations](https://developers.openai.com/api/docs/guides/audio).86- Audio outputs application state is stored for 1 hour to enable [multi-turn conversations](https://developers.openai.com/api/docs/guides/audio).

83- When Zero Data Retention is enabled for an organization, the `store` parameter will always be treated as `false`, even if the request attempts to set the value to `true`.87- When Zero Data Retention is enabled for an organization, the `store` parameter will always be treated as `false`, even if the request attempts to set the value to `true`.

84- See [image and file inputs](#image-and-file-inputs).88- See [image and file inputs](#image-and-file-inputs).

85- Extended prompt caching requires storing encrypted key/value tensors to GPU-local storage as application state. This data is stored on the local GPU machines and is not retained after the 24 hour data expiration. Requests to gpt-5.5, gpt-5.5-pro, and all future models require extended prompt caching, and setting a prompt_cache_retention value to in_memory will cause a request error. To learn more, see the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).89- Prompt caching may store encrypted key/value tensors in GPU-local storage as application state. This data is stored on the local GPU machines and is not retained after the 24-hour expiration. For `gpt-5.5` and `gpt-5.5-pro`, setting `prompt_cache_retention` to `in_memory` returns an error. For GPT-5.6 models and later model families, `prompt_cache_options.ttl` controls the minimum cache lifetime, not this maximum application-state retention period. To learn more, see the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).

86 90 

87#### `/v1/responses`91#### `/v1/responses`

88 92 


93- See [image and file inputs](#image-and-file-inputs).97- See [image and file inputs](#image-and-file-inputs).

94- MCP servers (used with the [remote MCP server tool](https://developers.openai.com/api/docs/guides/tools-remote-mcp)) are third-party services, and data sent to an MCP server is subject to their data retention policies.98- MCP servers (used with the [remote MCP server tool](https://developers.openai.com/api/docs/guides/tools-remote-mcp)) are third-party services, and data sent to an MCP server is subject to their data retention policies.

95- Hosted containers used by [Hosted Shell](https://developers.openai.com/api/docs/guides/tools-shell#hosted-shell-quickstart) and [Code Interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter) may write temporary application state to the container filesystem (backed by ephemeral block storage) while the container is active. Container data is deleted when the container expires or is explicitly deleted.99- Hosted containers used by [Hosted Shell](https://developers.openai.com/api/docs/guides/tools-shell#hosted-shell-quickstart) and [Code Interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter) may write temporary application state to the container filesystem (backed by ephemeral block storage) while the container is active. Container data is deleted when the container expires or is explicitly deleted.

96- Extended prompt caching requires storing encrypted key/value tensors to GPU-local storage as application state. This data is stored on the local GPU machines and is not retained after the 24 hour data expiration. Requests to gpt-5.5, gpt-5.5-pro, and all future models require extended prompt caching, and setting a prompt_cache_retention value to in_memory will cause a request error. To learn more, see the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).100- Prompt caching may store encrypted key/value tensors in GPU-local storage as application state. This data is stored on the local GPU machines and is not retained after the 24-hour expiration. For `gpt-5.5` and `gpt-5.5-pro`, setting `prompt_cache_retention` to `in_memory` returns an error. For GPT-5.6 models and later model families, `prompt_cache_options.ttl` controls the minimum cache lifetime, not this maximum application-state retention period. To learn more, see the [prompt caching guide](https://developers.openai.com/api/docs/guides/prompt-caching#prompt-cache-retention).

97- When Zero Data Retention is not enabled for an organization, all queries use extended prompt caching for all supported models.101- When Zero Data Retention is not enabled for an organization, all queries use extended prompt caching for all supported models.

98- For server-side compaction, no data is retained when `store="false"`.102- For server-side compaction, no data is retained when `store="false"`.

99- We support [Skills](https://developers.openai.com/api/docs/guides/tools-skills) in two form factors, both local execution and hosted container-based execution. Hosted skills follow the same container lifecycle as hosted shell: mounted skills and container files remain available while the container is active and are discarded when the container expires or is deleted.103- We support [Skills](https://developers.openai.com/api/docs/guides/tools-skills) in two form factors, both local execution and hosted container-based execution. Hosted skills follow the same container lifecycle as hosted shell: mounted skills and container files remain available while the container is active and are discarded when the container expires or is deleted.


117 121 

118#### Image and file inputs122#### Image and file inputs

119 123 

120Images and files may be uploaded as inputs to `/v1/responses` (including when using the Computer Use tool), `/v1/chat/completions`, and `/v1/images`. Image and file inputs are scanned for CSAM content upon submission. If the classifier detects potential CSAM content, the image will be retained for manual review, even if Zero Data Retention or Modified Abuse Monitoring is enabled.124Images and files may be uploaded as inputs to `/v1/responses` (including when using the Computer Use tool), `/v1/chat/completions`, and `/v1/images`. Image and file inputs are scanned for CSAM content upon submission. If the classifier detects potential CSAM content, the image will be retained for manual review, even if Zero Data Retention, Modified Abuse Monitoring, or Eyes Off is enabled.

121 125 

122#### Web Search126#### Web Search

123 127 


135 139 

136If you select a region that supports regional processing, as specifically identified below, the services will perform inference for your Customer Content in the selected region as well.140If you select a region that supports regional processing, as specifically identified below, the services will perform inference for your Customer Content in the selected region as well.

137 141 

138Data residency does not apply to system data, which may be processed and stored outside the selected region. System data means account data, metadata, and usage data that do not contain Customer Content, which are collected by the services and used to manage and operate the services, such as account information or profiles of end users that directly access the services (e.g., your personnel), analytics, usage statistics, billing information, support requests, and structured output schema.142Data residency does not apply to system data, which may be processed and stored outside the selected region. System data means account data, metadata, and usage data that do not contain Customer Content, which are collected by the services and used to manage and operate the services, such as account information or profiles of end users that directly access the services (for example, your personnel), analytics, usage statistics, billing information, support requests, and structured output schema.

139 143 

140### Limitations144### Limitations

141 145 

142Data residency does not apply to: (a) any transmission or storage of Customer Content outside of the selected region caused by the location of an End User or Customer’s infrastructure when accessing the services; (b) products, services, or content offered by parties other than OpenAI through the Services; or (c) any data other than Customer Content, such as system data.146Data residency does not apply to: (1) any transmission or storage of Customer Content outside of the selected region caused by the location of an End User or Customer’s infrastructure when accessing the services; (2) products, services, or content offered by parties other than OpenAI through the Services; or (3) any data other than Customer Content, such as system data.

143 147 

144If your selected Region does not support regional processing, as identified below, OpenAI may also process and temporarily store Customer Content outside of the Region to deliver the services.148If your selected Region does not support regional processing, as identified below, OpenAI may also process and temporarily store Customer Content outside of the Region to deliver the services.

145 149 

146### Additional requirements for non-US regions150### Additional requirements for non-US regions

147 151 

148To use data residency with any region other than the United States, you must be approved for abuse monitoring controls, and execute a Zero Data Retention amendment.152To use data residency with any region other than the United States, you must be approved for abuse monitoring controls, and execute a Modified Retention amendment.

149 153 

150Selecting the United Arab Emirates region requires additional approval. Contact [sales](https://openai.com/contact-sales) for assistance.154Selecting the United Arab Emirates region requires additional approval. Contact [sales](https://openai.com/contact-sales) for assistance.

151 155 


168The complete, unfiltered regional support table follows. Model snapshots for each service are listed in **API Endpoint, tool and model support**. When regional processing supports only a subset of snapshots, that subset is included in the processing-services cell.172The complete, unfiltered regional support table follows. Model snapshots for each service are listed in **API Endpoint, tool and model support**. When regional processing supports only a subset of snapshots, that subset is included in the processing-services cell.

169 173 

170| Region | Domain prefix | Regional storage | Regional processing | MAM or ZDR required | Supported modes | Storage services | Processing services |174| Region | Domain prefix | Regional storage | Regional processing | MAM or ZDR required | Supported modes | Storage services | Processing services |

171| ---------------------------- | ------------------- | :--------------: | :-----------------: | :-----------------: | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |175| -------------------------- | ------------------- | :--------------: | :-----------------: | :-----------------: | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

172| United States | `us.api.openai.com` | Yes | Yes | No | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/realtime (legacy previews)`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/realtime (legacy previews)`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`Code Interpreter tool`<br />`File Search`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` |176| United States | `us.api.openai.com` | Yes | Yes | No | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/realtime (legacy previews)`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/realtime (legacy previews)`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`Code Interpreter tool`<br />`File Search`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` |

173| Europe (EEA + Switzerland)\* | `eu.api.openai.com` | Yes | Yes | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`Code Interpreter tool`<br />`File Search`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` |177| Europe (EEA + Switzerland) | `eu.api.openai.com` | Yes | Yes | Yes\*\* | Text, Audio, Voice, Image\* | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/evals`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/realtime`<br />`/v1/realtime/transcription_sessions`<br />`/v1/realtime/translations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`Code Interpreter tool`<br />`File Search`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` |

174| Australia\* | `au.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |178| Australia\* | `au.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |

175| Canada\* | `ca.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |179| Canada\* | `ca.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |

176| Japan\* | `jp.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |180| Japan\* | `jp.api.openai.com` | Yes | No | Yes | Text, Audio, Voice, Image | `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech`<br />`/v1/batches`<br />`/v1/chat/completions`<br />`/v1/embeddings`<br />`/v1/files`<br />`/v1/fine_tuning/jobs`<br />`/v1/images/edits`<br />`/v1/images/generations`<br />`/v1/moderations`<br />`/v1/responses`<br />`/v1/responses File Search`<br />`/v1/responses Web Search`<br />`/v1/vector_stores`<br />`Code Interpreter tool`<br />`File Search`<br />`File Uploads`<br />`Remote MCP server tool`<br />`Scale Tier`<br />`Structured Outputs (excluding schema)`<br />`Supported input modalities` | None |


182 186 

183\* Image support in these regions requires approval for enhanced Zero Data Retention or enhanced Modified Abuse Monitoring.187\* Image support in these regions requires approval for enhanced Zero Data Retention or enhanced Modified Abuse Monitoring.

184 188 

189\*\* Requires Zero Data Retention, Modified Abuse Monitoring, Eyes Off, or Safety Retention.

190 

185#### API Endpoint, tool and model support191#### API Endpoint, tool and model support

186 192 

187| Endpoint or feature | Service | Storage regions | Processing regions | Supported models and snapshots | Regional processing snapshot exceptions | Notes |193| Endpoint or feature | Service | Storage regions | Processing regions | Supported models and snapshots | Regional processing snapshot exceptions | Notes |

188| -------------------------------------------------------------------- | ---------------- | ----------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |194| -------------------------------------------------------------------- | ---------------- | ----------------------------------------- | --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |

189| `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech` | Audio | All listed regions | United States, Europe (EEA + Switzerland) | `tts-1`, `whisper-1`, `gpt-4o-tts`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe` | None | — |195| `/v1/audio/transcriptions, /v1/audio/translations, /v1/audio/speech` | Audio | All listed regions | United States, Europe (EEA + Switzerland) | `tts-1`, `whisper-1`, `gpt-4o-tts`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe` | None | — |

190| `/v1/batches` | Batches | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-5.5-pro-2026-04-23`, `gpt-5.4-pro-2026-03-05`, `gpt-5.2-pro-2025-12-11`, `gpt-5-pro-2025-10-06`, `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5-2025-08-07`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-pro`, `o1-pro-2025-03-19`, `o3-mini-2025-01-31`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | None | — |196| `/v1/batches` | Batches | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-5.5-pro-2026-04-23`, `gpt-5.4-pro-2026-03-05`, `gpt-5.2-pro-2025-12-11`, `gpt-5-pro-2025-10-06`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5-2025-08-07`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-pro`, `o1-pro-2025-03-19`, `o3-mini-2025-01-31`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | None | — |

191| `/v1/chat/completions` | Chat Completions | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-2025-08-07`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-5-chat-latest-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-mini-2025-01-31`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | United Arab Emirates: `gpt-5.2-2025-12-11`, `gpt-4.1-2025-04-14` | — |197| `/v1/chat/completions` | Chat Completions | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-2025-08-07`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-5-chat-latest-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-mini-2025-01-31`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | United Arab Emirates: `gpt-5.2-2025-12-11`, `gpt-4.1-2025-04-14` | — |

192| `/v1/embeddings` | Embeddings | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `text-embedding-3-small`, `text-embedding-3-large`, `text-embedding-ada-002` | United Arab Emirates: `text-embedding-3-small`, `text-embedding-3-large` | — |198| `/v1/embeddings` | Embeddings | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `text-embedding-3-small`, `text-embedding-3-large`, `text-embedding-ada-002` | United Arab Emirates: `text-embedding-3-small`, `text-embedding-3-large` | — |

193| `/v1/evals` | Evals | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | Service-level support | None | — |199| `/v1/evals` | Evals | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

194| `/v1/files` | Files | All listed regions | None | Service-level support | None | — |200| `/v1/files` | Files | All listed regions | None | Service-level support | None | — |


200| `/v1/realtime/transcription_sessions` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-whisper` | None | — |206| `/v1/realtime/transcription_sessions` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-whisper` | None | — |

201| `/v1/realtime/translations` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-translate` | None | — |207| `/v1/realtime/translations` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-translate` | None | — |

202| `/v1/realtime (legacy previews)` | Realtime | United States | United States | `gpt-4o-realtime-preview-2024-12-17`, `gpt-4o-realtime-preview-2024-10-01`, `gpt-4o-mini-realtime-preview-2024-12-17` | None | — |208| `/v1/realtime (legacy previews)` | Realtime | United States | United States | `gpt-4o-realtime-preview-2024-12-17`, `gpt-4o-realtime-preview-2024-10-01`, `gpt-4o-mini-realtime-preview-2024-12-17` | None | — |

203| `/v1/responses` | Responses | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-5.5-pro-2026-04-23`, `gpt-5.4-pro-2026-03-05`, `gpt-5.2-pro-2025-12-11`, `gpt-5-pro-2025-10-06`, `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5-2025-08-07`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-5-chat-latest-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-pro`, `o1-pro-2025-03-19`, `computer-use-preview`, `o3-mini-2025-01-31`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | United Arab Emirates: `gpt-5.2-2025-12-11`, `gpt-4.1-2025-04-14` | computer-use-preview is supported only in the US and Europe. |209| `/v1/responses` | Responses | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-5.5-pro-2026-04-23`, `gpt-5.4-pro-2026-03-05`, `gpt-5.2-pro-2025-12-11`, `gpt-5-pro-2025-10-06`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.4-2026-03-05`, `gpt-5-2025-08-07`, `gpt-5.4-mini-2026-03-17`, `gpt-5.4-nano-2026-03-17`, `gpt-5.2-2025-12-11`, `gpt-5.1-2025-11-13`, `gpt-5-mini-2025-08-07`, `gpt-5-nano-2025-08-07`, `gpt-5-chat-latest-2025-08-07`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14`, `gpt-4.1-nano-2025-04-14`, `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-pro`, `o1-pro-2025-03-19`, `computer-use-preview`, `o3-mini-2025-01-31`, `o1-2024-12-17`, `o1-mini-2024-09-12`, `o1-preview`, `gpt-4o-2024-11-20`, `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4-turbo-2024-04-09`, `gpt-4-0613`, `gpt-3.5-turbo-0125` | United Arab Emirates: `gpt-5.2-2025-12-11`, `gpt-4.1-2025-04-14` | computer-use-preview is supported only in the US and Europe. |

204| `/v1/responses File Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |210| `/v1/responses File Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

205| `/v1/responses Web Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |211| `/v1/responses Web Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

206| `/v1/vector_stores` | Vector stores | All listed regions | None | Service-level support | None | — |212| `/v1/vector_stores` | Vector stores | All listed regions | None | Service-level support | None | — |


235 241 

236Enterprise Key Management (EKM) allows you to encrypt your customer content at OpenAI using keys managed by your own external Key Management System (KMS).242Enterprise Key Management (EKM) allows you to encrypt your customer content at OpenAI using keys managed by your own external Key Management System (KMS).

237 243 

238Once configured, EKM applies to any [application state](#types-of-data-stored-with-openai-api) created during your use of the platform. See the [EKM help center article](https://help.openai.com/en/articles/20000943-openai-enterprise-key-management-ekm-overview) for more information about how EKM works, and how to integrate with your KMS provider.244Once configured, EKM applies to any [application state](#types-of-data-stored-with-the-openai-api) created during your use of the platform. See the [EKM help center article](https://help.openai.com/en/articles/20000943-openai-enterprise-key-management-ekm-overview) for more information about how EKM works, and how to integrate with your KMS provider.

239 245 

240### EKM limitations246### EKM limitations

241 247 

242OpenAI supports Bring Your Own Key (BYOK) encryption with external accounts in AWS KMS, Google Cloud (GCP), and Azure Key Vault. If your organization leverages a different key management service, those keys need to be synced to one of the supported Cloud KMSs for use with OpenAI.248OpenAI supports Bring Your Own Key (BYOK) encryption with external accounts in AWS KMS, Google Cloud (GCP), and Azure Key Vault. If your organization leverages a different key management service, those keys need to be synced to one of the supported cloud KMS providers for use with OpenAI.

243 249 

244EKM does not support the following products. An attempt to use these endpoints in a project with EKM enabled will return an error.250EKM does not support the following products. An attempt to use these endpoints in a project with EKM enabled will return an error.

245 251 

Details

73 73 

74```bash74```bash

75openai responses create \75openai responses create \

76 --model gpt-5.5 \76 --model gpt-5.6 \

77 --input "Say hello in one sentence."77 --input "Say hello in one sentence."

78```78```

79 79 


121 121 

122```bash122```bash

123openai responses create \123openai responses create \

124 --model gpt-5.5 \124 --model gpt-5.6 \

125 --input "Summarize this note in one sentence.125 --input "Summarize this note in one sentence.

126 126 

127<note>127<note>


179 sed 's/^/ /' ./note.md179 sed 's/^/ /' ./note.md

180 printf ' </note>\n'180 printf ' </note>\n'

181} | openai responses create \181} | openai responses create \

182 --model gpt-5.5 \182 --model gpt-5.6 \

183 --format yaml \183 --format yaml \

184 --transform 'output.#(type=="message").content.0.text'184 --transform 'output.#(type=="message").content.0.text'

185```185```


212 212 

213```bash213```bash

214openai responses create \214openai responses create \

215 --model gpt-5.5 \215 --model gpt-5.6 \

216 --instructions "Extract the person and topic from the input." \216 --instructions "Extract the person and topic from the input." \

217 --input "Ada Lovelace wrote notes about the Analytical Engine." \217 --input "Ada Lovelace wrote notes about the Analytical Engine." \

218 --text.format "$(cat ./schema.json)" \218 --text.format "$(cat ./schema.json)" \


297 297 

298```bash298```bash

299openai responses create \299openai responses create \

300 --model gpt-5.5 \300 --model gpt-5.6 \

301 --format yaml \301 --format yaml \

302 --transform 'output.#(type=="message").content.0.text' <<'YAML'302 --transform 'output.#(type=="message").content.0.text' <<'YAML'

303tools:303tools:

mcp.md +3 −3

Details

458 458 

459### Handle authentication459### Handle authentication

460 460 

461As someone building a custom remote MCP server, authorization and authentication help you protect your data. We recommend using OAuth with [Client ID Metadata Documents](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#client-id-metadata-documents) for client registration when your authorization server supports CIMD and the connector creator chooses it. ChatGPT supports CIMD with public-client token exchange (`none`) or signed client assertion token exchange (`private_key_jwt`). Dynamic client registration remains supported when configured. For ChatGPT app auth requirements, see [Authentication](https://developers.openai.com/apps-sdk/build/auth). For protocol details, read the [MCP user guide](https://modelcontextprotocol.io/docs/concepts/transports#authentication-and-authorization) or the [authorization specification](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization).461As someone building a custom remote MCP server, authorization and authentication help you protect your data. We recommend using OAuth with [Client ID Metadata Documents](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization#client-id-metadata-documents) for client registration when your authorization server supports CIMD and the app creator chooses it. ChatGPT supports CIMD with public-client token exchange (`none`) or signed client assertion token exchange (`private_key_jwt`). Dynamic client registration remains supported when configured. For ChatGPT app auth requirements, see [Authentication](https://developers.openai.com/apps-sdk/build/auth). For protocol details, read the [MCP user guide](https://modelcontextprotocol.io/docs/concepts/transports#authentication-and-authorization) or the [authorization specification](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization).

462 462 

463If you connect your custom remote MCP server in ChatGPT as an app, users in your workspace will get an OAuth flow to your application.463If you connect your custom remote MCP server in ChatGPT as an app, users in your workspace will get an OAuth flow to your application.

464 464 

465### Connect in ChatGPT465### Connect in ChatGPT

466 466 

4671. Import your remote MCP server in [ChatGPT settings](https://chatgpt.com/#settings).4671. In [ChatGPT](https://chatgpt.com), open **Settings → Security and login** and turn on **Developer mode**.

4681. Create and configure your app in **Apps & Connectors** using your server URL.4681. Open **Settings Plugins** or [chatgpt.com/plugins](https://chatgpt.com/plugins), select the plus button, and create a developer-mode app using your server URL.

4691. Test your app by running prompts in chat and deep research.4691. Test your app by running prompts in chat and deep research.

470 470 

471For detailed setup steps, see [Connect from ChatGPT](https://developers.openai.com/apps-sdk/deploy/connect-chatgpt).471For detailed setup steps, see [Connect from ChatGPT](https://developers.openai.com/apps-sdk/deploy/connect-chatgpt).

Details

74 74 

75## Summarizing and analyzing the transcript with a GPT model75## Summarizing and analyzing the transcript with a GPT model

76 76 

77Having obtained the transcript, we now pass it to a GPT model via the [Chat Completions API](https://developers.openai.com/api/docs/api-reference/chat/create). The snippets below use a tested model to generate a summary, extract key points, action items, and perform sentiment analysis. For new projects, start with [`gpt-5.5`](https://developers.openai.com/api/docs/models/gpt-5.5).77Having obtained the transcript, we now pass it to a GPT model via the [Chat Completions API](https://developers.openai.com/api/docs/api-reference/chat/create). The snippets below use a tested model to generate a summary, extract key points, action items, and perform sentiment analysis. For new projects, start with [`gpt-5.6`](https://developers.openai.com/api/docs/models/gpt-5.6-sol).

78 78 

79This tutorial uses distinct functions for each task we want the model to perform. This is not the most efficient way to do this task - you can put these instructions into one function, however, splitting them up can lead to higher quality summarization.79This tutorial uses distinct functions for each task we want the model to perform. This is not the most efficient way to do this task - you can put these instructions into one function, however, splitting them up can lead to higher quality summarization.

80 80 


170 170 

171### Sentiment analysis171### Sentiment analysis

172 172 

173The `sentiment_analysis` function analyzes the overall sentiment of the discussion. It considers the tone, the emotions conveyed by the language used, and the context in which words and phrases are used. For less complicated tasks, it may also be worthwhile to try [`gpt-5.4-mini`](https://developers.openai.com/api/docs/models/gpt-5.4-mini) to see if you can get a similar level of performance at lower cost and latency. It might also be useful to experiment with taking the results of the `sentiment_analysis` function and passing it to the other functions to see how having the sentiment of the conversation impacts the other attributes.173The `sentiment_analysis` function analyzes the overall sentiment of the discussion. It considers the tone, the emotions conveyed by the language used, and the context in which words and phrases are used. For less complicated tasks, it may also be worthwhile to try [`gpt-5.6-terra`](https://developers.openai.com/api/docs/models/gpt-5.6-terra) to see if you can get a similar level of performance at lower cost and latency. It might also be useful to experiment with taking the results of the `sentiment_analysis` function and passing it to the other functions to see how having the sentiment of the conversation impacts the other attributes.

174 174 

175```python175```python

176def sentiment_analysis(transcription):176def sentiment_analysis(transcription):