SpyBara
Go Premium

Documentation 2026-11-01 23:00 UTC to 2026-11-02 23:58 UTC

47 files changed +843 −450. View all changes and history on the product overview
2026
Fri 13 23:58 Thu 12 22:57 Wed 11 23:57 Tue 10 23:02 Mon 9 23:02 Sun 8 22:59 Sat 7 22:59 Fri 6 23:00 Thu 5 23:00 Wed 4 22:58 Tue 3 22:58 Mon 2 23:58 Sun 1 23:00
Details

210 210 

211Here’s an example of the instructions for the Weather GPT. Notice how the instructions refer to the API action name and json parameters from the Open API schema.211Here’s an example of the instructions for the Weather GPT. Notice how the instructions refer to the API action name and json parameters from the Open API schema.

212 212 

213```213```text

214**Context**: A user needs information related to a weather forecast of a specific location.214**Context**: A user needs information related to a weather forecast of a specific location.

215 215 

216**Instructions**:216**Instructions**:

Details

149 149 

150Here’s an example of the required headers for each URL:150Here’s an example of the required headers for each URL:

151 151 

152```152```text

153Content-Type: application/pdf153Content-Type: application/pdf

154Content-Disposition: attachment; filename="example_document.pdf"154Content-Disposition: attachment; filename="example_document.pdf"

155```155```

Details

250 .notificationChannel(250 .notificationChannel(

251 SpendAlertCreateParams.NotificationChannel.builder()251 SpendAlertCreateParams.NotificationChannel.builder()

252 .addRecipient("billing@example.com")252 .addRecipient("billing@example.com")

253 .subjectPrefix("[OpenAI spend]")253 .subjectPrefix("OpenAI spend")

254 .build())254 .build())

255 .thresholdAmount(50000L)255 .thresholdAmount(50000L)

256 .build());256 .build());

Details

479 479 

480You cannot update `reasoning.summary`, `text`, `tools`, `instructions`, or `multi_agent` through this endpoint. Create a new session to change those settings.480You cannot update `reasoning.summary`, `text`, `tools`, `instructions`, or `multi_agent` through this endpoint. Create a new session to change those settings.

481 481 

482## Automatic action review

483 

484Set the session-level `review` field to `"auto_review"` to automatically review supported approval requests. Set it alongside `agent` or `agent_id`, rather than inside the agent configuration. If you omit `review` when creating a session, the value defaults to `"none"`.

485 

486Automatic review also changes execution permissions. Check the [environment prerequisites](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals#prepare-the-execution-environment) before enabling it.

487 

488You can update `review` when the main task is idle and input submission has settled. Subsequent execution and recovery use the new setting. A request to change the mode before those conditions are met returns `409 Conflict` and applies no changes. Use a project with automatic review enabled and a session that supports it. See [Automatic review](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals) for configuration and approval handling.

489 

482## Environment settings490## Environment settings

483 491 

484Set `environment` alongside `agent` when creating a session. It determines where the agent runs commands and works with files.492Set `environment` alongside `agent` when creating a session. It determines where the agent runs commands and works with files.

Details

470 .limit(20L)470 .limit(20L)

471 .order(EnvironmentListParams.Order.DESC)471 .order(EnvironmentListParams.Order.DESC)

472 .build());472 .build());

473System.out.println(environments);473System.out.println(environments.items());

474```474```

475 475 

476```ruby476```ruby

Details

25 25 

26See [MCP tools](https://developers.openai.com/api/docs/guides/agents-api/tools/mcp) for connection options.26See [MCP tools](https://developers.openai.com/api/docs/guides/agents-api/tools/mcp) for connection options.

27 27 

28## Review agent actions

29 

30Enable [automatic review](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals) with the session-level `review: "auto_review"` setting to automatically approve or deny supported approval requests. Keep the environment's network restrictions and credential controls in place; automatic review does not replace them.

31 

32Automatic review applies a permission profile with a workspace-write baseline and restricted network access. If you run the standard executor, your container must support sandboxing and permit Codex to create a sandbox. See [execution environment prerequisites](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals#prepare-the-execution-environment).

33 

34Browser origin approvals and sign-in still require your application's existing handlers. See [Computer use](https://developers.openai.com/api/docs/guides/agents-api/tools/computer-use#handle-origin-access) for those workflows.

35 

28 36 

29 37 

30 38 

Details

35 35 

36Prepare the files and dependencies your agent needs. Isolate environments by user or workload. Agents that share an environment can access the same files, credentials, and other resources.36Prepare the files and dependencies your agent needs. Isolate environments by user or workload. Agents that share an environment can access the same files, credentials, and other resources.

37 37 

38To enable automatic review with `review: "auto_review"`, run the standard executor in a container that supports sandboxing and permits Codex to create a sandbox. Automatic review applies a permission profile with a workspace-write baseline and restricted network access. Check the [automatic review prerequisites](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals#prepare-the-execution-environment) before enabling it.

39 

38Create the working directory and install the Codex CLI inside the environment. This example uses `/workspace`:40Create the working directory and install the Codex CLI inside the environment. This example uses `/workspace`:

39 41 

40```bash42```bash

Details

99 99 

100```java100```java

101// Replace the illustrative IDs and URLs below with your own resource values.101// Replace the illustrative IDs and URLs below with your own resource values.

102import com.fasterxml.jackson.databind.json.JsonMapper;

103import com.openai.client.OpenAIClient;102import com.openai.client.OpenAIClient;

104import com.openai.client.okhttp.OpenAIOkHttpClient;103import com.openai.client.okhttp.OpenAIOkHttpClient;

104import com.openai.core.ObjectMappers;

105import com.openai.core.http.StreamResponse;105import com.openai.core.http.StreamResponse;

106import com.openai.models.beta.agents.AgentSessionEvent;106import com.openai.models.beta.agents.AgentSessionEvent;

107 107 

108OpenAIClient client = OpenAIOkHttpClient.fromEnv();108OpenAIClient client = OpenAIOkHttpClient.fromEnv();

109var json = new JsonMapper();109var json = ObjectMappers.jsonMapper();

110try (StreamResponse<AgentSessionEvent> events =110try (StreamResponse<AgentSessionEvent> events =

111 client.beta().agents().sessions().events().streamStreaming("sess_123")) {111 client.beta().agents().sessions().events().streamStreaming("sess_123")) {

112 var iterator = events.stream().iterator();112 var iterator = events.stream().iterator();


390```390```

391 391 

392```java392```java

393// Replace the illustrative IDs and URLs below with your own resource values.393// Replace the illustrative session and turn IDs with values from your command item.

394import com.openai.client.OpenAIClient;394import com.openai.client.OpenAIClient;

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

396import com.openai.models.beta.agents.sessions.subagents.SubagentListParams;

397import com.openai.models.beta.agents.sessions.turns.Turn;

396import com.openai.models.beta.agents.sessions.turns.TurnListParams;398import com.openai.models.beta.agents.sessions.turns.TurnListParams;

397import com.openai.models.beta.agents.sessions.turns.TurnRetrieveParams;399import com.openai.models.beta.agents.sessions.turns.TurnRetrieveParams;

398 400 

399OpenAIClient client = OpenAIOkHttpClient.fromEnv();401OpenAIClient client = OpenAIOkHttpClient.fromEnv();

400var result =402var turn = findTurn(client, "sess_123", "turn_123");

401 client403System.out.println(turn.subagentId().orElse("main agent"));

402 .beta()404 

403 .agents()405// Discover the owning agent using native SDK pagination before retrieving the turn.

404 .sessions()406static Turn findTurn(OpenAIClient client, String sessionId, String turnId) {

407 var sessions = client.beta().agents().sessions();

408 var turns =

409 sessions.turns().list(TurnListParams.builder().sessionId(sessionId).limit(100L).build());

410 for (var turn : turns.autoPager()) {

411 if (turn.id().equals(turnId)) {

412 return sessions

413 .turns()

414 .retrieve(TurnRetrieveParams.builder().sessionId(sessionId).turnId(turnId).build());

415 }

416 }

417 var subagents =

418 sessions

419 .subagents()

420 .list(SubagentListParams.builder().sessionId(sessionId).limit(100L).build());

421 for (var subagent : subagents.autoPager()) {

422 var childTurns =

423 sessions

424 .subagents()

405 .turns()425 .turns()

406 .list(426 .list(

407 TurnListParams.builder()427 com.openai.models.beta.agents.sessions.subagents.turns.TurnListParams.builder()

408 .sessionId("sess_123")428 .sessionId(sessionId)

409 .limit(20L)429 .subagentId(subagent.id())

410 .order(TurnListParams.Order.of("desc"))430 .limit(100L)

411 .build());431 .build());

412System.out.println(result.items());432 for (var turn : childTurns.autoPager()) {

413var turn =433 if (turn.id().equals(turnId)) {

414 client434 return sessions

415 .beta()435 .subagents()

416 .agents()

417 .sessions()

418 .turns()436 .turns()

419 .retrieve(437 .retrieve(

420 TurnRetrieveParams.builder().turnId("turn_123").sessionId("sess_123").build());438 com.openai.models.beta.agents.sessions.subagents.turns.TurnRetrieveParams

421System.out.println(turn.subagentId());439 .builder()

440 .sessionId(sessionId)

441 .subagentId(subagent.id())

442 .turnId(turnId)

443 .build());

444 }

445 }

446 }

447 throw new IllegalArgumentException("Turn " + turnId + " not found in session " + sessionId);

448}

422```449```

423 450 

424```ruby451```ruby

Details

206Create and run tree.py206Create and run tree.py

207 207 

208```java208```java

209import com.fasterxml.jackson.databind.json.JsonMapper;

210import com.openai.client.OpenAIClient;209import com.openai.client.OpenAIClient;

211import com.openai.client.okhttp.OpenAIOkHttpClient;210import com.openai.client.okhttp.OpenAIOkHttpClient;

211import com.openai.core.ObjectMappers;

212import com.openai.core.http.StreamResponse;212import com.openai.core.http.StreamResponse;

213import com.openai.models.beta.agents.AgentSessionEvent;213import com.openai.models.beta.agents.AgentSessionEvent;

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


216import com.openai.services.beta.agents.AgentTurnResults;216import com.openai.services.beta.agents.AgentTurnResults;

217 217 

218OpenAIClient client = OpenAIOkHttpClient.fromEnv();218OpenAIClient client = OpenAIOkHttpClient.fromEnv();

219var json = new JsonMapper();219var json = ObjectMappers.jsonMapper();

220try (StreamResponse<AgentSessionEvent> events =220try (StreamResponse<AgentSessionEvent> events =

221 client221 client

222 .beta()222 .beta()

Details

112```112```

113 113 

114```java114```java

115import com.fasterxml.jackson.databind.json.JsonMapper;

116import com.openai.client.OpenAIClient;115import com.openai.client.OpenAIClient;

117import com.openai.client.okhttp.OpenAIOkHttpClient;116import com.openai.client.okhttp.OpenAIOkHttpClient;

117import com.openai.core.ObjectMappers;

118import com.openai.core.http.StreamResponse;118import com.openai.core.http.StreamResponse;

119import com.openai.models.beta.agents.AgentSessionEvent;119import com.openai.models.beta.agents.AgentSessionEvent;

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


122import com.openai.services.beta.agents.AgentTurnResults;122import com.openai.services.beta.agents.AgentTurnResults;

123 123 

124OpenAIClient client = OpenAIOkHttpClient.fromEnv();124OpenAIClient client = OpenAIOkHttpClient.fromEnv();

125var json = new JsonMapper();125var json = ObjectMappers.jsonMapper();

126try (StreamResponse<AgentSessionEvent> events =126try (StreamResponse<AgentSessionEvent> events =

127 client127 client

128 .beta()128 .beta()


187 187 

188Store the `session_id` with your application's conversation state. Use it to send follow-up messages and retrieve saved work for that conversation.188Store the `session_id` with your application's conversation state. Use it to send follow-up messages and retrieve saved work for that conversation.

189 189 

190To enable automatic action review, set `review` to `"auto_review"` when creating an eligible session in a project with automatic review enabled. You can change the setting when the main task is idle and input submission has settled. See [Automatic review](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals) for the review modes, environment prerequisites, and approval behavior.

191 

190See [Configuring Agents](https://developers.openai.com/api/docs/guides/agents-api/configuration) for reusable agent settings and [Architecture](https://developers.openai.com/api/docs/guides/agents-api/architecture) for environment choices. Sessions with `environment.type: "none"` require initial input. The [Create session reference](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/create) lists the request fields.192See [Configuring Agents](https://developers.openai.com/api/docs/guides/agents-api/configuration) for reusable agent settings and [Architecture](https://developers.openai.com/api/docs/guides/agents-api/architecture) for environment choices. Sessions with `environment.type: "none"` require initial input. The [Create session reference](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/create) lists the request fields.

191 193 

192If the session uses Files API attachments, file checks can return HTTP 429 with194If the session uses Files API attachments, file checks can return HTTP 429 with

Details

1# Automatic review

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 

5Automatic review approves or denies supported approval requests as an agent works, much like the automatic approval function in ChatGPT and Codex. Configure it using the `review` field when you create a session for your agent. The setting applies to root turns and any subagents they create.

6 

7 

8 

9**Review actions**

10 

11Automatically approve or deny supported requests from the agent and its subagents.

12 

13 

14 

15 

16 

17 

18**Change review between tasks**

19 

20Choose the review mode for the next root turn.

21 

22 

23 

24 

25 

26 

27**Keep network restrictions**

28 

29Review does not override the environment's outbound network restrictions.

30 

31 

32 

33 

34 

35 

36 

37 

38## API resources

39 

40 

41 

42 

43 

44 

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

46 

47`/v1/agents/sessions`

48 

49 

50 

51 

52Set the review mode and inspect pending actions.

53 

54 

55 

56 

57 

58 

59 

60 

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

62 

63`/v1/agents`

64 

65 

66 

67 

68Reuse the instructions and tools for the task.

69 

70 

71 

72 

73 

74 

75 

76 

77[Environment templates](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates)

78 

79`/v1/agents/environments/templates`

80 

81 

82 

83 

84Reuse the execution environment's configuration.

85 

86 

87 

88 

89 

90 

91 

92 

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

94 

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

96 

97 

98 

99 

100Follow progress and check how the turn ended.

101 

102 

103 

104 

105 

106 

107 

108 

109 

110 

111 

112## How it works

113 

114Automatic review brings the "Approve for me" functionality of the Codex harness to your agents. During a session, approval requests can arise when an agent's intended action requests additional permissions. Some example actions that could raise approval requests:

115 

116- Shell commands and terminal input that require approval, such as permission escalation or potentially dangerous commands.

117- File changes that require approval.

118- Additional permission requests, such as broader filesystem or network access.

119- Network access requests that trigger approval, subject to the environment’s network restrictions.

120- MCP tool calls whose approval rules require confirmation.

121 

122An OpenAI-managed reviewer model uses the conversation context to assess what the action would do, what risks it poses, and whether the action aligns with the user's intent. The model then approves or denies the request.

123 

124Tokens used for review are billed in addition to your agent’s model usage.

125 

126Your application still handles browser origin-access and sign-in requests. MCP

127forms that require input and requests that direct the user to a URL follow their

128existing flows. Automatic review does not require new approval event handlers.

129See [Events and items](https://developers.openai.com/api/docs/guides/agents-api/sessions/events) to follow the

130agent's progress and check the turn's outcome.

131 

132## Choose a review mode

133 

134Set the session's `review` field to choose the behavior:

135 

136| Value | Behavior |

137| --------------- | ----------------------------------------------------------------------------------------------------------------------------- |

138| `"auto_review"` | Automatically approve or deny supported requests based on the action's risks and the user's instructions in the conversation. |

139| `"none"` | Automatic review is not applied. Most actions execute directly, subject to the environment's permissions and restrictions. |

140 

141Omitting `review` defaults to `"none"`. The setting persists when the session

142resumes. To change it, send `"auto_review"` or `"none"`; `null` is not accepted.

143Setting `review` to `"none"` does not send those actions to your application for

144manual approval.

145 

146## Prepare the execution environment

147 

148For OpenAI-hosted execution, create the session with a new environment, optionally

149from an [environment template](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/environments/subresources/templates).

150Automatic review is not supported when reusing an existing hosted environment

151through `environment_id`.

152 

153For self-hosted execution, follow the

154[self-hosted environment setup](https://developers.openai.com/api/docs/guides/agents-api/environments/self-hosted#prepare-your-environment)

155and the [sandbox prerequisites for your operating system](https://learn.chatgpt.com/docs/sandboxing?surface=app#app-prerequisites)

156before enabling automatic review. Setting `review` alone does not configure

157sandboxing in your environment.

158 

159 

160 

161 

162Automatic review does not change the environment's network restrictions.

163Configure outbound access through the environment's

164[network settings](https://developers.openai.com/api/docs/guides/agents-api/environments/openai-hosted#control-network-access).

165Browser origin approval does not override those restrictions.

166 

167 

168 

169 

170## Create a session with automatic review

171 

172Set `review` to `"auto_review"` when you create a session. This example asks the

173agent to run `npm install` in `/workspace`.

174 

175With your [API key and SDK configured](https://developers.openai.com/api/docs/guides/agents-api/quickstart#prerequisites),

176use an existing agent and an environment template that provides Node.js and a

177project containing `/workspace/package.json`. Replace the example agent and

178template IDs with your own.

179 

180Run npm install with automatic review

181 

182```javascript

183import OpenAI from "openai";

184 

185const client = new OpenAI();

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

187 agent_id: "agt_123",

188 environment: {

189 type: "openai_hosted",

190 environment_template_id: "envtmpl_123",

191 },

192 review: "auto_review",

193 input: "Run npm install in /workspace.",

194});

195console.log(session.id);

196```

197 

198```python

199from openai import OpenAI

200 

201client = OpenAI()

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

203 agent_id="agt_123",

204 environment={

205 "type": "openai_hosted",

206 "environment_template_id": "envtmpl_123",

207 },

208 review="auto_review",

209 input="Run npm install in /workspace.",

210)

211print(session.id)

212```

213 

214```go

215import (

216 "context"

217 "fmt"

218 

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

220)

221 

222client := openai.NewClient()

223session, err := client.Beta.Agents.Sessions.New(context.Background(), openai.BetaAgentSessionNewParams{

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

225 Environment: openai.EnvironmentParamUnion{

226 OfParamOpenAIHosted: &openai.EnvironmentParamOpenAIHosted{

227 EnvironmentTemplateID: openai.String("envtmpl_123"),

228 },

229 },

230 Review: openai.BetaAgentSessionNewParamsReviewAutoReview,

231 Input: openai.BetaAgentSessionNewParamsInputUnion{OfString: openai.String("Run npm install in /workspace.")},

232})

233if err != nil {

234 panic(err)

235}

236fmt.Println(session.ID)

237```

238 

239```java

240import com.openai.client.OpenAIClient;

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

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

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

244 

245OpenAIClient client = OpenAIOkHttpClient.fromEnv();

246var session =

247 client

248 .beta()

249 .agents()

250 .sessions()

251 .create(

252 SessionCreateParams.builder()

253 .agentId("agt_123")

254 .environment(

255 EnvironmentParam.OpenAIHosted.builder()

256 .environmentTemplateId("envtmpl_123")

257 .build())

258 .review(SessionCreateParams.Review.AUTO_REVIEW)

259 .input("Run npm install in /workspace.")

260 .build());

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

262```

263 

264```ruby

265require "openai"

266 

267client = OpenAI::Client.new

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

269 agent_id: "agt_123",

270 environment: {

271 type: :openai_hosted,

272 environment_template_id: "envtmpl_123"

273 },

274 review: :auto_review,

275 input: "Run npm install in /workspace."

276)

277puts session.id

278```

279 

280```bash

281curl --fail-with-body https://api.openai.com/v1/agents/sessions \

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

283 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

285 -d '{

286 "agent_id": "agt_123",

287 "environment": {

288 "type": "openai_hosted",

289 "environment_template_id": "envtmpl_123"

290 },

291 "review": "auto_review",

292 "input": "Run npm install in /workspace."

293 }'

294```

295 

296 

297Use the returned session `id` to [change the review mode](#change-the-review-mode)

298between tasks. See the [Create session reference](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/create)

299for the request fields.

300 

301Your project must have access to automatic review. If it is unavailable, the API

302rejects requests to enable it and identifies `review` as the affected parameter.

303 

304 

305 

306 

307## Change the review mode

308 

309Update the session's `review` field between tasks. The main task must be idle and

310input submission must have settled before you change the mode. This example

311turns off automatic review. Replace `sess_123` with the session ID returned above:

312 

313Turn off automatic review

314 

315```javascript

316const updatedSession = await client.beta.agents.sessions.update("sess_123", {

317 review: "none",

318});

319console.log(updatedSession.id);

320```

321 

322```python

323updated_session = client.beta.agents.sessions.update("sess_123", review="none")

324print(updated_session.id)

325```

326 

327```go

328updatedSession, err := client.Beta.Agents.Sessions.Update(context.Background(), "sess_123", openai.BetaAgentSessionUpdateParams{

329 Review: openai.BetaAgentSessionUpdateParamsReviewNone,

330})

331if err != nil {

332 panic(err)

333}

334fmt.Println(updatedSession.ID)

335```

336 

337```java

338import com.openai.models.beta.agents.sessions.SessionUpdateParams;

339 

340var updatedSession =

341 client

342 .beta()

343 .agents()

344 .sessions()

345 .update(

346 SessionUpdateParams.builder()

347 .sessionId("sess_123")

348 .review(SessionUpdateParams.Review.NONE)

349 .build());

350System.out.println(updatedSession.id());

351```

352 

353```ruby

354updated_session = client.beta.agents.sessions.update("sess_123", review: :none)

355puts updated_session.id

356```

357 

358```bash

359curl --fail-with-body https://api.openai.com/v1/agents/sessions/sess_123 \

360 -X POST \

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

362 -H "Authorization: Bearer $OPENAI_API_KEY" \

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

364 -d '{

365 "review": "none"

366 }'

367```

368 

369 

370The update returns `200 OK` and the updated session. Omit `review` from other

371session updates to leave it unchanged. To enable automatic review again, send

372`"review": "auto_review"`. See the [Update session reference](https://developers.openai.com/api/reference/resources/beta/subresources/agents/subresources/sessions/methods/update)

373for the request fields.

374 

375A request to change the mode while the main task is active or input submission

376has not settled returns `409 Conflict`. None of the updates in that request are

377applied. Retry after the task is idle and input submission has settled. Handle

378`409` even after checking the session's status, because new input can arrive

379before the update. Sending the current review value is allowed while work is

380active.

381 

382 

383 

384 

385[Retrieve](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#inspect-a-session) or

386[list sessions](https://developers.openai.com/api/docs/guides/agents-api/sessions/manage#list-sessions) to inspect

387the saved `review` value. If the response omits the field, treat it as `"none"`.

Details

142```java142```java

143import com.openai.client.OpenAIClient;143import com.openai.client.OpenAIClient;

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

145import com.openai.models.beta.agents.AgentBrowserAuthenticationCancelParam;

146import com.openai.models.beta.agents.AgentBrowserOriginAccessParam;

145import com.openai.models.beta.agents.AgentSession;147import com.openai.models.beta.agents.AgentSession;

146import com.openai.models.beta.agents.AgentSessionInputMessageParam;148import com.openai.models.beta.agents.AgentSessionInputMessageParam;

147import com.openai.models.beta.agents.AgentSessionInputParam;149import com.openai.models.beta.agents.AgentSessionInputParam;

148import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult;150import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult;

149import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult.Response;

150import com.openai.models.beta.agents.AgentToolParam;151import com.openai.models.beta.agents.AgentToolParam;

151import com.openai.models.beta.agents.EnvironmentParam;152import com.openai.models.beta.agents.EnvironmentParam;

152import com.openai.models.beta.agents.sessions.SessionCreateParams;153import com.openai.models.beta.agents.sessions.SessionCreateParams;

153import com.openai.models.beta.agents.sessions.events.EventCreateParams;154import com.openai.models.beta.agents.sessions.events.EventCreateParams;

154import com.openai.models.beta.agents.sessions.items.ItemListParams;155import com.openai.models.beta.agents.sessions.items.ItemListParams;

156import java.io.BufferedReader;

157import java.io.IOException;

158import java.io.InputStreamReader;

159import java.nio.charset.StandardCharsets;

155import java.nio.file.Files;160import java.nio.file.Files;

156import java.util.Base64;161import java.util.Base64;

157import java.util.HashSet;162import java.util.HashSet;


253origin, including public websites. Enabling network access does not approve258origin, including public websites. Enabling network access does not approve

254these requests.259these requests.

255 260 

261Enabling [automatic review](https://developers.openai.com/api/docs/guides/agents-api/sessions/approvals)

262also preserves browser origin approvals and [sign-in](#handle-sign-in)

263requests. Continue handling them in your application.

264 

256To handle an origin approval:265To handle an origin approval:

257 266 

2581. On `agent.session.requires_action`, retrieve the session and inspect its current `required_actions`.2671. On `agent.session.requires_action`, retrieve the session and inspect its current `required_actions`.


441static void respondToOriginApproval(450static void respondToOriginApproval(

442 OpenAIClient client,451 OpenAIClient client,

443 String sessionId,452 String sessionId,

444 AgentSession.RequiredAction.ComputerUseApprovalRequest approval) {453 AgentSession.RequiredAction.ComputerUseApprovalRequest approval,

445 var console = System.console();454 BufferedReader approvals)

446 if (console == null)455 throws IOException {

447 throw new IllegalStateException("Run this example in an interactive terminal.");

448 var result =456 var result =

449 AgentSessionInputComputerUseApprovalRequestResult.builder().requestId(approval.requestId());457 AgentSessionInputComputerUseApprovalRequestResult.builder().requestId(approval.requestId());

450 if (approval.request().browserOriginAccess().isPresent()) {458 if (approval.request().browserOriginAccess().isPresent()) {

451 var request = approval.request().browserOriginAccess().get();459 var request = approval.request().browserOriginAccess().get();

452 console.printf("Origin: %s%n", request.origin());460 System.out.printf("Origin: %s%n", request.origin());

453 console.printf("Reason: %s%n", request.reason().orElse("Not supplied"));461 System.out.printf("Reason: %s%n", request.reason().orElse("Not supplied"));

454 String decision;462 String decision;

455 while (true) {463 while (true) {

456 String input =464 System.out.print("Allow browser access? [approve/deny/cancel; default deny] ");

457 console.readLine("Allow browser access? [approve/deny/cancel; default deny] ");465 System.out.flush();

466 String input = approvals.readLine();

458 if (input == null) throw new IllegalStateException("Approval input closed.");467 if (input == null) throw new IllegalStateException("Approval input closed.");

459 decision = input.strip().toLowerCase(java.util.Locale.ROOT);468 decision = input.strip().toLowerCase(java.util.Locale.ROOT);

460 if (decision.isEmpty()) decision = "deny";469 if (decision.isEmpty()) decision = "deny";

461 if (List.of("approve", "deny", "cancel").contains(decision)) break;470 if (List.of("approve", "deny", "cancel").contains(decision)) break;

462 console.printf("Enter approve, deny, or cancel.%n");471 System.out.printf("Enter approve, deny, or cancel.%n");

463 }472 }

464 result.response(473 result.response(

465 Response.BrowserOriginAccess.builder()474 AgentBrowserOriginAccessParam.builder()

466 .decision(Response.BrowserOriginAccess.Decision.of(decision))475 .decision(AgentBrowserOriginAccessParam.Decision.of(decision))

467 .build());476 .build());

468 } else if (approval.request().browserAuthentication().isPresent()) {477 } else if (approval.request().browserAuthentication().isPresent()) {

469 console.printf("Sign-in is outside this public-page task; cancelling the request.%n");478 System.out.printf("Sign-in is outside this public-page task; cancelling the request.%n");

470 result.response(479 result.response(AgentBrowserAuthenticationCancelParam.builder().build());

471 Response.BrowserAuthentication.ofCancel(

472 Response.BrowserAuthentication.Cancel.builder().build()));

473 } else {480 } else {

474 throw new IllegalStateException("Unsupported computer-use approval request.");481 throw new IllegalStateException("Unsupported computer-use approval request.");

475 }482 }


890```897```

891 898 

892```java899```java

900var approvals = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));

893byte[] lastScreenshot = null;901byte[] lastScreenshot = null;

894var handledRequests = new HashSet<String>();902var handledRequests = new HashSet<String>();

895try (var events = client.beta().agents().sessions().events().streamStreaming(session.id())) {903try (var events = client.beta().agents().sessions().events().streamStreaming(session.id())) {


922 if (action.computerUseApprovalRequest().isEmpty()) continue;930 if (action.computerUseApprovalRequest().isEmpty()) continue;

923 var approval = action.computerUseApprovalRequest().get();931 var approval = action.computerUseApprovalRequest().get();

924 if (!handledRequests.contains(approval.requestId())) {932 if (!handledRequests.contains(approval.requestId())) {

925 respondToOriginApproval(client, session.id(), approval);933 respondToOriginApproval(client, session.id(), approval, approvals);

926 handledRequests.add(approval.requestId());934 handledRequests.add(approval.requestId());

927 }935 }

928 }936 }


2009```java2017```java

2010import com.openai.client.OpenAIClient;2018import com.openai.client.OpenAIClient;

2011import com.openai.client.okhttp.OpenAIOkHttpClient;2019import com.openai.client.okhttp.OpenAIOkHttpClient;

2020import com.openai.models.beta.agents.AgentBrowserAuthenticationCancelParam;

2021import com.openai.models.beta.agents.AgentBrowserAuthenticationSubmitParam;

2022import com.openai.models.beta.agents.AgentBrowserOriginAccessParam;

2012import com.openai.models.beta.agents.AgentSession;2023import com.openai.models.beta.agents.AgentSession;

2013import com.openai.models.beta.agents.AgentSessionInputMessageParam;2024import com.openai.models.beta.agents.AgentSessionInputMessageParam;

2014import com.openai.models.beta.agents.AgentSessionInputParam;2025import com.openai.models.beta.agents.AgentSessionInputParam;

2015import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult;2026import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult;

2016import com.openai.models.beta.agents.AgentSessionInputParam.AgentSessionInputComputerUseApprovalRequestResult.Response;

2017import com.openai.models.beta.agents.AgentToolParam;2027import com.openai.models.beta.agents.AgentToolParam;

2018import com.openai.models.beta.agents.EnvironmentParam;2028import com.openai.models.beta.agents.EnvironmentParam;

2019import com.openai.models.beta.agents.sessions.SessionCreateParams;2029import com.openai.models.beta.agents.sessions.SessionCreateParams;


2026 var cancellation =2036 var cancellation =

2027 AgentSessionInputComputerUseApprovalRequestResult.builder()2037 AgentSessionInputComputerUseApprovalRequestResult.builder()

2028 .requestId(requestId)2038 .requestId(requestId)

2029 .response(2039 .response(AgentBrowserAuthenticationCancelParam.builder().build())

2030 Response.BrowserAuthentication.ofCancel(

2031 Response.BrowserAuthentication.Cancel.builder().build()))

2032 .build();2040 .build();

2033 client2041 client

2034 .withOptions(options -> options.maxRetries(0))2042 .withOptions(options -> options.maxRetries(0))


2063 console.printf("Enter approve, deny, or cancel.%n");2071 console.printf("Enter approve, deny, or cancel.%n");

2064 }2072 }

2065 result.response(2073 result.response(

2066 Response.BrowserOriginAccess.builder()2074 AgentBrowserOriginAccessParam.builder()

2067 .decision(Response.BrowserOriginAccess.Decision.of(decision))2075 .decision(AgentBrowserOriginAccessParam.Decision.of(decision))

2068 .build());2076 .build());

2069 } else if (approval.request().browserAuthentication().isPresent()) {2077 } else if (approval.request().browserAuthentication().isPresent()) {

2070 var challenge = approval.request().browserAuthentication().get();2078 var challenge = approval.request().browserAuthentication().get();


2077 cancelAuthentication(client, sessionId, approval.requestId());2085 cancelAuthentication(client, sessionId, approval.requestId());

2078 return;2086 return;

2079 }2087 }

2080 var response = Response.BrowserAuthentication.Submit.builder().fields(List.of());2088 var response = AgentBrowserAuthenticationSubmitParam.builder().fields(List.of());

2081 var activeFields = challenge.fields();2089 var activeFields = challenge.fields();

2082 if (!challenge.options().isEmpty()) {2090 if (!challenge.options().isEmpty()) {

2083 for (int i = 0; i < challenge.options().size(); i++) {2091 for (int i = 0; i < challenge.options().size(); i++) {


2143 continue;2151 continue;

2144 }2152 }

2145 response.addField(2153 response.addField(

2146 Response.BrowserAuthentication.Submit.Field.builder()2154 AgentBrowserAuthenticationSubmitParam.Field.builder()

2147 .fieldId(field.id())2155 .fieldId(field.id())

2148 .value(value)2156 .value(value)

2149 .build());2157 .build());


2154 if (!challenge.options().isEmpty() || activeFields.isEmpty() || fieldsSubmitted > 0) break;2162 if (!challenge.options().isEmpty() || activeFields.isEmpty() || fieldsSubmitted > 0) break;

2155 console.printf("Enter at least one field to submit this form, or cancel.%n");2163 console.printf("Enter at least one field to submit this form, or cancel.%n");

2156 }2164 }

2157 result.response(Response.BrowserAuthentication.ofSubmit(response.build()));2165 result.response(response.build());

2158 } else {2166 } else {

2159 throw new IllegalStateException("Unsupported computer-use approval request.");2167 throw new IllegalStateException("Unsupported computer-use approval request.");

2160 }2168 }

Details

123 .voice("alloy")123 .voice("alloy")

124 .format(ChatCompletionAudioParam.Format.WAV)124 .format(ChatCompletionAudioParam.Format.WAV)

125 .build())125 .build())

126 .store(true)126 .store(false)

127 .build();127 .build();

128 128 

129var message = client.chat().completions().create(params).choices().get(0).message();129var message = client.chat().completions().create(params).choices().get(0).message();


369 .voice("alloy")369 .voice("alloy")

370 .format(ChatCompletionAudioParam.Format.WAV)370 .format(ChatCompletionAudioParam.Format.WAV)

371 .build())371 .build())

372 .store(true)372 .store(false)

373 .build();373 .build();

374 374 

375client.chat().completions().create(params).choices().stream()375client.chat().completions().create(params).choices().stream()

Details

542import com.fasterxml.jackson.databind.json.JsonMapper;542import com.fasterxml.jackson.databind.json.JsonMapper;

543import com.openai.client.OpenAIClient;543import com.openai.client.OpenAIClient;

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

545import com.openai.core.RequestOptions;

545import com.openai.core.http.StreamResponse;546import com.openai.core.http.StreamResponse;

547import com.openai.errors.OpenAIIoException;

546import com.openai.models.responses.ResponseCreateParams;548import com.openai.models.responses.ResponseCreateParams;

547import com.openai.models.responses.ResponseRetrieveParams;549import com.openai.models.responses.ResponseRetrieveParams;

548import com.openai.models.responses.ResponseStreamEvent;550import com.openai.models.responses.ResponseStreamEvent;

551import java.time.Duration;

549import java.util.concurrent.atomic.AtomicBoolean;552import java.util.concurrent.atomic.AtomicBoolean;

550import java.util.concurrent.atomic.AtomicLong;553import java.util.concurrent.atomic.AtomicLong;

551import java.util.concurrent.atomic.AtomicReference;554import java.util.concurrent.atomic.AtomicReference;


561AtomicReference<String> responseId = new AtomicReference<>("");564AtomicReference<String> responseId = new AtomicReference<>("");

562AtomicBoolean streamCompleted = new AtomicBoolean(false);565AtomicBoolean streamCompleted = new AtomicBoolean(false);

563JsonMapper json = new JsonMapper();566JsonMapper json = new JsonMapper();

564try (StreamResponse<ResponseStreamEvent> stream = client.responses().createStreaming(params)) {567// This long-running response can exceed the SDK's default request deadline.

568RequestOptions streamOptions = RequestOptions.builder().timeout(Duration.ofMinutes(30)).build();

569try (StreamResponse<ResponseStreamEvent> stream =

570 client.responses().createStreaming(params, streamOptions)) {

565 stream.stream()571 stream.stream()

566 .forEach(572 .forEach(

567 event -> {573 event -> {

568 lastSequenceNumber.set(json.valueToTree(event).path("sequence_number").asLong());574 if (event.failed().isPresent()

575 || event.incomplete().isPresent()

576 || event.error().isPresent()) {

577 throw new IllegalStateException("Background response did not complete");

578 }

579 var data = json.valueToTree(event);

580 // Keepalives count connection traffic, not stored response events.

581 if (data.path("type").asText().startsWith("response.")

582 && data.path("sequence_number").isIntegralNumber()) {

583 lastSequenceNumber.set(data.path("sequence_number").asLong());

584 }

569 event585 event

570 .created()586 .created()

571 .ifPresent(587 .ifPresent(


587 System.out.println("response.completed");603 System.out.println("response.completed");

588 });604 });

589 });605 });

606} catch (OpenAIIoException error) {

607 // Resume an interrupted stream once, from its stored-event checkpoint.

608 if (Thread.currentThread().isInterrupted()

609 || streamCompleted.get()

610 || responseId.get().isBlank()

611 || lastSequenceNumber.get() < 0) {

612 throw error;

613 }

590}614}

591System.out.println(615System.out.println(

592 "Response " + responseId.get() + "; last sequence number " + lastSequenceNumber.get());616 "Response " + responseId.get() + "; last sequence number " + lastSequenceNumber.get());

593if (!streamCompleted.get()) {617if (!streamCompleted.get()) {

618 if (Thread.currentThread().isInterrupted()

619 || responseId.get().isBlank()

620 || lastSequenceNumber.get() < 0) {

621 throw new IllegalStateException("Stream ended without a resumable checkpoint");

622 }

594 try (StreamResponse<ResponseStreamEvent> resumed =623 try (StreamResponse<ResponseStreamEvent> resumed =

595 client624 client

596 .responses()625 .responses()


598 ResponseRetrieveParams.builder()627 ResponseRetrieveParams.builder()

599 .responseId(responseId.get())628 .responseId(responseId.get())

600 .startingAfter(lastSequenceNumber.get())629 .startingAfter(lastSequenceNumber.get())

601 .build())) {630 .build(),

631 streamOptions)) {

602 resumed.stream()632 resumed.stream()

603 .forEach(633 .forEach(

604 event ->634 event -> {

605 event.outputTextDelta().ifPresent(delta -> System.out.println(delta.delta())));635 if (event.failed().isPresent()

636 || event.incomplete().isPresent()

637 || event.error().isPresent()) {

638 throw new IllegalStateException("Resumed response did not complete");

639 }

640 event.outputTextDelta().ifPresent(delta -> System.out.println(delta.delta()));

641 event.completed().ifPresent(completed -> streamCompleted.set(true));

642 });

643 }

644 if (!streamCompleted.get()) {

645 throw new IllegalStateException("Resumed response did not complete");

606 }646 }

607}647}

608```648```

Details

125 125 

126An example completions API response looks as follows:126An example completions API response looks as follows:

127 127 

128```128```text

129{129{

130 "choices": [130 "choices": [

131 {131 {


194 194 

195The Chat Completions format can be made similar to the completions format by constructing a request using a single user message. For example, one can translate from English to French with the following completions prompt:195The Chat Completions format can be made similar to the completions format by constructing a request using a single user message. For example, one can translate from English to French with the following completions prompt:

196 196 

197```197```text

198Translate the following English text to French: "{text}"198Translate the following English text to French: "{text}"

199```199```

200 200 

201And an equivalent chat prompt would be:201And an equivalent chat prompt would be:

202 202 

203```203```text

204[{"role": "user", "content": 'Translate the following English text to French: "{text}"'}]204[{"role": "user", "content": 'Translate the following English text to French: "{text}"'}]

205```205```

206 206 

Details

50 50 

51 Examples:51 Examples:

52 52 

53```53```text

54 Schedule a 30‑minute meeting tomorrow at 3pm PT with54 Schedule a 30‑minute meeting tomorrow at 3pm PT with

55 alice@example.com and bob@example.com using "Calendar.create_event".55 alice@example.com and bob@example.com using "Calendar.create_event".

56 Do not use any other scheduling tools.56 Do not use any other scheduling tools.

57```57```

58 58 

59```59```text

60 Create a pull request using "GitHub.open_pull_request" from branch60 Create a pull request using "GitHub.open_pull_request" from branch

61 "feat-retry" into "main" with title "Add retry logic" and body "…".61 "feat-retry" into "main" with title "Add retry logic" and body "…".

62 Do not push directly to main.62 Do not push directly to main.

Details

474import java.util.List;474import java.util.List;

475 475 

476private static List<Double> normalizeL2(List<Float> embedding) {476private static List<Double> normalizeL2(List<Float> embedding) {

477 double norm = Math.sqrt(embedding.stream().mapToDouble(value -> value * value).sum());477 double norm =

478 Math.sqrt(embedding.stream().mapToDouble(value -> value.doubleValue() * value).sum());

478 return embedding.stream().map(value -> norm == 0 ? 0.0 : value / norm).toList();479 return embedding.stream().map(value -> norm == 0 ? 0.0 : value / norm).toList();

479}480}

480 481 


1413 double queryMagnitude = 0;1414 double queryMagnitude = 0;

1414 double candidateMagnitude = 0;1415 double candidateMagnitude = 0;

1415 for (int dimension = 0; dimension < query.size(); dimension++) {1416 for (int dimension = 0; dimension < query.size(); dimension++) {

1416 dotProduct += query.get(dimension) * candidate.get(dimension);1417 double queryValue = query.get(dimension);

1417 queryMagnitude += query.get(dimension) * query.get(dimension);1418 double candidateValue = candidate.get(dimension);

1418 candidateMagnitude += candidate.get(dimension) * candidate.get(dimension);1419 dotProduct += queryValue * candidateValue;

1420 queryMagnitude += queryValue * queryValue;

1421 candidateMagnitude += candidateValue * candidateValue;

1419 }1422 }

1420 return 1 - dotProduct / Math.sqrt(queryMagnitude * candidateMagnitude);1423 return 1 - dotProduct / Math.sqrt(queryMagnitude * candidateMagnitude);

1421 }))1424 }))

guides/evals.md +6 −0

Details

665 665 

666```java666```java

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

668import com.openai.models.ReasoningEffort;

668import com.openai.models.evals.runs.*;669import com.openai.models.evals.runs.*;

669 670 

670// Replace these illustrative IDs with your eval and uploaded dataset file.671// Replace these illustrative IDs with your eval and uploaded dataset file.


682 RunCreateParams.DataSource.CreateEvalResponsesRunDataSource.Type683 RunCreateParams.DataSource.CreateEvalResponsesRunDataSource.Type

683 .RESPONSES)684 .RESPONSES)

684 .model("gpt-6-astra")685 .model("gpt-6-astra")

686 .samplingParams(

687 RunCreateParams.DataSource.CreateEvalResponsesRunDataSource

688 .SamplingParams.builder()

689 .reasoningEffort(ReasoningEffort.LOW)

690 .build())

685 .inputMessages(691 .inputMessages(

686 RunCreateParams.DataSource.CreateEvalResponsesRunDataSource692 RunCreateParams.DataSource.CreateEvalResponsesRunDataSource

687 .InputMessages.Template.builder()693 .InputMessages.Template.builder()

Details

70 70 

71We then send all of the tool definition, the original prompt, the model's tool call, and the tool call output back to the model to finally receive a text response like:71We then send all of the tool definition, the original prompt, the model's tool call, and the tool call output back to the model to finally receive a text response like:

72 72 

73```73```text

74The weather in Paris today is 25C.74The weather in Paris today is 25C.

75```75```

76 76 


704import com.openai.client.OpenAIClient;704import com.openai.client.OpenAIClient;

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

706import com.openai.core.JsonValue;706import com.openai.core.JsonValue;

707import com.openai.core.ObjectMappers;

707import com.openai.models.responses.EasyInputMessage;708import com.openai.models.responses.EasyInputMessage;

708import com.openai.models.responses.FunctionTool;709import com.openai.models.responses.FunctionTool;

709import com.openai.models.responses.ResponseCreateParams;710import com.openai.models.responses.ResponseCreateParams;


715response.output().stream()716response.output().stream()

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

717 .forEach(input::add);718 .forEach(input::add);

718response.output().stream()719for (var item : response.output()) {

719 .flatMap(item -> item.functionCall().stream())720 if (item.functionCall().isEmpty()) continue;

720 .forEach(721 var call = item.functionCall().get();

721 call -> {

722 String result;722 String result;

723 if (call.name().equals("get_weather")) {723 if (call.name().equals("get_weather")) {

724 record Coordinates(double latitude, double longitude) {}724 record Coordinates(double latitude, double longitude) {}

725 725 

726 Coordinates coordinates = call.arguments(Coordinates.class);726 Coordinates coordinates = call.arguments(Coordinates.class);

727 result =727 result =

728 JsonValue.from(728 ObjectMappers.jsonMapper()

729 .writeValueAsString(

729 Map.of(730 Map.of(

730 "latitude", coordinates.latitude(),731 "latitude", coordinates.latitude(),

731 "longitude", coordinates.longitude(),732 "longitude", coordinates.longitude(),

732 "temperature_c", 18))733 "temperature_c", 18));

733 .toString();

734 } else if (call.name().equals("send_email")) {734 } else if (call.name().equals("send_email")) {

735 record Email(String to, String body) {}735 record Email(String to, String body) {}

736 736 

737 Email message = call.arguments(Email.class);737 Email message = call.arguments(Email.class);

738 result = JsonValue.from(Map.of("to", message.to(), "status", "sent")).toString();738 result =

739 ObjectMappers.jsonMapper()

740 .writeValueAsString(Map.of("to", message.to(), "status", "sent"));

739 } else {741 } else {

740 throw new IllegalArgumentException("Unknown function: " + call.name());742 throw new IllegalArgumentException("Unknown function: " + call.name());

741 }743 }


746 .output(result)748 .output(result)

747 .build());749 .build());

748 input.add(output);750 input.add(output);

749 System.out.println(call.callId() + " " + result);751}

750 });752System.out.println(ObjectMappers.jsonMapper().writeValueAsString(input));

751```753```

752 754 

753```ruby755```ruby


1347 .build();1349 .build();

1348 1350 

1349try (StreamResponse<ResponseStreamEvent> stream = client.responses().createStreaming(params)) {1351try (StreamResponse<ResponseStreamEvent> stream = client.responses().createStreaming(params)) {

1350 stream.stream()1352 stream.stream().forEach(System.out::println);

1351 .forEach(

1352 event -> {

1353 System.out.println(event);

1354 event

1355 .outputItemAdded()

1356 .ifPresent(added -> System.out.println("response.output_item.added: " + added));

1357 event

1358 .functionCallArgumentsDelta()

1359 .ifPresent(

1360 delta ->

1361 System.out.println("response.function_call_arguments.delta: " + delta));

1362 });

1363}1353}

1364```1354```

1365 1355 


2013 2003 

2014Correct (single, bounded terminal):2004Correct (single, bounded terminal):

2015 2005 

2016```2006```text

2017start: SENTENCE2007start: SENTENCE

2018SENTENCE: /[A-Za-z, ]*(the hero|a dragon|an old man|the princess)[A-Za-z, ]*(fought|saved|found|lost)[A-Za-z, ]*(a treasure|the kingdom|a secret|his way)[A-Za-z, ]*\./2008SENTENCE: /[A-Za-z, ]*(the hero|a dragon|an old man|the princess)[A-Za-z, ]*(fought|saved|found|lost)[A-Za-z, ]*(a treasure|the kingdom|a secret|his way)[A-Za-z, ]*\./

2019```2009```

2020 2010 

2021Do NOT do this (splitting across rules/terminals). This attempts to let rules partition free text between terminals. The lexer will greedily match the free-text pieces and you'll lose control:2011Do NOT do this (splitting across rules/terminals). This attempts to let rules partition free text between terminals. The lexer will greedily match the free-text pieces and you'll lose control:

2022 2012 

2023```2013```text

2024start: sentence2014start: sentence

2025sentence: /[A-Za-z, ]+/ subject /[A-Za-z, ]+/ verb /[A-Za-z, ]+/ object /[A-Za-z, ]+/2015sentence: /[A-Za-z, ]+/ subject /[A-Za-z, ]+/ verb /[A-Za-z, ]+/ object /[A-Za-z, ]+/

2026```2016```


2055 2045 

2056Good rule usage example:2046Good rule usage example:

2057 2047 

2058```2048```text

2059start: expr2049start: expr

2060NUMBER: /[0-9]+/2050NUMBER: /[0-9]+/

2061PLUS: "+"2051PLUS: "+"

Details

315 315 

316For example, say you know from your human experts which answers are best:316For example, say you know from your human experts which answers are best:

317 317 

318```318```text

319answer_1 > answer_2 > answer_3319answer_1 > answer_2 > answer_3

320```320```

321 321 

322Verify that the model grader's answers match that:322Verify that the model grader's answers match that:

323 323 

324```324```text

325model_grader(answer_1, reference_answer) > model_grader(answer_2, reference_answer) > model_grader(answer_3, reference_answer)325model_grader(answer_1, reference_answer) > model_grader(answer_2, reference_answer) > model_grader(answer_3, reference_answer)

326```326```

327 327 


462 462 

463The following third-party packages are available at execution time for the image tag `2025-05-08`463The following third-party packages are available at execution time for the image tag `2025-05-08`

464 464 

465```465```text

466numpy==2.2.4466numpy==2.2.4

467scipy==1.15.2467scipy==1.15.2

468sympy==1.13.3468sympy==1.13.3


483 483 

484Additionally, the following NLTK corpora are available:484Additionally, the following NLTK corpora are available:

485 485 

486```486```text

487punkt487punkt

488stopwords488stopwords

489wordnet489wordnet

Details

1143 1143 

1144A. Compute how many 32px x 32px patches are needed to cover the image after applying the pixel-dimension limit. A patch may extend beyond the image boundary.1144A. Compute how many 32px x 32px patches are needed to cover the image after applying the pixel-dimension limit. A patch may extend beyond the image boundary.

1145 1145 

1146```1146```text

1147patch_count = ceil(width/32)×ceil(height/32)1147patch_count = ceil(width/32)×ceil(height/32)

1148```1148```

1149 1149 

1150B. When the selected model and detail level specify a resizing patch budget, scale the image down proportionally if it exceeds that budget. Otherwise, skip this step. Adjust the scale to stay within budget after converting to integer pixel dimensions and computing patch coverage. Keep full precision until calculating the final dimensions.1150B. When the selected model and detail level specify a resizing patch budget, scale the image down proportionally if it exceeds that budget. Otherwise, skip this step. Adjust the scale to stay within budget after converting to integer pixel dimensions and computing patch coverage. Keep full precision until calculating the final dimensions.

1151 1151 

1152```1152```text

1153shrink_factor = sqrt((32^2 * patch_budget) / (width * height))1153shrink_factor = sqrt((32^2 * patch_budget) / (width * height))

1154adjusted_shrink_factor = shrink_factor * min(1154adjusted_shrink_factor = shrink_factor * min(

1155 floor(width * shrink_factor / 32) / (width * shrink_factor / 32),1155 floor(width * shrink_factor / 32) / (width * shrink_factor / 32),


1159 1159 

1160C. If step B resized the image, round down the final scaled width and height to integer pixels. Compute the patches needed to cover the resulting image. This is the image-token count before applying the model multiplier. When a patch budget applies, this count stays within that budget.1160C. If step B resized the image, round down the final scaled width and height to integer pixels. Compute the patches needed to cover the resulting image. This is the image-token count before applying the model multiplier. When a patch budget applies, this count stays within that budget.

1161 1161 

1162```1162```text

1163resized_patch_count = ceil(resized_width/32)×ceil(resized_height/32)1163resized_patch_count = ceil(resized_width/32)×ceil(resized_height/32)

1164```1164```

1165 1165 

Details

9## Outbound IP addresses9## Outbound IP addresses

10 10 

11| Product | Used for | Published ranges |11| Product | Used for | Published ranges |

12| -------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- |12| ------------------------------- | ------------------------------------------------------- | -------------------------------------------------------- |

13| ChatGPT integrations | Plugins, connectors, GPT Actions, and agentic commerce | [ChatGPT connectors](https://openai.com/chatgpt-connectors.json) |13| ChatGPT integrations | Plugins, connectors, GPT Actions, and agentic commerce | [ChatGPT connectors] |

14| Codex cloud | Connections from Codex cloud to services such as GitHub | [ChatGPT agents](https://openai.com/chatgpt-agents.json) |14| Codex cloud | Connections from Codex cloud to services such as GitHub | [ChatGPT agents](https://openai.com/chatgpt-agents.json) |

15| Private Safety Processing (PSP) | Writing to and reading from customer configured storage | [PSP connectors][ChatGPT connectors] |

15 16 

16Each JSON file includes a `creationTime` and a `prefixes` array. The ranges can change as OpenAI infrastructure changes. Fetch the relevant file regularly and update your allowlist automatically.17Each JSON file includes a `creationTime` and a `prefixes` array. The ranges can change as OpenAI infrastructure changes. Fetch the relevant file regularly and update your allowlist automatically.

18 

19[ChatGPT connectors]: https://openai.com/chatgpt-connectors.json

Details

604 604 

605You could prompt the model to regenerate the file with a prompt like:605You could prompt the model to regenerate the file with a prompt like:

606 606 

607```607```text

608Add a get route to this application that responds with608Add a get route to this application that responds with

609the text "hello world". Generate the entire application609the text "hello world". Generate the entire application

610file again with this route added, and with no other610file again with this route added, and with no other

Details

6 6 

7Zero Data Retention with Private Safety Processing (ZDR with PSP) enables offline, automated safety review without OpenAI retaining customer prompts or responses. This guide provides an overview of how ZDR with PSP works and your operating responsibilities. For the full architecture and security model, see the [Private Safety Processing technical white paper](https://openaiassets.blob.core.windows.net/$web/pdf/c7284810-2252-462f-803e-075b0c95bccb/psp-whitepaper.pdf).7Zero Data Retention with Private Safety Processing (ZDR with PSP) enables offline, automated safety review without OpenAI retaining customer prompts or responses. This guide provides an overview of how ZDR with PSP works and your operating responsibilities. For the full architecture and security model, see the [Private Safety Processing technical white paper](https://openaiassets.blob.core.windows.net/$web/pdf/c7284810-2252-462f-803e-075b0c95bccb/psp-whitepaper.pdf).

8 8 

9<figure>

10 <video

11 controls

12 playsInline

13 preload="metadata"

14 aria-label="Private Safety Processing overview"

15 style={{ width: "100%", height: "auto" }}

16 >

17 <source

18 src="https://cdn.openai.com/devhub/docs/api/private-safety-processing/private-safety-processing-overview-v9-1080p.webm"

19 type="video/webm"

20 />

21 <track

22 kind="captions"

23 src="/captions/platform/private-safety-processing-overview-v9.vtt"

24 srcLang="en"

25 label="English"

26 />

27 </video>

28 <figcaption>Private Safety Processing overview (1 min 31 sec).</figcaption>

29</figure>

30 

9## Built with Three Principles31## Built with Three Principles

10 32 

111. **Customers control their content**331. **Customers control their content**


81 103 

82OpenAI’s inner decryption key is not enough to decrypt a stored record when EKM is enabled: your customer-managed key authorization is also required. Revoking that authorization prevents decryption of retained records, but does not delete them or undo completed processing.104OpenAI’s inner decryption key is not enough to decrypt a stored record when EKM is enabled: your customer-managed key authorization is also required. Revoking that authorization prevents decryption of retained records, but does not delete them or undo completed processing.

83 105 

84We recommend enabling EKM for this additional control. See the [EKM technical FAQ](https://help.openai.com/en/articles/20000945-ekm-technical-faq) for authorization and revocation, and the [technical whitepaper](https://openaiassets.blob.core.windows.net/$web/pdf/c7284810-2252-462f-803e-075b0c95bccb/psp-whitepaper.pdf) for encryption, confidential computing, guardrails, and transparency.106We recommend enabling EKM for this additional control. The KMS that holds your EKM key can be in a different region from your configured storage. See the [EKM technical FAQ](https://help.openai.com/en/articles/20000945-ekm-technical-faq) for authorization and revocation, and the [technical whitepaper](https://openaiassets.blob.core.windows.net/$web/pdf/c7284810-2252-462f-803e-075b0c95bccb/psp-whitepaper.pdf) for encryption, confidential computing, guardrails, and transparency.

85 107 

86 108 

87 109 


118ORG_ID="<OPENAI_ORG_ID>"140ORG_ID="<OPENAI_ORG_ID>"

119PROJECT_ID="<CUSTOMER_PROJECT_ID>"141PROJECT_ID="<CUSTOMER_PROJECT_ID>"

120KEY_ID="<EXTERNAL_KEY_ID>"142KEY_ID="<EXTERNAL_KEY_ID>"

121 143OPENAI_ADMIN_KEY="<OPENAI_ADMIN_KEY>"

122: "${OPENAI_ADMIN_KEY:?Load your organization admin key securely}"

123 

124PROJECTS_URL="$API_BASE/organization/projects"144PROJECTS_URL="$API_BASE/organization/projects"

125```145```

126 146 


160 180 

161First set the API variables shown in [Select a key for PSP decryption](#select-a-key-for-psp-decryption).181First set the API variables shown in [Select a key for PSP decryption](#select-a-key-for-psp-decryption).

162 182 

163Send `null` to clear the selection. Omitting the field leaves it unchanged. Repeating a clear is supported.183Send `null` to clear the selection. Omitting the field leaves it unchanged.

164 184 

165```bash185```bash

166curl --fail-with-body -sS "$PROJECTS_URL/$PROJECT_ID" \186curl --fail-with-body -sS "$PROJECTS_URL/$PROJECT_ID" \


199### Before you start219### Before you start

200 220 

201- Organizations already approved for Zero Data Retention can set up ZDR with PSP directly in the API console. If your organization isn't approved for ZDR, see the [eligibility and approval requirements](https://developers.openai.com/api/docs/guides/your-data#data-retention-controls-for-abuse-monitoring).221- Organizations already approved for Zero Data Retention can set up ZDR with PSP directly in the API console. If your organization isn't approved for ZDR, see the [eligibility and approval requirements](https://developers.openai.com/api/docs/guides/your-data#data-retention-controls-for-abuse-monitoring).

202- Choose a storage region that matches your project's data residency. You need permission to create storage and delegate access in your cloud account.222- You can choose any supported storage region that meets your project's data residency requirements. You need permission to create storage and delegate access in your cloud account.

203- Have an organization administrator register and validate storage in the API console. For the Management API, use an OpenAI organization Admin API key. Project administrators can view guidance and status; a project inference key won't work for the Management API calls.223- Have an organization administrator register and validate storage in the API console. For the Management API, use an OpenAI organization Admin API key. Project administrators can view guidance and status; a project inference key won't work for the Management API calls.

204 224 

205### Open storage setup in the API console225### Open storage setup in the API console


246 266 

247#### 1. Create the bucket267#### 1. Create the bucket

248 268 

249Create a dedicated S3 bucket in a region compatible with your project's data residency. If Data Residency is off, the recommended region is us-west-1.269Create a dedicated S3 bucket in a region compatible with your project's data residency. If Data Residency is off, you can choose any region for your bucket.

250 270 

251- Keep **ACLs disabled**.271- Keep **ACLs disabled**.

252- Turn on **Block all Public Access**.272- Turn on **Block all Public Access**.


362 382 

363#### 2. Create the container383#### 2. Create the container

364 384 

365Create a private container in **Storage Account > Data Storage > Containers > Add Container**. Add this container metadata in **Container > Settings > Metadata** with your exact OpenAI organization ID:385Create a private container in **Storage Account > Data Storage > Containers > Add Container**. Open **Container > Settings > Metadata** and set `openai_organization_id` to your exact OpenAI organization ID. This field is required.

386 

387To restrict the container to one OpenAI project, also set `openai_project_id` to the exact project ID. This field is optional. Only the matching project can register or validate the container, read from it, or write to it.

366 388 

367- `openai_organization_id`: your OpenAI organization ID389Two OpenAI projects in the same organization can share the container if you omit `openai_project_id` and the storage region meets both projects' data residency requirements. Register and validate the container for each project.

368 390 

369Add the metadata to the container, not the storage account or individual blobs.391Add the metadata to the container, not the storage account or individual blobs.

370 392 


528 550 

529Use these bucket settings:551Use these bucket settings:

530 552 

531- **Storage tier:** Standard553- **Storage tier:** Standard with automatic tiering disabled

532- **Visibility:** Private554- **Visibility:** Private

533- **Object versioning:** Disabled555- **Object versioning:** Disabled

534- **Auto-tiering:** Disabled

535 556 

536Keep replication disabled. Record the bucket name and region identifier as `CUSTOMER_BUCKET_NAME` and `CUSTOMER_OCI_REGION`. Open **Profile**, select **Tenancy** followed by your tenancy's name, and copy its OCID as `CUSTOMER_TENANCY_OCID`. Your tenancy must be subscribed to the bucket's region.557Keep replication disabled. Record the bucket name and region identifier as `CUSTOMER_BUCKET_NAME` and `CUSTOMER_OCI_REGION`. Open **Profile**, select **Tenancy** followed by your tenancy's name, and copy its OCID as `CUSTOMER_TENANCY_OCID`. Your tenancy must be subscribed to the bucket's region.

537 558 


546 567 

547Use the same IDs in the access policy and storage registration. Each bucket is bound to one OpenAI organization and project.568Use the same IDs in the access policy and storage registration. Each bucket is bound to one OpenAI organization and project.

548 569 

549![OCI bucket creation form showing the openai_organization_id and openai_project_id freeform tags with example values.](https://developers.openai.com/images/platform/guides/private-safety-processing/setup-oci-bucket-tags.webp)570![OCI bucket creation form with example values for the OpenAI organization and project ID tags.](https://developers.openai.com/images/platform/guides/private-safety-processing/setup-oci-bucket-tags.webp)

550 571 

551#### 3. Grant OpenAI access572#### 3. Grant OpenAI access

552 573 

553In **Identity & Security > Policies**, select your tenancy's root compartment and create a policy named `psp-storage-access`. Turn on **Show manual editor** and enter these statements with your bucket name, region, and OpenAI organization and project IDs in the `CUSTOMER_...` placeholders. Keep OpenAI's tenancy and group OCIDs unchanged.574In **Identity & Security > Policies**, select your tenancy's root compartment and create a policy named `psp-storage-access`. Turn on **Show manual editor** and enter these statements with your bucket name, region, and OpenAI organization and project IDs in the `CUSTOMER_...` placeholders. Keep the OCID values for OpenAI's tenancy and group unchanged.

554 575 

555```text576```text

556Define tenancy OpenAICSG as ocid1.tenancy.oc1..aaaaaaaa4kzwe5jdr4gsxft7dfnwbnp3aozhxeskabsqo7czdkbp6fkh3uha577Define tenancy OpenAICSG as ocid1.tenancy.oc1..aaaaaaaa4kzwe5jdr4gsxft7dfnwbnp3aozhxeskabsqo7czdkbp6fkh3uha


561Allow service objectstorage-CUSTOMER_OCI_REGION to {BUCKET_INSPECT, BUCKET_READ, OBJECT_INSPECT, OBJECT_DELETE} in tenancy where target.bucket.name = 'CUSTOMER_BUCKET_NAME'582Allow service objectstorage-CUSTOMER_OCI_REGION to {BUCKET_INSPECT, BUCKET_READ, OBJECT_INSPECT, OBJECT_DELETE} in tenancy where target.bucket.name = 'CUSTOMER_BUCKET_NAME'

562```583```

563 584 

564The policy lets OpenAI look up your Object Storage namespace, read bucket configuration, and read and write objects under your project's prefix. Namespace lookup requires the tenancy-level permission without a bucket condition. The last statement lets Oracle's regional Object Storage service delete expired objects; for Ashburn, the service name is `objectstorage-us-ashburn-1`.585The policy lets OpenAI look up your Object Storage namespace, read bucket configuration, and read and write objects under your project's prefix. Namespace lookup requires the tenancy-level permission without a bucket condition. The last statement lets Oracle's regional Object Storage service delete expired objects. For the `us-ashburn-1` region, use `objectstorage-us-ashburn-1` as the service name.

565 586 

566Save the policy. OpenAI manages its credentials; you don't need to create or share an API signing key or access key.587Save the policy. OpenAI manages its credentials; you don't need to create or share an API signing key or access key.

567 588 


832 853 

833After fixing the configuration, open **Connect storage** for the project and run the validation command with an organization Admin API key. Retrieve the registration or select **Refresh** to confirm **Validated**. Refresh alone doesn't run validation.854After fixing the configuration, open **Connect storage** for the project and run the validation command with an organization Admin API key. Retrieve the registration or select **Refresh** to confirm **Validated**. Refresh alone doesn't run validation.

834 855 

835### Contact support

836 856 

837If storage or validation issues persist after troubleshooting, [contact OpenAI Support](https://help.openai.com/en/).

838 857 

839### Change or stop your setup858 

859### Remove Storage

840 860 

841To disconnect storage, open **Project Settings > Data retention**. Under **External storage**, select the trash icon beside the connection, then confirm with **Disconnect storage**.861To disconnect storage, open **Project Settings > Data retention**. Under **External storage**, select the trash icon beside the connection, then confirm with **Disconnect storage**.

842 862 


874 {" - Supported regions and processing boundaries."}894 {" - Supported regions and processing boundaries."}

875 </li>895 </li>

876</ul>896</ul>

897 

898## Contact support

899 

900If storage or validation issues persist after troubleshooting, [contact OpenAI Support](https://help.openai.com/en/).

Details

767 767 

768Typically, you will provide examples as part of a `developer` message in your API request. Here's an example `developer` message containing examples that show a model how to classify positive or negative customer service reviews.768Typically, you will provide examples as part of a `developer` message in your API request. Here's an example `developer` message containing examples that show a model how to classify positive or negative customer service reviews.

769 769 

770```770```text

771# Identity771# Identity

772 772 

773You are a helpful assistant that labels short product reviews as773You are a helpful assistant that labels short product reviews as


925**Planning and persistence**925**Planning and persistence**

926Instruct the model to resolve the full query before yielding control, decomposing it into sub-tasks and reflecting after each tool call to confirm completeness.926Instruct the model to resolve the full query before yielding control, decomposing it into sub-tasks and reflecting after each tool call to confirm completeness.

927 927 

928```928```text

929Remember, you are an agent - please keep going until the user's929Remember, you are an agent - please keep going until the user's

930query is completely resolved, before ending your turn and yielding930query is completely resolved, before ending your turn and yielding

931back to the user. Decompose the user's query into all required931back to the user. Decompose the user's query into all required


946 946 

947Ask the model to explain why it is calling a tool, but only at notable steps.947Ask the model to explain why it is calling a tool, but only at notable steps.

948 948 

949```949```text

950Before you call a tool explain why you are calling it950Before you call a tool explain why you are calling it

951```951```

952 952 

Details

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

2791import com.openai.core.JsonValue;2791import com.openai.core.JsonValue;

2792import com.openai.models.chat.completions.ChatCompletionCreateParams;2792import com.openai.models.chat.completions.ChatCompletionCreateParams;

2793import java.util.LinkedHashMap;

2793import java.util.List;2794import java.util.List;

2794import java.util.Map;2795import java.util.Map;

2795 2796 


2960 }2961 }

2961 """2962 """

2962 .strip();2963 .strip();

2963Map<String, Object> metaSchema =2964// The same recursive grammar governs properties, arrays, references, and unions.

2964 Map.ofEntries(2965Map<String, Object> schemaRef = Map.of("$ref", "#/$defs/schema_definition");

2965 Map.entry("name", "metaschema"),2966Map<String, Object> schemaProperties =

2966 Map.entry(

2967 "schema",

2968 Map.ofEntries(2967 Map.ofEntries(

2969 Map.entry("type", "object"),2968 Map.entry("description", Map.of("type", "string")),

2970 Map.entry(

2971 "properties",

2972 Map.ofEntries(

2973 Map.entry(

2974 "name",

2975 Map.ofEntries(

2976 Map.entry("type", "string"),

2977 Map.entry("description", "The name of the schema"))),

2978 Map.entry(2969 Map.entry(

2979 "type",2970 "type",

2980 Map.ofEntries(2971 Map.of(

2981 Map.entry("type", "string"),2972 "type",

2982 Map.entry(2973 "string",

2983 "enum",2974 "enum",

2984 List.of(2975 List.of("object", "array", "string", "number", "boolean", "null"))),

2985 "object", "array", "string", "number", "boolean",2976 Map.entry("properties", Map.of("type", "object", "additionalProperties", schemaRef)),

2986 "null")))),

2987 Map.entry(

2988 "properties",

2989 Map.ofEntries(

2990 Map.entry("type", "object"),

2991 Map.entry(

2992 "additionalProperties",

2993 Map.ofEntries(

2994 Map.entry("$ref", "#/$defs/schema_definition"))))),

2995 Map.entry(2977 Map.entry(

2996 "items",2978 "items",

2997 Map.ofEntries(2979 Map.of("anyOf", List.of(schemaRef, Map.of("type", "array", "items", schemaRef)))),

2998 Map.entry(2980 Map.entry("required", Map.of("type", "array", "items", Map.of("type", "string"))),

2999 "anyOf",2981 Map.entry("additionalProperties", Map.of("type", "boolean")),

3000 List.of(2982 Map.entry("enum", Map.of("type", "array", "minItems", 1, "uniqueItems", true)),

3001 Map.ofEntries(2983 Map.entry("$ref", Map.of("type", "string")),

3002 Map.entry("$ref", "#/$defs/schema_definition")),2984 Map.entry("$defs", Map.of("type", "object", "additionalProperties", schemaRef)),

3003 Map.ofEntries(2985 Map.entry("anyOf", Map.of("type", "array", "minItems", 1, "items", schemaRef)));

3004 Map.entry("type", "array"),2986Map<String, Object> objectCondition =

3005 Map.entry(2987 Map.of(

3006 "items",2988 "required", List.of("type"), "properties", Map.of("type", Map.of("const", "object")));

3007 Map.ofEntries(2989Map<String, Object> objectRequirements = Map.of("required", List.of("properties"));

3008 Map.entry(2990Map<String, Object> schemaDefinition =

3009 "$ref",2991 Map.of(

3010 "#/$defs/schema_definition")))))))),

3011 Map.entry(

3012 "required",

3013 Map.ofEntries(

3014 Map.entry("type", "array"),

3015 Map.entry(

3016 "items", Map.ofEntries(Map.entry("type", "string"))))),

3017 Map.entry(

3018 "additionalProperties",

3019 Map.ofEntries(Map.entry("type", "boolean"))))),

3020 Map.entry("required", List.of("type")),

3021 Map.entry("additionalProperties", false),

3022 Map.entry(

3023 "if",

3024 Map.ofEntries(

3025 Map.entry(

3026 "properties",

3027 Map.ofEntries(

3028 Map.entry(

3029 "type", Map.ofEntries(Map.entry("const", "object"))))))),

3030 Map.entry("then", Map.ofEntries(Map.entry("required", List.of("properties")))),

3031 Map.entry(

3032 "$defs",

3033 Map.ofEntries(

3034 Map.entry(

3035 "schema_definition",

3036 Map.ofEntries(

3037 Map.entry("type", "object"),

3038 Map.entry(

3039 "properties",

3040 Map.ofEntries(

3041 Map.entry(

3042 "type",2992 "type",

3043 Map.ofEntries(2993 "object",

3044 Map.entry("type", "string"),

3045 Map.entry(

3046 "enum",

3047 List.of(

3048 "object", "array", "string", "number",

3049 "boolean", "null")))),

3050 Map.entry(

3051 "properties",2994 "properties",

3052 Map.ofEntries(2995 schemaProperties,

3053 Map.entry("type", "object"),

3054 Map.entry(

3055 "additionalProperties",2996 "additionalProperties",

3056 Map.ofEntries(2997 false,

3057 Map.entry(2998 "if",

3058 "$ref",2999 objectCondition,

3059 "#/$defs/schema_definition"))))),3000 "then",

3060 Map.entry(3001 objectRequirements,

3061 "items",

3062 Map.ofEntries(

3063 Map.entry(

3064 "anyOf",3002 "anyOf",

3065 List.of(3003 List.of(

3066 Map.ofEntries(3004 Map.of("required", List.of("type")),

3067 Map.entry(3005 Map.of("required", List.of("$ref")),

3068 "$ref",3006 Map.of("required", List.of("anyOf"))));

3069 "#/$defs/schema_definition")),3007var rootProperties = new LinkedHashMap<>(schemaProperties);

3070 Map.ofEntries(3008rootProperties.put("name", Map.of("type", "string", "description", "The name of the schema"));

3071 Map.entry("type", "array"),3009Map<String, Object> metaSchema =

3072 Map.entry(3010 Map.of(

3073 "items",3011 "name",

3074 Map.ofEntries(3012 "metaschema",

3075 Map.entry(3013 "schema",

3076 "$ref",3014 Map.of(

3077 "#/$defs/schema_definition")))))))),3015 "type",

3078 Map.entry(3016 "object",

3017 "properties",

3018 rootProperties,

3079 "required",3019 "required",

3080 Map.ofEntries(3020 List.of("type"),

3081 Map.entry("type", "array"),

3082 Map.entry(

3083 "items",

3084 Map.ofEntries(

3085 Map.entry("type", "string"))))),

3086 Map.entry(

3087 "additionalProperties",3021 "additionalProperties",

3088 Map.ofEntries(Map.entry("type", "boolean"))))),3022 false,

3089 Map.entry("required", List.of("type")),

3090 Map.entry("additionalProperties", false),

3091 Map.entry(

3092 "if",3023 "if",

3093 Map.ofEntries(3024 objectCondition,

3094 Map.entry(

3095 "properties",

3096 Map.ofEntries(

3097 Map.entry(

3098 "type",

3099 Map.ofEntries(

3100 Map.entry("const", "object"))))))),

3101 Map.entry(

3102 "then",3025 "then",

3103 Map.ofEntries(3026 objectRequirements,

3104 Map.entry("required", List.of("properties")))))))))));3027 "$defs",

3028 Map.of("schema_definition", schemaDefinition)));

3105 3029 

3106ChatCompletionCreateParams params =3030ChatCompletionCreateParams params =

3107 ChatCompletionCreateParams.builder()3031 ChatCompletionCreateParams.builder()


4582 "type", "object",4506 "type", "object",

4583 "properties",4507 "properties",

4584 Map.of(4508 Map.of(

4509 "enum",

4510 Map.of("type", "array", "minItems", 1, "uniqueItems", true),

4511 "description",

4512 Map.of("type", "string"),

4585 "type",4513 "type",

4586 Map.of(4514 Map.of(

4587 "type",4515 "type",


4604 "array",4532 "array",

4605 "items",4533 "items",

4606 Map.of("$ref", "#/$defs/schema_definition")))),4534 Map.of("$ref", "#/$defs/schema_definition")))),

4607 "required", Map.of("type", "array", "items", Map.of("type", "string")),4535 "required",

4608 "additionalProperties", Map.of("type", "boolean")),4536 Map.of("type", "array", "items", Map.of("type", "string")),

4537 "additionalProperties",

4538 Map.of("type", "boolean")),

4609 "required", List.of("type"),4539 "required", List.of("type"),

4610 "additionalProperties", false,4540 "additionalProperties", false,

4611 "if", Map.of("properties", Map.of("type", Map.of("const", "object"))),4541 "if", Map.of("properties", Map.of("type", Map.of("const", "object"))),

Details

326```java326```java

327import com.openai.client.okhttp.OkHttpClient;327import com.openai.client.okhttp.OkHttpClient;

328import com.openai.core.ClientOptions;328import com.openai.core.ClientOptions;

329import com.openai.core.JsonMissing;

329import com.openai.helpers.RealtimeConnection;330import com.openai.helpers.RealtimeConnection;

330import com.openai.helpers.RealtimeWebSocketOptions;331import com.openai.helpers.RealtimeWebSocketOptions;

331import com.openai.models.realtime.*;332import com.openai.models.realtime.*;


335 ConversationItemCreateEvent.builder()336 ConversationItemCreateEvent.builder()

336 .item(337 .item(

337 RealtimeConversationItemUserMessage.builder()338 RealtimeConversationItemUserMessage.builder()

339 .object_(JsonMissing.of())

338 .addContent(340 .addContent(

339 RealtimeConversationItemUserMessage.Content.builder()341 RealtimeConversationItemUserMessage.Content.builder()

340 .type(RealtimeConversationItemUserMessage.Content.Type.INPUT_TEXT)342 .type(RealtimeConversationItemUserMessage.Content.Type.INPUT_TEXT)


1027```java1029```java

1028import com.openai.client.okhttp.OkHttpClient;1030import com.openai.client.okhttp.OkHttpClient;

1029import com.openai.core.ClientOptions;1031import com.openai.core.ClientOptions;

1032import com.openai.core.JsonMissing;

1030import com.openai.helpers.RealtimeConnection;1033import com.openai.helpers.RealtimeConnection;

1031import com.openai.helpers.RealtimeWebSocketOptions;1034import com.openai.helpers.RealtimeWebSocketOptions;

1032import com.openai.models.realtime.*;1035import com.openai.models.realtime.*;


1040 ConversationItemCreateEvent.builder()1043 ConversationItemCreateEvent.builder()

1041 .item(1044 .item(

1042 RealtimeConversationItemUserMessage.builder()1045 RealtimeConversationItemUserMessage.builder()

1046 .object_(JsonMissing.of())

1043 .addContent(1047 .addContent(

1044 RealtimeConversationItemUserMessage.Content.builder()1048 RealtimeConversationItemUserMessage.Content.builder()

1045 .type(RealtimeConversationItemUserMessage.Content.Type.INPUT_AUDIO)1049 .type(RealtimeConversationItemUserMessage.Content.Type.INPUT_AUDIO)


1815 ResponseCreateEvent.builder()1819 ResponseCreateEvent.builder()

1816 .response(1820 .response(

1817 RealtimeResponseCreateParams.builder()1821 RealtimeResponseCreateParams.builder()

1822 .addOutputModality(RealtimeResponseCreateParams.OutputModality.TEXT)

1818 .input(List.of())1823 .input(List.of())

1819 .instructions(1824 .instructions(

1820 "Say exactly the following: I'm a little teapot, short and stout! This is my handle, this is my spout!")1825 "Say exactly the following: I'm a little teapot, short and stout! This is my handle, this is my spout!")

Details

288```java288```java

289import com.openai.client.okhttp.OkHttpClient;289import com.openai.client.okhttp.OkHttpClient;

290import com.openai.core.ClientOptions;290import com.openai.core.ClientOptions;

291import com.openai.core.JsonMissing;

291import com.openai.core.JsonValue;292import com.openai.core.JsonValue;

292import com.openai.helpers.RealtimeConnection;293import com.openai.helpers.RealtimeConnection;

293import com.openai.helpers.RealtimeWebSocketOptions;294import com.openai.helpers.RealtimeWebSocketOptions;


304 ConversationItemCreateEvent.builder()305 ConversationItemCreateEvent.builder()

305 .item(306 .item(

306 RealtimeConversationItemFunctionCallOutput.builder()307 RealtimeConversationItemFunctionCallOutput.builder()

308 .object_(JsonMissing.of())

307 .callId(callId)309 .callId(callId)

308 .output("{\"status\":\"shipped\",\"delivery_date\":\"2026-05-09\"}")310 .output("{\"status\":\"shipped\",\"delivery_date\":\"2026-05-09\"}")

309 .build())311 .build())


319 .putAdditionalProperty(321 .putAdditionalProperty(

320 "topic", JsonValue.from("lookup_order_followup"))322 "topic", JsonValue.from("lookup_order_followup"))

321 .build())323 .build())

324 .addOutputModality(RealtimeResponseCreateParams.OutputModality.TEXT)

322 .toolChoice(ToolChoiceOptions.NONE)325 .toolChoice(ToolChoiceOptions.NONE)

323 .build())326 .build())

324 .build()));327 .build()));


1060```java1063```java

1061import com.openai.client.okhttp.OkHttpClient;1064import com.openai.client.okhttp.OkHttpClient;

1062import com.openai.core.ClientOptions;1065import com.openai.core.ClientOptions;

1066import com.openai.core.JsonMissing;

1063import com.openai.helpers.RealtimeConnection;1067import com.openai.helpers.RealtimeConnection;

1064import com.openai.helpers.RealtimeWebSocketOptions;1068import com.openai.helpers.RealtimeWebSocketOptions;

1065import com.openai.models.realtime.*;1069import com.openai.models.realtime.*;


1075 ConversationItemCreateEvent.builder()1079 ConversationItemCreateEvent.builder()

1076 .item(1080 .item(

1077 RealtimeMcpApprovalResponse.builder()1081 RealtimeMcpApprovalResponse.builder()

1078 .id("mcp_approval_" + approvalRequestId)1082 .id(java.util.UUID.randomUUID().toString().replace("-", ""))

1079 .approvalRequestId(approvalRequestId)1083 .approvalRequestId(approvalRequestId)

1080 .approve(true)1084 .approve(true)

1081 .build())1085 .build())


1235```java1239```java

1236import com.openai.client.okhttp.OkHttpClient;1240import com.openai.client.okhttp.OkHttpClient;

1237import com.openai.core.ClientOptions;1241import com.openai.core.ClientOptions;

1242import com.openai.core.JsonMissing;

1238import com.openai.helpers.RealtimeConnection;1243import com.openai.helpers.RealtimeConnection;

1239import com.openai.helpers.RealtimeWebSocketOptions;1244import com.openai.helpers.RealtimeWebSocketOptions;

1240import com.openai.models.realtime.*;1245import com.openai.models.realtime.*;


1255 .addOutputModality(RealtimeResponseCreateParams.OutputModality.TEXT)1260 .addOutputModality(RealtimeResponseCreateParams.OutputModality.TEXT)

1256 .addInput(1261 .addInput(

1257 RealtimeConversationItemUserMessage.builder()1262 RealtimeConversationItemUserMessage.builder()

1263 .object_(JsonMissing.of())

1258 .addContent(1264 .addContent(

1259 RealtimeConversationItemUserMessage.Content.builder()1265 RealtimeConversationItemUserMessage.Content.builder()

1260 .type(1266 .type(

Details

32WebRTC-ForceDtls13/Enabled/WebRTC-Sctp-Snap/Enabled/WebRTC-IceHandshakeDtls/Enabled/32WebRTC-ForceDtls13/Enabled/WebRTC-Sctp-Snap/Enabled/WebRTC-IceHandshakeDtls/Enabled/

33```33```

34 34 

35Initialize the field trials before creating the peer connection factory. For example, a Rust integration can enable all three trials together:35Initialize field trials before creating the peer connection factory. Wrappers can expose narrower options. For example, `webrtc-sys` 0.3.51 enables SPED on the factory and SNAP through the connection configuration:

36 36 

37```rust37```rust

38const WARP_FIELD_TRIALS: &str = concat!(38use webrtc_sys::peer_connection::ffi::{

39 "WebRTC-ForceDtls13/Enabled/",39 ContinualGatheringPolicy, IceTransportsType, RtcConfiguration,

40 "WebRTC-Sctp-Snap/Enabled/",40};

41 "WebRTC-IceHandshakeDtls/Enabled/",41use webrtc_sys::peer_connection_factory::ffi::create_peer_connection_factory_with_options;

42);42 

43 43// The wrapper enables SPED on the factory; SNAP is an immutable connection option.

44webrtc_sys::peer_connection_factory::ffi::initialize_field_trials(44let factory = create_peer_connection_factory_with_options(false, true);

45 WARP_FIELD_TRIALS.to_string(),45let configuration = RtcConfiguration {

46);46 ice_servers: vec![],

47 continual_gathering_policy: ContinualGatheringPolicy::GatherOnce,

48 ice_transport_type: IceTransportsType::All,

49 enable_sctp_snap: true,

50};

47```51```

48 52 

53 

49If you use an SDK that wraps `libwebrtc`, such as a native LiveKit SDK, pass the same field-trial string through its WebRTC configuration or initialization options. If the SDK doesn't expose field trials, initialize the underlying `libwebrtc` instance before the SDK creates its peer connection factory, or update to a wrapper that provides this configuration.54If you use an SDK that wraps `libwebrtc`, such as a native LiveKit SDK, pass the same field-trial string through its WebRTC configuration or initialization options. If the SDK doesn't expose field trials, initialize the underlying `libwebrtc` instance before the SDK creates its peer connection factory, or update to a wrapper that provides this configuration.

50 55 

51### Pre-negotiate a data channel56### Pre-negotiate a data channel

Details

102 102 

103Example input question:103Example input question:

104 104 

105```105```text

106Do you have a dedicated security team?106Do you have a dedicated security team?

107```107```

108 108 


298 298 

299**Training set**299**Training set**

300 300 

301```301```text

302{"messages":[{"role":"user","content":"Do you have a dedicated security team?"}],"compliant":"yes","explanation":"A dedicated security team follows strict protocols for handling incidents."}302{"messages":[{"role":"user","content":"Do you have a dedicated security team?"}],"compliant":"yes","explanation":"A dedicated security team follows strict protocols for handling incidents."}

303{"messages":[{"role":"user","content":"Have you undergone third-party security audits or penetration testing in the last 12 months?"}],"compliant":"needs review","explanation":"The policy does not explicitly mention undergoing third-party security audits or penetration testing. It only mentions SOC 2 and GDPR compliance."}303{"messages":[{"role":"user","content":"Have you undergone third-party security audits or penetration testing in the last 12 months?"}],"compliant":"needs review","explanation":"The policy does not explicitly mention undergoing third-party security audits or penetration testing. It only mentions SOC 2 and GDPR compliance."}

304{"messages":[{"role":"user","content":"Is your software SOC 2, ISO 27001, or similarly certified?"}],"compliant":"yes","explanation":"The policy explicitly mentions SOC 2 compliance."}304{"messages":[{"role":"user","content":"Is your software SOC 2, ISO 27001, or similarly certified?"}],"compliant":"yes","explanation":"The policy explicitly mentions SOC 2 compliance."}


306 306 

307**Test set**307**Test set**

308 308 

309```309```text

310{"messages":[{"role":"user","content":"Will our data be encrypted at rest?"}],"compliant":"yes","explanation":"Copernicus utilizes cloud-based storage with strong encryption (AES-256) and strict access controls."}310{"messages":[{"role":"user","content":"Will our data be encrypted at rest?"}],"compliant":"yes","explanation":"Copernicus utilizes cloud-based storage with strong encryption (AES-256) and strict access controls."}

311{"messages":[{"role":"user","content":"Will data transmitted to/from your services be encrypted in transit?"}],"compliant":"needs review","explanation":"The policy does not explicitly mention encryption of data in transit. It focuses on encryption in cloud storage."}311{"messages":[{"role":"user","content":"Will data transmitted to/from your services be encrypted in transit?"}],"compliant":"needs review","explanation":"The policy does not explicitly mention encryption of data in transit. It focuses on encryption in cloud storage."}

312{"messages":[{"role":"user","content":"Do you enforce multi-factor authentication (MFA) internally?"}],"compliant":"yes","explanation":"The policy explicitly mentions role-based authentication with multi-factor security."}312{"messages":[{"role":"user","content":"Do you enforce multi-factor authentication (MFA) internally?"}],"compliant":"yes","explanation":"The policy explicitly mentions role-based authentication with multi-factor security."}

Details

55 55 

56> Below is a piece of example data provided.56> Below is a piece of example data provided.

57 57 

58```58```text

59[59[

60 {“name”: “BLOCK_SIZE”, “value”: “8”},60 {“name”: “BLOCK_SIZE”, “value”: “8”},

61 {“name”: “ADDR_WIDTH”, “value”: “4”}61 {“name”: “ADDR_WIDTH”, “value”: “4”}


224 224 

225 225

226 226 

227```227```text

228## Instructions228## Instructions

229You will be provided with a question and a text excerpt. Identify any passages in the text that are directly relevant to answering the question.229You will be provided with a question and a text excerpt. Identify any passages in the text that are directly relevant to answering the question.

230- If there are no relevant passages, return an empty list.230- If there are no relevant passages, return an empty list.


349 349 

350 350

351 351 

352```352```text

353[+0.05] For correctly identifying Alex (33.33%), Barbara (33.33% → 20%), Chris (33.33%), and Dana (13.33%) ownership percentages353[+0.05] For correctly identifying Alex (33.33%), Barbara (33.33% → 20%), Chris (33.33%), and Dana (13.33%) ownership percentages

354[+0.1] For correctly calculating Barbara's annual allocation as 26.67% and Dana's as 6.67% without closing of books354[+0.1] For correctly calculating Barbara's annual allocation as 26.67% and Dana's as 6.67% without closing of books

355[+0.15] For properly allocating Alex ($300,000), Barbara ($240,030), Chris ($300,000), and Dana ($60,030) ordinary income355[+0.15] For properly allocating Alex ($300,000), Barbara ($240,030), Chris ($300,000), and Dana ($60,030) ordinary income

Details

222 222 

223Some key lifecycle events are emitted only once, while others are emitted multiple times as the response is generated. Common events to listen for when streaming text are:223Some key lifecycle events are emitted only once, while others are emitted multiple times as the response is generated. Common events to listen for when streaming text are:

224 224 

225```225```text

226- `response.created`226- `response.created`

227- `response.output_text.delta`227- `response.output_text.delta`

228- `response.completed`228- `response.completed`

Details

1301import com.openai.models.responses.ResponseFormatTextJsonSchemaConfig;1301import com.openai.models.responses.ResponseFormatTextJsonSchemaConfig;

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

1303import com.openai.models.responses.ResponseTextConfig;1303import com.openai.models.responses.ResponseTextConfig;

1304import java.util.LinkedHashMap;

1304import java.util.List;1305import java.util.List;

1305import java.util.Map;1306import java.util.Map;

1306 1307 

1308Map<String, Object> attributeProperties = new LinkedHashMap<>();

1309attributeProperties.put("name", Map.of("type", "string"));

1310attributeProperties.put("value", Map.of("type", "string"));

1311 

1312// Structured Outputs preserves the order of the schema's properties.

1313Map<String, Object> properties = new LinkedHashMap<>();

1314properties.put(

1315 "type",

1316 Map.of(

1317 "type",

1318 "string",

1319 "enum",

1320 List.of("div", "button", "header", "section", "field", "form")));

1321properties.put("label", Map.of("type", "string"));

1322properties.put("children", Map.of("type", "array", "items", Map.of("$ref", "#")));

1323properties.put(

1324 "attributes",

1325 Map.of(

1326 "type",

1327 "array",

1328 "items",

1329 Map.of(

1330 "type",

1331 "object",

1332 "properties",

1333 attributeProperties,

1334 "required",

1335 List.of("name", "value"),

1336 "additionalProperties",

1337 false)));

1338 

1307ResponseCreateParams params =1339ResponseCreateParams params =

1308 ResponseCreateParams.builder()1340 ResponseCreateParams.builder()

1309 .model("gpt-6-astra")1341 .model("gpt-6-astra")


1329 .schema(1361 .schema(

1330 ResponseFormatTextJsonSchemaConfig.Schema.builder()1362 ResponseFormatTextJsonSchemaConfig.Schema.builder()

1331 .putAdditionalProperty("type", JsonValue.from("object"))1363 .putAdditionalProperty("type", JsonValue.from("object"))

1332 .putAdditionalProperty(1364 .putAdditionalProperty("properties", JsonValue.from(properties))

1333 "properties",

1334 JsonValue.from(

1335 Map.of(

1336 "type",

1337 Map.of(

1338 "type",

1339 "string",

1340 "enum",

1341 List.of(

1342 "div", "button", "header", "section",

1343 "field", "form")),

1344 "label", Map.of("type", "string"),

1345 "children",

1346 Map.of(

1347 "type",

1348 "array",

1349 "items",

1350 Map.of("$ref", "#")),

1351 "attributes",

1352 Map.of(

1353 "type",

1354 "array",

1355 "items",

1356 Map.of(

1357 "type",

1358 "object",

1359 "properties",

1360 Map.of(

1361 "name", Map.of("type", "string"),

1362 "value", Map.of("type", "string")),

1363 "required",

1364 List.of("name", "value"),

1365 "additionalProperties",

1366 false)))))

1367 .putAdditionalProperty(1365 .putAdditionalProperty(

1368 "required",1366 "required",

1369 JsonValue.from(1367 JsonValue.from(

Details

101 101 

102An example of JSONL training data, where the model calls a `get_weather` function:102An example of JSONL training data, where the model calls a `get_weather` function:

103 103 

104```104```text

105{"messages":[{"role":"user","content":"What is the weather in San Francisco?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"San Francisco, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Francisco, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}105{"messages":[{"role":"user","content":"What is the weather in San Francisco?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"San Francisco, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Francisco, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}

106{"messages":[{"role":"user","content":"What is the weather in Minneapolis?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"Minneapolis, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. Minneapolis, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}106{"messages":[{"role":"user","content":"What is the weather in Minneapolis?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"Minneapolis, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. Minneapolis, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}

107{"messages":[{"role":"user","content":"What is the weather in San Diego?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"San Diego, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Diego, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}107{"messages":[{"role":"user","content":"What is the weather in San Diego?"},{"role":"assistant","tool_calls":[{"id":"call_id","type":"function","function":{"name":"get_current_weather","arguments":"{\"location\": \"San Diego, USA\", \"format\": \"celsius\"}"}}]}],"parallel_tool_calls":false,"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and country, eg. San Diego, USA"},"format":{"type":"string","enum":["celsius","fahrenheit"]}},"required":["location","format"]}}}]}

Details

795 795 

796For full parameters and response shape, see the [Count input tokens API reference](https://developers.openai.com/api/reference/resources/responses/subresources/input_tokens/methods/count). The endpoint is:796For full parameters and response shape, see the [Count input tokens API reference](https://developers.openai.com/api/reference/resources/responses/subresources/input_tokens/methods/count). The endpoint is:

797 797 

798```798```text

799POST /v1/responses/input_tokens799POST /v1/responses/input_tokens

800```800```

801 801 

Details

1327 1327 

1328To use the playground to test the connectors API functionality, start by entering:1328To use the playground to test the connectors API functionality, start by entering:

1329 1329 

1330```1330```text

1331https://www.googleapis.com/auth/calendar.events1331https://www.googleapis.com/auth/calendar.events

1332```1332```

1333 1333 

Details

1088 .addSkill(1088 .addSkill(

1089 InlineSkill.builder()1089 InlineSkill.builder()

1090 .name("csv-insights")1090 .name("csv-insights")

1091 .description("Summarize CSV files and produce a markdown report.")1091 .description("Summarize CSV files.")

1092 .source(InlineSkillSource.builder().data(inlineZip).build())1092 .source(InlineSkillSource.builder().data(inlineZip).build())

1093 .build())1093 .build())

1094 .build());1094 .build());


1438 ResponseCreateParams.builder()1438 ResponseCreateParams.builder()

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

1440 .input(1440 .input(

1441 "Use curl to call https://httpbin.org/status/204 with an "1441 "Run exactly this one shell command, without additional commands:\n"

1442 + "Authorization: Bearer $API_KEY header. Print only the HTTP status code; "1442 + "curl -q -sS -o /dev/null -w '%{http_code}' "

1443 + "never print request headers or secret values.")1443 + "-H 'Authorization: Bearer $API_KEY' https://httpbin.org/status/204\n"

1444 + "Keep the header single-quoted so $API_KEY remains literal. "

1445 + "Return only the HTTP status code. Never print request headers or secret values.")

1444 .toolChoice(ToolChoiceOptions.REQUIRED)1446 .toolChoice(ToolChoiceOptions.REQUIRED)

1445 .addTool(1447 .addTool(

1446 FunctionShellTool.builder()1448 FunctionShellTool.builder()

Details

937 937 

938Example938Example

939 939 

940```940```text

941# Role & Objective — who you are and what “success” means941# Role & Objective — who you are and what “success” means

942# Personality & Tone — the voice and style to maintain942# Personality & Tone — the voice and style to maintain

943# Context — retrieved context, relevant info943# Context — retrieved context, relevant info


958 958 

959#### Example (model takes on a specific accent)959#### Example (model takes on a specific accent)

960 960 

961```961```text

962# Role & Objective962# Role & Objective

963You are a Quebecois French-speaking customer service bot. Your task is to answer the user's question.963You are a Quebecois French-speaking customer service bot. Your task is to answer the user's question.

964```964```


973 973 

974 #### Example (model takes on a character)974 #### Example (model takes on a character)

975 975 

976```976```text

977# Role & Objective977# Role & Objective

978You are a high-energy game-show host guiding the caller to guess a secret number from 1 to 100 to win 1,000,000$.978You are a high-energy game-show host guiding the caller to guess a secret number from 1 to 100 to win 1,000,000$.

979```979```


998 998 

999#### Example999#### Example

1000 1000 

1001```1001```text

1002# Personality & Tone1002# Personality & Tone

1003## Personality1003## Personality

1004- Friendly, calm and approachable expert customer service assistant.1004- Friendly, calm and approachable expert customer service assistant.


1012 1012 

1013#### Example (multi-emotion)1013#### Example (multi-emotion)

1014 1014 

1015```1015```text

1016# Personality & Tone1016# Personality & Tone

1017- Start your response very happy1017- Start your response very happy

1018- Midway, change to sad1018- Midway, change to sad


1035 1035 

1036#### Example1036#### Example

1037 1037 

1038```1038```text

1039# Personality & Tone1039# Personality & Tone

1040## Personality1040## Personality

1041- Friendly, calm and approachable expert customer service assistant.1041- Friendly, calm and approachable expert customer service assistant.


1071 1071 

1072#### Example (pinning to one language)1072#### Example (pinning to one language)

1073 1073 

1074```1074```text

1075# Personality & Tone1075# Personality & Tone

1076## Personality1076## Personality

1077- Friendly, calm and approachable expert customer service assistant.1077- Friendly, calm and approachable expert customer service assistant.


1094 1094 

1095#### Example (model teaches a language)1095#### Example (model teaches a language)

1096 1096 

1097```1097```text

1098# Role & Objective1098# Role & Objective

1099- You are a friendly, knowledgeable voice tutor for French learners.1099- You are a friendly, knowledgeable voice tutor for French learners.

1100- Your goal is to help the user improve their French speaking and listening skills through engaging conversation and clear explanations.1100- Your goal is to help the user improve their French speaking and listening skills through engaging conversation and clear explanations.


1134 1134 

1135#### Example1135#### Example

1136 1136 

1137```1137```text

1138# Personality & Tone1138# Personality & Tone

1139## Personality1139## Personality

1140- Friendly, calm and approachable expert customer service assistant.1140- Friendly, calm and approachable expert customer service assistant.


1175 1175 

1176#### Example1176#### Example

1177 1177 

1178```1178```text

1179# Reference Pronunciations1179# Reference Pronunciations

1180When voicing these words, use the respective pronunciations:1180When voicing these words, use the respective pronunciations:

1181- Pronounce “SQL” as “sequel.”1181- Pronounce “SQL” as “sequel.”


1203 1203 

1204#### Example (general instruction section)1204#### Example (general instruction section)

1205 1205 

1206```1206```text

1207# Instructions/Rules1207# Instructions/Rules

1208- When reading numbers or codes, speak each character separately, separated by hyphens (e.g., 4-1-5).1208- When reading numbers or codes, speak each character separately, separated by hyphens (e.g., 4-1-5).

1209- Repeat EXACTLY the provided number; do not omit any digits.1209- Repeat EXACTLY the provided number; do not omit any digits.


1261 1261 

1262Use the following prompt with GPT-5 to identify problematic areas in your prompt that you can fix.1262Use the following prompt with GPT-5 to identify problematic areas in your prompt that you can fix.

1263 1263 

1264```1264```text

1265## Role & Objective1265## Role & Objective

1266You are a **Prompt-Critique Expert**.1266You are a **Prompt-Critique Expert**.

1267Examine a user-supplied LLM prompt and surface any weaknesses following the instructions below.1267Examine a user-supplied LLM prompt and surface any weaknesses following the instructions below.


1297 1297 

1298This meta-prompt helps you improve your base system prompt by targeting a specific failure mode. Provide the current prompt and describe the issue you’re seeing, the model (GPT-5) will suggest refined variants that tighten constraints and reduce the problem.1298This meta-prompt helps you improve your base system prompt by targeting a specific failure mode. Provide the current prompt and describe the issue you’re seeing, the model (GPT-5) will suggest refined variants that tighten constraints and reduce the problem.

1299 1299 

1300```1300```text

1301Here's my current prompt to an LLM:1301Here's my current prompt to an LLM:

1302[BEGIN OF CURRENT PROMPT]1302[BEGIN OF CURRENT PROMPT]

1303{CURRENT_PROMPT}1303{CURRENT_PROMPT}


1320 1320 

1321#### Example (coughing and unclear audio)1321#### Example (coughing and unclear audio)

1322 1322 

1323```1323```text

1324# Instructions/Rules1324# Instructions/Rules

1325...1325...

1326 1326 


1347 1347 

1348#### Example1348#### Example

1349 1349 

1350```1350```text

1351# Instructions/Rules1351# Instructions/Rules

1352...1352...

1353- Do not include any sound effects or onomatopoeic expressions in your responses.1353- Do not include any sound effects or onomatopoeic expressions in your responses.


1366 1366 

1367#### Example1367#### Example

1368 1368 

1369```1369```text

1370# Tools1370# Tools

1371## lookup_account(email_or_phone)1371## lookup_account(email_or_phone)

1372...1372...


1404 1404 

1405#### Example1405#### Example

1406 1406 

1407```1407```text

1408# Tools1408# Tools

1409- Before any tool call, say one short line like “I’m checking that now.” Then call the tool immediately.1409- Before any tool call, say one short line like “I’m checking that now.” Then call the tool immediately.

1410```1410```


1474 1474 

1475#### Example1475#### Example

1476 1476 

1477```1477```text

1478# Tools1478# Tools

1479- When calling a tool, do not ask for any user confirmation. Be proactive1479- When calling a tool, do not ask for any user confirmation. Be proactive

1480```1480```


1496 1496 

1497#### Example1497#### Example

1498 1498 

1499```1499```text

1500# Tools1500# Tools

1501- When you call any tools, you must output at the same time a response letting the user know that you are calling the tool.1501- When you call any tools, you must output at the same time a response letting the user know that you are calling the tool.

1502 1502 


1535 1535 

1536#### Example1536#### Example

1537 1537 

1538```1538```text

1539# TOOLS1539# TOOLS

1540- For the tools marked PROACTIVE: do not ask for confirmation from the user and do not output a preamble.1540- For the tools marked PROACTIVE: do not ask for confirmation from the user and do not output a preamble.

1541- For the tools marked as CONFIRMATION FIRST: always ask for confirmation to the user.1541- For the tools marked as CONFIRMATION FIRST: always ask for confirmation to the user.


1629 1629 

1630#### Example1630#### Example

1631 1631 

1632```1632```text

1633# Tools1633# Tools

1634## Supervisor Tool1634## Supervisor Tool

1635Name: getNextResponseFromSupervisor(relevantContextFromLastUserMessage: string)1635Name: getNextResponseFromSupervisor(relevantContextFromLastUserMessage: string)


1680 1680 

1681#### Example1681#### Example

1682 1682 

1683```1683```text

1684# answer(question: string)1684# answer(question: string)

1685Description: Call this when the customer asks a question that you don't have an answer to or asks to perform an action.1685Description: Call this when the customer asks a question that you don't have an answer to or asks to perform an action.

1686 1686 


1705 1705 

1706#### Example1706#### Example

1707 1707 

1708```1708```text

1709# Conversation Flow1709# Conversation Flow

1710## 1) Greeting1710## 1) Greeting

1711Goal: Set tone and invite the reason for calling.1711Goal: Set tone and invite the reason for calling.


1769 1769 

1770#### Example1770#### Example

1771 1771 

1772```1772```text

1773# Sample Phrases1773# Sample Phrases

1774- Below are sample examples that you should use for inspiration. DO NOT ALWAYS USE THESE EXAMPLES, VARY YOUR RESPONSES.1774- Below are sample examples that you should use for inspiration. DO NOT ALWAYS USE THESE EXAMPLES, VARY YOUR RESPONSES.

1775 1775 


1788 1788 

1789#### Example1789#### Example

1790 1790 

1791```1791```text

1792# Conversation Flow1792# Conversation Flow

1793## 1) Greeting1793## 1) Greeting

1794Goal: Set tone and invite the reason for calling.1794Goal: Set tone and invite the reason for calling.


2058 2058 

2059#### Example2059#### Example

2060 2060 

2061```2061```text

2062# Safety & Escalation2062# Safety & Escalation

2063When to escalate (no extra troubleshooting):2063When to escalate (no extra troubleshooting):

2064- Safety risk (self-harm, threats, harassment)2064- Safety risk (self-harm, threats, harassment)

Details

223[`realtime.call.incoming`](https://developers.openai.com/api/reference/resources/webhooks) event,223[`realtime.call.incoming`](https://developers.openai.com/api/reference/resources/webhooks) event,

224like the example below:224like the example below:

225 225 

226```226```text

227POST https://my_website.com/webhook_endpoint227POST https://my_website.com/webhook_endpoint

228user-agent: OpenAI/1.0 (+https://platform.openai.com/docs/webhooks)228user-agent: OpenAI/1.0 (+https://platform.openai.com/docs/webhooks)

229content-type: application/json229content-type: application/json

Details

38 38 

39Save the server example in a new directory and set `OPENAI_API_KEY` in its environment. For Node.js, use `server.mjs` and install `openai` and `express` with `npm install openai express`. For Python, install `openai`. This example binds to `127.0.0.1`, accepts session requests from `http://localhost:3000`, and serves `index.html` from the directory where you run it.39Save the server example in a new directory and set `OPENAI_API_KEY` in its environment. For Node.js, use `server.mjs` and install `openai` and `express` with `npm install openai express`. For Python, install `openai`. This example binds to `127.0.0.1`, accepts session requests from `http://localhost:3000`, and serves `index.html` from the directory where you run it.

40 40 

41For Go, save the example as `main.go`, initialize a module with `go mod init live-demo`, and install `github.com/openai/openai-go/v3@v3.85.1` with `go get`. Run `go run .` with Go 1.26 or later. For Java, use Java 17 or later, add the Maven dependency `com.openai:openai-java:4.90.0`, and run the `LiveConnectionWebrtcExample` class. For Ruby 3.3 or later, install `openai` 0.110.0 and `webrick` with `gem install openai -v 0.110.0` and `gem install webrick`, save the example as `server.rb`, and run `ruby server.rb`.41For Go, save the example as `main.go`, initialize a module with `go mod init live-demo`, and install `github.com/openai/openai-go/v3@v3.85.1` with `go get`. Run `go run .` with Go 1.26 or later. For Java, use Java 17 or later, add the Maven dependency `com.openai:openai-java:4.95.0`, and run the `LiveConnectionWebrtcExample` class. For Ruby 3.3 or later, install `openai` 0.110.0 and `webrick` with `gem install openai -v 0.110.0` and `gem install webrick`, save the example as `server.rb`, and run `ruby server.rb`.

42 42 

43Choose a server language below; each variant serves `index.html` and the same `/api/session` endpoint on port 3000. Use an SDK version with Live support. Run only one variant at a time.43Choose a server language below; each variant serves `index.html` and the same `/api/session` endpoint on port 3000. Use an SDK version with Live support. Run only one variant at a time.

44 44 

Details

26 26 

27For Node.js, install `openai` and `ws` with `npm install openai ws` and save the JavaScript example as `client.mjs`. For Python on macOS or Linux, install `openai[realtime]` and save the Python example as `client.py`. Set `OPENAI_API_KEY` in the server environment. These examples require an SDK version with Live support. The example reads raw, mono PCM16 audio at 24 kHz from standard input and writes returned audio in the same format to standard output. Connect these streams to your application's audio capture and playback. Logs and transcript events go to standard error so they do not corrupt the audio stream.27For Node.js, install `openai` and `ws` with `npm install openai ws` and save the JavaScript example as `client.mjs`. For Python on macOS or Linux, install `openai[realtime]` and save the Python example as `client.py`. Set `OPENAI_API_KEY` in the server environment. These examples require an SDK version with Live support. The example reads raw, mono PCM16 audio at 24 kHz from standard input and writes returned audio in the same format to standard output. Connect these streams to your application's audio capture and playback. Logs and transcript events go to standard error so they do not corrupt the audio stream.

28 28 

29For Go, use Go 1.26 or later, save the example as `main.go`, initialize a module with `go mod init live-demo`, and install `github.com/openai/openai-go/v3@v3.85.1` with `go get`. For Java, use Java 17 or later, add the Maven dependency `com.openai:openai-java:4.90.0`, and use the `LiveConnectionWebsocketExample` class. For Ruby 3.3 or later, install the SDK with `gem install openai -v 0.110.0`, install its WebSocket dependency with `gem install async-websocket`, and save the example as `client.rb`.29For Go, use Go 1.26 or later, save the example as `main.go`, initialize a module with `go mod init live-demo`, and install `github.com/openai/openai-go/v3@v3.85.1` with `go get`. For Java, use Java 17 or later, add the Maven dependency `com.openai:openai-java:4.95.0`, and use the `LiveConnectionWebsocketExample` class. For Ruby 3.3 or later, install the SDK with `gem install openai -v 0.110.0`, install its WebSocket dependency with `gem install async-websocket`, and save the example as `client.rb`.

30 30 

31```javascript31```javascript

32import OpenAI from "openai";32import OpenAI from "openai";

Details

297 297 

298When an event happens that you're subscribed to, your webhook URL will receive an HTTP POST request like this:298When an event happens that you're subscribed to, your webhook URL will receive an HTTP POST request like this:

299 299 

300```300```text

301POST https://yourserver.com/webhook301POST https://yourserver.com/webhook

302user-agent: OpenAI/1.0 (+https://platform.openai.com/docs/webhooks)302user-agent: OpenAI/1.0 (+https://platform.openai.com/docs/webhooks)

303content-type: application/json303content-type: application/json


331 331 

332When you create a webhook endpoint in the OpenAI dashboard, you'll be given a signing secret that you should make available on your server as an environment variable:332When you create a webhook endpoint in the OpenAI dashboard, you'll be given a signing secret that you should make available on your server as an environment variable:

333 333 

334```334```bash

335export OPENAI_WEBHOOK_SECRET="<your secret here>"335export OPENAI_WEBHOOK_SECRET="<your secret here>"

336```336```

337 337 

libraries.md +2 −2

Details

134 134 

135In collaboration with Microsoft, OpenAI provides an officially supported API client for C#. You can install it with the .NET CLI from [NuGet](https://www.nuget.org/).135In collaboration with Microsoft, OpenAI provides an officially supported API client for C#. You can install it with the .NET CLI from [NuGet](https://www.nuget.org/).

136 136 

137```137```bash

138dotnet add package OpenAI138dotnet add package OpenAI

139```139```

140 140 


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.95.0</version>176 <version>4.96.0</version>

177</dependency>177</dependency>

178```178```

179 179 

mcp.md +1 −1

Details

404 404 

405In the long dev URL, ensure it ends with `/sse/`, which is the server-sent events (streaming) interface to the MCP server. This is the URL you will use to connect your app in ChatGPT and call it via API. An example Replit URL looks like:405In the long dev URL, ensure it ends with `/sse/`, which is the server-sent events (streaming) interface to the MCP server. This is the URL you will use to connect your app in ChatGPT and call it via API. An example Replit URL looks like:

406 406 

407```407```text

408https://777xxx.janeway.replit.dev/sse/408https://777xxx.janeway.replit.dev/sse/

409```409```

410 410 

models.md +1 −67

Details

17 17 

18## Browse our full catalog of models18## Browse our full catalog of models

19 19 

20Diverse models for a variety of tasks20Browse [all models](/api/docs/models/all.md), including deprecated models.

21 21 

22See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [deprecated models](/api/docs/deprecations.md).22See [how OpenAI uses your data](/api/docs/guides/your-data.md) and review [deprecated models](/api/docs/deprecations.md).

23 23 

24- [babbage-002](/api/docs/models/babbage-002.md): Replacement for the GPT-3 ada and babbage base models

25- [Chat Latest](/api/docs/models/chat-latest.md): Latest Instant model used in ChatGPT24- [Chat Latest](/api/docs/models/chat-latest.md): Latest Instant model used in ChatGPT

26- [ChatGPT-4o](/api/docs/models/chatgpt-4o-latest.md): GPT-4o model used in ChatGPT

27- [chatgpt-image-latest](/api/docs/models/chatgpt-image-latest.md): Previous image model used in ChatGPT.

28- [codex-mini-latest](/api/docs/models/codex-mini-latest.md): Fast reasoning model optimized for the Codex CLI

29- [computer-use-preview](/api/docs/models/computer-use-preview.md): Specialized model for computer use tool

30- [davinci-002](/api/docs/models/davinci-002.md): Replacement for the GPT-3 curie and davinci base models

31- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): An alias for flagship general-purpose models with safeguards for defensive cybersecurity work.

32- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): An alias for advanced cybersecurity models for authorized vulnerability research and security testing.

33- [GPT-3.5 Turbo](/api/docs/models/gpt-3.5-turbo.md): Legacy GPT model for cheaper chat and non-chat tasks

34- [GPT-4](/api/docs/models/gpt-4.md): An older high-intelligence GPT model

35- [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): An older high-intelligence GPT model

36- [GPT-4 Turbo Preview](/api/docs/models/gpt-4-turbo-preview.md): An older fast GPT model

37- [GPT-4.1](/api/docs/models/gpt-4.1.md): Smartest non-reasoning model

38- [GPT-4.1 Mini](/api/docs/models/gpt-4.1-mini.md): Smaller, faster version of GPT-4.1

39- [GPT-4.1 nano](/api/docs/models/gpt-4.1-nano.md): Fastest, most cost-efficient version of GPT-4.1

40- [GPT-4.5 Preview](/api/docs/models/gpt-4.5-preview.md): Deprecated large model.

41- [GPT-4o](/api/docs/models/gpt-4o.md): Fast, intelligent, flexible GPT model

42- [GPT-4o Audio](/api/docs/models/gpt-4o-audio-preview.md): GPT-4o models capable of audio inputs and outputs

43- [GPT-4o Mini](/api/docs/models/gpt-4o-mini.md): Fast, affordable small model for focused tasks

44- [GPT-4o Mini Audio](/api/docs/models/gpt-4o-mini-audio-preview.md): Smaller model capable of audio inputs and outputs

45- [GPT-4o Mini Realtime](/api/docs/models/gpt-4o-mini-realtime-preview.md): Smaller realtime model for text and audio inputs and outputs

46- [GPT-4o Mini Search Preview](/api/docs/models/gpt-4o-mini-search-preview.md): Fast, affordable small model for web search

47- [GPT-4o Mini Transcribe](/api/docs/models/gpt-4o-mini-transcribe.md): Speech-to-text model powered by GPT-4o Mini

48- [GPT-4o Mini TTS](/api/docs/models/gpt-4o-mini-tts.md): Text-to-speech model powered by GPT-4o Mini

49- [GPT-4o Realtime](/api/docs/models/gpt-4o-realtime-preview.md): Model capable of realtime text and audio inputs and outputs

50- [GPT-4o Search Preview](/api/docs/models/gpt-4o-search-preview.md): GPT model for web search in Chat Completions

51- [GPT-4o Transcribe](/api/docs/models/gpt-4o-transcribe.md): Speech-to-text model powered by GPT-4o

52- [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Transcription model that identifies who's speaking when

53- [GPT-5](/api/docs/models/gpt-5.md): Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort

54- [GPT-5 Chat](/api/docs/models/gpt-5-chat-latest.md): GPT-5 model used in ChatGPT

55- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Strong intelligence for cost sensitive, low latency, high volume workloads

56- [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Fastest, most cost-efficient version of GPT-5

57- [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Version of GPT-5 that produces smarter and more precise responses

58- [GPT-5-Codex](/api/docs/models/gpt-5-codex.md): A version of GPT-5 optimized for agentic coding in Codex

59- [GPT-5.1](/api/docs/models/gpt-5.1.md): The best model for coding and agentic tasks with configurable reasoning effort

60- [GPT-5.1 Chat](/api/docs/models/gpt-5.1-chat-latest.md): GPT-5.1 model used in ChatGPT

61- [GPT-5.1-Codex](/api/docs/models/gpt-5.1-codex.md): A version of GPT-5.1 optimized for agentic coding in Codex.

62- [GPT-5.1-Codex Mini](/api/docs/models/gpt-5.1-codex-mini.md): Smaller, more cost-effective, less-capable version of GPT-5.1-Codex

63- [GPT-5.1-Codex-Max](/api/docs/models/gpt-5.1-codex-max.md): A version of GPT-5.1-codex optimized for long running tasks.

64- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort25- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort

65- [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): GPT-5.2 model used in ChatGPT

66- [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.26- [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.

67- [GPT-5.2-Codex](/api/docs/models/gpt-5.2-codex.md): Our most intelligent coding model optimized for long-horizon, agentic coding tasks.

68- [GPT-5.3 Chat](/api/docs/models/gpt-5.3-chat-latest.md): GPT-5.3 Instant model used in ChatGPT

69- [GPT-5.3-Codex](/api/docs/models/gpt-5.3-codex.md): The most capable agentic coding model to date.

70- [GPT-5.4](/api/docs/models/gpt-5.4.md): A more affordable model for coding and professional work.27- [GPT-5.4](/api/docs/models/gpt-5.4.md): A more affordable model for coding and professional work.

71- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents28- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents

72- [GPT-5.4 nano](/api/docs/models/gpt-5.4-nano.md): Our cheapest GPT-5.4-class model for simple high-volume tasks

73- [GPT-5.4 Pro](/api/docs/models/gpt-5.4-pro.md): Version of GPT-5.4 that produces smarter and more precise responses.29- [GPT-5.4 Pro](/api/docs/models/gpt-5.4-pro.md): Version of GPT-5.4 that produces smarter and more precise responses.

74- [GPT-5.5](/api/docs/models/gpt-5.5.md): A new class of intelligence for coding and professional work.30- [GPT-5.5](/api/docs/models/gpt-5.5.md): A new class of intelligence for coding and professional work.

75- [GPT-5.5 Pro](/api/docs/models/gpt-5.5-pro.md): Version of GPT-5.5 that produces smarter and more precise responses.31- [GPT-5.5 Pro](/api/docs/models/gpt-5.5-pro.md): Version of GPT-5.5 that produces smarter and more precise responses.


82- [GPT-6 Sol](/api/docs/models/gpt-6-sol.md): Built to power complex coding and agentic workflows.38- [GPT-6 Sol](/api/docs/models/gpt-6-sol.md): Built to power complex coding and agentic workflows.

83- [GPT-6.1 Sol](/api/docs/models/gpt-6.1-sol.md): Near-Astra performance for complex work at a lower cost.39- [GPT-6.1 Sol](/api/docs/models/gpt-6.1-sol.md): Near-Astra performance for complex work at a lower cost.

84- [GPT-6.1 Terra](/api/docs/models/gpt-6.1-terra.md): A fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.40- [GPT-6.1 Terra](/api/docs/models/gpt-6.1-terra.md): A fast, efficient model for visual reasoning, precise computer use, and clear, natural writing.

85- [GPT-Audio](/api/docs/models/gpt-audio.md): For audio inputs and outputs with Chat Completions API

86- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): A cost-efficient version of GPT Audio

87- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.41- [GPT-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.

88- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Retired image generation model

89- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): A cost-efficient version of GPT Image 1

90- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Our previous image generation model

91- [GPT-Image-2](/api/docs/models/gpt-image-2.md): State-of-the-art image generation model42- [GPT-Image-2](/api/docs/models/gpt-image-2.md): State-of-the-art image generation model

92- [GPT-Image-2.5 Flare](/api/docs/models/gpt-image-2.5-flare.md): Fast, high-quality everyday image generation43- [GPT-Image-2.5 Flare](/api/docs/models/gpt-image-2.5-flare.md): Fast, high-quality everyday image generation

93- [GPT-Image-2.5 Sunburst](/api/docs/models/gpt-image-2.5-sunburst.md): Our most capable model for image generation and editing44- [GPT-Image-2.5 Sunburst](/api/docs/models/gpt-image-2.5-sunburst.md): Our most capable model for image generation and editing


95- [GPT-Live-Transcribe](/api/docs/models/gpt-live-transcribe.md): Low-latency speech-to-text model for realtime transcription46- [GPT-Live-Transcribe](/api/docs/models/gpt-live-transcribe.md): Low-latency speech-to-text model for realtime transcription

96- [gpt-oss-120b](/api/docs/models/gpt-oss-120b.md): Most powerful open-weight model, fits into an H100 GPU47- [gpt-oss-120b](/api/docs/models/gpt-oss-120b.md): Most powerful open-weight model, fits into an H100 GPU

97- [gpt-oss-20b](/api/docs/models/gpt-oss-20b.md): Medium-sized open-weight model for low latency48- [gpt-oss-20b](/api/docs/models/gpt-oss-20b.md): Medium-sized open-weight model for low latency

98- [GPT-Realtime](/api/docs/models/gpt-realtime.md): Model capable of realtime text and audio inputs and outputs

99- [GPT-Realtime Mini](/api/docs/models/gpt-realtime-mini.md): A cost-efficient version of GPT-Realtime

100- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out49- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out

101- [GPT-Realtime-2](/api/docs/models/gpt-realtime-2.md): Reasoning model with tool use50- [GPT-Realtime-2](/api/docs/models/gpt-realtime-2.md): Reasoning model with tool use

102- [GPT-Realtime-2.1](/api/docs/models/gpt-realtime-2.1.md): Reasoning model with tool use51- [GPT-Realtime-2.1](/api/docs/models/gpt-realtime-2.1.md): Reasoning model with tool use


104- [GPT-Realtime-Translate](/api/docs/models/gpt-realtime-translate.md): Streaming speech-to-speech translation model53- [GPT-Realtime-Translate](/api/docs/models/gpt-realtime-translate.md): Streaming speech-to-speech translation model

105- [GPT-Realtime-Whisper](/api/docs/models/gpt-realtime-whisper.md): Streaming speech-to-text model for realtime transcription54- [GPT-Realtime-Whisper](/api/docs/models/gpt-realtime-whisper.md): Streaming speech-to-text model for realtime transcription

106- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription55- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription

107- [o1](/api/docs/models/o1.md): Previous full o-series reasoning model

108- [o1 Preview](/api/docs/models/o1-preview.md): Preview of our first o-series reasoning model

109- [o1-mini](/api/docs/models/o1-mini.md): A small model alternative to o1

110- [o1-pro](/api/docs/models/o1-pro.md): Version of o1 with more compute for better responses

111- [o3](/api/docs/models/o3.md): Reasoning model for complex tasks, succeeded by GPT-5

112- [o3-deep-research](/api/docs/models/o3-deep-research.md): Our most powerful deep research model

113- [o3-mini](/api/docs/models/o3-mini.md): A small model alternative to o3

114- [o3-pro](/api/docs/models/o3-pro.md): Version of o3 with more compute for better responses

115- [o4-mini](/api/docs/models/o4-mini.md): Fast, cost-efficient reasoning model, succeeded by GPT-5 Mini

116- [o4-mini-deep-research](/api/docs/models/o4-mini-deep-research.md): Faster, more affordable deep research model

117- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images56- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images

118- [text-embedding-3-large](/api/docs/models/text-embedding-3-large.md): Most capable embedding model57- [text-embedding-3-large](/api/docs/models/text-embedding-3-large.md): Most capable embedding model

119- [text-embedding-3-small](/api/docs/models/text-embedding-3-small.md): Small embedding model58- [text-embedding-3-small](/api/docs/models/text-embedding-3-small.md): Small embedding model

120- [text-embedding-ada-002](/api/docs/models/text-embedding-ada-002.md): Older embedding model59- [text-embedding-ada-002](/api/docs/models/text-embedding-ada-002.md): Older embedding model

121- [text-moderation](/api/docs/models/text-moderation-latest.md): Previous generation text-only moderation model

122- [text-moderation-stable](/api/docs/models/text-moderation-stable.md): Previous generation text-only moderation model

123- [TTS-1](/api/docs/models/tts-1.md): Text-to-speech model optimized for speed

124- [TTS-1 HD](/api/docs/models/tts-1-hd.md): Text-to-speech model optimized for quality

125- [Whisper](/api/docs/models/whisper-1.md): General-purpose speech recognition model

126- [GPT-Rosalind](/api/docs/pricing#specialized-models): Life sciences reasoning for approved organizations. Model ID: `gpt-rosalind-research`.60- [GPT-Rosalind](/api/docs/pricing#specialized-models): Life sciences reasoning for approved organizations. Model ID: `gpt-rosalind-research`.

models/all.md +36 −31

Details

37- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out37- [GPT-Realtime-1.5](/api/docs/models/gpt-realtime-1.5.md): The best voice model for audio in, audio out

38- [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-Audio-1.5](/api/docs/models/gpt-audio-1.5.md): The best voice model for audio in, audio out with Chat Completions.

39- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription39- [GPT-Transcribe](/api/docs/models/gpt-transcribe.md): High-accuracy speech-to-text model for file and Realtime input transcription

40- [GPT-4o Transcribe](/api/docs/models/gpt-4o-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o

41- [GPT-4o Mini Transcribe](/api/docs/models/gpt-4o-mini-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o Mini

42- [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Deprecated. Transcription model that identifies who's speaking when

43- [Whisper](/api/docs/models/whisper-1.md): Deprecated. General-purpose speech recognition model

44- [GPT-4o Mini TTS](/api/docs/models/gpt-4o-mini-tts.md): Deprecated. Text-to-speech model powered by GPT-4o Mini

45 40 

46## OpenAI Daybreak41## OpenAI Daybreak

47 42 


85- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents80- [GPT-5.4 Mini](/api/docs/models/gpt-5.4-mini.md): Our strongest mini model yet for coding, computer use, and subagents

86- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort81- [GPT-5.2](/api/docs/models/gpt-5.2.md): Previous flagship model for professional work with configurable reasoning effort

87- [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.82- [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.

88- [GPT-5](/api/docs/models/gpt-5.md): Deprecated. Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort

89- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Deprecated. Strong intelligence for cost sensitive, low latency, high volume workloads

90- [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Deprecated. Fastest, most cost-efficient version of GPT-5

91- [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Deprecated. Version of GPT-5 that produces smarter and more precise responses

92- [o3-pro](/api/docs/models/o3-pro.md): Deprecated. Version of o3 with more compute for better responses

93- [o3](/api/docs/models/o3.md): Deprecated. Reasoning model for complex tasks, succeeded by GPT-5

94- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images83- [omni-moderation](/api/docs/models/omni-moderation-latest.md): Identify potentially harmful content in text and images

84 

85## ChatGPT models

86 

87Models used in ChatGPT, not recommended for API use.

88 

89- [Chat Latest](/api/docs/models/chat-latest.md): Latest Instant model used in ChatGPT

90 

91## Deprecated models

92 

93Includes models that have already shut down.

94 

95- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Deprecated. Our previous image generation model

96- [chatgpt-image-latest](/api/docs/models/chatgpt-image-latest.md): Deprecated. Previous image model used in ChatGPT.

97- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Shut down. Retired image generation model

98- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): Deprecated. A cost-efficient version of GPT Image 1

99- [GPT-Realtime](/api/docs/models/gpt-realtime.md): Deprecated. Model capable of realtime text and audio inputs and outputs

100- [GPT-Audio](/api/docs/models/gpt-audio.md): Deprecated. For audio inputs and outputs with Chat Completions API

101- [GPT-4o Transcribe](/api/docs/models/gpt-4o-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o

102- [GPT-4o Mini Transcribe](/api/docs/models/gpt-4o-mini-transcribe.md): Deprecated. Speech-to-text model powered by GPT-4o Mini

103- [GPT-4o Transcribe Diarize](/api/docs/models/gpt-4o-transcribe-diarize.md): Deprecated. Transcription model that identifies who's speaking when

104- [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 quality

106- [Whisper](/api/docs/models/whisper-1.md): Deprecated. General-purpose speech recognition model

107- [GPT-Realtime Mini](/api/docs/models/gpt-realtime-mini.md): Deprecated. A cost-efficient version of GPT-Realtime

108- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): Deprecated. A cost-efficient version of GPT Audio

109- [GPT-4o Audio](/api/docs/models/gpt-4o-audio-preview.md): Shut down. GPT-4o models capable of audio inputs and outputs

110- [GPT-4o Mini Audio](/api/docs/models/gpt-4o-mini-audio-preview.md): Shut down. Smaller model capable of audio inputs and outputs

111- [GPT-4o Realtime](/api/docs/models/gpt-4o-realtime-preview.md): Shut down. Model capable of realtime text and audio inputs and outputs

112- [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

113- [GPT-4o Mini TTS](/api/docs/models/gpt-4o-mini-tts.md): Deprecated. Text-to-speech model powered by GPT-4o Mini

95- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): Deprecated. An alias for advanced cybersecurity models for authorized vulnerability research and security testing.114- [Daybreak Red](/api/docs/models/gpt-daybreak-red-latest.md): Deprecated. An alias for advanced cybersecurity models for authorized vulnerability research and security testing.

96- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): Deprecated. An alias for flagship general-purpose models with safeguards for defensive cybersecurity work.115- [Daybreak Blue](/api/docs/models/gpt-daybreak-blue-latest.md): Deprecated. An alias for flagship general-purpose models with safeguards for defensive cybersecurity work.

97- [GPT-5.4 nano](/api/docs/models/gpt-5.4-nano.md): Deprecated. Our cheapest GPT-5.4-class model for simple high-volume tasks116- [GPT-5.4 nano](/api/docs/models/gpt-5.4-nano.md): Deprecated. Our cheapest GPT-5.4-class model for simple high-volume tasks

98- [GPT-5.3-Codex](/api/docs/models/gpt-5.3-codex.md): Deprecated. The most capable agentic coding model to date.117- [GPT-5.3-Codex](/api/docs/models/gpt-5.3-codex.md): Deprecated. The most capable agentic coding model to date.

99- [GPT-5.1](/api/docs/models/gpt-5.1.md): Deprecated. The best model for coding and agentic tasks with configurable reasoning effort118- [GPT-5.1](/api/docs/models/gpt-5.1.md): Deprecated. The best model for coding and agentic tasks with configurable reasoning effort

100- [GPT-Realtime](/api/docs/models/gpt-realtime.md): Deprecated. Model capable of realtime text and audio inputs and outputs119- [GPT-5](/api/docs/models/gpt-5.md): Deprecated. Previous intelligent reasoning model for coding and agentic tasks with configurable reasoning effort

101- [GPT-Audio](/api/docs/models/gpt-audio.md): Deprecated. For audio inputs and outputs with Chat Completions API120- [GPT-5 Mini](/api/docs/models/gpt-5-mini.md): Deprecated. Strong intelligence for cost sensitive, low latency, high volume workloads

121- [GPT-5 nano](/api/docs/models/gpt-5-nano.md): Deprecated. Fastest, most cost-efficient version of GPT-5

122- [GPT-5 Pro](/api/docs/models/gpt-5-pro.md): Deprecated. Version of GPT-5 that produces smarter and more precise responses

123- [o3-pro](/api/docs/models/o3-pro.md): Deprecated. Version of o3 with more compute for better responses

124- [o3](/api/docs/models/o3.md): Deprecated. Reasoning model for complex tasks, succeeded by GPT-5

102- [GPT-4.1](/api/docs/models/gpt-4.1.md): Deprecated. Smartest non-reasoning model125- [GPT-4.1](/api/docs/models/gpt-4.1.md): Deprecated. Smartest non-reasoning model

103- [GPT-4.1 Mini](/api/docs/models/gpt-4.1-mini.md): Deprecated. Smaller, faster version of GPT-4.1126- [GPT-4.1 Mini](/api/docs/models/gpt-4.1-mini.md): Deprecated. Smaller, faster version of GPT-4.1

104- [GPT-4o Mini](/api/docs/models/gpt-4o-mini.md): Deprecated. Fast, affordable small model for focused tasks127- [GPT-4o Mini](/api/docs/models/gpt-4o-mini.md): Deprecated. Fast, affordable small model for focused tasks

105- [TTS-1](/api/docs/models/tts-1.md): Deprecated. Text-to-speech model optimized for speed

106- [TTS-1 HD](/api/docs/models/tts-1-hd.md): Deprecated. Text-to-speech model optimized for quality

107- [GPT-5.3 Chat](/api/docs/models/gpt-5.3-chat-latest.md): Shut down. GPT-5.3 Instant model used in ChatGPT128- [GPT-5.3 Chat](/api/docs/models/gpt-5.3-chat-latest.md): Shut down. GPT-5.3 Instant model used in ChatGPT

108- [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): Shut down. GPT-5.2 model used in ChatGPT129- [GPT-5.2 Chat](/api/docs/models/gpt-5.2-chat-latest.md): Shut down. GPT-5.2 model used in ChatGPT

109- [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.130- [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.

110- [GPT-Image-1.5](/api/docs/models/gpt-image-1.5.md): Deprecated. Our previous image generation model

111- [chatgpt-image-latest](/api/docs/models/chatgpt-image-latest.md): Deprecated. Previous image model used in ChatGPT.

112- [GPT-Image-1 Mini](/api/docs/models/gpt-image-1-mini.md): Deprecated. A cost-efficient version of GPT Image 1

113- [GPT-Image-1](/api/docs/models/gpt-image-1.md): Shut down. Retired image generation model

114- [o3-deep-research](/api/docs/models/o3-deep-research.md): Shut down. Our most powerful deep research model131- [o3-deep-research](/api/docs/models/o3-deep-research.md): Shut down. Our most powerful deep research model

115- [o4-mini-deep-research](/api/docs/models/o4-mini-deep-research.md): Shut down. Faster, more affordable deep research model132- [o4-mini-deep-research](/api/docs/models/o4-mini-deep-research.md): Shut down. Faster, more affordable deep research model

116- [GPT-4.1 nano](/api/docs/models/gpt-4.1-nano.md): Shut down. Fastest, most cost-efficient version of GPT-4.1133- [GPT-4.1 nano](/api/docs/models/gpt-4.1-nano.md): Shut down. Fastest, most cost-efficient version of GPT-4.1

117- [o4-mini](/api/docs/models/o4-mini.md): Shut down. Fast, cost-efficient reasoning model, succeeded by GPT-5 Mini134- [o4-mini](/api/docs/models/o4-mini.md): Shut down. Fast, cost-efficient reasoning model, succeeded by GPT-5 Mini

118- [o1-pro](/api/docs/models/o1-pro.md): Shut down. Version of o1 with more compute for better responses135- [o1-pro](/api/docs/models/o1-pro.md): Shut down. Version of o1 with more compute for better responses

119- [computer-use-preview](/api/docs/models/computer-use-preview.md): Shut down. Specialized model for computer use tool136- [computer-use-preview](/api/docs/models/computer-use-preview.md): Shut down. Specialized model for computer use tool

120- [GPT-Realtime Mini](/api/docs/models/gpt-realtime-mini.md): Deprecated. A cost-efficient version of GPT-Realtime

121- [GPT-Audio Mini](/api/docs/models/gpt-audio-mini.md): Deprecated. A cost-efficient version of GPT Audio

122- [GPT-4o Mini Search Preview](/api/docs/models/gpt-4o-mini-search-preview.md): Shut down. Fast, affordable small model for web search137- [GPT-4o Mini Search Preview](/api/docs/models/gpt-4o-mini-search-preview.md): Shut down. Fast, affordable small model for web search

123- [GPT-4o Search Preview](/api/docs/models/gpt-4o-search-preview.md): Shut down. GPT model for web search in Chat Completions138- [GPT-4o Search Preview](/api/docs/models/gpt-4o-search-preview.md): Shut down. GPT model for web search in Chat Completions

124- [GPT-4.5 Preview](/api/docs/models/gpt-4.5-preview.md): Shut down. Deprecated large model.139- [GPT-4.5 Preview](/api/docs/models/gpt-4.5-preview.md): Shut down. Deprecated large model.


127- [o1-mini](/api/docs/models/o1-mini.md): Shut down. A small model alternative to o1142- [o1-mini](/api/docs/models/o1-mini.md): Shut down. A small model alternative to o1

128- [o1 Preview](/api/docs/models/o1-preview.md): Shut down. Preview of our first o-series reasoning model143- [o1 Preview](/api/docs/models/o1-preview.md): Shut down. Preview of our first o-series reasoning model

129- [GPT-4o](/api/docs/models/gpt-4o.md): Deprecated. Fast, intelligent, flexible GPT model144- [GPT-4o](/api/docs/models/gpt-4o.md): Deprecated. Fast, intelligent, flexible GPT model

130- [GPT-4o Audio](/api/docs/models/gpt-4o-audio-preview.md): Shut down. GPT-4o models capable of audio inputs and outputs

131- [GPT-4o Mini Audio](/api/docs/models/gpt-4o-mini-audio-preview.md): Shut down. Smaller model capable of audio inputs and outputs

132- [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

133- [GPT-4o Realtime](/api/docs/models/gpt-4o-realtime-preview.md): Shut down. Model capable of realtime text and audio inputs and outputs

134- [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): Shut down. An older high-intelligence GPT model145- [GPT-4 Turbo](/api/docs/models/gpt-4-turbo.md): Shut down. An older high-intelligence GPT model

135- [babbage-002](/api/docs/models/babbage-002.md): Shut down. Replacement for the GPT-3 ada and babbage base models146- [babbage-002](/api/docs/models/babbage-002.md): Shut down. Replacement for the GPT-3 ada and babbage base models

136- [ChatGPT-4o](/api/docs/models/chatgpt-4o-latest.md): Shut down. GPT-4o model used in ChatGPT147- [ChatGPT-4o](/api/docs/models/chatgpt-4o-latest.md): Shut down. GPT-4o model used in ChatGPT


148- [text-moderation](/api/docs/models/text-moderation-latest.md): Shut down. Previous generation text-only moderation model159- [text-moderation](/api/docs/models/text-moderation-latest.md): Shut down. Previous generation text-only moderation model

149- [text-moderation-stable](/api/docs/models/text-moderation-stable.md): Shut down. Previous generation text-only moderation model160- [text-moderation-stable](/api/docs/models/text-moderation-stable.md): Shut down. Previous generation text-only moderation model

150 161 

151## ChatGPT models

152 

153Models used in ChatGPT, not recommended for API use.

154 

155- [Chat Latest](/api/docs/models/chat-latest.md): Latest Instant model used in ChatGPT

156 

157[How we use your data](/api/docs/guides/your-data.md) · [Deprecated models](/api/docs/deprecations.md)162[How we use your data](/api/docs/guides/your-data.md) · [Deprecated models](/api/docs/deprecations.md)

quickstart.md +2 −2

Details

151 151 

152In collaboration with Microsoft, OpenAI provides an officially supported API client for C#. You can install it with the .NET CLI from [NuGet](https://www.nuget.org/).152In collaboration with Microsoft, OpenAI provides an officially supported API client for C#. You can install it with the .NET CLI from [NuGet](https://www.nuget.org/).

153 153 

154```154```bash

155dotnet add package OpenAI155dotnet add package OpenAI

156```156```

157 157 


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.95.0</version>193 <version>4.96.0</version>

194</dependency>194</dependency>

195```195```

196 196