SpyBara
Go Premium

Documentation 2026-10-22 22:59 UTC to 2026-10-23 23:58 UTC

19 files changed +3,717 −126. View all changes and history on the product overview
2026
Sat 31 23:01 Fri 30 23:59 Thu 29 23:59 Wed 28 23:00 Tue 27 23:58 Mon 26 23:58 Sat 24 23:02 Fri 23 23:58 Thu 22 22:59 Wed 21 23:02 Tue 20 23:02 Mon 19 23:00 Sun 18 23:00 Sat 17 22:57 Fri 16 23:02 Thu 15 23:00 Wed 14 23:59 Tue 13 23:00 Sun 11 23:59 Sat 10 23:58 Fri 9 22:57 Thu 8 23:01 Wed 7 23:57 Tue 6 22:58 Mon 5 22:59 Sun 4 22:58 Fri 2 23:58 Thu 1 22:59

deprecations.md +61 −45

Details

54The following models are deprecated and will be removed from the API on April 1, 2027, with six months' notice. Migrate to the recommended replacements before the shutdown date.54The following models are deprecated and will be removed from the API on April 1, 2027, with six months' notice. Migrate to the recommended replacements before the shutdown date.

55 55 

56| Shutdown date | Model / system | Recommended replacement |56| Shutdown date | Model / system | Recommended replacement |

57| ------------- | --------------- | ----------------------- |57| ------------- | ------------------------------------------- | ----------------------- |

58| Apr 1, 2027 | `gpt-5.3-codex` | `gpt-6-sol` |58| Apr 1, 2027 | `gpt-5.3-codex` | `gpt-6-sol` |

59| Apr 1, 2027 | `gpt-5.4-nano` | `gpt-6-luna` |59| Apr 1, 2027 | `gpt-5.4-nano` \| `gpt-5.4-nano-2026-03-17` | `gpt-6-luna` |

60| Apr 1, 2027 | `gpt-5.1` | `gpt-6-sol` |60| Apr 1, 2027 | `gpt-5.1` \| `gpt-5.1-2025-11-13` | `gpt-6-sol` |

61 61 

62### 2026-10-01: Text-to-speech models62### 2026-10-01: Text-to-speech models

63 63 

64The following text-to-speech models are deprecated and will be removed from the API on January 6, 2027, with at least three months' notice. Migrate to `gpt-realtime-2.1-mini` before the shutdown date. See the [Realtime API guide](https://developers.openai.com/api/docs/guides/realtime) to plan your migration.64The following text-to-speech models are deprecated and will be removed from the API on January 6, 2027, with at least three months' notice. Migrate to `gpt-realtime-2.1-mini` before the shutdown date. See the [Realtime API guide](https://developers.openai.com/api/docs/guides/realtime) to plan your migration.

65 65 

66| Shutdown date | Model / system | Recommended replacement |66| Shutdown date | Model / system | Recommended replacement |

67| ------------- | ---------------------------- | ----------------------- |67| ------------- | ------------------------------------------------- | ----------------------- |

68| Jan 6, 2027 | `tts-1` | `gpt-realtime-2.1-mini` |68| Jan 6, 2027 | `tts-1` | `gpt-realtime-2.1-mini` |

69| Jan 6, 2027 | `tts-1-hd` | `gpt-realtime-2.1-mini` |69| Jan 6, 2027 | `tts-1-hd` | `gpt-realtime-2.1-mini` |

70| Jan 6, 2027 | `gpt-4o-mini-tts-2025-03-20` | `gpt-realtime-2.1-mini` |70| Jan 6, 2027 | `gpt-4o-mini-tts` \| `gpt-4o-mini-tts-2025-03-20` | `gpt-realtime-2.1-mini` |

71| Jan 6, 2027 | `gpt-4o-mini-tts-2025-12-15` | `gpt-realtime-2.1-mini` |71| Jan 6, 2027 | `gpt-4o-mini-tts` \| `gpt-4o-mini-tts-2025-12-15` | `gpt-realtime-2.1-mini` |

72 72 

73### 2026-08-26: Transcription models73### 2026-08-26: Transcription models

74 74 


77For information about the recommended replacements, see the [transcription guide](https://developers.openai.com/api/docs/guides/transcription).77For information about the recommended replacements, see the [transcription guide](https://developers.openai.com/api/docs/guides/transcription).

78 78 

79| Shutdown date | Model / system | Recommended replacement |79| Shutdown date | Model / system | Recommended replacement |

80| ------------- | --------------------------- | ----------------------------------------- |80| ------------- | --------------------------------------------------------------- | ----------------------------------------- |

81| Feb 26, 2027 | `whisper-1` | `gpt-live-transcribe` or `gpt-transcribe` |81| Feb 26, 2027 | `whisper-1` | `gpt-live-transcribe` or `gpt-transcribe` |

82| Feb 26, 2027 | `gpt-4o-transcribe` | `gpt-live-transcribe` or `gpt-transcribe` |82| Feb 26, 2027 | `gpt-4o-transcribe` | `gpt-live-transcribe` or `gpt-transcribe` |

83| Feb 26, 2027 | `gpt-4o-mini-transcribe` | `gpt-live-transcribe` or `gpt-transcribe` |83| Feb 26, 2027 | `gpt-4o-mini-transcribe` \| `gpt-4o-mini-transcribe-2025-12-15` | `gpt-live-transcribe` or `gpt-transcribe` |

84| Feb 26, 2027 | `gpt-4o-transcribe-diarize` | `gpt-live-transcribe` or `gpt-transcribe` |84| Feb 26, 2027 | `gpt-4o-transcribe-diarize` | `gpt-live-transcribe` or `gpt-transcribe` |

85| Feb 26, 2027 | `/v1/audio/translations` | `v1/realtime/translations` |85| Feb 26, 2027 | `/v1/audio/translations` | `v1/realtime/translations` |

86 86 


89On July 20, 2026, we notified developers using legacy audio, realtime, and transcription model families and snapshots of their deprecation and removal from the API on January 20, 2027.89On July 20, 2026, we notified developers using legacy audio, realtime, and transcription model families and snapshots of their deprecation and removal from the API on January 20, 2027.

90 90 

91| Shutdown date | Model family / snapshot | Recommended replacement |91| Shutdown date | Model family / snapshot | Recommended replacement |

92| ------------- | ----------------------------------- | ----------------------------------- |92| ------------- | ----------------------------------------------------- | ----------------------------------- |

93| Jan 20, 2027 | `gpt-realtime` | `gpt-realtime-2.1` |93| Jan 20, 2027 | `gpt-realtime` \| `gpt-realtime-2025-08-28` | `gpt-realtime-2.1` |

94| Jan 20, 2027 | `gpt-audio` | `gpt-audio-1.5` |94| Jan 20, 2027 | `gpt-audio` \| `gpt-audio-2025-08-28` | `gpt-audio-1.5` |

95| Jan 20, 2027 | `gpt-4o-audio` | `gpt-audio-1.5` |95| Jan 20, 2027 | `gpt-4o-audio` | `gpt-audio-1.5` |

96| Jan 20, 2027 | `gpt-4o-realtime` | `gpt-realtime-2.1` |96| Jan 20, 2027 | `gpt-4o-realtime` | `gpt-realtime-2.1` |

97| Jan 20, 2027 | `gpt-realtime-mini` | `gpt-realtime-2.1-mini` |97| Jan 20, 2027 | `gpt-realtime-mini` \| `gpt-realtime-mini-2025-12-15` | `gpt-realtime-2.1-mini` |

98| Jan 20, 2027 | `gpt-audio-mini` | `gpt-audio-1.5` |98| Jan 20, 2027 | `gpt-audio-mini` \| `gpt-audio-mini-2025-12-15` | `gpt-audio-1.5` |

99| Jan 20, 2027 | `gpt-4o-mini-realtime` | `gpt-realtime-2.1-mini` |99| Jan 20, 2027 | `gpt-4o-mini-realtime` | `gpt-realtime-2.1-mini` |

100| Jan 20, 2027 | `gpt-4o-mini-audio` | `gpt-audio-1.5` |100| Jan 20, 2027 | `gpt-4o-mini-audio` | `gpt-audio-1.5` |

101| Jan 20, 2027 | `gpt-4o-mini-transcribe-2025-03-20` | `gpt-4o-mini-transcribe-2025-12-15` |101| Jan 20, 2027 | `gpt-4o-mini-transcribe-2025-03-20` | `gpt-4o-mini-transcribe-2025-12-15` |


105On June 11, 2026, we notified developers using older GPT-5 and o3 model snapshots of their deprecation and removal from the API on December 11, 2026.105On June 11, 2026, we notified developers using older GPT-5 and o3 model snapshots of their deprecation and removal from the API on December 11, 2026.

106 106 

107| Shutdown date | Model / system | Recommended replacement |107| Shutdown date | Model / system | Recommended replacement |

108| ------------- | ----------------------- | ------------------------------------- |108| ------------- | --------------------------------------- | ------------------------------------- |

109| Dec 11, 2026 | `gpt-5-2025-08-07` | `gpt-5.6-sol` |109| Dec 11, 2026 | `gpt-5` \| `gpt-5-2025-08-07` | `gpt-5.6-sol` |

110| Dec 11, 2026 | `gpt-5-mini-2025-08-07` | `gpt-5.6-terra` |110| Dec 11, 2026 | `gpt-5-mini` \| `gpt-5-mini-2025-08-07` | `gpt-5.6-terra` |

111| Dec 11, 2026 | `gpt-5-nano-2025-08-07` | `gpt-5.6-luna` |111| Dec 11, 2026 | `gpt-5-nano` \| `gpt-5-nano-2025-08-07` | `gpt-5.6-luna` |

112| Dec 11, 2026 | `gpt-5-pro-2025-10-06` | `gpt-5.6-sol` (`reasoning.mode: pro`) |112| Dec 11, 2026 | `gpt-5-pro` \| `gpt-5-pro-2025-10-06` | `gpt-5.6-sol` (`reasoning.mode: pro`) |

113| Dec 11, 2026 | `o3-2025-04-16` | `gpt-5.6-sol` |113| Dec 11, 2026 | `o3` \| `o3-2025-04-16` | `gpt-5.6-sol` |

114| Dec 11, 2026 | `o3-pro-2025-06-10` | `gpt-5.6-sol` (`reasoning.mode: pro`) |114| Dec 11, 2026 | `o3-pro` \| `o3-pro-2025-06-10` | `gpt-5.6-sol` (`reasoning.mode: pro`) |

115 115 

116### 2026-06-03: Reusable prompts116### 2026-06-03: Reusable prompts

117 117 


154On June 2, 2026, we notified developers using older GPT Image models of their deprecation and removal from the API on December 1, 2026.154On June 2, 2026, we notified developers using older GPT Image models of their deprecation and removal from the API on December 1, 2026.

155 155 

156| Shutdown date | Model / system | Recommended replacement |156| Shutdown date | Model / system | Recommended replacement |

157| ------------- | ---------------------- | ------------------------------------------------- |157| ------------- | --------------------------------------------- | ------------------------------------------------- |

158| Dec 1, 2026 | `gpt-image-1-mini` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |158| Dec 1, 2026 | `gpt-image-1-mini` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |

159| Dec 1, 2026 | `gpt-image-1.5` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |159| Dec 1, 2026 | `gpt-image-1.5` \| `gpt-image-1.5-2025-12-16` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |

160| Dec 1, 2026 | `chatgpt-image-latest` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |160| Dec 1, 2026 | `chatgpt-image-latest` | `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` |

161 161 

162### Update to OpenAI’s self-serve fine-tuning162### Update to OpenAI’s self-serve fine-tuning


171| July 2, 2026 | Creating fine-tuning jobs is no longer available to organizations that have not run inference on a fine-tuned model in the past 60 days. |171| July 2, 2026 | Creating fine-tuning jobs is no longer available to organizations that have not run inference on a fine-tuned model in the past 60 days. |

172| Jan 6, 2027 | Active existing customers will no longer be able to create new fine-tuning jobs on this date. Inference on fine-tuned models will be disabled only when the underlying base model is deprecated. |172| Jan 6, 2027 | Active existing customers will no longer be able to create new fine-tuning jobs on this date. Inference on fine-tuned models will be disabled only when the underlying base model is deprecated. |

173 173 

174## Past deprecations

175 

176Past deprecations are listed below, with the most recent announcements at the top.

177 

178### 2026-09-11: GPT-5.4-Cyber

179 

180The `gpt-5.4-cyber` model is deprecated and will be removed from the API on October 1, 2026. Migrate to the most capable cyber model available to you before the shutdown date.

181 

182| Shutdown date | Model / system | Recommended replacement |

183| ------------- | --------------- | ---------------------------------------------- |

184| Oct 1, 2026 | `gpt-5.4-cyber` | The most capable cyber model available to you. |

185 

186### 2026-05-08: `gpt-5.2-chat-latest` and `gpt-5.3-chat-latest` model snapshots

187 

188On May 8th, 2026, we notified developers using `gpt-5.2-chat-latest` and `gpt-5.3-chat-latest` model snapshots of their deprecation and removal from the API.

189 

190| Shutdown date | Model / system | Recommended replacement |

191| ------------- | --------------------- | ----------------------- |

192| Aug 10, 2026 | `gpt-5.2-chat-latest` | `gpt-5.6-sol` |

193| Aug 10, 2026 | `gpt-5.3-chat-latest` | `gpt-5.6-sol` |

194 

174### 2026-04-22: Legacy GPT model snapshots195### 2026-04-22: Legacy GPT model snapshots

175 196 

176To improve reliability and make it easier for developers to choose the right models, we are deprecating a set of older OpenAI models. Access to these models will be shut down on the dates below.197On April 22, 2026, we announced the deprecation of the following older OpenAI models. Access to these models was shut down on October 23, 2026.

177 198 

178| Shutdown date | Model snapshot | Substitute model |199| Shutdown date | Model snapshot | Substitute model |

179| ---------------- | ---------------------------------------------------------------------- | ------------------------------------------------- |200| ---------------- | ---------------------------------------------------------------------- | ------------------------------------------------- |


190| October 23, 2026 | `ft-o4-mini-2025-04-16` | `gpt-5.6-terra` |211| October 23, 2026 | `ft-o4-mini-2025-04-16` | `gpt-5.6-terra` |

191| October 23, 2026 | `o4-mini-2025-04-16` \| `o4-mini` | `gpt-5.6-terra` |212| October 23, 2026 | `o4-mini-2025-04-16` \| `o4-mini` | `gpt-5.6-terra` |

192 213 

193We are also removing fine-tuned versions as below:214The following fine-tuned versions were also shut down on October 23, 2026:

194 215 

195| Shutdown date | Model snapshot | Recommended replacement base model |216| Shutdown date | Model snapshot | Recommended replacement base model |

196| ---------------- | ---------------------------- | ---------------------------------- |217| ---------------- | ---------------------------- | ---------------------------------- |


200| October 23, 2026 | `ft-babbage-002` | `gpt-5.6-terra` |221| October 23, 2026 | `ft-babbage-002` | `gpt-5.6-terra` |

201| October 23, 2026 | `ft-davinci-002` | `gpt-5.6-terra` |222| October 23, 2026 | `ft-davinci-002` | `gpt-5.6-terra` |

202 223 

203## Past deprecations

204 

205Past deprecations are listed below, with the most recent announcements at the top.

206 

207### 2026-09-11: GPT-5.4-Cyber

208 

209The `gpt-5.4-cyber` model is deprecated and will be removed from the API on October 1, 2026. Migrate to the most capable cyber model available to you before the shutdown date.

210 

211| Shutdown date | Model / system | Recommended replacement |

212| ------------- | --------------- | ---------------------------------------------- |

213| Oct 1, 2026 | `gpt-5.4-cyber` | The most capable cyber model available to you. |

214 

215### 2026-05-08: `gpt-5.2-chat-latest` and `gpt-5.3-chat-latest` model snapshots

216 

217On May 8th, 2026, we notified developers using `gpt-5.2-chat-latest` and `gpt-5.3-chat-latest` model snapshots of their deprecation and removal from the API.

218 

219| Shutdown date | Model / system | Recommended replacement |

220| ------------- | --------------------- | ----------------------- |

221| Aug 10, 2026 | `gpt-5.2-chat-latest` | `gpt-5.6-sol` |

222| Aug 10, 2026 | `gpt-5.3-chat-latest` | `gpt-5.6-sol` |

223 

224### 2026-04-22: Legacy GPT model snapshots (July 2026 shutdown)224### 2026-04-22: Legacy GPT model snapshots (July 2026 shutdown)

225 225 

226On April 22, 2026, we announced the deprecation of the following older OpenAI models. Access to these models was shut down on July 23, 2026.226On April 22, 2026, we announced the deprecation of the following older OpenAI models. Access to these models was shut down on July 23, 2026.


534 534 

535### Plain-text aliases535### Plain-text aliases

536 536 

537- gpt-5.4-nano | gpt-5.4-nano-2026-03-17

538- gpt-5.1 | gpt-5.1-2025-11-13

539- gpt-4o-mini-tts | gpt-4o-mini-tts-2025-03-20

540- gpt-4o-mini-tts | gpt-4o-mini-tts-2025-12-15

541- gpt-4o-mini-transcribe | gpt-4o-mini-transcribe-2025-12-15

542- gpt-realtime | gpt-realtime-2025-08-28

543- gpt-audio | gpt-audio-2025-08-28

544- gpt-realtime-mini | gpt-realtime-mini-2025-12-15

545- gpt-audio-mini | gpt-audio-mini-2025-12-15

546- gpt-5 | gpt-5-2025-08-07

547- gpt-5-mini | gpt-5-mini-2025-08-07

548- gpt-5-nano | gpt-5-nano-2025-08-07

549- gpt-5-pro | gpt-5-pro-2025-10-06

550- o3 | o3-2025-04-16

551- o3-pro | o3-pro-2025-06-10

552- gpt-image-1.5 | gpt-image-1.5-2025-12-16

537- gpt-3.5-turbo-0125 | gpt-3.5-turbo, gpt-3.5-turbo-completions553- gpt-3.5-turbo-0125 | gpt-3.5-turbo, gpt-3.5-turbo-completions

538- gpt-4-0613 | gpt-4, gpt-4-0613-completions, gpt-4-completions554- gpt-4-0613 | gpt-4, gpt-4-0613-completions, gpt-4-completions

539- gpt-4-turbo | gpt-4-turbo-2024-04-09, gpt-4-turbo-completions555- gpt-4-turbo | gpt-4-turbo-2024-04-09, gpt-4-turbo-completions

Details

1# Databricks Sandbox

2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 

5Use [Databricks Sandbox](https://docs.databricks.com/aws/en/compute/serverless/sandbox) to run an agent's shell commands and work with files in your Databricks workspace. Your application manages the sandbox. Its executor, `codex exec-server`, opens an outbound connection to OpenAI using the session's `environment.id` and `environment.remote_url`.

6 

7Databricks Sandbox is in beta. Check that your workspace is in a [supported region](https://docs.databricks.com/aws/en/resources/feature-region-support), then enable Databricks Sandbox on the workspace's Previews page.

8 

9## Before you begin

10 

11- Authenticate a Databricks profile for your workspace. Use its name in place of `my-workspace` below.

12- Set `OPENAI_API_KEY` to your application key and `OPENAI_EXECUTOR_API_KEY` to a separate [environment key](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#authentication) from the same organization, project, and user or service account. Only the environment key enters the sandbox as `CODEX_API_KEY`.

13- If your OpenAI organization enforces an IP allowlist, keep it up to date as sandbox outbound IPs change. For workspaces in the serverless compute firewall preview, follow the [Databricks guidance for regional IP ranges](https://docs.databricks.com/aws/en/resources/ip-domain-region#outbound-ips-for-serverless-compute-firewall-preview).

14 

15## Run the example

16 

17From the root of the [OpenAI Cookbook repository](https://github.com/openai/openai-cookbook/tree/main/examples/agents_api/sandboxes/databricks), run the example with `uv` and Python 3.11 or later. Choose an unused sandbox ID because the example deletes the sandbox during cleanup.

18 

19```bash

20uv run examples/agents_api/sandboxes/databricks/application_managed/main.py \

21 --profile my-workspace --sandbox-id "openai-agent-$(date +%s)"

22```

23 

24The example creates a self-hosted session, starts the executor in the sandbox, and asks the agent to write a greeting to a file. It reads the file back and prints `Verified the agent's file write.` on success. It then stops the executor and deletes the session and sandbox.

Details

218 218 

219| Provider | Guide |219| Provider | Guide |

220| --------------------------------- | ------------------------------------------------------------------------------------- |220| --------------------------------- | ------------------------------------------------------------------------------------- |

221| Modal | [Modal setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/modal) |221| AWS Lambda MicroVMs | [AWS setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/aws) |

222| Blaxel | [Blaxel setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/blaxel) |

222| Cloudflare | [Cloudflare setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/cloudflare) |223| Cloudflare | [Cloudflare setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/cloudflare) |

223| Vercel | [Vercel setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/vercel) |224| Databricks Sandbox | [Databricks setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/databricks) |

224| Daytona | [Daytona setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/daytona) |225| Daytona | [Daytona setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/daytona) |

225| Blaxel | [Blaxel setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/blaxel) |

226| E2B | [E2B setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/e2b) |

227| DigitalOcean | [DigitalOcean setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/digitalocean) |226| DigitalOcean | [DigitalOcean setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/digitalocean) |

228| AWS Lambda MicroVMs | [AWS setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/aws) |227| E2B | [E2B setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/e2b) |

228| Modal | [Modal setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/modal) |

229| Oracle Cloud Infrastructure (OCI) | [OCI setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/oci) |229| Oracle Cloud Infrastructure (OCI) | [OCI setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/oci) |

230| Vercel | [Vercel setup](https://developers.openai.com/api/docs/guides/agents-api/environments/providers/vercel) |

230 231 

231For webhook-managed provisioning, implement a handler using [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle#start-compute-from-webhooks) and your provider's SDK or API. Keep provisioning ownership and cleanup policies explicit.232For webhook-managed provisioning, implement a handler using [Sandbox lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle#start-compute-from-webhooks) and your provider's SDK or API. Keep provisioning ownership and cleanup policies explicit.

Details

13 13 

14Turns run asynchronously. Your application can follow progress through streaming or receive session state changes through [webhooks](https://developers.openai.com/api/docs/guides/agents-api/sessions/webhooks).14Turns run asynchronously. Your application can follow progress through streaming or receive session state changes through [webhooks](https://developers.openai.com/api/docs/guides/agents-api/sessions/webhooks).

15 15 

16Use [scheduled automations](https://developers.openai.com/api/docs/guides/agents-api/sessions/automations) to start work at a future time or on a recurring schedule. An automation can create a new session for each run or continue an existing conversation.

17 

16 18 

17 19 

18 20 

Details

1# Scheduled automations

2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 

5Use scheduled automations to kick off agent sessions on a cron schedule. You can also enable the `automations` tool for your agents, so they can schedule tasks in the course of their work.

6 

7 

8 

9**Automate sessions on a cron schedule**

10 

11Use a cron expression and time zone to start new sessions or continue an existing session.

12 

13 

14 

15 

16 

17 

18**Enable agents to create automations**

19 

20Add the `automations` tool so an agent can schedule follow-ups in its current session.

21 

22 

23 

24 

25 

26 

27**Monitor automation invocations**

28 

29Each invocation records an attempt to send a task to a session. Inspect its status and session ID.

30 

31 

32 

33 

34 

35Automate sessions on a cron schedule

36 

37```javascript

38import OpenAI from "openai";

39 

40const client = new OpenAI();

41const automation = await client.beta.agents.automations.create({

42 type: "periodic",

43 name: "Daily session",

44 expression: "0 10 * * *",

45 timezone: "America/New_York",

46 target: {

47 type: "new_session",

48 agent_id: "agt_123",

49 environment: { type: "openai_hosted" },

50 input: [

51 {

52 role: "user",

53 content: [

54 {

55 type: "input_text",

56 text: "Summarize the current status and next steps.",

57 },

58 ],

59 },

60 ],

61 },

62});

63console.log(automation);

64```

65 

66```python

67from openai import OpenAI

68 

69client = OpenAI()

70automation = client.beta.agents.automations.create(

71 type="periodic",

72 name="Daily session",

73 expression="0 10 * * *",

74 timezone="America/New_York",

75 target={

76 "type": "new_session",

77 "agent_id": "agt_123",

78 "environment": {"type": "openai_hosted"},

79 "input": [

80 {

81 "role": "user",

82 "content": [

83 {

84 "type": "input_text",

85 "text": "Summarize the current status and next steps.",

86 }

87 ],

88 }

89 ],

90 },

91)

92print(automation.to_json())

93```

94 

95```go

96import (

97 "context"

98 "fmt"

99 

100 "github.com/openai/openai-go/v3"

101)

102 

103ctx := context.Background()

104client := openai.NewClient()

105automation, err := client.Beta.Agents.Automations.New(ctx,

106 openai.BetaAgentAutomationNewParams{

107 CreateAutomationParams: openai.AutomationScheduleParamUnion{

108 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

109 Name: "Daily session",

110 Expression: "0 10 * * *",

111 Timezone: "America/New_York",

112 Target: openai.AutomationTargetParamUnion{

113 OfParamNewSession: &openai.AutomationTargetParamNewSession{

114 AgentID: openai.String("agt_123"),

115 Environment: openai.EnvironmentParamUnion{

116 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

117 },

118 Input: []openai.AgentSessionInputMessageParam{

119 {

120 Content: []openai.InputContentParamUnion{

121 {

122 OfParamInputText: &openai.InputContentParamInputText{

123 Text: "Summarize the current status and next steps.",

124 },

125 },

126 },

127 },

128 },

129 },

130 },

131 },

132 },

133 })

134if err != nil {

135 panic(err)

136}

137fmt.Println(automation)

138```

139 

140```java

141import com.openai.client.OpenAIClient;

142import com.openai.client.okhttp.OpenAIOkHttpClient;

143import com.openai.models.beta.agents.AgentSessionInputMessageParam;

144import com.openai.models.beta.agents.EnvironmentParam;

145import com.openai.models.beta.agents.automations.AutomationCreateParams;

146import com.openai.models.beta.agents.automations.AutomationScheduleParam;

147import com.openai.models.beta.agents.automations.AutomationTargetParam;

148 

149OpenAIClient client = OpenAIOkHttpClient.fromEnv();

150var automation =

151 client

152 .beta()

153 .agents()

154 .automations()

155 .create(

156 AutomationCreateParams.builder()

157 .automationScheduleParam(

158 AutomationScheduleParam.Periodic.builder()

159 .name("Daily session")

160 .expression("0 10 * * *")

161 .timezone("America/New_York")

162 .target(

163 AutomationTargetParam.NewSession.builder()

164 .agentId("agt_123")

165 .environment(EnvironmentParam.OpenAIHosted.builder().build())

166 .addInput(

167 AgentSessionInputMessageParam.builder()

168 .addInputTextContent(

169 "Summarize the current status and next steps.")

170 .build())

171 .build())

172 .build())

173 .build());

174System.out.println(automation);

175```

176 

177```csharp

178using OpenAI;

179using OpenAI.Agents;

180#pragma warning disable OPENAI001

181 

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

183AgentClient client = new OpenAIClient(key).GetAgentClient();

184AgentAutomation automation = await client.CreateAutomationAsync(

185 new AgentAutomationCreationOptions

186 {

187 Type = AgentAutomationType.Periodic,

188 Name = "Daily session",

189 Expression = "0 10 * * *",

190 Timezone = "America/New_York",

191 Target = new NewSessionAutomationTarget

192 {

193 AgentId = "agt_123",

194 Environment = new EnvironmentParamOpenaiHosted(),

195 Input =

196 [

197 new InputMessageParam(

198 [new InputContentParamInputText("Summarize the current status and next steps.")]

199 ),

200 ],

201 },

202 }

203);

204Console.WriteLine(automation.Id);

205```

206 

207```ruby

208require "openai"

209 

210client = OpenAI::Client.new

211automation = client.beta.agents.automations.create(

212 body: {

213 type: "periodic",

214 name: "Daily session",

215 expression: "0 10 * * *",

216 timezone: "America/New_York",

217 target: {

218 type: "new_session",

219 agent_id: "agt_123",

220 environment: { type: "openai_hosted" },

221 input: [

222 {

223 role: "user",

224 content: [

225 {

226 type: "input_text",

227 text: "Summarize the current status and next steps."

228 }

229 ]

230 }

231 ]

232 }

233 }

234)

235puts automation

236```

237 

238```bash

239curl https://api.openai.com/v1/agents/automations \

240 -H "OpenAI-Beta: agents=v1" \

241 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

243 -d '{

244 "type": "periodic",

245 "name": "Daily session",

246 "expression": "0 10 * * *",

247 "timezone": "America/New_York",

248 "target": {

249 "type": "new_session",

250 "agent_id": "agt_123",

251 "environment": {

252 "type": "openai_hosted"

253 },

254 "input": [

255 {

256 "role": "user",

257 "content": [

258 {

259 "type": "input_text",

260 "text": "Summarize the current status and next steps."

261 }

262 ]

263 }

264 ]

265 }

266 }'

267```

268 

269

270 

271

272 

273 Enable agents to create automations

274 

275```javascript

276import OpenAI from "openai";

277 

278const client = new OpenAI();

279const session = await client.beta.agents.sessions.create({

280 agent: {

281 model: "gpt-6-astra",

282 instructions:

283 "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

284 tools: [{ type: "automations" }],

285 multi_agent: { enabled: true },

286 },

287 environment: { type: "openai_hosted" },

288 input:

289 "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.",

290});

291console.log(session.id);

292```

293 

294```python

295from openai import OpenAI

296 

297client = OpenAI()

298session = client.beta.agents.sessions.create(

299 agent={

300 "model": "gpt-6-astra",

301 "instructions": (

302 "Use automations to schedule tasks requested by the user. "

303 "Delegate each scheduled task to a subagent and ask for a concise result. "

304 "Keep the goal, schedule, and useful summaries in the main session. "

305 "Adjust or stop schedules when the user asks."

306 ),

307 "multi_agent": {"enabled": True},

308 "tools": [{"type": "automations"}],

309 },

310 environment={"type": "openai_hosted"},

311 input=(

312 "Every day at 10 AM in America/New_York, review the goals we discuss here "

313 "and suggest the next actions I could take."

314 ),

315)

316print(session.id)

317```

318 

319```go

320import (

321 "context"

322 "fmt"

323 

324 "github.com/openai/openai-go/v3"

325)

326 

327ctx := context.Background()

328client := openai.NewClient()

329session, err := client.Beta.Agents.Sessions.New(ctx,

330 openai.BetaAgentSessionNewParams{

331 Agent: openai.BetaAgentSessionNewParamsAgent{

332 Model: openai.String("gpt-6-astra"),

333 Instructions: openai.String("Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks."),

334 MultiAgent: openai.MultiAgentConfigParam{

335 Enabled: true,

336 },

337 Tools: []openai.AgentToolParamUnion{

338 {OfParamAutomations: &openai.AgentToolParamAutomations{}},

339 },

340 },

341 Environment: openai.EnvironmentParamUnion{

342 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

343 },

344 Input: openai.BetaAgentSessionNewParamsInputUnion{

345 OfString: openai.String("Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."),

346 },

347 })

348if err != nil {

349 panic(err)

350}

351fmt.Println(session.ID)

352```

353 

354```java

355import com.openai.client.OpenAIClient;

356import com.openai.client.okhttp.OpenAIOkHttpClient;

357import com.openai.models.beta.agents.EnvironmentParam;

358import com.openai.models.beta.agents.MultiAgentConfigParam;

359import com.openai.models.beta.agents.sessions.SessionCreateParams;

360 

361OpenAIClient client = OpenAIOkHttpClient.fromEnv();

362var session =

363 client

364 .beta()

365 .agents()

366 .sessions()

367 .create(

368 SessionCreateParams.builder()

369 .agent(

370 SessionCreateParams.Agent.builder()

371 .model("gpt-6-astra")

372 .instructions(

373 "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.")

374 .multiAgent(MultiAgentConfigParam.builder().enabled(true).build())

375 .addToolAutomations()

376 .build())

377 .environment(EnvironmentParam.OpenAIHosted.builder().build())

378 .input(

379 "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.")

380 .build());

381System.out.println(session.id());

382```

383 

384```csharp

385using OpenAI;

386using OpenAI.Agents;

387#pragma warning disable OPENAI001

388 

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

390AgentClient client = new OpenAIClient(key).GetAgentClient();

391AgentSession session = await client.CreateAgentSessionAsync(

392 new AgentSessionCreationOptions

393 {

394 Agent = new SessionAgentConfigParam

395 {

396 Model = "gpt-6-astra",

397 Instructions = "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

398 MultiAgent = new MultiAgentConfigParam { Enabled = true },

399 Tools = [new AgentToolConfigParamAutomations()],

400 },

401 Environment = new EnvironmentParamOpenaiHosted(),

402 Input =

403 [

404 new InputMessageParam(

405 [new InputContentParamInputText("Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.")]

406 ),

407 ],

408 }

409);

410Console.WriteLine(session.Id);

411```

412 

413```ruby

414require "openai"

415 

416client = OpenAI::Client.new

417session = client.beta.agents.sessions.create(

418 agent: {

419 model: "gpt-6-astra",

420 instructions: "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

421 multi_agent: { enabled: true },

422 tools: [{ type: "automations" }]

423 },

424 environment: { type: "openai_hosted" },

425 input: "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."

426)

427puts session.id

428```

429 

430```bash

431curl https://api.openai.com/v1/agents/sessions \

432 -H "OpenAI-Beta: agents=v1" \

433 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

435 -d '{

436 "agent": {

437 "model": "gpt-6-astra",

438 "instructions": "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

439 "tools": [{ "type": "automations" }],

440 "multi_agent": { "enabled": true }

441 },

442 "environment": {

443 "type": "openai_hosted"

444 },

445 "input": "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."

446 }'

447```

448 

449

450 

451

452 

453 Monitor automation invocations

454 

455```javascript

456import OpenAI from "openai";

457 

458const client = new OpenAI();

459for await (const invocation of client.beta.agents.automations.invocations.list(

460 "auto_123"

461)) {

462 console.log(invocation.id, invocation.status, invocation.session_id);

463}

464```

465 

466```python

467from openai import OpenAI

468 

469client = OpenAI()

470invocations = client.beta.agents.automations.invocations.list(automation_id="auto_123")

471for invocation in invocations:

472 print(invocation.id, invocation.status, invocation.session_id)

473```

474 

475```go

476import (

477 "context"

478 "fmt"

479 

480 "github.com/openai/openai-go/v3"

481)

482 

483ctx := context.Background()

484client := openai.NewClient()

485invocations := client.Beta.Agents.Automations.Invocations.ListAutoPaging(ctx, "auto_123",

486 openai.BetaAgentAutomationInvocationListParams{})

487for invocations.Next() {

488 invocation := invocations.Current()

489 fmt.Println(invocation.ID, invocation.Status, invocation.SessionID)

490}

491if err := invocations.Err(); err != nil {

492 panic(err)

493}

494```

495 

496```java

497import com.openai.client.OpenAIClient;

498import com.openai.client.okhttp.OpenAIOkHttpClient;

499import com.openai.models.beta.agents.automations.invocations.InvocationListParams;

500 

501OpenAIClient client = OpenAIOkHttpClient.fromEnv();

502var invocations =

503 client

504 .beta()

505 .agents()

506 .automations()

507 .invocations()

508 .list(InvocationListParams.builder().automationId("auto_123").build());

509for (var invocation : invocations.autoPager()) {

510 System.out.println(

511 invocation.id() + " " + invocation.status() + " " + invocation.sessionId());

512}

513```

514 

515```csharp

516using OpenAI;

517using OpenAI.Agents;

518#pragma warning disable OPENAI001

519 

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

521AgentClient client = new OpenAIClient(key).GetAgentClient();

522await foreach (AgentAutomationInvocation invocation in client.GetAutomationInvocationsAsync("auto_123"))

523{

524 Console.WriteLine($"{invocation.Id} {invocation.Status} {invocation.SessionId}");

525}

526```

527 

528```ruby

529require "openai"

530 

531client = OpenAI::Client.new

532invocations = client.beta.agents.automations.invocations.list("auto_123")

533invocations.auto_paging_each do |invocation|

534 puts "#{invocation.id} #{invocation.status} #{invocation.session_id}"

535end

536```

537 

538```bash

539curl https://api.openai.com/v1/agents/automations/auto_123/invocations \

540 -H "OpenAI-Beta: agents=v1" \

541 -H "Authorization: Bearer $OPENAI_API_KEY"

542```

543 

544 

545 

546 

547 

548 

549 

550 

551## API resources

552 

553 

554 

555 

556 

557 

558[Agents](https://developers.openai.com/api/reference/resources/beta/subresources/agents)

559 

560`/v1/agents`

561 

562 

563 

564 

565Define the instructions and tools for the task.

566 

567 

568 

569 

570 

571 

572 

573 

574[Automations](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/automations)

575 

576`/v1/agents/automations`

577 

578 

579 

580 

581Save when to run and which session to use.

582 

583 

584 

585 

586 

587 

588 

589 

590[Invocations](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/automations/subresources/invocations)

591 

592`/v1/agents/automations/{automation_id}/invocations`

593 

594 

595 

596 

597See when a task was sent and which session received it.

598 

599 

600 

601 

602 

603 

604 

605 

606[Sessions](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions)

607 

608`/v1/agents/sessions`

609 

610 

611 

612 

613Run the task with conversation history and tools.

614 

615 

616 

617 

618 

619 

620 

621 

622[Session events](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/subresources/events)

623 

624`/v1/agents/sessions/{session_id}/events`

625 

626 

627 

628 

629Follow progress and collect the result.

630 

631 

632 

633 

634 

635 

636 

637 

638 

639 

640## Use cases

641 

642### Restaurant reservations

643 

644```javascript

645import OpenAI from "openai";

646 

647const client = new OpenAI();

648const automation = await client.beta.agents.automations.create({

649 type: "periodic",

650 name: "Check restaurant reservations",

651 expression: "0 */2 * * *",

652 timezone: "America/New_York",

653 target: {

654 type: "existing_session",

655 session_id: "sess_123",

656 instructions:

657 "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

658 },

659});

660console.log(automation);

661```

662 

663```python

664from openai import OpenAI

665 

666client = OpenAI()

667automation = client.beta.agents.automations.create(

668 type="periodic",

669 name="Check restaurant reservations",

670 expression="0 */2 * * *",

671 timezone="America/New_York",

672 target={

673 "type": "existing_session",

674 "session_id": "sess_123",

675 "instructions": (

676 "Check restaurant availability for our dinner plans. "

677 "Compare with earlier checks and report newly available tables."

678 ),

679 },

680)

681print(automation.to_json())

682```

683 

684```go

685import (

686 "context"

687 "fmt"

688 

689 "github.com/openai/openai-go/v3"

690)

691 

692ctx := context.Background()

693client := openai.NewClient()

694automation, err := client.Beta.Agents.Automations.New(ctx,

695 openai.BetaAgentAutomationNewParams{

696 CreateAutomationParams: openai.AutomationScheduleParamUnion{

697 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

698 Name: "Check restaurant reservations",

699 Expression: "0 */2 * * *",

700 Timezone: "America/New_York",

701 Target: openai.AutomationTargetParamUnion{

702 OfParamExistingSession: &openai.AutomationTargetParamExistingSession{

703 SessionID: "sess_123",

704 Instructions: "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

705 },

706 },

707 },

708 },

709 })

710if err != nil {

711 panic(err)

712}

713fmt.Println(automation)

714```

715 

716```java

717import com.openai.client.OpenAIClient;

718import com.openai.client.okhttp.OpenAIOkHttpClient;

719import com.openai.models.beta.agents.automations.AutomationCreateParams;

720import com.openai.models.beta.agents.automations.AutomationScheduleParam;

721import com.openai.models.beta.agents.automations.AutomationTargetParam;

722 

723OpenAIClient client = OpenAIOkHttpClient.fromEnv();

724var automation =

725 client

726 .beta()

727 .agents()

728 .automations()

729 .create(

730 AutomationCreateParams.builder()

731 .automationScheduleParam(

732 AutomationScheduleParam.Periodic.builder()

733 .name("Check restaurant reservations")

734 .expression("0 */2 * * *")

735 .timezone("America/New_York")

736 .target(

737 AutomationTargetParam.ExistingSession.builder()

738 .sessionId("sess_123")

739 .instructions(

740 "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.")

741 .build())

742 .build())

743 .build());

744System.out.println(automation);

745```

746 

747```csharp

748using OpenAI;

749using OpenAI.Agents;

750#pragma warning disable OPENAI001

751 

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

753AgentClient client = new OpenAIClient(key).GetAgentClient();

754AgentAutomation automation = await client.CreateAutomationAsync(

755 new AgentAutomationCreationOptions

756 {

757 Type = AgentAutomationType.Periodic,

758 Name = "Check restaurant reservations",

759 Expression = "0 */2 * * *",

760 Timezone = "America/New_York",

761 Target = new ExistingSessionAutomationTarget

762 {

763 SessionId = "sess_123",

764 Instructions = "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

765 },

766 }

767);

768Console.WriteLine(automation.Id);

769```

770 

771```ruby

772require "openai"

773 

774client = OpenAI::Client.new

775automation = client.beta.agents.automations.create(

776 body: {

777 type: "periodic",

778 name: "Check restaurant reservations",

779 expression: "0 */2 * * *",

780 timezone: "America/New_York",

781 target: {

782 type: "existing_session",

783 session_id: "sess_123",

784 instructions: "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables."

785 }

786 }

787)

788puts automation

789```

790 

791```bash

792curl https://api.openai.com/v1/agents/automations \

793 -H "OpenAI-Beta: agents=v1" \

794 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

796 -d '{

797 "type": "periodic",

798 "name": "Check restaurant reservations",

799 "expression": "0 */2 * * *",

800 "timezone": "America/New_York",

801 "target": {

802 "type": "existing_session",

803 "session_id": "sess_123",

804 "instructions": "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables."

805 }

806 }'

807```

808 

809### Monthly spending

810 

811```javascript

812import OpenAI from "openai";

813 

814const client = new OpenAI();

815const automation = await client.beta.agents.automations.create({

816 type: "periodic",

817 name: "Monthly spending review",

818 expression: "0 9 1 * *",

819 timezone: "America/New_York",

820 target: {

821 type: "new_session",

822 agent_id: "agt_123",

823 environment: { type: "openai_hosted" },

824 input: [

825 {

826 role: "user",

827 content: [

828 {

829 type: "input_text",

830 text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.",

831 },

832 ],

833 },

834 ],

835 },

836});

837console.log(automation);

838```

839 

840```python

841from openai import OpenAI

842 

843client = OpenAI()

844automation = client.beta.agents.automations.create(

845 type="periodic",

846 name="Monthly spending review",

847 expression="0 9 1 * *",

848 timezone="America/New_York",

849 target={

850 "type": "new_session",

851 "agent_id": "agt_123",

852 "environment": {"type": "openai_hosted"},

853 "input": [

854 {

855 "role": "user",

856 "content": [

857 {

858 "type": "input_text",

859 "text": (

860 "Review my spending for the previous month. Flag unused "

861 "subscriptions, price increases, and other potential "

862 "savings for me to review."

863 ),

864 }

865 ],

866 }

867 ],

868 },

869)

870print(automation.to_json())

871```

872 

873```go

874import (

875 "context"

876 "fmt"

877 

878 "github.com/openai/openai-go/v3"

879)

880 

881ctx := context.Background()

882client := openai.NewClient()

883automation, err := client.Beta.Agents.Automations.New(ctx,

884 openai.BetaAgentAutomationNewParams{

885 CreateAutomationParams: openai.AutomationScheduleParamUnion{

886 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

887 Name: "Monthly spending review",

888 Expression: "0 9 1 * *",

889 Timezone: "America/New_York",

890 Target: openai.AutomationTargetParamUnion{

891 OfParamNewSession: &openai.AutomationTargetParamNewSession{

892 AgentID: openai.String("agt_123"),

893 Environment: openai.EnvironmentParamUnion{

894 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

895 },

896 Input: []openai.AgentSessionInputMessageParam{

897 {

898 Content: []openai.InputContentParamUnion{

899 {

900 OfParamInputText: &openai.InputContentParamInputText{

901 Text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.",

902 },

903 },

904 },

905 },

906 },

907 },

908 },

909 },

910 },

911 })

912if err != nil {

913 panic(err)

914}

915fmt.Println(automation)

916```

917 

918```java

919import com.openai.client.OpenAIClient;

920import com.openai.client.okhttp.OpenAIOkHttpClient;

921import com.openai.models.beta.agents.AgentSessionInputMessageParam;

922import com.openai.models.beta.agents.EnvironmentParam;

923import com.openai.models.beta.agents.automations.AutomationCreateParams;

924import com.openai.models.beta.agents.automations.AutomationScheduleParam;

925import com.openai.models.beta.agents.automations.AutomationTargetParam;

926 

927OpenAIClient client = OpenAIOkHttpClient.fromEnv();

928var automation =

929 client

930 .beta()

931 .agents()

932 .automations()

933 .create(

934 AutomationCreateParams.builder()

935 .automationScheduleParam(

936 AutomationScheduleParam.Periodic.builder()

937 .name("Monthly spending review")

938 .expression("0 9 1 * *")

939 .timezone("America/New_York")

940 .target(

941 AutomationTargetParam.NewSession.builder()

942 .agentId("agt_123")

943 .environment(EnvironmentParam.OpenAIHosted.builder().build())

944 .addInput(

945 AgentSessionInputMessageParam.builder()

946 .addInputTextContent(

947 "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.")

948 .build())

949 .build())

950 .build())

951 .build());

952System.out.println(automation);

953```

954 

955```csharp

956using OpenAI;

957using OpenAI.Agents;

958#pragma warning disable OPENAI001

959 

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

961AgentClient client = new OpenAIClient(key).GetAgentClient();

962AgentAutomation automation = await client.CreateAutomationAsync(

963 new AgentAutomationCreationOptions

964 {

965 Type = AgentAutomationType.Periodic,

966 Name = "Monthly spending review",

967 Expression = "0 9 1 * *",

968 Timezone = "America/New_York",

969 Target = new NewSessionAutomationTarget

970 {

971 AgentId = "agt_123",

972 Environment = new EnvironmentParamOpenaiHosted(),

973 Input =

974 [

975 new InputMessageParam(

976 [new InputContentParamInputText("Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.")]

977 ),

978 ],

979 },

980 }

981);

982Console.WriteLine(automation.Id);

983```

984 

985```ruby

986require "openai"

987 

988client = OpenAI::Client.new

989automation = client.beta.agents.automations.create(

990 body: {

991 type: "periodic",

992 name: "Monthly spending review",

993 expression: "0 9 1 * *",

994 timezone: "America/New_York",

995 target: {

996 type: "new_session",

997 agent_id: "agt_123",

998 environment: { type: "openai_hosted" },

999 input: [

1000 {

1001 role: "user",

1002 content: [

1003 {

1004 type: "input_text",

1005 text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review."

1006 }

1007 ]

1008 }

1009 ]

1010 }

1011 }

1012)

1013puts automation

1014```

1015 

1016```bash

1017curl https://api.openai.com/v1/agents/automations \

1018 -H "OpenAI-Beta: agents=v1" \

1019 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

1021 -d '{

1022 "type": "periodic",

1023 "name": "Monthly spending review",

1024 "expression": "0 9 1 * *",

1025 "timezone": "America/New_York",

1026 "target": {

1027 "type": "new_session",

1028 "agent_id": "agt_123",

1029 "environment": {

1030 "type": "openai_hosted"

1031 },

1032 "input": [

1033 {

1034 "role": "user",

1035 "content": [

1036 {

1037 "type": "input_text",

1038 "text": "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review."

1039 }

1040 ]

1041 }

1042 ]

1043 }

1044 }'

1045```

1046 

1047### Daily actions

1048 

1049```javascript

1050import OpenAI from "openai";

1051 

1052const client = new OpenAI();

1053const automation = await client.beta.agents.automations.create({

1054 type: "periodic",

1055 name: "Daily suggestions",

1056 expression: "0 10 * * *",

1057 timezone: "America/New_York",

1058 target: {

1059 type: "new_session",

1060 agent_id: "agt_123",

1061 environment: { type: "openai_hosted" },

1062 input: [

1063 {

1064 role: "user",

1065 content: [

1066 {

1067 type: "input_text",

1068 text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.",

1069 },

1070 ],

1071 },

1072 ],

1073 },

1074});

1075console.log(automation);

1076```

1077 

1078```python

1079from openai import OpenAI

1080 

1081client = OpenAI()

1082automation = client.beta.agents.automations.create(

1083 type="periodic",

1084 name="Daily suggestions",

1085 expression="0 10 * * *",

1086 timezone="America/New_York",

1087 target={

1088 "type": "new_session",

1089 "agent_id": "agt_123",

1090 "environment": {"type": "openai_hosted"},

1091 "input": [

1092 {

1093 "role": "user",

1094 "content": [

1095 {

1096 "type": "input_text",

1097 "text": (

1098 "Review my calendar, tasks, and recent messages for today. "

1099 "Suggest the most useful actions I could take today, "

1100 "with a short reason for each."

1101 ),

1102 }

1103 ],

1104 }

1105 ],

1106 },

1107)

1108print(automation.to_json())

1109```

1110 

1111```go

1112import (

1113 "context"

1114 "fmt"

1115 

1116 "github.com/openai/openai-go/v3"

1117)

1118 

1119ctx := context.Background()

1120client := openai.NewClient()

1121automation, err := client.Beta.Agents.Automations.New(ctx,

1122 openai.BetaAgentAutomationNewParams{

1123 CreateAutomationParams: openai.AutomationScheduleParamUnion{

1124 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

1125 Name: "Daily suggestions",

1126 Expression: "0 10 * * *",

1127 Timezone: "America/New_York",

1128 Target: openai.AutomationTargetParamUnion{

1129 OfParamNewSession: &openai.AutomationTargetParamNewSession{

1130 AgentID: openai.String("agt_123"),

1131 Environment: openai.EnvironmentParamUnion{

1132 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

1133 },

1134 Input: []openai.AgentSessionInputMessageParam{

1135 {

1136 Content: []openai.InputContentParamUnion{

1137 {

1138 OfParamInputText: &openai.InputContentParamInputText{

1139 Text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.",

1140 },

1141 },

1142 },

1143 },

1144 },

1145 },

1146 },

1147 },

1148 },

1149 })

1150if err != nil {

1151 panic(err)

1152}

1153fmt.Println(automation)

1154```

1155 

1156```java

1157import com.openai.client.OpenAIClient;

1158import com.openai.client.okhttp.OpenAIOkHttpClient;

1159import com.openai.models.beta.agents.AgentSessionInputMessageParam;

1160import com.openai.models.beta.agents.EnvironmentParam;

1161import com.openai.models.beta.agents.automations.AutomationCreateParams;

1162import com.openai.models.beta.agents.automations.AutomationScheduleParam;

1163import com.openai.models.beta.agents.automations.AutomationTargetParam;

1164 

1165OpenAIClient client = OpenAIOkHttpClient.fromEnv();

1166var automation =

1167 client

1168 .beta()

1169 .agents()

1170 .automations()

1171 .create(

1172 AutomationCreateParams.builder()

1173 .automationScheduleParam(

1174 AutomationScheduleParam.Periodic.builder()

1175 .name("Daily suggestions")

1176 .expression("0 10 * * *")

1177 .timezone("America/New_York")

1178 .target(

1179 AutomationTargetParam.NewSession.builder()

1180 .agentId("agt_123")

1181 .environment(EnvironmentParam.OpenAIHosted.builder().build())

1182 .addInput(

1183 AgentSessionInputMessageParam.builder()

1184 .addInputTextContent(

1185 "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.")

1186 .build())

1187 .build())

1188 .build())

1189 .build());

1190System.out.println(automation);

1191```

1192 

1193```csharp

1194using OpenAI;

1195using OpenAI.Agents;

1196#pragma warning disable OPENAI001

1197 

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

1199AgentClient client = new OpenAIClient(key).GetAgentClient();

1200AgentAutomation automation = await client.CreateAutomationAsync(

1201 new AgentAutomationCreationOptions

1202 {

1203 Type = AgentAutomationType.Periodic,

1204 Name = "Daily suggestions",

1205 Expression = "0 10 * * *",

1206 Timezone = "America/New_York",

1207 Target = new NewSessionAutomationTarget

1208 {

1209 AgentId = "agt_123",

1210 Environment = new EnvironmentParamOpenaiHosted(),

1211 Input =

1212 [

1213 new InputMessageParam(

1214 [new InputContentParamInputText("Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.")]

1215 ),

1216 ],

1217 },

1218 }

1219);

1220Console.WriteLine(automation.Id);

1221```

1222 

1223```ruby

1224require "openai"

1225 

1226client = OpenAI::Client.new

1227automation = client.beta.agents.automations.create(

1228 body: {

1229 type: "periodic",

1230 name: "Daily suggestions",

1231 expression: "0 10 * * *",

1232 timezone: "America/New_York",

1233 target: {

1234 type: "new_session",

1235 agent_id: "agt_123",

1236 environment: { type: "openai_hosted" },

1237 input: [

1238 {

1239 role: "user",

1240 content: [

1241 {

1242 type: "input_text",

1243 text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each."

1244 }

1245 ]

1246 }

1247 ]

1248 }

1249 }

1250)

1251puts automation

1252```

1253 

1254```bash

1255curl https://api.openai.com/v1/agents/automations \

1256 -H "OpenAI-Beta: agents=v1" \

1257 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

1259 -d '{

1260 "type": "periodic",

1261 "name": "Daily suggestions",

1262 "expression": "0 10 * * *",

1263 "timezone": "America/New_York",

1264 "target": {

1265 "type": "new_session",

1266 "agent_id": "agt_123",

1267 "environment": {

1268 "type": "openai_hosted"

1269 },

1270 "input": [

1271 {

1272 "role": "user",

1273 "content": [

1274 {

1275 "type": "input_text",

1276 "text": "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each."

1277 }

1278 ]

1279 }

1280 ]

1281 }

1282 }'

1283```

1284 

1285 

1286 

1287## How it works

1288 

1289An automation is a saved schedule for agent work. The Agents API stores the schedule and sends each task to its target session:

1290 

12911. **Define the work.** Choose when it should run and whether each run starts a new session or continues an existing one.

12922. **Send the task.** Each run creates an **invocation**, a record of the attempt to send the task to its target session. If that session is busy, the task waits.

12933. **Follow the result.** The agent works with the session's tools and context. Follow session events to track progress and collect results. The session receiving the task doesn't mean the agent has finished the work.

1294 

1295Your application can create, update, pause, or delete schedules through the API. With the `automations` tool enabled, an agent can also schedule its own next check in its current session.

1296 

1297## Choose the session and schedule

1298 

1299Choose a target based on whether the task needs earlier conversation history:

1300 

1301| Target | Use it for | Required configuration |

1302| ------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------- |

1303| `new_session` | Independent work, such as a monthly spending review. | An agent, an environment, and initial messages in `target.input`. |

1304| `existing_session` | Follow-up work that needs the session's previous findings. | A session ID and reminder text in `target.instructions`. |

1305 

1306Choose timing independently of the target:

1307 

1308| Type | Timing fields | Example |

1309| ---------- | --------------------------- | -------------------------------------------------------------------- |

1310| `periodic` | `expression` and `timezone` | Every day at 10 AM in `America/New_York`. |

1311| `once` | `run_at` | One check at a future time specified as a Unix timestamp in seconds. |

1312 

1313Both schedule types work with either target. Creating an automation saves it with status `active`; it doesn't run the task immediately. A periodic automation's first occurrence is scheduled for the next matching time.

1314 

1315## Schedule daily suggestions

1316 

1317Before creating the automation, create an agent with instructions and tools for the task, including access to the user's calendar, tasks, and messages. See [Reuse an agent across sessions](https://developers.openai.com/api/docs/guides/agents-api/configuration#reuse-an-agent-across-sessions).

1318 

1319The SDKs include the `OpenAI-Beta: agents=v1` header; include it when calling the API with cURL.

1320 

1321Here's an example of how to create an automation to start a new session for 10 AM each day in New York:

1322 

1323Schedule daily suggestions

1324 

1325```javascript

1326import OpenAI from "openai";

1327 

1328const client = new OpenAI();

1329const automation = await client.beta.agents.automations.create({

1330 type: "periodic",

1331 name: "Daily suggestions",

1332 expression: "0 10 * * *",

1333 timezone: "America/New_York",

1334 target: {

1335 type: "new_session",

1336 agent_id: "agt_123",

1337 environment: { type: "openai_hosted" },

1338 input: [

1339 {

1340 role: "user",

1341 content: [

1342 {

1343 type: "input_text",

1344 text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.",

1345 },

1346 ],

1347 },

1348 ],

1349 },

1350});

1351console.log(automation);

1352```

1353 

1354```python

1355from openai import OpenAI

1356 

1357client = OpenAI()

1358automation = client.beta.agents.automations.create(

1359 type="periodic",

1360 name="Daily suggestions",

1361 expression="0 10 * * *",

1362 timezone="America/New_York",

1363 target={

1364 "type": "new_session",

1365 "agent_id": "agt_123",

1366 "environment": {"type": "openai_hosted"},

1367 "input": [

1368 {

1369 "role": "user",

1370 "content": [

1371 {

1372 "type": "input_text",

1373 "text": (

1374 "Review my calendar, tasks, and recent messages for today. "

1375 "Suggest the most useful actions I could take today, "

1376 "with a short reason for each."

1377 ),

1378 }

1379 ],

1380 }

1381 ],

1382 },

1383)

1384print(automation.to_json())

1385```

1386 

1387```go

1388import (

1389 "context"

1390 "fmt"

1391 

1392 "github.com/openai/openai-go/v3"

1393)

1394 

1395ctx := context.Background()

1396client := openai.NewClient()

1397automation, err := client.Beta.Agents.Automations.New(ctx,

1398 openai.BetaAgentAutomationNewParams{

1399 CreateAutomationParams: openai.AutomationScheduleParamUnion{

1400 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

1401 Name: "Daily suggestions",

1402 Expression: "0 10 * * *",

1403 Timezone: "America/New_York",

1404 Target: openai.AutomationTargetParamUnion{

1405 OfParamNewSession: &openai.AutomationTargetParamNewSession{

1406 AgentID: openai.String("agt_123"),

1407 Environment: openai.EnvironmentParamUnion{

1408 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

1409 },

1410 Input: []openai.AgentSessionInputMessageParam{

1411 {

1412 Content: []openai.InputContentParamUnion{

1413 {

1414 OfParamInputText: &openai.InputContentParamInputText{

1415 Text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.",

1416 },

1417 },

1418 },

1419 },

1420 },

1421 },

1422 },

1423 },

1424 },

1425 })

1426if err != nil {

1427 panic(err)

1428}

1429fmt.Println(automation)

1430```

1431 

1432```java

1433import com.openai.client.OpenAIClient;

1434import com.openai.client.okhttp.OpenAIOkHttpClient;

1435import com.openai.models.beta.agents.AgentSessionInputMessageParam;

1436import com.openai.models.beta.agents.EnvironmentParam;

1437import com.openai.models.beta.agents.automations.AutomationCreateParams;

1438import com.openai.models.beta.agents.automations.AutomationScheduleParam;

1439import com.openai.models.beta.agents.automations.AutomationTargetParam;

1440 

1441OpenAIClient client = OpenAIOkHttpClient.fromEnv();

1442var automation =

1443 client

1444 .beta()

1445 .agents()

1446 .automations()

1447 .create(

1448 AutomationCreateParams.builder()

1449 .automationScheduleParam(

1450 AutomationScheduleParam.Periodic.builder()

1451 .name("Daily suggestions")

1452 .expression("0 10 * * *")

1453 .timezone("America/New_York")

1454 .target(

1455 AutomationTargetParam.NewSession.builder()

1456 .agentId("agt_123")

1457 .environment(EnvironmentParam.OpenAIHosted.builder().build())

1458 .addInput(

1459 AgentSessionInputMessageParam.builder()

1460 .addInputTextContent(

1461 "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.")

1462 .build())

1463 .build())

1464 .build())

1465 .build());

1466System.out.println(automation);

1467```

1468 

1469```csharp

1470using OpenAI;

1471using OpenAI.Agents;

1472#pragma warning disable OPENAI001

1473 

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

1475AgentClient client = new OpenAIClient(key).GetAgentClient();

1476AgentAutomation automation = await client.CreateAutomationAsync(

1477 new AgentAutomationCreationOptions

1478 {

1479 Type = AgentAutomationType.Periodic,

1480 Name = "Daily suggestions",

1481 Expression = "0 10 * * *",

1482 Timezone = "America/New_York",

1483 Target = new NewSessionAutomationTarget

1484 {

1485 AgentId = "agt_123",

1486 Environment = new EnvironmentParamOpenaiHosted(),

1487 Input =

1488 [

1489 new InputMessageParam(

1490 [new InputContentParamInputText("Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each.")]

1491 ),

1492 ],

1493 },

1494 }

1495);

1496Console.WriteLine(automation.Id);

1497```

1498 

1499```ruby

1500require "openai"

1501 

1502client = OpenAI::Client.new

1503automation = client.beta.agents.automations.create(

1504 body: {

1505 type: "periodic",

1506 name: "Daily suggestions",

1507 expression: "0 10 * * *",

1508 timezone: "America/New_York",

1509 target: {

1510 type: "new_session",

1511 agent_id: "agt_123",

1512 environment: { type: "openai_hosted" },

1513 input: [

1514 {

1515 role: "user",

1516 content: [

1517 {

1518 type: "input_text",

1519 text: "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each."

1520 }

1521 ]

1522 }

1523 ]

1524 }

1525 }

1526)

1527puts automation

1528```

1529 

1530```bash

1531curl https://api.openai.com/v1/agents/automations \

1532 -H "OpenAI-Beta: agents=v1" \

1533 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

1535 -d '{

1536 "type": "periodic",

1537 "name": "Daily suggestions",

1538 "expression": "0 10 * * *",

1539 "timezone": "America/New_York",

1540 "target": {

1541 "type": "new_session",

1542 "agent_id": "agt_123",

1543 "environment": {

1544 "type": "openai_hosted"

1545 },

1546 "input": [

1547 {

1548 "role": "user",

1549 "content": [

1550 {

1551 "type": "input_text",

1552 "text": "Review my calendar, tasks, and recent messages for today. Suggest the most useful actions I could take today, with a short reason for each."

1553 }

1554 ]

1555 }

1556 ]

1557 }

1558 }'

1559```

1560 

1561 

1562Save the returned automation `id` to inspect or manage the schedule later. Each invocation starts a new conversation. The environment configuration above provisions an [OpenAI-hosted sandbox](https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted) for that session.

1563 

1564You can supply inline agent configuration in `target.agent` instead of a saved `target.agent_id`. Supply exactly one of these fields. Put the initial messages inside `target.input`, not at the top level of the request. Include at least one message with nonempty text or an image URL.

1565 

1566### Review spending each month

1567 

1568The same approach works for a monthly spending review. Give the saved agent access to the user's financial records, then schedule a new session for 9 AM on the first day of each month:

1569 

1570Schedule a monthly spending review

1571 

1572```javascript

1573import OpenAI from "openai";

1574 

1575const client = new OpenAI();

1576const automation = await client.beta.agents.automations.create({

1577 type: "periodic",

1578 name: "Monthly spending review",

1579 expression: "0 9 1 * *",

1580 timezone: "America/New_York",

1581 target: {

1582 type: "new_session",

1583 agent_id: "agt_123",

1584 environment: { type: "openai_hosted" },

1585 input: [

1586 {

1587 role: "user",

1588 content: [

1589 {

1590 type: "input_text",

1591 text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.",

1592 },

1593 ],

1594 },

1595 ],

1596 },

1597});

1598console.log(automation);

1599```

1600 

1601```python

1602from openai import OpenAI

1603 

1604client = OpenAI()

1605automation = client.beta.agents.automations.create(

1606 type="periodic",

1607 name="Monthly spending review",

1608 expression="0 9 1 * *",

1609 timezone="America/New_York",

1610 target={

1611 "type": "new_session",

1612 "agent_id": "agt_123",

1613 "environment": {"type": "openai_hosted"},

1614 "input": [

1615 {

1616 "role": "user",

1617 "content": [

1618 {

1619 "type": "input_text",

1620 "text": (

1621 "Review my spending for the previous month. Flag unused "

1622 "subscriptions, price increases, and other potential "

1623 "savings for me to review."

1624 ),

1625 }

1626 ],

1627 }

1628 ],

1629 },

1630)

1631print(automation.to_json())

1632```

1633 

1634```go

1635import (

1636 "context"

1637 "fmt"

1638 

1639 "github.com/openai/openai-go/v3"

1640)

1641 

1642ctx := context.Background()

1643client := openai.NewClient()

1644automation, err := client.Beta.Agents.Automations.New(ctx,

1645 openai.BetaAgentAutomationNewParams{

1646 CreateAutomationParams: openai.AutomationScheduleParamUnion{

1647 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

1648 Name: "Monthly spending review",

1649 Expression: "0 9 1 * *",

1650 Timezone: "America/New_York",

1651 Target: openai.AutomationTargetParamUnion{

1652 OfParamNewSession: &openai.AutomationTargetParamNewSession{

1653 AgentID: openai.String("agt_123"),

1654 Environment: openai.EnvironmentParamUnion{

1655 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

1656 },

1657 Input: []openai.AgentSessionInputMessageParam{

1658 {

1659 Content: []openai.InputContentParamUnion{

1660 {

1661 OfParamInputText: &openai.InputContentParamInputText{

1662 Text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.",

1663 },

1664 },

1665 },

1666 },

1667 },

1668 },

1669 },

1670 },

1671 },

1672 })

1673if err != nil {

1674 panic(err)

1675}

1676fmt.Println(automation)

1677```

1678 

1679```java

1680import com.openai.client.OpenAIClient;

1681import com.openai.client.okhttp.OpenAIOkHttpClient;

1682import com.openai.models.beta.agents.AgentSessionInputMessageParam;

1683import com.openai.models.beta.agents.EnvironmentParam;

1684import com.openai.models.beta.agents.automations.AutomationCreateParams;

1685import com.openai.models.beta.agents.automations.AutomationScheduleParam;

1686import com.openai.models.beta.agents.automations.AutomationTargetParam;

1687 

1688OpenAIClient client = OpenAIOkHttpClient.fromEnv();

1689var automation =

1690 client

1691 .beta()

1692 .agents()

1693 .automations()

1694 .create(

1695 AutomationCreateParams.builder()

1696 .automationScheduleParam(

1697 AutomationScheduleParam.Periodic.builder()

1698 .name("Monthly spending review")

1699 .expression("0 9 1 * *")

1700 .timezone("America/New_York")

1701 .target(

1702 AutomationTargetParam.NewSession.builder()

1703 .agentId("agt_123")

1704 .environment(EnvironmentParam.OpenAIHosted.builder().build())

1705 .addInput(

1706 AgentSessionInputMessageParam.builder()

1707 .addInputTextContent(

1708 "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.")

1709 .build())

1710 .build())

1711 .build())

1712 .build());

1713System.out.println(automation);

1714```

1715 

1716```csharp

1717using OpenAI;

1718using OpenAI.Agents;

1719#pragma warning disable OPENAI001

1720 

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

1722AgentClient client = new OpenAIClient(key).GetAgentClient();

1723AgentAutomation automation = await client.CreateAutomationAsync(

1724 new AgentAutomationCreationOptions

1725 {

1726 Type = AgentAutomationType.Periodic,

1727 Name = "Monthly spending review",

1728 Expression = "0 9 1 * *",

1729 Timezone = "America/New_York",

1730 Target = new NewSessionAutomationTarget

1731 {

1732 AgentId = "agt_123",

1733 Environment = new EnvironmentParamOpenaiHosted(),

1734 Input =

1735 [

1736 new InputMessageParam(

1737 [new InputContentParamInputText("Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review.")]

1738 ),

1739 ],

1740 },

1741 }

1742);

1743Console.WriteLine(automation.Id);

1744```

1745 

1746```ruby

1747require "openai"

1748 

1749client = OpenAI::Client.new

1750automation = client.beta.agents.automations.create(

1751 body: {

1752 type: "periodic",

1753 name: "Monthly spending review",

1754 expression: "0 9 1 * *",

1755 timezone: "America/New_York",

1756 target: {

1757 type: "new_session",

1758 agent_id: "agt_123",

1759 environment: { type: "openai_hosted" },

1760 input: [

1761 {

1762 role: "user",

1763 content: [

1764 {

1765 type: "input_text",

1766 text: "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review."

1767 }

1768 ]

1769 }

1770 ]

1771 }

1772 }

1773)

1774puts automation

1775```

1776 

1777```bash

1778curl https://api.openai.com/v1/agents/automations \

1779 -H "OpenAI-Beta: agents=v1" \

1780 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

1782 -d '{

1783 "type": "periodic",

1784 "name": "Monthly spending review",

1785 "expression": "0 9 1 * *",

1786 "timezone": "America/New_York",

1787 "target": {

1788 "type": "new_session",

1789 "agent_id": "agt_123",

1790 "environment": {

1791 "type": "openai_hosted"

1792 },

1793 "input": [

1794 {

1795 "role": "user",

1796 "content": [

1797 {

1798 "type": "input_text",

1799 "text": "Review my spending for the previous month. Flag unused subscriptions, price increases, and other potential savings for me to review."

1800 }

1801 ]

1802 }

1803 ]

1804 }

1805 }'

1806```

1807 

1808 

1809### Set recurring timing

1810 

1811Use a five-field cron expression with a named time zone:

1812 

1813| Expression | Schedule |

1814| ----------------- | ------------------------------- |

1815| `0 10 * * *` | Every day at 10 AM |

1816| `0 */2 * * *` | Every two hours |

1817| `0 9 1 * *` | First day of each month at 9 AM |

1818| `0 9 * * MON-FRI` | Monday through Friday at 9 AM |

1819 

1820The time zone determines how to interpret the expression. Use `UTC` for a UTC schedule or an IANA time zone such as `America/New_York` for a local schedule. Don't include `run_at` in a periodic automation.

1821 

1822A cron schedule follows clock times in the selected time zone. For example, `0 */3 * * *` schedules runs at midnight, 3 AM, 6 AM, and every three hours after that, rather than every three hours from creation.

1823 

1824The schedule specifies the intended time. The Agents API adds a small randomized delay to recurring runs to spread load. The task can wait longer if the target session is busy.

1825 

1826## Continue an existing session

1827 

1828Use an existing session when the agent needs earlier findings, messages, or saved work. For example, a session planning dinner can keep the restaurant preferences and results from earlier availability checks.

1829 

1830Here's how to check for restaurant reservations every two hours in that session:

1831 

1832Check restaurant reservations

1833 

1834```javascript

1835import OpenAI from "openai";

1836 

1837const client = new OpenAI();

1838const automation = await client.beta.agents.automations.create({

1839 type: "periodic",

1840 name: "Check restaurant reservations",

1841 expression: "0 */2 * * *",

1842 timezone: "America/New_York",

1843 target: {

1844 type: "existing_session",

1845 session_id: "sess_123",

1846 instructions:

1847 "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

1848 },

1849});

1850console.log(automation);

1851```

1852 

1853```python

1854from openai import OpenAI

1855 

1856client = OpenAI()

1857automation = client.beta.agents.automations.create(

1858 type="periodic",

1859 name="Check restaurant reservations",

1860 expression="0 */2 * * *",

1861 timezone="America/New_York",

1862 target={

1863 "type": "existing_session",

1864 "session_id": "sess_123",

1865 "instructions": (

1866 "Check restaurant availability for our dinner plans. "

1867 "Compare with earlier checks and report newly available tables."

1868 ),

1869 },

1870)

1871print(automation.to_json())

1872```

1873 

1874```go

1875import (

1876 "context"

1877 "fmt"

1878 

1879 "github.com/openai/openai-go/v3"

1880)

1881 

1882ctx := context.Background()

1883client := openai.NewClient()

1884automation, err := client.Beta.Agents.Automations.New(ctx,

1885 openai.BetaAgentAutomationNewParams{

1886 CreateAutomationParams: openai.AutomationScheduleParamUnion{

1887 OfParamPeriodic: &openai.AutomationScheduleParamPeriodic{

1888 Name: "Check restaurant reservations",

1889 Expression: "0 */2 * * *",

1890 Timezone: "America/New_York",

1891 Target: openai.AutomationTargetParamUnion{

1892 OfParamExistingSession: &openai.AutomationTargetParamExistingSession{

1893 SessionID: "sess_123",

1894 Instructions: "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

1895 },

1896 },

1897 },

1898 },

1899 })

1900if err != nil {

1901 panic(err)

1902}

1903fmt.Println(automation)

1904```

1905 

1906```java

1907import com.openai.client.OpenAIClient;

1908import com.openai.client.okhttp.OpenAIOkHttpClient;

1909import com.openai.models.beta.agents.automations.AutomationCreateParams;

1910import com.openai.models.beta.agents.automations.AutomationScheduleParam;

1911import com.openai.models.beta.agents.automations.AutomationTargetParam;

1912 

1913OpenAIClient client = OpenAIOkHttpClient.fromEnv();

1914var automation =

1915 client

1916 .beta()

1917 .agents()

1918 .automations()

1919 .create(

1920 AutomationCreateParams.builder()

1921 .automationScheduleParam(

1922 AutomationScheduleParam.Periodic.builder()

1923 .name("Check restaurant reservations")

1924 .expression("0 */2 * * *")

1925 .timezone("America/New_York")

1926 .target(

1927 AutomationTargetParam.ExistingSession.builder()

1928 .sessionId("sess_123")

1929 .instructions(

1930 "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.")

1931 .build())

1932 .build())

1933 .build());

1934System.out.println(automation);

1935```

1936 

1937```csharp

1938using OpenAI;

1939using OpenAI.Agents;

1940#pragma warning disable OPENAI001

1941 

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

1943AgentClient client = new OpenAIClient(key).GetAgentClient();

1944AgentAutomation automation = await client.CreateAutomationAsync(

1945 new AgentAutomationCreationOptions

1946 {

1947 Type = AgentAutomationType.Periodic,

1948 Name = "Check restaurant reservations",

1949 Expression = "0 */2 * * *",

1950 Timezone = "America/New_York",

1951 Target = new ExistingSessionAutomationTarget

1952 {

1953 SessionId = "sess_123",

1954 Instructions = "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables.",

1955 },

1956 }

1957);

1958Console.WriteLine(automation.Id);

1959```

1960 

1961```ruby

1962require "openai"

1963 

1964client = OpenAI::Client.new

1965automation = client.beta.agents.automations.create(

1966 body: {

1967 type: "periodic",

1968 name: "Check restaurant reservations",

1969 expression: "0 */2 * * *",

1970 timezone: "America/New_York",

1971 target: {

1972 type: "existing_session",

1973 session_id: "sess_123",

1974 instructions: "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables."

1975 }

1976 }

1977)

1978puts automation

1979```

1980 

1981```bash

1982curl https://api.openai.com/v1/agents/automations \

1983 -H "OpenAI-Beta: agents=v1" \

1984 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

1986 -d '{

1987 "type": "periodic",

1988 "name": "Check restaurant reservations",

1989 "expression": "0 */2 * * *",

1990 "timezone": "America/New_York",

1991 "target": {

1992 "type": "existing_session",

1993 "session_id": "sess_123",

1994 "instructions": "Check restaurant availability for our dinner plans. Compare with earlier checks and report newly available tables."

1995 }

1996 }'

1997```

1998 

1999 

2000Each invocation delivers the saved instructions as an automation notification to the same session, using its current agent configuration and saved state. The notification is separate from a new user message.

2001 

2002If the session is working, delivery waits for it to become available. A scheduled run doesn't interrupt the active turn or supply a missing tool result or approval. Your application must still [handle required actions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#handle-required-actions).

2003 

2004### Schedule one check

2005 

2006For a single follow-up, use `type: "once"` with `run_at`. The value must be an integer Unix timestamp in **seconds** that is in the future. Don't include `expression` or `timezone`.

2007 

2008Schedule a check at **January 1, 2027, at 9 AM UTC**:

2009 

2010Schedule an agent to run once

2011 

2012```javascript

2013import OpenAI from "openai";

2014 

2015const client = new OpenAI();

2016const automation = await client.beta.agents.automations.create({

2017 type: "once",

2018 name: "Check restaurant reply",

2019 run_at: 1798794000,

2020 target: {

2021 type: "existing_session",

2022 session_id: "sess_123",

2023 instructions:

2024 "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans.",

2025 },

2026});

2027console.log(automation);

2028```

2029 

2030```python

2031from openai import OpenAI

2032 

2033client = OpenAI()

2034automation = client.beta.agents.automations.create(

2035 type="once",

2036 name="Check restaurant reply",

2037 run_at=1798794000,

2038 target={

2039 "type": "existing_session",

2040 "session_id": "sess_123",

2041 "instructions": (

2042 "Check whether the restaurant replied about our booking. "

2043 "Summarize any changes to the dinner plans."

2044 ),

2045 },

2046)

2047print(automation.to_json())

2048```

2049 

2050```go

2051import (

2052 "context"

2053 "fmt"

2054 

2055 "github.com/openai/openai-go/v3"

2056)

2057 

2058ctx := context.Background()

2059client := openai.NewClient()

2060automation, err := client.Beta.Agents.Automations.New(ctx,

2061 openai.BetaAgentAutomationNewParams{

2062 CreateAutomationParams: openai.AutomationScheduleParamUnion{

2063 OfParamOnce: &openai.AutomationScheduleParamOnce{

2064 Name: "Check restaurant reply",

2065 RunAt: 1798794000,

2066 Target: openai.AutomationTargetParamUnion{

2067 OfParamExistingSession: &openai.AutomationTargetParamExistingSession{

2068 SessionID: "sess_123",

2069 Instructions: "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans.",

2070 },

2071 },

2072 },

2073 },

2074 })

2075if err != nil {

2076 panic(err)

2077}

2078fmt.Println(automation)

2079```

2080 

2081```java

2082import com.openai.client.OpenAIClient;

2083import com.openai.client.okhttp.OpenAIOkHttpClient;

2084import com.openai.models.beta.agents.automations.AutomationCreateParams;

2085import com.openai.models.beta.agents.automations.AutomationScheduleParam;

2086import com.openai.models.beta.agents.automations.AutomationTargetParam;

2087 

2088OpenAIClient client = OpenAIOkHttpClient.fromEnv();

2089var automation =

2090 client

2091 .beta()

2092 .agents()

2093 .automations()

2094 .create(

2095 AutomationCreateParams.builder()

2096 .automationScheduleParam(

2097 AutomationScheduleParam.Once.builder()

2098 .name("Check restaurant reply")

2099 .runAt(1798794000L)

2100 .target(

2101 AutomationTargetParam.ExistingSession.builder()

2102 .sessionId("sess_123")

2103 .instructions(

2104 "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans.")

2105 .build())

2106 .build())

2107 .build());

2108System.out.println(automation);

2109```

2110 

2111```csharp

2112using OpenAI;

2113using OpenAI.Agents;

2114#pragma warning disable OPENAI001

2115 

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

2117AgentClient client = new OpenAIClient(key).GetAgentClient();

2118AgentAutomation automation = await client.CreateAutomationAsync(

2119 new AgentAutomationCreationOptions

2120 {

2121 Type = AgentAutomationType.Once,

2122 Name = "Check restaurant reply",

2123 RunAt = 1798794000,

2124 Target = new ExistingSessionAutomationTarget

2125 {

2126 SessionId = "sess_123",

2127 Instructions = "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans.",

2128 },

2129 }

2130);

2131Console.WriteLine(automation.Id);

2132```

2133 

2134```ruby

2135require "openai"

2136 

2137client = OpenAI::Client.new

2138automation = client.beta.agents.automations.create(

2139 body: {

2140 type: "once",

2141 name: "Check restaurant reply",

2142 run_at: 1798794000,

2143 target: {

2144 type: "existing_session",

2145 session_id: "sess_123",

2146 instructions: "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans."

2147 }

2148 }

2149)

2150puts automation

2151```

2152 

2153```bash

2154curl https://api.openai.com/v1/agents/automations \

2155 -H "OpenAI-Beta: agents=v1" \

2156 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

2158 -d '{

2159 "type": "once",

2160 "name": "Check restaurant reply",

2161 "run_at": 1798794000,

2162 "target": {

2163 "type": "existing_session",

2164 "session_id": "sess_123",

2165 "instructions": "Check whether the restaurant replied about our booking. Summarize any changes to the dinner plans."

2166 }

2167 }'

2168```

2169 

2170 

2171A completed one-time schedule has no more scheduled runs. You can still invoke it manually or create another automation for another scheduled follow-up.

2172 

2173## Let the agent schedule follow-ups

2174 

2175Add `automations` to the agent's tools so it can schedule work requested by the user. This example also enables subagents, so the main agent can delegate each scheduled task and keep a concise summary of the result:

2176 

2177Let agents schedule tasks

2178 

2179```javascript

2180import OpenAI from "openai";

2181 

2182const client = new OpenAI();

2183const session = await client.beta.agents.sessions.create({

2184 agent: {

2185 model: "gpt-6-astra",

2186 instructions:

2187 "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

2188 tools: [{ type: "automations" }],

2189 multi_agent: { enabled: true },

2190 },

2191 environment: { type: "openai_hosted" },

2192 input:

2193 "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.",

2194});

2195console.log(session.id);

2196```

2197 

2198```python

2199from openai import OpenAI

2200 

2201client = OpenAI()

2202session = client.beta.agents.sessions.create(

2203 agent={

2204 "model": "gpt-6-astra",

2205 "instructions": (

2206 "Use automations to schedule tasks requested by the user. "

2207 "Delegate each scheduled task to a subagent and ask for a concise result. "

2208 "Keep the goal, schedule, and useful summaries in the main session. "

2209 "Adjust or stop schedules when the user asks."

2210 ),

2211 "multi_agent": {"enabled": True},

2212 "tools": [{"type": "automations"}],

2213 },

2214 environment={"type": "openai_hosted"},

2215 input=(

2216 "Every day at 10 AM in America/New_York, review the goals we discuss here "

2217 "and suggest the next actions I could take."

2218 ),

2219)

2220print(session.id)

2221```

2222 

2223```go

2224import (

2225 "context"

2226 "fmt"

2227 

2228 "github.com/openai/openai-go/v3"

2229)

2230 

2231ctx := context.Background()

2232client := openai.NewClient()

2233session, err := client.Beta.Agents.Sessions.New(ctx,

2234 openai.BetaAgentSessionNewParams{

2235 Agent: openai.BetaAgentSessionNewParamsAgent{

2236 Model: openai.String("gpt-6-astra"),

2237 Instructions: openai.String("Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks."),

2238 MultiAgent: openai.MultiAgentConfigParam{

2239 Enabled: true,

2240 },

2241 Tools: []openai.AgentToolParamUnion{

2242 {OfParamAutomations: &openai.AgentToolParamAutomations{}},

2243 },

2244 },

2245 Environment: openai.EnvironmentParamUnion{

2246 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{},

2247 },

2248 Input: openai.BetaAgentSessionNewParamsInputUnion{

2249 OfString: openai.String("Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."),

2250 },

2251 })

2252if err != nil {

2253 panic(err)

2254}

2255fmt.Println(session.ID)

2256```

2257 

2258```java

2259import com.openai.client.OpenAIClient;

2260import com.openai.client.okhttp.OpenAIOkHttpClient;

2261import com.openai.models.beta.agents.EnvironmentParam;

2262import com.openai.models.beta.agents.MultiAgentConfigParam;

2263import com.openai.models.beta.agents.sessions.SessionCreateParams;

2264 

2265OpenAIClient client = OpenAIOkHttpClient.fromEnv();

2266var session =

2267 client

2268 .beta()

2269 .agents()

2270 .sessions()

2271 .create(

2272 SessionCreateParams.builder()

2273 .agent(

2274 SessionCreateParams.Agent.builder()

2275 .model("gpt-6-astra")

2276 .instructions(

2277 "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.")

2278 .multiAgent(MultiAgentConfigParam.builder().enabled(true).build())

2279 .addToolAutomations()

2280 .build())

2281 .environment(EnvironmentParam.OpenAIHosted.builder().build())

2282 .input(

2283 "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.")

2284 .build());

2285System.out.println(session.id());

2286```

2287 

2288```csharp

2289using OpenAI;

2290using OpenAI.Agents;

2291#pragma warning disable OPENAI001

2292 

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

2294AgentClient client = new OpenAIClient(key).GetAgentClient();

2295AgentSession session = await client.CreateAgentSessionAsync(

2296 new AgentSessionCreationOptions

2297 {

2298 Agent = new SessionAgentConfigParam

2299 {

2300 Model = "gpt-6-astra",

2301 Instructions = "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

2302 MultiAgent = new MultiAgentConfigParam { Enabled = true },

2303 Tools = [new AgentToolConfigParamAutomations()],

2304 },

2305 Environment = new EnvironmentParamOpenaiHosted(),

2306 Input =

2307 [

2308 new InputMessageParam(

2309 [new InputContentParamInputText("Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take.")]

2310 ),

2311 ],

2312 }

2313);

2314Console.WriteLine(session.Id);

2315```

2316 

2317```ruby

2318require "openai"

2319 

2320client = OpenAI::Client.new

2321session = client.beta.agents.sessions.create(

2322 agent: {

2323 model: "gpt-6-astra",

2324 instructions: "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

2325 multi_agent: { enabled: true },

2326 tools: [{ type: "automations" }]

2327 },

2328 environment: { type: "openai_hosted" },

2329 input: "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."

2330)

2331puts session.id

2332```

2333 

2334```bash

2335curl https://api.openai.com/v1/agents/sessions \

2336 -H "OpenAI-Beta: agents=v1" \

2337 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

2339 -d '{

2340 "agent": {

2341 "model": "gpt-6-astra",

2342 "instructions": "Use automations to schedule tasks requested by the user. Delegate each scheduled task to a subagent and ask for a concise result. Keep the goal, schedule, and useful summaries in the main session. Adjust or stop schedules when the user asks.",

2343 "tools": [{ "type": "automations" }],

2344 "multi_agent": { "enabled": true }

2345 },

2346 "environment": {

2347 "type": "openai_hosted"

2348 },

2349 "input": "Every day at 10 AM in America/New_York, review the goals we discuss here and suggest the next actions I could take."

2350 }'

2351```

2352 

2353 

2354This lets the agent create, list, get, update, pause, resume, and delete its own automations. The Agents API sets the current session as the target. The agent can create one-time or periodic runs, but it can't use these tools to start a new session or manage another session's automations.

2355 

2356The tools can access only automations created by the agent in the current session. Your application can manage those automations through the API, alongside automations it created itself. The Agents API records the creator in `created_by`; don't send that field in a create request.

2357 

2358The tool is absent by default. Your application can schedule work without enabling it. Removing the tool from an agent's configuration doesn't delete saved schedules; pause or delete them through the API when needed.

2359 

2360### Keep repeated work out of the main context

2361 

2362For ongoing goals, [enable multi-agent orchestration](https://developers.openai.com/api/docs/guides/agents-api/multi-agent#enable-multi-agent-orchestration) with `agent.multi_agent.enabled: true`. Ask the main agent to keep the goal and schedule, delegate each task to a subagent, and retain a short result. This keeps detailed tool output from repeated checks out of the main session's context window.

2363 

2364For example, include this in the main agent's instructions:

2365 

2366> Delegate each scheduled task to a subagent. Give it the goal and relevant prior findings, and ask for a concise result. Review that result, keep the useful summary, and decide whether to continue, change, or stop the schedule.

2367 

2368The `automations` tool manages schedules. Keep the other tools and data access the agent needs to do the scheduled work.

2369 

2370## Schedule onboarding follow-ups from your app

2371 

2372Your application can also create schedules in response to its own events. For example, when a user signs up, start an onboarding session and schedule its first follow-up for 48 hours later:

2373 

2374Schedule an onboarding follow-up

2375 

2376```javascript

2377import OpenAI from "openai";

2378 

2379const client = new OpenAI();

2380const automation = await client.beta.agents.automations.create({

2381 type: "once",

2382 name: "Onboarding follow-up",

2383 run_at: Math.floor(Date.now() / 1000) + 48 * 60 * 60,

2384 target: {

2385 type: "existing_session",

2386 session_id: "sess_123",

2387 instructions:

2388 "Review onboarding progress and send the next onboarding message if the user has not completed onboarding.",

2389 },

2390});

2391console.log(automation);

2392```

2393 

2394```python

2395import time

2396 

2397from openai import OpenAI

2398 

2399client = OpenAI()

2400automation = client.beta.agents.automations.create(

2401 type="once",

2402 name="Onboarding follow-up",

2403 run_at=int(time.time()) + 48 * 60 * 60,

2404 target={

2405 "type": "existing_session",

2406 "session_id": "sess_123",

2407 "instructions": (

2408 "Review onboarding progress and send the next onboarding message "

2409 "if the user has not completed onboarding."

2410 ),

2411 },

2412)

2413print(automation.to_json())

2414```

2415 

2416```go

2417import (

2418 "context"

2419 "fmt"

2420 "time"

2421 

2422 "github.com/openai/openai-go/v3"

2423)

2424 

2425ctx := context.Background()

2426client := openai.NewClient()

2427automation, err := client.Beta.Agents.Automations.New(ctx,

2428 openai.BetaAgentAutomationNewParams{

2429 CreateAutomationParams: openai.AutomationScheduleParamUnion{

2430 OfParamOnce: &openai.AutomationScheduleParamOnce{

2431 Name: "Onboarding follow-up",

2432 RunAt: time.Now().Add(48 * time.Hour).Unix(),

2433 Target: openai.AutomationTargetParamUnion{

2434 OfParamExistingSession: &openai.AutomationTargetParamExistingSession{

2435 SessionID: "sess_123",

2436 Instructions: "Review onboarding progress and send the next onboarding message if the user has not completed onboarding.",

2437 },

2438 },

2439 },

2440 },

2441 })

2442if err != nil {

2443 panic(err)

2444}

2445fmt.Println(automation)

2446```

2447 

2448```java

2449import com.openai.client.OpenAIClient;

2450import com.openai.client.okhttp.OpenAIOkHttpClient;

2451import com.openai.models.beta.agents.automations.AutomationCreateParams;

2452import com.openai.models.beta.agents.automations.AutomationScheduleParam;

2453import com.openai.models.beta.agents.automations.AutomationTargetParam;

2454import java.time.Duration;

2455import java.time.Instant;

2456 

2457OpenAIClient client = OpenAIOkHttpClient.fromEnv();

2458var automation =

2459 client

2460 .beta()

2461 .agents()

2462 .automations()

2463 .create(

2464 AutomationCreateParams.builder()

2465 .automationScheduleParam(

2466 AutomationScheduleParam.Once.builder()

2467 .name("Onboarding follow-up")

2468 .runAt(Instant.now().plus(Duration.ofHours(48)).getEpochSecond())

2469 .target(

2470 AutomationTargetParam.ExistingSession.builder()

2471 .sessionId("sess_123")

2472 .instructions(

2473 "Review onboarding progress and send the next onboarding message if the user has not completed onboarding.")

2474 .build())

2475 .build())

2476 .build());

2477System.out.println(automation);

2478```

2479 

2480```csharp

2481using OpenAI;

2482using OpenAI.Agents;

2483#pragma warning disable OPENAI001

2484 

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

2486AgentClient client = new OpenAIClient(key).GetAgentClient();

2487AgentAutomation automation = await client.CreateAutomationAsync(

2488 new AgentAutomationCreationOptions

2489 {

2490 Type = AgentAutomationType.Once,

2491 Name = "Onboarding follow-up",

2492 RunAt = DateTimeOffset.UtcNow.AddHours(48).ToUnixTimeSeconds(),

2493 Target = new ExistingSessionAutomationTarget

2494 {

2495 SessionId = "sess_123",

2496 Instructions = "Review onboarding progress and send the next onboarding message if the user has not completed onboarding.",

2497 },

2498 }

2499);

2500Console.WriteLine(automation.Id);

2501```

2502 

2503```ruby

2504require "openai"

2505 

2506client = OpenAI::Client.new

2507automation = client.beta.agents.automations.create(

2508 body: {

2509 type: "once",

2510 name: "Onboarding follow-up",

2511 run_at: Time.now.to_i + 48 * 60 * 60,

2512 target: {

2513 type: "existing_session",

2514 session_id: "sess_123",

2515 instructions: "Review onboarding progress and send the next onboarding message if the user has not completed onboarding."

2516 }

2517 }

2518)

2519puts automation

2520```

2521 

2522```bash

2523RUN_AT=$(($(date +%s) + 48 * 60 * 60))

2524 

2525curl https://api.openai.com/v1/agents/automations \

2526 -H "OpenAI-Beta: agents=v1" \

2527 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

2529 -d @- <<EOF

2530{

2531 "type": "once",

2532 "name": "Onboarding follow-up",

2533 "run_at": $RUN_AT,

2534 "target": {

2535 "type": "existing_session",

2536 "session_id": "sess_123",

2537 "instructions": "Review onboarding progress and send the next onboarding message if the user has not completed onboarding."

2538 }

2539 }

2540EOF

2541```

2542 

2543 

2544After each completed follow-up, your application can schedule another one 48 hours later. Stop when onboarding is complete or the user opts out, and delete any pending follow-up. Use one-time schedules for this interval; a cron day-of-month expression doesn't represent a repeating 48-hour interval across month boundaries.

2545 

2546The onboarding agent needs access to onboarding progress and the application's messaging tools. Creating the automation schedules the work; it doesn't send the message immediately.

2547 

2548## Try a run and inspect delivery

2549 

2550To test a saved automation immediately, send `POST /v1/agents/automations/auto_123/invocations` with no request body. A manual invocation doesn't change the saved schedule or consume a one-time scheduled run. It also works while the schedule is paused.

2551 

2552Save the returned invocation ID. Retrieve it with `GET /v1/agents/automations/auto_123/invocations/ainv_123`, or list delivery history with `GET /v1/agents/automations/auto_123/invocations`.

2553 

2554For an overview of past runs, list the automation's invocations:

2555 

2556Monitor automation invocations

2557 

2558```javascript

2559import OpenAI from "openai";

2560 

2561const client = new OpenAI();

2562for await (const invocation of client.beta.agents.automations.invocations.list(

2563 "auto_123"

2564)) {

2565 console.log(invocation.id, invocation.status, invocation.session_id);

2566}

2567```

2568 

2569```python

2570from openai import OpenAI

2571 

2572client = OpenAI()

2573invocations = client.beta.agents.automations.invocations.list(automation_id="auto_123")

2574for invocation in invocations:

2575 print(invocation.id, invocation.status, invocation.session_id)

2576```

2577 

2578```go

2579import (

2580 "context"

2581 "fmt"

2582 

2583 "github.com/openai/openai-go/v3"

2584)

2585 

2586ctx := context.Background()

2587client := openai.NewClient()

2588invocations := client.Beta.Agents.Automations.Invocations.ListAutoPaging(ctx, "auto_123",

2589 openai.BetaAgentAutomationInvocationListParams{})

2590for invocations.Next() {

2591 invocation := invocations.Current()

2592 fmt.Println(invocation.ID, invocation.Status, invocation.SessionID)

2593}

2594if err := invocations.Err(); err != nil {

2595 panic(err)

2596}

2597```

2598 

2599```java

2600import com.openai.client.OpenAIClient;

2601import com.openai.client.okhttp.OpenAIOkHttpClient;

2602import com.openai.models.beta.agents.automations.invocations.InvocationListParams;

2603 

2604OpenAIClient client = OpenAIOkHttpClient.fromEnv();

2605var invocations =

2606 client

2607 .beta()

2608 .agents()

2609 .automations()

2610 .invocations()

2611 .list(InvocationListParams.builder().automationId("auto_123").build());

2612for (var invocation : invocations.autoPager()) {

2613 System.out.println(

2614 invocation.id() + " " + invocation.status() + " " + invocation.sessionId());

2615}

2616```

2617 

2618```csharp

2619using OpenAI;

2620using OpenAI.Agents;

2621#pragma warning disable OPENAI001

2622 

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

2624AgentClient client = new OpenAIClient(key).GetAgentClient();

2625await foreach (AgentAutomationInvocation invocation in client.GetAutomationInvocationsAsync("auto_123"))

2626{

2627 Console.WriteLine($"{invocation.Id} {invocation.Status} {invocation.SessionId}");

2628}

2629```

2630 

2631```ruby

2632require "openai"

2633 

2634client = OpenAI::Client.new

2635invocations = client.beta.agents.automations.invocations.list("auto_123")

2636invocations.auto_paging_each do |invocation|

2637 puts "#{invocation.id} #{invocation.status} #{invocation.session_id}"

2638end

2639```

2640 

2641```bash

2642curl https://api.openai.com/v1/agents/automations/auto_123/invocations \

2643 -H "OpenAI-Beta: agents=v1" \

2644 -H "Authorization: Bearer $OPENAI_API_KEY"

2645```

2646 

2647 

2648The history contains invocations already created, but it does not include every future occurrence. Inspect these fields:

2649 

2650| Field | What to check |

2651| -------------- | ---------------------------------------------------------------------------------------------------------- |

2652| `status` | Starts as `queued`; becomes `completed` when delivery succeeds. |

2653| `session_id` | The value identifies the session to follow after delivery and can be `null` before a session is available. |

2654| `source.type` | `manual` for a manual invocation or `automation` for a scheduled run. |

2655| `scheduled_at` | The intended scheduled time, or `null` for a manual invocation. |

2656 

2657**A completed delivery doesn't mean the agent has completed its work.** For a new session, it means the session accepted its initial input. For an existing session, it means the session accepted the notification and the request to start work.

2658 

2659Use the invocation's `session_id` to [follow session events](https://developers.openai.com/api/docs/guides/agents-api/sessions/events) and inspect the turn's outcome.

2660 

2661The automation schedules the work. Your application displays session output and sends any notifications to the user.

2662 

2663## Change or stop a schedule

2664 

2665Retrieve an automation with `GET /v1/agents/automations/auto_123`. List your project's automations with `GET /v1/agents/automations`; add `session_id=sess_123` to find automations targeting an existing session.

2666 

2667Update the cron expression to move a recurring check to 11 AM:

2668 

2669Change a schedule

2670 

2671```javascript

2672import OpenAI from "openai";

2673 

2674const client = new OpenAI();

2675const automation = await client.beta.agents.automations.update("auto_123", {

2676 expression: "0 11 * * *",

2677});

2678console.log(automation);

2679```

2680 

2681```python

2682from openai import OpenAI

2683 

2684client = OpenAI()

2685automation = client.beta.agents.automations.update(

2686 automation_id="auto_123",

2687 expression="0 11 * * *",

2688)

2689print(automation.to_json())

2690```

2691 

2692```go

2693import (

2694 "context"

2695 "fmt"

2696 

2697 "github.com/openai/openai-go/v3"

2698)

2699 

2700ctx := context.Background()

2701client := openai.NewClient()

2702automation, err := client.Beta.Agents.Automations.Update(ctx, "auto_123",

2703 openai.BetaAgentAutomationUpdateParams{

2704 Expression: openai.String("0 11 * * *"),

2705 })

2706if err != nil {

2707 panic(err)

2708}

2709fmt.Println(automation)

2710```

2711 

2712```java

2713import com.openai.client.OpenAIClient;

2714import com.openai.client.okhttp.OpenAIOkHttpClient;

2715import com.openai.models.beta.agents.automations.AutomationUpdateParams;

2716 

2717OpenAIClient client = OpenAIOkHttpClient.fromEnv();

2718var automation =

2719 client

2720 .beta()

2721 .agents()

2722 .automations()

2723 .update(

2724 AutomationUpdateParams.builder()

2725 .automationId("auto_123")

2726 .expression("0 11 * * *")

2727 .build());

2728System.out.println(automation);

2729```

2730 

2731```csharp

2732using OpenAI;

2733using OpenAI.Agents;

2734#pragma warning disable OPENAI001

2735 

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

2737AgentClient client = new OpenAIClient(key).GetAgentClient();

2738AgentAutomation automation = await client.UpdateAutomationAsync(

2739 "auto_123",

2740 new AgentAutomationUpdateOptions { Expression = "0 11 * * *" }

2741);

2742Console.WriteLine(automation.Id);

2743```

2744 

2745```ruby

2746require "openai"

2747 

2748client = OpenAI::Client.new

2749automation = client.beta.agents.automations.update(

2750 "auto_123",

2751 expression: "0 11 * * *"

2752)

2753puts automation

2754```

2755 

2756```bash

2757curl https://api.openai.com/v1/agents/automations/auto_123 \

2758 -H "OpenAI-Beta: agents=v1" \

2759 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

2761 -d '{

2762 "expression": "0 11 * * *"

2763 }'

2764```

2765 

2766 

2767Omitted fields stay unchanged. A supplied `target` replaces the whole target, so include all its required fields and retain its type. Update reminder text in `target.instructions` or initial messages in `target.input`. An agent-created automation must retain its creator session as the target.

2768 

2769Make changes before the next scheduled time. Updates apply to future invocations; an invocation that is already queued keeps the target and input saved when it was created.

2770 

2771Use the following operations without a request body:

2772 

2773| Goal | Operation | Effect |

2774| ---------------------- | --------------------------------------------- | ------------------------------------------------------------------------ |

2775| Pause scheduled work. | `POST /v1/agents/automations/auto_123/pause` | Holds pending scheduled deliveries; manual invocation remains available. |

2776| Resume scheduled work. | `POST /v1/agents/automations/auto_123/resume` | Reactivates the saved schedule. |

2777| Remove the schedule. | `DELETE /v1/agents/automations/auto_123` | Prevents future scheduled and manual invocations. |

2778 

2779Pausing or deleting an automation doesn't stop work already accepted by a session or delete the session. A delivery already in progress may still reach its session. To stop current work, [cancel its active turn](https://developers.openai.com/api/docs/guides/agents-api/sessions#cancel-an-active-turn).

2780 

2781If a one-time automation's scheduled time passes while it is paused, set a new future `run_at` before resuming. A completed one-time automation can't be paused or resumed; create another automation for another scheduled follow-up.

Details

178 178 

179### Is Fast mode compatible with data residency, Zero Data Retention, and a BAA?179### Is Fast mode compatible with data residency, Zero Data Retention, and a BAA?

180 180 

181Fast mode is compatible with data residency, Zero Data Retention, and a Business Associate Agreement (BAA), subject to model-specific availability. Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra. Existing endpoint, tool, eligibility, and contractual requirements still apply. See the [Your data guide](https://developers.openai.com/api/docs/guides/your-data) for details.181Fast mode is compatible with data residency, Zero Data Retention, and a Business Associate Agreement (BAA), subject to model-specific availability. Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra or GPT-6 Sol. Existing endpoint, tool, eligibility, and contractual requirements still apply. See the [Your data guide](https://developers.openai.com/api/docs/guides/your-data) for details.

Details

3574also listed below. You should still account for text and image input tokens when3574also listed below. You should still account for text and image input tokens when

3575estimating the total cost of a request.3575estimating the total cost of a request.

3576 3576 

3577`gpt-image-1` was shut down on October 23, 2026. Its prices below are retained

3578for historical comparisons. See the [deprecation notice](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots)

3579for replacement models.

3580 

3577A larger non-square resolution can sometimes produce fewer output tokens than3581A larger non-square resolution can sometimes produce fewer output tokens than

3578 a smaller or square resolution at the same quality setting.3582 a smaller or square resolution at the same quality setting.

3579 3583 

Details

1527 </h2>1527 </h2>

1528 1528

1529 1529 

1530 Overview and request settings for existing GPT Image 1 workflows.1530 Legacy request settings for migrating GPT Image 1 workflows.

1531 1531

1532 1532 

1533 </header>1533 </header>


1535 1535 

1536## Overview1536## Overview

1537 1537 

1538**Deprecated model.** `gpt-image-1` is scheduled to shut down on October 23,1538**Retired model.** `gpt-image-1` was shut down on October 23, 2026. Use

1539 2026. See the [deprecation1539 `gpt-image-2.5-sunburst` or `gpt-image-2.5-flare` instead. See the

1540 notice](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots) and1540 [deprecation

1541 validate existing workflows with `gpt-image-2` before migrating.1541 notice](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots) for

1542 migration details.

1542 1543 

1543GPT Image 1 supports image generation and editing with reference images and masks. Use this reference to maintain existing integrations. For shared techniques such as describing a scene, preserving details, and refining an edit, see the [prompting guide](https://developers.openai.com/api/docs/guides/image-prompting?model=gpt-image-2.5).1544GPT Image 1 supported image generation and editing with reference images and masks. Use this reference when migrating existing integrations. For shared techniques such as describing a scene, preserving details, and refining an edit, see the [prompting guide](https://developers.openai.com/api/docs/guides/image-prompting?model=gpt-image-2.5).

1544 1545 

1545## Model parameters1546## Model parameters

1546 1547 

1547Use `client.images.generate` for generation and `client.images.edit` for edits. See the [image generation guide](https://developers.openai.com/api/docs/guides/image-generation) for API setup and request examples.1548These settings describe legacy GPT Image 1 requests. See the [image generation guide](https://developers.openai.com/api/docs/guides/image-generation) for supported models, API setup, and current request examples.

1548 1549 

1549| Parameter | GPT Image 1 |1550| Parameter | GPT Image 1 |

1550| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |1551| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

Details

1227 1227 

1228#### GPT Image 11228#### GPT Image 1

1229 1229 

1230The following input-token rules apply to `gpt-image-1`. Use tile-based image sizing, but scale the shortest side down to 512px instead of 768px. Token use depends on the image dimensions and the `input_fidelity` parameter in the [Images API](https://developers.openai.com/api/reference/resources/images/methods/edit).1230`gpt-image-1` was shut down on October 23, 2026. The following input-token rules are retained for historical cost comparisons. See the [deprecation notice](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots) for replacement models.

1231 

1232For legacy requests, use tile-based image sizing, but scale the shortest side down to 512px instead of 768px. Token use depends on the image dimensions and the `input_fidelity` parameter in the [Images API](https://developers.openai.com/api/reference/resources/images/methods/edit).

1231 1233 

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

1233When 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.1235When 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.


1235- If your image is square, we add 4160 extra input image tokens.1237- If your image is square, we add 4160 extra input image tokens.

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

1237 1239 

1238To see pricing for image input tokens, refer to the [image pricing section](https://developers.openai.com/api/docs/pricing#multimodal-image-pricing).1240For historical image input-token prices, see the [GPT Image 1 model page](https://developers.openai.com/api/docs/models/gpt-image-1).

1239 1241 

1240## Limitations1242## Limitations

1241 1243 

Details

74## Limitations74## Limitations

75 75 

76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.

77- Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).77- Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).

78 78 

79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>

80 80 


203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.

204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.

205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.

206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).

207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.

208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.

209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.

Details

74## Limitations74## Limitations

75 75 

76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.

77- Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).77- Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).

78 78 

79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>

80 80 


203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.

204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.

205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.

206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).

207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.

208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.

209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.

Details

74## Limitations74## Limitations

75 75 

76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.76- GPT-6 Astra and GPT-6.1 Sol do not support the `none` reasoning effort; GPT-6 Sol and GPT-6 Luna do.

77- Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).77- Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. See [data residency eligibility](https://developers.openai.com/api/docs/guides/your-data#which-models-and-features-are-eligible-for-data-residency).

78 78 

79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>79<a id="prompting-best-practices" className="scroll-mt-[110px]"></a>

80 80 


203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.203- **Reasoning effort:** Preserve your current effective [reasoning effort](https://developers.openai.com/api/docs/guides/reasoning#reasoning-effort) where supported. GPT-6 Astra and GPT-6.1 Sol do not support `none`; use `low` instead. GPT-6 Sol and GPT-6 Luna support `none`. If your existing request uses `minimal`, start with `low` and compare results on representative tasks. Use `reasoning.effort` in Responses or `reasoning_effort` in Chat Completions.

204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.204- **Tool calling:** Use the [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses#migrating-from-chat-completions). GPT-6 Astra and GPT-6.1 Sol support Chat Completions, but tool calling requires Responses. GPT-6 Sol and GPT-6 Luna support function calling in Chat Completions only with `reasoning_effort: "none"`. Use Responses for reasoning with tools.

205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.205- **Unsupported parameters:** When reasoning effort is not `none`, remove `temperature`, `top_p`, and `top_logprobs`. For Chat Completions, also remove `logprobs`. For Responses, remove `message.output_text.logprobs` from `include`.

206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna, but not GPT-6 Astra. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).206- **Data residency:** Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna, but not GPT-6 Astra or GPT-6 Sol. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only. Fast mode for GPT-6 Astra does not include a latency SLA. See [Fast mode compatibility](https://developers.openai.com/api/docs/guides/fast-mode#is-fast-mode-compatible-with-data-residency-zero-data-retention-and-a-baa).

207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.207- **Changing reasoning effort:** If your application changes effort between responses, use `configuration_update` items in standard, single-agent requests. Keep request-level `reasoning.effort` unchanged to preserve the prompt prefix for caching. Check the [compatibility limits](https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation) before adopting this feature.

208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.208- **Prompt caching:** When migrating from GPT-5.5 or earlier, replace `prompt_cache_retention` with `prompt_cache_options.ttl` set to `"30m"`. Review the [prompt caching changes](https://developers.openai.com/api/docs/guides/prompt-caching#summary-of-model-differences), including cache boundaries and cache-write billing.

209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.209- **Unnecessary approval pauses:** If you run into issues where the model keeps asking for approval before proceeding, use the [initiative and follow-through guidance](#initiative-and-follow-through) to prompt for more autonomous execution. See the rest of [Prompting best practices](#prompting-best-practices) for guidance on instruction following, writing style, subagent delegation, and testing.

Details

2 2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5## Get started with computer use

6 

7### Run code execution

8 

9Connect the API loop to your browser or desktop runtime.

10 

11```javascript

12import { randomUUID } from "node:crypto";

13import OpenAI from "openai";

14 

15async function runComputerUse(endpoint, prompt, model = "gpt-6-astra") {

16 const client = new OpenAI();

17 const sessionId = randomUUID();

18 

19 const tools = [

20 {

21 type: "function",

22 name: "exec_js",

23 description: `Run JavaScript in a persistent browser. Available: Playwright's

24browser, context, and page objects; console.log(value); and display(base64Image).

25Save reusable variables on globalThis. Inspect a screenshot before acting and

26check the screen after a short group of actions. Keep screenshots in memory.

27Use top-level await for async operations. Return images with display() and concise

28text with console.log(). The context viewport is 1440x900.`,

29 parameters: {

30 type: "object",

31 properties: { code: { type: "string" } },

32 required: ["code"],

33 additionalProperties: false,

34 },

35 strict: true,

36 },

37 ];

38 

39 let nextInput = [{ role: "user", content: prompt }];

40 let previousResponseId;

41 

42 for (let turn = 0; turn < 20; turn++) {

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

44 model,

45 tools,

46 input: nextInput,

47 previous_response_id: previousResponseId,

48 reasoning: { effort: "low" },

49 });

50 if (response.status !== "completed") {

51 throw new Error(`Response stopped with status: ${response.status}`);

52 }

53 const calls = response.output.filter(

54 (item) => item.type === "function_call"

55 );

56 if (

57 calls.length === 0 &&

58 response.output.some(

59 (item) => item.type === "message" && item.phase !== "commentary"

60 )

61 ) {

62 console.log(response.output_text);

63 return;

64 }

65 if (turn === 19) {

66 throw new Error(

67 "The task reached the 20-response limit. Inspect the last result."

68 );

69 }

70 

71 nextInput = [];

72 for (const call of calls) {

73 if (call.name !== "exec_js")

74 throw new Error(`Unexpected tool: ${call.name}`);

75 const { code } = JSON.parse(call.arguments);

76 const output = await executeInSandbox(code, sessionId, endpoint);

77 nextInput.push({

78 type: "function_call_output",

79 call_id: call.call_id,

80 output,

81 });

82 }

83 previousResponseId = response.id;

84 }

85}

86```

87 

88```python

89import json

90import uuid

91 

92from openai import OpenAI

93from openai.types.responses import (

94 FunctionToolParam,

95 ResponseInputParam,

96)

97 

98def run_computer_use(endpoint, prompt, model="gpt-6-astra"):

99 client = OpenAI()

100 session_id = str(uuid.uuid4())

101 tools: list[FunctionToolParam] = [

102 {

103 "type": "function",

104 "name": "exec_py",

105 "description": (

106 "Run Python in a persistent desktop. Variables persist across calls. "

107 "PyAutoGUI operations are synchronous. Available: pyautogui, time, "

108 "log(value), and display(PIL_image). Inspect the screen with "

109 "display(pyautogui.screenshot()) before acting. Use screenshot "

110 "coordinates and check the screen after a short group of actions. "

111 "Keep screenshots in memory and PyAutoGUI's fail-safe enabled."

112 ),

113 "parameters": {

114 "type": "object",

115 "properties": {"code": {"type": "string"}},

116 "required": ["code"],

117 "additionalProperties": False,

118 },

119 "strict": True,

120 }

121 ]

122 next_input: ResponseInputParam = [{"role": "user", "content": prompt}]

123 previous_response_id = None

124 

125 for turn in range(20):

126 response = client.responses.create(

127 model=model,

128 tools=tools,

129 input=next_input,

130 previous_response_id=previous_response_id,

131 )

132 if response.status != "completed":

133 raise RuntimeError(f"Response stopped with status: {response.status}")

134 

135 calls = [item for item in response.output if item.type == "function_call"]

136 if not calls and any(

137 item.type == "message" and item.phase != "commentary"

138 for item in response.output

139 ):

140 print(response.output_text)

141 return

142 if turn == 19:

143 raise RuntimeError(

144 "The task reached the 20-response limit. Inspect the last result."

145 )

146 

147 next_input = []

148 for call in calls:

149 if call.name != "exec_py":

150 raise ValueError(f"Unexpected tool: {call.name}")

151 code = json.loads(call.arguments)["code"]

152 output = execute_in_sandbox(code, session_id, endpoint)

153 next_input.append(

154 {

155 "type": "function_call_output",

156 "call_id": call.call_id,

157 "output": output,

158 }

159 )

160 previous_response_id = response.id

161```

162 

163```go

164func runComputerUse(ctx context.Context, client openai.Client, endpoint, prompt string, terminal *bufio.Scanner, output io.Writer) error {

165 session := make([]byte, 16)

166 if _, err := rand.Read(session); err != nil {

167 return err

168 }

169 sessionID := hex.EncodeToString(session)

170 tool := responses.ToolParamOfFunction("exec_py", map[string]any{

171 "type": "object", "properties": map[string]any{"code": map[string]any{"type": "string"}},

172 "required": []string{"code"}, "additionalProperties": false,

173 }, true)

174 tool.OfFunction.Description = openai.String("Run Python in a persistent desktop. Variables persist across calls. " +

175 "PyAutoGUI operations are synchronous. Available: pyautogui, time, " +

176 "log(value), and display(PIL_image). Inspect the screen with " +

177 "display(pyautogui.screenshot()) before acting. Use screenshot " +

178 "coordinates and check the screen after a short group of actions. " +

179 "Keep screenshots in memory and PyAutoGUI's fail-safe enabled.")

180 params := responses.ResponseNewParams{

181 Model: "gpt-6-astra", Tools: []responses.ToolUnionParam{tool},

182 Input: responses.ResponseNewParamsInputUnion{OfString: openai.String(prompt)},

183 }

184 for turn := 0; turn < 20; turn++ {

185 response, err := client.Responses.New(ctx, params)

186 if err != nil {

187 return err

188 }

189 if response.Status != "completed" {

190 return fmt.Errorf("response stopped with status: %s", response.Status)

191 }

192 var calls []responses.ResponseFunctionToolCall

193 finalMessage := false

194 for _, item := range response.Output {

195 if item.Type == "function_call" {

196 calls = append(calls, item.AsFunctionCall())

197 }

198 if item.Type == "message" && item.AsMessage().Phase != "commentary" {

199 finalMessage = true

200 }

201 }

202 if len(calls) == 0 && finalMessage {

203 fmt.Fprintln(output, response.OutputText())

204 return nil

205 }

206 if turn == 19 {

207 return fmt.Errorf("task reached the 20-response limit; inspect the last result")

208 }

209 nextInput := responses.ResponseInputParam{}

210 for _, call := range calls {

211 if call.Name != "exec_py" {

212 return fmt.Errorf("unexpected tool: %s", call.Name)

213 }

214 var arguments struct {

215 Code *string `json:"code"`

216 }

217 if err := json.Unmarshal([]byte(call.Arguments), &arguments); err != nil {

218 return err

219 }

220 if arguments.Code == nil {

221 return fmt.Errorf("exec_py requires code")

222 }

223 observations, err := executeInSandbox(ctx, endpoint, sessionID, *arguments.Code, terminal, output)

224 if err != nil {

225 return err

226 }

227 nextInput = append(nextInput, responses.ResponseInputItemUnionParam{

228 OfFunctionCallOutput: &responses.ResponseInputItemFunctionCallOutputParam{

229 CallID: openai.String(call.CallID),

230 Output: responses.ResponseInputItemFunctionCallOutputOutputUnionParam{OfResponseFunctionCallOutputItemArray: observations},

231 },

232 })

233 }

234 params.Input = responses.ResponseNewParamsInputUnion{OfInputItemList: nextInput}

235 params.PreviousResponseID = openai.String(response.ID)

236 }

237 return nil

238}

239```

240 

241```java

242import com.fasterxml.jackson.databind.JsonNode;

243import com.fasterxml.jackson.databind.ObjectMapper;

244import com.openai.client.OpenAIClient;

245import com.openai.client.okhttp.OpenAIOkHttpClient;

246import com.openai.core.JsonValue;

247import com.openai.models.responses.EasyInputMessage;

248import com.openai.models.responses.FunctionTool;

249import com.openai.models.responses.ResponseCreateParams;

250import com.openai.models.responses.ResponseFunctionCallOutputItem;

251import com.openai.models.responses.ResponseInputImageContent;

252import com.openai.models.responses.ResponseInputItem;

253import com.openai.models.responses.ResponseInputTextContent;

254import java.io.IOException;

255import java.net.URI;

256import java.net.http.HttpClient;

257import java.net.http.HttpRequest;

258import java.net.http.HttpResponse;

259import java.time.Duration;

260import java.util.ArrayList;

261import java.util.List;

262import java.util.Map;

263import java.util.Scanner;

264import java.util.UUID;

265 

266ResponseInputItem userInput =

267 ResponseInputItem.ofEasyInputMessage(

268 EasyInputMessage.builder()

269 .role(EasyInputMessage.Role.USER)

270 .content(

271 "Go to Hacker News, click on the most interesting link (be prepared to "

272 + "justify your choice), take a screenshot, and give me a critique of the visual layout.")

273 .build());

274 

275ResponseCreateParams params =

276 ResponseCreateParams.builder()

277 .model("gpt-6-astra")

278 .inputOfResponse(List.of(userInput))

279 .addTool(

280 FunctionTool.builder()

281 .name("exec_py")

282 .description(

283 "Execute provided interactive async Python in a persistent, isolated browser runtime.")

284 .parameters(

285 FunctionTool.Parameters.builder()

286 .putAdditionalProperty("type", JsonValue.from("object"))

287 .putAdditionalProperty(

288 "properties",

289 JsonValue.from(

290 Map.of(

291 "code",

292 Map.of(

293 "type",

294 "string",

295 "description",

296 "Python code to execute. Write small snippets. State "

297 + "persists across tool calls via globals(). The "

298 + "isolated runtime supports await and provides "

299 + "only these helpers and Playwright objects: log(x) "

300 + "for concise text output, display(base64_png_string) "

301 + "for image output, browser, context, and page. "

302 + "Keep screenshots and image data in memory and "

303 + "pass them directly to display(). Do not assume "

304 + "other globals or packages are available."))))

305 .putAdditionalProperty("required", JsonValue.from(List.of("code")))

306 .putAdditionalProperty("additionalProperties", JsonValue.from(false))

307 .build())

308 .strict(true)

309 .build())

310 .addTool(

311 FunctionTool.builder()

312 .name("ask_user")

313 .description(

314 "Ask the user a clarification question and wait for their response.")

315 .parameters(

316 FunctionTool.Parameters.builder()

317 .putAdditionalProperty("type", JsonValue.from("object"))

318 .putAdditionalProperty(

319 "properties",

320 JsonValue.from(

321 Map.of(

322 "question",

323 Map.of(

324 "type",

325 "string",

326 "description",

327 "The exact question to show the user. Use this instead "

328 + "of asking a freeform clarifying question in a "

329 + "final answer."))))

330 .putAdditionalProperty("required", JsonValue.from(List.of("question")))

331 .putAdditionalProperty("additionalProperties", JsonValue.from(false))

332 .build())

333 .strict(true)

334 .build())

335 .build();

336 

337List<ResponseInputItem> conversation = new ArrayList<>(List.of(userInput));

338ObjectMapper json = new ObjectMapper();

339Scanner terminal = new Scanner(System.in);

340String sessionId = UUID.randomUUID().toString();

341 

342for (int step = 0; step < 20; step++) {

343 var response =

344 client.responses().create(params.toBuilder().inputOfResponse(conversation).build());

345 response.output().stream()

346 .map(item -> JsonValue.from(item).convert(ResponseInputItem.class))

347 .forEach(conversation::add);

348 boolean calledTool = false;

349 for (var item : response.output()) {

350 if (item.functionCall().isPresent()) {

351 var call = item.functionCall().orElseThrow();

352 JsonNode arguments = json.readTree(call.arguments());

353 var output = ResponseInputItem.FunctionCallOutput.builder().callId(call.callId());

354 

355 if (call.name().equals("exec_py")) {

356 String code = arguments.path("code").asText();

357 System.out.println(code);

358 System.out.print("Send this generated Python to the isolated runtime? Type yes: ");

359 String approval = terminal.hasNextLine() ? terminal.nextLine() : "";

360 List<ResponseFunctionCallOutputItem> execution;

361 if (approval.trim().equalsIgnoreCase("yes")) {

362 try {

363 execution = executeInSandbox(code, sessionId, json);

364 } catch (IOException exception) {

365 execution =

366 List.of(

367 ResponseFunctionCallOutputItem.ofInputText(

368 ResponseInputTextContent.builder()

369 .text("Sandbox execution failed: " + exception.getMessage())

370 .build()));

371 }

372 } else {

373 execution =

374 List.of(

375 ResponseFunctionCallOutputItem.ofInputText(

376 ResponseInputTextContent.builder()

377 .text("The user declined this code execution.")

378 .build()));

379 }

380 output.outputOfResponseFunctionCallOutputItemList(execution);

381 execution.forEach(System.out::println);

382 } else if (call.name().equals("ask_user")) {

383 String question = arguments.path("question").asText();

384 System.out.println("MODEL QUESTION: " + question);

385 output.output(terminal.hasNextLine() ? terminal.nextLine() : "");

386 } else {

387 throw new IllegalArgumentException("Unsupported function: " + call.name());

388 }

389 

390 conversation.add(ResponseInputItem.ofFunctionCallOutput(output.build()));

391 calledTool = true;

392 } else if (item.message().isPresent()) {

393 var message = item.message().orElseThrow();

394 message.content().stream()

395 .flatMap(content -> content.outputText().stream())

396 .forEach(text -> System.out.println(text.text()));

397 }

398 }

399 if (!calledTool) break;

400}

401 

402private static List<ResponseFunctionCallOutputItem> executeInSandbox(

403 String code, String sessionId, ObjectMapper json) throws IOException, InterruptedException {

404 URI endpoint = URI.create(System.getenv("OPENAI_EXAMPLE_CODE_EXECUTION_URL"));

405 if (!endpoint.getScheme().equals("https")

406 && !List.of("localhost", "127.0.0.1", "::1").contains(endpoint.getHost())) {

407 throw new IllegalArgumentException("The isolated sandbox endpoint must use HTTPS");

408 }

409 

410 var request =

411 HttpRequest.newBuilder(endpoint)

412 .timeout(Duration.ofSeconds(30))

413 .header("Content-Type", "application/json")

414 .POST(

415 HttpRequest.BodyPublishers.ofString(

416 json.writeValueAsString(

417 Map.of("session_id", sessionId, "language", "python", "code", code))));

418 String token = System.getenv("OPENAI_EXAMPLE_CODE_EXECUTION_TOKEN");

419 if (token != null && !token.isBlank()) request.header("Authorization", "Bearer " + token);

420 

421 HttpResponse<String> response =

422 HttpClient.newBuilder()

423 .connectTimeout(Duration.ofSeconds(10))

424 .build()

425 .send(request.build(), HttpResponse.BodyHandlers.ofString());

426 if (response.statusCode() < 200 || response.statusCode() >= 300) {

427 throw new IOException("Isolated sandbox rejected execution: HTTP " + response.statusCode());

428 }

429 

430 JsonNode outputs = json.readTree(response.body()).path("output");

431 if (!outputs.isArray()) throw new IOException("Sandbox returned an invalid output payload");

432 List<ResponseFunctionCallOutputItem> result = new ArrayList<>();

433 for (JsonNode item : outputs) {

434 String type = item.path("type").asText();

435 if (type.equals("input_text") && item.path("text").isTextual()) {

436 result.add(

437 ResponseFunctionCallOutputItem.ofInputText(

438 ResponseInputTextContent.builder().text(item.path("text").asText()).build()));

439 } else if (type.equals("input_image")

440 && item.path("image_url").isTextual()

441 && item.path("detail").asText().equals("original")) {

442 result.add(

443 ResponseFunctionCallOutputItem.ofInputImage(

444 ResponseInputImageContent.builder()

445 .detail(ResponseInputImageContent.Detail.ORIGINAL)

446 .imageUrl(item.path("image_url").asText())

447 .build()));

448 } else {

449 throw new IOException("Sandbox returned an unsupported output item: " + type);

450 }

451 }

452 return result;

453}

454```

455 

456```ruby

457require "json"

458require "openai"

459require "securerandom"

460 

461def run_computer_use(endpoint, prompt)

462 client = OpenAI::Client.new

463 session_id = SecureRandom.uuid

464 tools = [

465 {

466 type: :function,

467 name: "exec_py",

468 description: "Run Python in a persistent desktop. Variables persist across calls. PyAutoGUI operations are synchronous. Available: pyautogui, time, log(value), and display(PIL_image). Inspect the screen with display(pyautogui.screenshot()) before acting. Use screenshot coordinates and check the screen after a short group of actions. Keep screenshots in memory and PyAutoGUI's fail-safe enabled.",

469 parameters: {

470 type: :object,

471 properties: { code: { type: :string } },

472 required: ["code"],

473 additionalProperties: false

474 },

475 strict: true

476 }

477 ]

478 next_input = []

479 next_input << {

480 role: :user,

481 content: prompt

482 }

483 history = {}

484 20.times do |turn|

485 response = client.responses.create(

486 model: "gpt-6-astra", tools: tools, input: next_input, previous_response_id: history[:id]

487 )

488 raise "Response stopped with status: #{response.status}" unless response.status == OpenAI::Responses::ResponseStatus::COMPLETED

489 

490 calls = response.output.grep(OpenAI::Responses::ResponseFunctionToolCall)

491 if calls.empty? && response.output.any? { |item| item.is_a?(OpenAI::Responses::ResponseOutputMessage) && item.phase != :commentary }

492 puts(response.output_text)

493 return response

494 end

495 raise "The task reached the 20-response limit" if turn == 19

496 

497 next_input.clear

498 calls.each do |call|

499 raise "Unexpected tool: #{call.name}" unless call.name == "exec_py"

500 

501 code = JSON.parse(call.arguments).fetch("code")

502 raise "Expected Python source text" unless code.is_a?(String)

503 

504 output = execute_in_sandbox(code, session_id, endpoint)

505 next_input << {

506 type: :function_call_output,

507 call_id: call.call_id,

508 output: output

509 }

510 end

511 history[:id] = response.id

512 end

513end

514```

515 

516### Send a computer request

517 

518Use the computer tool for structured mouse and keyboard actions.

519 

520```javascript

521import OpenAI from "openai";

522 

523const client = new OpenAI();

524 

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

526 model: "gpt-6.1-sol",

527 tools: [{ type: "computer" }],

528 input:

529 "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.",

530});

531 

532console.log(JSON.stringify(response.output, null, 2));

533```

534 

535```python

536from openai import OpenAI

537 

538client = OpenAI()

539 

540response = client.responses.create(

541 model="gpt-6.1-sol",

542 tools=[{"type": "computer"}],

543 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.",

544)

545 

546print(response.output)

547```

548 

549```go

550package main

551 

552import (

553 "context"

554 "fmt"

555 

556 "github.com/openai/openai-go/v3"

557 "github.com/openai/openai-go/v3/responses"

558)

559 

560func main() {

561 client := openai.NewClient()

562 response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{

563 Model: "gpt-6.1-sol",

564 Tools: []responses.ToolUnionParam{{OfComputer: &responses.ComputerToolParam{}}},

565 Input: responses.ResponseNewParamsInputUnion{OfString: openai.String("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.")},

566 })

567 if err != nil {

568 panic(err)

569 }

570 fmt.Println(response.Output)

571}

572```

573 

574```java

575import com.openai.client.OpenAIClient;

576import com.openai.client.okhttp.OpenAIOkHttpClient;

577import com.openai.core.JsonValue;

578import com.openai.models.responses.ResponseCreateParams;

579import java.util.List;

580import java.util.Map;

581 

582ResponseCreateParams params =

583 ResponseCreateParams.builder()

584 .model("gpt-6.1-sol")

585 .input(

586 "Open the Filters panel if needed, then search for penguin. Use the computer tool for UI interaction.")

587 .putAdditionalBodyProperty("tools", JsonValue.from(List.of(Map.of("type", "computer"))))

588 .build();

589 

590client.responses().create(params).output().forEach(System.out::println);

591```

592 

593```ruby

594require "openai"

595 

596client = OpenAI::Client.new

597response = client.responses.create(

598 model: "gpt-6.1-sol",

599 input: "Open the Filters panel if needed, then search for penguin. Use the computer tool for UI interaction.",

600 tools: [{ type: :computer }]

601)

602 

603puts(response.output)

604```

605 

606### Return a screenshot

607 

608Continue the conversation with the updated screen.

609 

610```javascript

611import OpenAI from "openai";

612 

613const client = new OpenAI();

614 

615async function sendComputerScreenshot(response, callId, screenshotBase64) {

616 const output = {

617 type: "computer_screenshot",

618 image_url: `data:image/png;base64,${screenshotBase64}`,

619 detail: "original",

620 };

621 

622 return await client.responses.create({

623 model: "gpt-6.1-sol",

624 tools: [{ type: "computer" }],

625 previous_response_id: response.id,

626 input: [

627 {

628 type: "computer_call_output",

629 call_id: callId,

630 output,

631 },

632 ],

633 });

634}

635```

636 

637```python

638from openai import OpenAI

639 

640client = OpenAI()

641 

642 

643def send_computer_screenshot(response, call_id, screenshot_base64):

644 return client.responses.create(

645 model="gpt-6.1-sol",

646 tools=[{"type": "computer"}],

647 previous_response_id=response.id,

648 input=[

649 {

650 "type": "computer_call_output",

651 "call_id": call_id,

652 "output": {

653 "type": "computer_screenshot",

654 "image_url": f"data:image/png;base64,{screenshot_base64}",

655 "detail": "original",

656 },

657 }

658 ],

659 )

660```

661 

662```go

663package main

664 

665import (

666 "context"

667 "fmt"

668 

669 "github.com/openai/openai-go/v3"

670 "github.com/openai/openai-go/v3/responses"

671)

672 

673func main() {

674 client := openai.NewClient()

675 response, err := sendComputerScreenshot(client, "resp_abc123", "call_abc123", "<base64 bytes here>")

676 if err != nil {

677 panic(err)

678 }

679 fmt.Println(response.Output)

680}

681 

682func sendComputerScreenshot(client openai.Client, responseID string, callID string, screenshotBase64 string) (*responses.Response, error) {

683 screenshot := responses.ResponseComputerToolCallOutputScreenshotParam{

684 ImageURL: openai.String("data:image/png;base64," + screenshotBase64),

685 }

686 screenshot.SetExtraFields(map[string]any{"detail": "original"})

687 return client.Responses.New(context.Background(), responses.ResponseNewParams{

688 Model: "gpt-6.1-sol",

689 Tools: []responses.ToolUnionParam{{OfComputer: &responses.ComputerToolParam{}}},

690 PreviousResponseID: openai.String(responseID),

691 Input: responses.ResponseNewParamsInputUnion{OfInputItemList: responses.ResponseInputParam{

692 responses.ResponseInputItemParamOfComputerCallOutput(callID, screenshot),

693 }},

694 })

695}

696```

697 

698```java

699import com.openai.client.OpenAIClient;

700import com.openai.client.okhttp.OpenAIOkHttpClient;

701import com.openai.core.JsonValue;

702import com.openai.models.responses.ResponseComputerToolCallOutputScreenshot;

703import com.openai.models.responses.ResponseCreateParams;

704import com.openai.models.responses.ResponseInputItem;

705import java.util.List;

706import java.util.Map;

707 

708String responseId = "resp_abc123";

709 

710String computerCallId = "call_abc123";

711 

712String screenshotBase64 = "<base64 bytes here>";

713 

714ResponseCreateParams params =

715 ResponseCreateParams.builder()

716 .model("gpt-6.1-sol")

717 .input(

718 ResponseCreateParams.Input.ofResponse(

719 List.of(

720 ResponseInputItem.ofComputerCallOutput(

721 ResponseInputItem.ComputerCallOutput.builder()

722 .callId(computerCallId)

723 .output(

724 ResponseComputerToolCallOutputScreenshot.builder()

725 .imageUrl("data:image/png;base64," + screenshotBase64)

726 .putAdditionalProperty("detail", JsonValue.from("original"))

727 .build())

728 .build()))))

729 .previousResponseId(responseId)

730 .putAdditionalBodyProperty("tools", JsonValue.from(List.of(Map.of("type", "computer"))))

731 .build();

732 

733client.responses().create(params).output().forEach(System.out::println);

734```

735 

736```ruby

737require "openai"

738 

739client = OpenAI::Client.new

740response = client.responses.create(

741 model: "gpt-6.1-sol",

742 previous_response_id: "resp_abc123",

743 input: [

744 {

745 type: :computer_call_output,

746 call_id: "call_abc123",

747 output: {

748 type: :computer_screenshot,

749 image_url: "data:image/png;base64,<base64 bytes here>",

750 detail: :original

751 }

752 }

753 ],

754 tools: [{ type: :computer }]

755)

756 

757puts(response.output)

758```

759 

760 

761 

5Computer use lets a model operate a browser or desktop interface. Use it to fill out forms, test user flows, or complete tasks in an application.762Computer use lets a model operate a browser or desktop interface. Use it to fill out forms, test user flows, or complete tasks in an application.

6 763 

7Choose a path based on what the model needs to see and who runs the environment:764Choose a path based on what the model needs to see and who runs the environment:

Details

2 2 

3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5The image generation tool allows you to generate images using a text prompt, and optionally image inputs. It uses GPT Image models, including `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`, and automatically optimizes text inputs for improved performance.5The image generation tool allows you to generate images using a text prompt, and optionally image inputs. It uses GPT Image models, including `gpt-image-2.5-sunburst`, `gpt-image-2.5-flare`, `gpt-image-2`, `gpt-image-1.5`, and `gpt-image-1-mini`, and automatically optimizes text inputs for improved performance.

6 6 

7Set the `image_generation` tool's `model` to `gpt-image-2.5-sunburst` for precise editing, or `gpt-image-2.5-flare` for fast, high-quality image generation. Use a supported mainline model in the top-level Responses `model` field.7Set the `image_generation` tool's `model` to `gpt-image-2.5-sunburst` for precise editing, or `gpt-image-2.5-flare` for fast, high-quality image generation. Use a supported mainline model in the top-level Responses `model` field.

8 8 

9`gpt-image-1` was shut down on October 23, 2026. See the [deprecation

10 notice](https://developers.openai.com/api/docs/deprecations#2026-04-22-legacy-gpt-model-snapshots) for migration details.

11 

9To learn more about image generation, refer to our dedicated [image generation12To learn more about image generation, refer to our dedicated [image generation

10 guide](https://developers.openai.com/api/docs/guides/image-generation?api=responses).13guide](https://developers.openai.com/api/docs/guides/image-generation?api=responses).

11 14 

12## Usage15## Usage

13 16 

Details

135 135 

136#### `/v1/images`136#### `/v1/images`

137 137 

138- Image generation is Zero Data Retention compatible when using `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1`, and `gpt-image-1-mini`.138- Image generation is Zero Data Retention compatible when using `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1.5`, and `gpt-image-1-mini`.

139 139 

140#### `/v1/files`140#### `/v1/files`

141 141 


261 261 

262Use **Support by region** to compare regional capabilities and expand the services available in each region. Use **API Endpoint, tool and model support** for complete model lists and a detailed service view. Support for regional storage does not imply support for regional processing.262Use **Support by region** to compare regional capabilities and expand the services available in each region. Use **API Endpoint, tool and model support** for complete model lists and a detailed service view. Support for regional storage does not imply support for regional processing.

263 263 

264Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra. GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna support EU data residency with Standard, Flex, and Batch processing. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only.264EU data residency is not available for every model in Fast mode. Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra or GPT-6 Sol. GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna support EU data residency with Standard, Flex, and Batch processing. [Ultrafast mode](https://developers.openai.com/api/docs/guides/ultrafast-mode) for GPT-6.1 Sol supports US and EU data residency and global processing. GPT-6 Astra Ultrafast supports US data residency and global processing only.

265 265 

266#### Support by region266#### Support by region

267 267 


287#### API Endpoint, tool and model support287#### API Endpoint, tool and model support

288 288 

289| Endpoint or feature | Service | Storage regions | Processing regions | Supported models and snapshots | Regional processing snapshot exceptions | Notes |289| Endpoint or feature | Service | Storage regions | Processing regions | Supported models and snapshots | Regional processing snapshot exceptions | Notes |

290| -------------------------------------------------------------------- | ---------------- | ----------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |290| -------------------------------------------------------------------- | ---------------- | ----------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

291| `/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`, `gpt-transcribe` | None | — |291| `/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`, `gpt-transcribe` | None | — |

292| `/v1/batches` | Batches | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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`, `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 | GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna support EU data residency with Standard, Flex, and Batch processing. GPT-6.1 Sol supports only US and EU data residency. |292| `/v1/batches` | Batches | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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`, `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 | GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna support EU data residency with Standard, Flex, and Batch processing. GPT-6.1 Sol supports only US and EU data residency. |

293| `/v1/chat/completions` | Chat Completions | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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-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`, `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.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.2-2025-12-11` | Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra. GPT-6.1 Sol supports only US and EU data residency. |293| `/v1/chat/completions` | Chat Completions | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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-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`, `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.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.2-2025-12-11` | Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra or GPT-6 Sol. GPT-6.1 Sol supports only US and EU data residency. |

294| `/v1/decisions` | Decisions | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-6-luna` | None | Available in all supported API regions. Regional processing is supported in the United States and Europe (EEA + Switzerland). Prompt caching is subject to the retention limitations below. |294| `/v1/decisions` | Decisions | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-6-luna` | None | Available in all supported API regions. Regional processing is supported in the United States and Europe (EEA + Switzerland). Prompt caching is subject to the retention limitations below. |

295| `/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-large` | — |295| `/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-large` | — |

296| `/v1/evals` | Evals | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | Service-level support | None | — |296| `/v1/evals` | Evals | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

297| `/v1/files` | Files | All listed regions | None | Service-level support | None | — |297| `/v1/files` | Files | All listed regions | None | Service-level support | None | — |

298| `/v1/fine_tuning/jobs` | Fine-tuning | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14` | None | — |298| `/v1/fine_tuning/jobs` | Fine-tuning | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-4o-2024-08-06`, `gpt-4o-mini-2024-07-18`, `gpt-4.1-2025-04-14`, `gpt-4.1-mini-2025-04-14` | None | — |

299| `/v1/images/edits` | Images | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1`, `gpt-image-1.5`, `gpt-image-1-mini` | None | — |299| `/v1/images/edits` | Images | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1-mini` | None | — |

300| `/v1/images/generations` | Images | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1`, `gpt-image-1.5`, `gpt-image-1-mini` | None | — |300| `/v1/images/generations` | Images | All listed regions | United States, Europe (EEA + Switzerland) | `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2`, `gpt-image-1.5`, `gpt-image-1-mini` | None | — |

301| `/v1/moderations` | Moderation | All listed regions | United States, Europe (EEA + Switzerland) | `omni-moderation-latest` | None | — |301| `/v1/moderations` | Moderation | All listed regions | United States, Europe (EEA + Switzerland) | `omni-moderation-latest` | None | — |

302| `/v1/live/sessions` | GPT-Live | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-live-1` | None | — |302| `/v1/live/sessions` | GPT-Live | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-live-1` | None | — |

303| `/v1/realtime` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime`, `gpt-realtime-1.5`, `gpt-realtime-mini`, `gpt-realtime-2`, `gpt-realtime-2.1`, `gpt-realtime-2.1-mini` | None | — |303| `/v1/realtime` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime`, `gpt-realtime-1.5`, `gpt-realtime-mini`, `gpt-realtime-2`, `gpt-realtime-2.1`, `gpt-realtime-2.1-mini` | None | — |

304| `/v1/realtime/transcription_sessions` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-whisper`, `gpt-live-transcribe`, `gpt-transcribe` | None | — |304| `/v1/realtime/transcription_sessions` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-whisper`, `gpt-live-transcribe`, `gpt-transcribe` | None | — |

305| `/v1/realtime/translations` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-translate` | None | — |305| `/v1/realtime/translations` | Realtime | United States, Europe (EEA + Switzerland) | United States, Europe (EEA + Switzerland) | `gpt-realtime-translate` | None | — |

306| `/v1/responses` | Responses | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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`, `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.5-pro-2026-04-23`, `gpt-5.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.2-2025-12-11` | Fast mode supports EU data residency for GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra. GPT-6.1 Sol supports only US and EU data residency. |306| `/v1/responses` | Responses | All listed regions | United States, Europe (EEA + Switzerland), United Arab Emirates | `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6-sol`, `gpt-6-luna`, `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`, `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.5-pro-2026-04-23`, `gpt-5.6-luna`, `gpt-5.5-2026-04-23`, `gpt-5.2-2025-12-11` | Fast mode supports EU data residency for GPT-6.1 Sol and GPT-6 Luna. Fast mode is not available with EU data residency for GPT-6 Astra or GPT-6 Sol. GPT-6.1 Sol supports only US and EU data residency. |

307| `/v1/responses File Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |307| `/v1/responses File Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

308| `/v1/responses Web Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |308| `/v1/responses Web Search` | Responses | All listed regions | United States, Europe (EEA + Switzerland) | Service-level support | None | — |

309| `/v1/vector_stores` | Vector stores | All listed regions | None | Service-level support | None | — |309| `/v1/vector_stores` | Vector stores | All listed regions | None | Service-level support | None | — |

libraries.md +1 −1

Details

173<dependency>173<dependency>

174 <groupId>com.openai</groupId>174 <groupId>com.openai</groupId>

175 <artifactId>openai-java</artifactId>175 <artifactId>openai-java</artifactId>

176 <version>4.90.0</version>176 <version>4.91.0</version>

177</dependency>177</dependency>

178```178```

179 179 

models.md +1 −1

Details

83- [GPT-Audio](/api/docs/models/gpt-audio.md): For audio inputs and outputs with Chat Completions API83- [GPT-Audio](/api/docs/models/gpt-audio.md): For audio inputs and outputs with Chat Completions API

84- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): A cost-efficient version of GPT Audio84- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): A cost-efficient version of GPT Audio

85- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.85- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.

86- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Our previous image generation model86- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Retired image generation model

87- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): A cost-efficient version of GPT Image 187- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): A cost-efficient version of GPT Image 1

88- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Our previous image generation model88- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Our previous image generation model

89- [GPT-Image-2](/api/docs/models/gpt-image-2.md): State-of-the-art image generation model89- [GPT-Image-2](/api/docs/models/gpt-image-2.md): State-of-the-art image generation model

models/all.md +48 −48

Details

36- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out36- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out

37- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.37- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.

38- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription38- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription

39- [GPT-4o Transcribe](/api/docs/models/gpt-4o-transcribe.md): Speech-to-text model powered by GPT-4o39- [GPT-4o Transcribe](/api/docs/models/gpt-4o-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o

40- [GPT-4o Mini Transcribe](/api/docs/models/gpt-4o-mini-transcribe.md): Speech-to-text model powered by GPT-4o Mini40- [GPT-4o Mini Transcribe](/api/docs/models/gpt-4o-mini-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o Mini

41- [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Transcription model that identifies who's speaking when41- [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Deprecated. Transcription model that identifies who's speaking when

42- [Whisper](/api/docs/models/whisper-1.md): General-purpose speech recognition model42- [Whisper](/api/docs/models/whisper-1.md): Deprecated. General-purpose speech recognition model

43- [GPT-4o Mini TTS](/api/docs/models/gpt-4o-mini-tts.md): Text-to-speech model powered by GPT-4o Mini43- [GPT-4o Mini TTS](/api/docs/models/gpt-4o-mini-tts.md): Deprecated. Text-to-speech model powered by GPT-4o Mini

44 44 

45## OpenAI Daybreak45## OpenAI Daybreak

46 46 


84- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents84- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents

85- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort85- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort

86- [GPT-5.2 Pro](/api/docs/models/gpt-5.2-pro.md): Previous pro model for professional work that produces smarter and more precise responses.86- [GPT-5.2 Pro](/api/docs/models/gpt-5.2-pro.md): Previous pro model for professional work that produces smarter and more precise responses.

87- [GPT-5](/api/docs/models/gpt-5.md): Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort87- [GPT-5](/api/docs/models/gpt-5.md): Deprecated. Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort

88- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Strong intelligence for cost sensitive, low latency, high volume workloads88- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Deprecated. Strong intelligence for cost sensitive, low latency, high volume workloads

89- [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Fastest, most cost-efficient version of GPT-589- [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Deprecated. Fastest, most cost-efficient version of GPT-5

90- [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Version of GPT-5 that produces smarter and more precise responses90- [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Deprecated. Version of GPT-5 that produces smarter and more precise responses

91- [o3-pro](/api/docs/models/o3-pro.md): Version of o3 with more compute for better responses91- [o3-pro](/api/docs/models/o3-pro.md): Deprecated. Version of o3 with more compute for better responses

92- [o3](/api/docs/models/o3.md): Reasoning model for complex tasks, succeeded by GPT-592- [o3](/api/docs/models/o3.md): Deprecated. Reasoning model for complex tasks, succeeded by GPT-5

93- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images93- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images

94- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): Deprecated. An alias for advanced cybersecurity models for authorized vulnerability research and security testing.94- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): Deprecated. An alias for advanced cybersecurity models for authorized vulnerability research and security testing.

95- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): Deprecated. An alias for flagship general-purpose models with safeguards for defensive cybersecurity work.95- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): Deprecated. An alias for flagship general-purpose models with safeguards for defensive cybersecurity work.


103- [GPT-4o Mini](/api/docs/models/gpt-4o-mini.md): Deprecated. Fast, affordable small model for focused tasks103- [GPT-4o Mini](/api/docs/models/gpt-4o-mini.md): Deprecated. Fast, affordable small model for focused tasks

104- [TTS-1](/api/docs/models/tts-1.md): Deprecated. Text-to-speech model optimized for speed104- [TTS-1](/api/docs/models/tts-1.md): Deprecated. Text-to-speech model optimized for speed

105- [TTS-1 HD](/api/docs/models/tts-1-hd.md): Deprecated. Text-to-speech model optimized for quality105- [TTS-1 HD](/api/docs/models/tts-1-hd.md): Deprecated. Text-to-speech model optimized for quality

106- [GPT-5.3 Chat](/api/docs/models/gpt-5.3-chat-latest.md): Deprecated. GPT-5.3 Instant model used in ChatGPT106- [GPT-5.3 Chat](/api/docs/models/gpt-5.3-chat-latest.md): Shut down. GPT-5.3 Instant model used in ChatGPT

107- [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): Deprecated. GPT-5.2 model used in ChatGPT107- [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): Shut down. GPT-5.2 model used in ChatGPT

108- [GPT-5.2-Codex](/api/docs/models/gpt-5.2-codex.md): Deprecated. Our most intelligent coding model optimized for long-horizon, agentic coding tasks.108- [GPT-5.2-Codex](/api/docs/models/gpt-5.2-codex.md): Shut down. Our most intelligent coding model optimized for long-horizon, agentic coding tasks.

109- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Deprecated. Our previous image generation model109- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Deprecated. Our previous image generation model

110- [chatgpt-image-latest](/api/docs/models/chatgpt-image-latest.md): Deprecated. Previous image model used in ChatGPT.110- [chatgpt-image-latest](/api/docs/models/chatgpt-image-latest.md): Deprecated. Previous image model used in ChatGPT.

111- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): Deprecated. A cost-efficient version of GPT Image 1111- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): Deprecated. A cost-efficient version of GPT Image 1

112- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Deprecated. Our previous image generation model112- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Shut down. Retired image generation model

113- [o3-deep-research](/api/docs/models/o3-deep-research.md): Deprecated. Our most powerful deep research model113- [o3-deep-research](/api/docs/models/o3-deep-research.md): Shut down. Our most powerful deep research model

114- [o4-mini-deep-research](/api/docs/models/o4-mini-deep-research.md): Deprecated. Faster, more affordable deep research model114- [o4-mini-deep-research](/api/docs/models/o4-mini-deep-research.md): Shut down. Faster, more affordable deep research model

115- [GPT-4.1 nano](/api/docs/models/gpt-4.1-nano.md): Deprecated. Fastest, most cost-efficient version of GPT-4.1115- [GPT-4.1 nano](/api/docs/models/gpt-4.1-nano.md): Shut down. Fastest, most cost-efficient version of GPT-4.1

116- [o4-mini](/api/docs/models/o4-mini.md): Deprecated. Fast, cost-efficient reasoning model, succeeded by GPT-5 Mini116- [o4-mini](/api/docs/models/o4-mini.md): Shut down. Fast, cost-efficient reasoning model, succeeded by GPT-5 Mini

117- [o1-pro](/api/docs/models/o1-pro.md): Deprecated. Version of o1 with more compute for better responses117- [o1-pro](/api/docs/models/o1-pro.md): Shut down. Version of o1 with more compute for better responses

118- [computer-use-preview](/api/docs/models/computer-use-preview.md): Deprecated. Specialized model for computer use tool118- [computer-use-preview](/api/docs/models/computer-use-preview.md): Shut down. Specialized model for computer use tool

119- [GPT-Realtime Mini](/api/docs/models/gpt-realtime-mini.md): Deprecated. A cost-efficient version of GPT-Realtime119- [GPT-Realtime Mini](/api/docs/models/gpt-realtime-mini.md): Deprecated. A cost-efficient version of GPT-Realtime

120- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): Deprecated. A cost-efficient version of GPT Audio120- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): Deprecated. A cost-efficient version of GPT Audio

121- [GPT-4o Mini Search Preview](/api/docs/models/gpt-4o-mini-search-preview.md): Deprecated. Fast, affordable small model for web search121- [GPT-4o Mini Search Preview](/api/docs/models/gpt-4o-mini-search-preview.md): Shut down. Fast, affordable small model for web search

122- [GPT-4o Search Preview](/api/docs/models/gpt-4o-search-preview.md): Deprecated. GPT model for web search in Chat Completions122- [GPT-4o Search Preview](/api/docs/models/gpt-4o-search-preview.md): Shut down. GPT model for web search in Chat Completions

123- [GPT-4.5 Preview](/api/docs/models/gpt-4.5-preview.md): Deprecated. Deprecated large model.123- [GPT-4.5 Preview](/api/docs/models/gpt-4.5-preview.md): Shut down. Deprecated large model.

124- [o3-mini](/api/docs/models/o3-mini.md): Deprecated. A small model alternative to o3124- [o3-mini](/api/docs/models/o3-mini.md): Shut down. A small model alternative to o3

125- [o1](/api/docs/models/o1.md): Deprecated. Previous full o-series reasoning model125- [o1](/api/docs/models/o1.md): Shut down. Previous full o-series reasoning model

126- [o1-mini](/api/docs/models/o1-mini.md): Deprecated. A small model alternative to o1126- [o1-mini](/api/docs/models/o1-mini.md): Shut down. A small model alternative to o1

127- [o1 Preview](/api/docs/models/o1-preview.md): Deprecated. Preview of our first o-series reasoning model127- [o1 Preview](/api/docs/models/o1-preview.md): Shut down. Preview of our first o-series reasoning model

128- [GPT-4o](/api/docs/models/gpt-4o.md): Deprecated. Fast, intelligent, flexible GPT model128- [GPT-4o](/api/docs/models/gpt-4o.md): Deprecated. Fast, intelligent, flexible GPT model

129- [GPT-4o Audio](/api/docs/models/gpt-4o-audio-preview.md): Deprecated. GPT-4o models capable of audio inputs and outputs129- [GPT-4o Audio](/api/docs/models/gpt-4o-audio-preview.md): Shut down. GPT-4o models capable of audio inputs and outputs

130- [GPT-4o Mini Audio](/api/docs/models/gpt-4o-mini-audio-preview.md): Deprecated. Smaller model capable of audio inputs and outputs130- [GPT-4o Mini Audio](/api/docs/models/gpt-4o-mini-audio-preview.md): Shut down. Smaller model capable of audio inputs and outputs

131- [GPT-4o Mini Realtime](/api/docs/models/gpt-4o-mini-realtime-preview.md): Deprecated. Smaller realtime model for text and audio inputs and outputs131- [GPT-4o Mini Realtime](/api/docs/models/gpt-4o-mini-realtime-preview.md): Shut down. Smaller realtime model for text and audio inputs and outputs

132- [GPT-4o Realtime](/api/docs/models/gpt-4o-realtime-preview.md): Deprecated. Model capable of realtime text and audio inputs and outputs132- [GPT-4o Realtime](/api/docs/models/gpt-4o-realtime-preview.md): Shut down. Model capable of realtime text and audio inputs and outputs

133- [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): Deprecated. An older high-intelligence GPT model133- [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): Shut down. An older high-intelligence GPT model

134- [babbage-002](/api/docs/models/babbage-002.md): Deprecated. Replacement for the GPT-3 ada and babbage base models134- [babbage-002](/api/docs/models/babbage-002.md): Shut down. Replacement for the GPT-3 ada and babbage base models

135- [ChatGPT-4o](/api/docs/models/chatgpt-4o-latest.md): Deprecated. GPT-4o model used in ChatGPT135- [ChatGPT-4o](/api/docs/models/chatgpt-4o-latest.md): Shut down. GPT-4o model used in ChatGPT

136- [GPT-5.1-Codex](/api/docs/models/gpt-5.1-codex.md): Deprecated. A version of GPT-5.1 optimized for agentic coding in Codex.136- [GPT-5.1-Codex](/api/docs/models/gpt-5.1-codex.md): Shut down. A version of GPT-5.1 optimized for agentic coding in Codex.

137- [GPT-5.1-Codex-Max](/api/docs/models/gpt-5.1-codex-max.md): Deprecated. A version of GPT-5.1-codex optimized for long running tasks.137- [GPT-5.1-Codex-Max](/api/docs/models/gpt-5.1-codex-max.md): Shut down. A version of GPT-5.1-codex optimized for long running tasks.

138- [GPT-5.1-Codex Mini](/api/docs/models/gpt-5.1-codex-mini.md): Deprecated. Smaller, more cost-effective, less-capable version of GPT-5.1-Codex138- [GPT-5.1-Codex Mini](/api/docs/models/gpt-5.1-codex-mini.md): Shut down. Smaller, more cost-effective, less-capable version of GPT-5.1-Codex

139- [GPT-5-Codex](/api/docs/models/gpt-5-codex.md): Deprecated. A version of GPT-5 optimized for agentic coding in Codex139- [GPT-5-Codex](/api/docs/models/gpt-5-codex.md): Shut down. A version of GPT-5 optimized for agentic coding in Codex

140- [codex-mini-latest](/api/docs/models/codex-mini-latest.md): Deprecated. Fast reasoning model optimized for the Codex CLI140- [codex-mini-latest](/api/docs/models/codex-mini-latest.md): Shut down. Fast reasoning model optimized for the Codex CLI

141- [davinci-002](/api/docs/models/davinci-002.md): Deprecated. Replacement for the GPT-3 curie and davinci base models141- [davinci-002](/api/docs/models/davinci-002.md): Shut down. Replacement for the GPT-3 curie and davinci base models

142- [GPT-3.5 Turbo](/api/docs/models/gpt-3.5-turbo.md): Deprecated. Legacy GPT model for cheaper chat and non-chat tasks142- [GPT-3.5 Turbo](/api/docs/models/gpt-3.5-turbo.md): Shut down. Legacy GPT model for cheaper chat and non-chat tasks

143- [GPT-4](/api/docs/models/gpt-4.md): Deprecated. An older high-intelligence GPT model143- [GPT-4](/api/docs/models/gpt-4.md): Shut down. An older high-intelligence GPT model

144- [GPT-4 Turbo Preview](/api/docs/models/gpt-4-turbo-preview.md): Deprecated. An older fast GPT model144- [GPT-4 Turbo Preview](/api/docs/models/gpt-4-turbo-preview.md): Shut down. An older fast GPT model

145- [GPT-5.1 Chat](/api/docs/models/gpt-5.1-chat-latest.md): Deprecated. GPT-5.1 model used in ChatGPT145- [GPT-5.1 Chat](/api/docs/models/gpt-5.1-chat-latest.md): Shut down. GPT-5.1 model used in ChatGPT

146- [GPT-5 Chat](/api/docs/models/gpt-5-chat-latest.md): Deprecated. GPT-5 model used in ChatGPT146- [GPT-5 Chat](/api/docs/models/gpt-5-chat-latest.md): Shut down. GPT-5 model used in ChatGPT

147- [text-moderation](/api/docs/models/text-moderation-latest.md): Deprecated. Previous generation text-only moderation model147- [text-moderation](/api/docs/models/text-moderation-latest.md): Shut down. Previous generation text-only moderation model

148- [text-moderation-stable](/api/docs/models/text-moderation-stable.md): Deprecated. Previous generation text-only moderation model148- [text-moderation-stable](/api/docs/models/text-moderation-stable.md): Shut down. Previous generation text-only moderation model

149 149 

150## ChatGPT models150## ChatGPT models

151 151 

quickstart.md +1 −1

Details

190<dependency>190<dependency>

191 <groupId>com.openai</groupId>191 <groupId>com.openai</groupId>

192 <artifactId>openai-java</artifactId>192 <artifactId>openai-java</artifactId>

193 <version>4.90.0</version>193 <version>4.91.0</version>

194</dependency>194</dependency>

195```195```

196 196