SpyBara
Go Premium

Reference 2026-06-12 00:01 UTC to 2026-06-16 21:57 UTC

81 files changed +10,373 −32. View all changes and history on the product overview
2026
Fri 26 17:57 Wed 17 18:02 Tue 16 21:57 Fri 12 00:01 Wed 10 15:48 Tue 9 06:34 Fri 5 06:45 Thu 4 06:52 Tue 2 06:51

cli/resources/$shared/index.md +950 −0 created

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `all_models: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

8 

9 - `union_member_0: string`

10 

11 - `chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more`

12 

13 - `"gpt-5.4"`

14 

15 - `"gpt-5.4-mini"`

16 

17 - `"gpt-5.4-nano"`

18 

19 - `"gpt-5.4-mini-2026-03-17"`

20 

21 - `"gpt-5.4-nano-2026-03-17"`

22 

23 - `"gpt-5.3-chat-latest"`

24 

25 - `"gpt-5.2"`

26 

27 - `"gpt-5.2-2025-12-11"`

28 

29 - `"gpt-5.2-chat-latest"`

30 

31 - `"gpt-5.2-pro"`

32 

33 - `"gpt-5.2-pro-2025-12-11"`

34 

35 - `"gpt-5.1"`

36 

37 - `"gpt-5.1-2025-11-13"`

38 

39 - `"gpt-5.1-codex"`

40 

41 - `"gpt-5.1-mini"`

42 

43 - `"gpt-5.1-chat-latest"`

44 

45 - `"gpt-5"`

46 

47 - `"gpt-5-mini"`

48 

49 - `"gpt-5-nano"`

50 

51 - `"gpt-5-2025-08-07"`

52 

53 - `"gpt-5-mini-2025-08-07"`

54 

55 - `"gpt-5-nano-2025-08-07"`

56 

57 - `"gpt-5-chat-latest"`

58 

59 - `"gpt-4.1"`

60 

61 - `"gpt-4.1-mini"`

62 

63 - `"gpt-4.1-nano"`

64 

65 - `"gpt-4.1-2025-04-14"`

66 

67 - `"gpt-4.1-mini-2025-04-14"`

68 

69 - `"gpt-4.1-nano-2025-04-14"`

70 

71 - `"o4-mini"`

72 

73 - `"o4-mini-2025-04-16"`

74 

75 - `"o3"`

76 

77 - `"o3-2025-04-16"`

78 

79 - `"o3-mini"`

80 

81 - `"o3-mini-2025-01-31"`

82 

83 - `"o1"`

84 

85 - `"o1-2024-12-17"`

86 

87 - `"o1-preview"`

88 

89 - `"o1-preview-2024-09-12"`

90 

91 - `"o1-mini"`

92 

93 - `"o1-mini-2024-09-12"`

94 

95 - `"gpt-4o"`

96 

97 - `"gpt-4o-2024-11-20"`

98 

99 - `"gpt-4o-2024-08-06"`

100 

101 - `"gpt-4o-2024-05-13"`

102 

103 - `"gpt-4o-audio-preview"`

104 

105 - `"gpt-4o-audio-preview-2024-10-01"`

106 

107 - `"gpt-4o-audio-preview-2024-12-17"`

108 

109 - `"gpt-4o-audio-preview-2025-06-03"`

110 

111 - `"gpt-4o-mini-audio-preview"`

112 

113 - `"gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `"gpt-4o-search-preview"`

116 

117 - `"gpt-4o-mini-search-preview"`

118 

119 - `"gpt-4o-search-preview-2025-03-11"`

120 

121 - `"gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `"chatgpt-4o-latest"`

124 

125 - `"codex-mini-latest"`

126 

127 - `"gpt-4o-mini"`

128 

129 - `"gpt-4o-mini-2024-07-18"`

130 

131 - `"gpt-4-turbo"`

132 

133 - `"gpt-4-turbo-2024-04-09"`

134 

135 - `"gpt-4-0125-preview"`

136 

137 - `"gpt-4-turbo-preview"`

138 

139 - `"gpt-4-1106-preview"`

140 

141 - `"gpt-4-vision-preview"`

142 

143 - `"gpt-4"`

144 

145 - `"gpt-4-0314"`

146 

147 - `"gpt-4-0613"`

148 

149 - `"gpt-4-32k"`

150 

151 - `"gpt-4-32k-0314"`

152 

153 - `"gpt-4-32k-0613"`

154 

155 - `"gpt-3.5-turbo"`

156 

157 - `"gpt-3.5-turbo-16k"`

158 

159 - `"gpt-3.5-turbo-0301"`

160 

161 - `"gpt-3.5-turbo-0613"`

162 

163 - `"gpt-3.5-turbo-1106"`

164 

165 - `"gpt-3.5-turbo-0125"`

166 

167 - `"gpt-3.5-turbo-16k-0613"`

168 

169 - `ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

170 

171 - `"o1-pro"`

172 

173 - `"o1-pro-2025-03-19"`

174 

175 - `"o3-pro"`

176 

177 - `"o3-pro-2025-06-10"`

178 

179 - `"o3-deep-research"`

180 

181 - `"o3-deep-research-2025-06-26"`

182 

183 - `"o4-mini-deep-research"`

184 

185 - `"o4-mini-deep-research-2025-06-26"`

186 

187 - `"computer-use-preview"`

188 

189 - `"computer-use-preview-2025-03-11"`

190 

191 - `"gpt-5-codex"`

192 

193 - `"gpt-5-pro"`

194 

195 - `"gpt-5-pro-2025-10-06"`

196 

197 - `"gpt-5.1-codex-max"`

198 

199### Chat Model

200 

201- `chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more`

202 

203 - `"gpt-5.4"`

204 

205 - `"gpt-5.4-mini"`

206 

207 - `"gpt-5.4-nano"`

208 

209 - `"gpt-5.4-mini-2026-03-17"`

210 

211 - `"gpt-5.4-nano-2026-03-17"`

212 

213 - `"gpt-5.3-chat-latest"`

214 

215 - `"gpt-5.2"`

216 

217 - `"gpt-5.2-2025-12-11"`

218 

219 - `"gpt-5.2-chat-latest"`

220 

221 - `"gpt-5.2-pro"`

222 

223 - `"gpt-5.2-pro-2025-12-11"`

224 

225 - `"gpt-5.1"`

226 

227 - `"gpt-5.1-2025-11-13"`

228 

229 - `"gpt-5.1-codex"`

230 

231 - `"gpt-5.1-mini"`

232 

233 - `"gpt-5.1-chat-latest"`

234 

235 - `"gpt-5"`

236 

237 - `"gpt-5-mini"`

238 

239 - `"gpt-5-nano"`

240 

241 - `"gpt-5-2025-08-07"`

242 

243 - `"gpt-5-mini-2025-08-07"`

244 

245 - `"gpt-5-nano-2025-08-07"`

246 

247 - `"gpt-5-chat-latest"`

248 

249 - `"gpt-4.1"`

250 

251 - `"gpt-4.1-mini"`

252 

253 - `"gpt-4.1-nano"`

254 

255 - `"gpt-4.1-2025-04-14"`

256 

257 - `"gpt-4.1-mini-2025-04-14"`

258 

259 - `"gpt-4.1-nano-2025-04-14"`

260 

261 - `"o4-mini"`

262 

263 - `"o4-mini-2025-04-16"`

264 

265 - `"o3"`

266 

267 - `"o3-2025-04-16"`

268 

269 - `"o3-mini"`

270 

271 - `"o3-mini-2025-01-31"`

272 

273 - `"o1"`

274 

275 - `"o1-2024-12-17"`

276 

277 - `"o1-preview"`

278 

279 - `"o1-preview-2024-09-12"`

280 

281 - `"o1-mini"`

282 

283 - `"o1-mini-2024-09-12"`

284 

285 - `"gpt-4o"`

286 

287 - `"gpt-4o-2024-11-20"`

288 

289 - `"gpt-4o-2024-08-06"`

290 

291 - `"gpt-4o-2024-05-13"`

292 

293 - `"gpt-4o-audio-preview"`

294 

295 - `"gpt-4o-audio-preview-2024-10-01"`

296 

297 - `"gpt-4o-audio-preview-2024-12-17"`

298 

299 - `"gpt-4o-audio-preview-2025-06-03"`

300 

301 - `"gpt-4o-mini-audio-preview"`

302 

303 - `"gpt-4o-mini-audio-preview-2024-12-17"`

304 

305 - `"gpt-4o-search-preview"`

306 

307 - `"gpt-4o-mini-search-preview"`

308 

309 - `"gpt-4o-search-preview-2025-03-11"`

310 

311 - `"gpt-4o-mini-search-preview-2025-03-11"`

312 

313 - `"chatgpt-4o-latest"`

314 

315 - `"codex-mini-latest"`

316 

317 - `"gpt-4o-mini"`

318 

319 - `"gpt-4o-mini-2024-07-18"`

320 

321 - `"gpt-4-turbo"`

322 

323 - `"gpt-4-turbo-2024-04-09"`

324 

325 - `"gpt-4-0125-preview"`

326 

327 - `"gpt-4-turbo-preview"`

328 

329 - `"gpt-4-1106-preview"`

330 

331 - `"gpt-4-vision-preview"`

332 

333 - `"gpt-4"`

334 

335 - `"gpt-4-0314"`

336 

337 - `"gpt-4-0613"`

338 

339 - `"gpt-4-32k"`

340 

341 - `"gpt-4-32k-0314"`

342 

343 - `"gpt-4-32k-0613"`

344 

345 - `"gpt-3.5-turbo"`

346 

347 - `"gpt-3.5-turbo-16k"`

348 

349 - `"gpt-3.5-turbo-0301"`

350 

351 - `"gpt-3.5-turbo-0613"`

352 

353 - `"gpt-3.5-turbo-1106"`

354 

355 - `"gpt-3.5-turbo-0125"`

356 

357 - `"gpt-3.5-turbo-16k-0613"`

358 

359### Comparison Filter

360 

361- `comparison_filter: object { key, type, value }`

362 

363 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

364 

365 - `key: string`

366 

367 The key to compare against the value.

368 

369 - `type: "eq" or "ne" or "gt" or 5 more`

370 

371 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

372 

373 - `eq`: equals

374 - `ne`: not equal

375 - `gt`: greater than

376 - `gte`: greater than or equal

377 - `lt`: less than

378 - `lte`: less than or equal

379 - `in`: in

380 - `nin`: not in

381 

382 - `"eq"`

383 

384 - `"ne"`

385 

386 - `"gt"`

387 

388 - `"gte"`

389 

390 - `"lt"`

391 

392 - `"lte"`

393 

394 - `"in"`

395 

396 - `"nin"`

397 

398 - `value: string or number or boolean or array of string or number`

399 

400 The value to compare against the attribute key; supports string, number, or boolean types.

401 

402 - `union_member_0: string`

403 

404 - `union_member_1: number`

405 

406 - `union_member_2: boolean`

407 

408 - `union_member_3: array of string or number`

409 

410 - `union_member_0: string`

411 

412 - `union_member_1: number`

413 

414### Compound Filter

415 

416- `compound_filter: object { filters, type }`

417 

418 Combine multiple filters using `and` or `or`.

419 

420 - `filters: array of ComparisonFilter or unknown`

421 

422 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

423 

424 - `comparison_filter: object { key, type, value }`

425 

426 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

427 

428 - `key: string`

429 

430 The key to compare against the value.

431 

432 - `type: "eq" or "ne" or "gt" or 5 more`

433 

434 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

435 

436 - `eq`: equals

437 - `ne`: not equal

438 - `gt`: greater than

439 - `gte`: greater than or equal

440 - `lt`: less than

441 - `lte`: less than or equal

442 - `in`: in

443 - `nin`: not in

444 

445 - `"eq"`

446 

447 - `"ne"`

448 

449 - `"gt"`

450 

451 - `"gte"`

452 

453 - `"lt"`

454 

455 - `"lte"`

456 

457 - `"in"`

458 

459 - `"nin"`

460 

461 - `value: string or number or boolean or array of string or number`

462 

463 The value to compare against the attribute key; supports string, number, or boolean types.

464 

465 - `union_member_0: string`

466 

467 - `union_member_1: number`

468 

469 - `union_member_2: boolean`

470 

471 - `union_member_3: array of string or number`

472 

473 - `union_member_0: string`

474 

475 - `union_member_1: number`

476 

477 - `union_member_1: unknown`

478 

479 - `type: "and" or "or"`

480 

481 Type of operation: `and` or `or`.

482 

483 - `"and"`

484 

485 - `"or"`

486 

487### Custom Tool Input Format

488 

489- `custom_tool_input_format: object { type } or object { definition, syntax, type }`

490 

491 The input format for the custom tool. Default is unconstrained text.

492 

493 - `text: object { type }`

494 

495 Unconstrained free-form text.

496 

497 - `grammar: object { definition, syntax, type }`

498 

499 A grammar defined by the user.

500 

501 - `definition: string`

502 

503 The grammar definition.

504 

505 - `syntax: "lark" or "regex"`

506 

507 The syntax of the grammar definition. One of `lark` or `regex`.

508 

509 - `"lark"`

510 

511 - `"regex"`

512 

513 - `type: "grammar"`

514 

515 Grammar format. Always `grammar`.

516 

517### Error Object

518 

519- `error_object: object { code, message, param, type }`

520 

521 - `code: string`

522 

523 - `message: string`

524 

525 - `param: string`

526 

527 - `type: string`

528 

529### Function Definition

530 

531- `function_definition: object { name, description, parameters, strict }`

532 

533 - `name: string`

534 

535 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

536 

537 - `description: optional string`

538 

539 A description of what the function does, used by the model to choose when and how to call the function.

540 

541 - `parameters: optional map[unknown]`

542 

543 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

544 

545 Omitting `parameters` defines a function with an empty parameter list.

546 

547 - `strict: optional boolean`

548 

549 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).

550 

551### Function Parameters

552 

553- `function_parameters: map[unknown]`

554 

555 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

556 

557 Omitting `parameters` defines a function with an empty parameter list.

558 

559### Metadata

560 

561- `metadata: map[string]`

562 

563 Set of 16 key-value pairs that can be attached to an object. This can be

564 useful for storing additional information about the object in a structured

565 format, and querying for objects via API or the dashboard.

566 

567 Keys are strings with a maximum length of 64 characters. Values are strings

568 with a maximum length of 512 characters.

569 

570### Reasoning

571 

572- `reasoning: object { context, effort, generate_summary, summary }`

573 

574 **gpt-5 and o-series models only**

575 

576 Configuration options for

577 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

578 

579 - `context: optional "auto" or "current_turn" or "all_turns"`

580 

581 Controls which reasoning items are rendered back to the model on later turns.

582 When returned on a response, this is the effective reasoning context mode

583 used for the response.

584 

585 - `"auto"`

586 

587 - `"current_turn"`

588 

589 - `"all_turns"`

590 

591 - `effort: optional "none" or "minimal" or "low" or 3 more`

592 

593 Constrains effort on reasoning for

594 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

595 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

596 reasoning effort can result in faster responses and fewer tokens used

597 on reasoning in a response.

598 

599 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

600 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

601 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

602 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

603 

604 - `"none"`

605 

606 - `"minimal"`

607 

608 - `"low"`

609 

610 - `"medium"`

611 

612 - `"high"`

613 

614 - `"xhigh"`

615 

616 - `generate_summary: optional "auto" or "concise" or "detailed"`

617 

618 **Deprecated:** use `summary` instead.

619 

620 A summary of the reasoning performed by the model. This can be

621 useful for debugging and understanding the model's reasoning process.

622 One of `auto`, `concise`, or `detailed`.

623 

624 - `"auto"`

625 

626 - `"concise"`

627 

628 - `"detailed"`

629 

630 - `summary: optional "auto" or "concise" or "detailed"`

631 

632 A summary of the reasoning performed by the model. This can be

633 useful for debugging and understanding the model's reasoning process.

634 One of `auto`, `concise`, or `detailed`.

635 

636 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

637 

638 - `"auto"`

639 

640 - `"concise"`

641 

642 - `"detailed"`

643 

644### Reasoning Effort

645 

646- `reasoning_effort: "none" or "minimal" or "low" or 3 more`

647 

648 Constrains effort on reasoning for

649 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

650 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

651 reasoning effort can result in faster responses and fewer tokens used

652 on reasoning in a response.

653 

654 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

655 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

656 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

657 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

658 

659 - `"none"`

660 

661 - `"minimal"`

662 

663 - `"low"`

664 

665 - `"medium"`

666 

667 - `"high"`

668 

669 - `"xhigh"`

670 

671### Response Format JSON Object

672 

673- `response_format_json_object: object { type }`

674 

675 JSON object response format. An older method of generating JSON responses.

676 Using `json_schema` is recommended for models that support it. Note that the

677 model will not generate JSON without a system or user message instructing it

678 to do so.

679 

680 - `type: "json_object"`

681 

682 The type of response format being defined. Always `json_object`.

683 

684### Response Format JSON Schema

685 

686- `response_format_json_schema: object { json_schema, type }`

687 

688 JSON Schema response format. Used to generate structured JSON responses.

689 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

690 

691 - `json_schema: object { name, description, schema, strict }`

692 

693 Structured Outputs configuration options, including a JSON Schema.

694 

695 - `name: string`

696 

697 The name of the response format. Must be a-z, A-Z, 0-9, or contain

698 underscores and dashes, with a maximum length of 64.

699 

700 - `description: optional string`

701 

702 A description of what the response format is for, used by the model to

703 determine how to respond in the format.

704 

705 - `schema: optional map[unknown]`

706 

707 The schema for the response format, described as a JSON Schema object.

708 Learn how to build JSON schemas [here](https://json-schema.org/).

709 

710 - `strict: optional boolean`

711 

712 Whether to enable strict schema adherence when generating the output.

713 If set to true, the model will always follow the exact schema defined

714 in the `schema` field. Only a subset of JSON Schema is supported when

715 `strict` is `true`. To learn more, read the [Structured Outputs

716 guide](https://platform.openai.com/docs/guides/structured-outputs).

717 

718 - `type: "json_schema"`

719 

720 The type of response format being defined. Always `json_schema`.

721 

722### Response Format Text

723 

724- `response_format_text: object { type }`

725 

726 Default response format. Used to generate text responses.

727 

728 - `type: "text"`

729 

730 The type of response format being defined. Always `text`.

731 

732### Response Format Text Grammar

733 

734- `response_format_text_grammar: object { grammar, type }`

735 

736 A custom grammar for the model to follow when generating text.

737 Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).

738 

739 - `grammar: string`

740 

741 The custom grammar for the model to follow.

742 

743 - `type: "grammar"`

744 

745 The type of response format being defined. Always `grammar`.

746 

747### Response Format Text Python

748 

749- `response_format_text_python: object { type }`

750 

751 Configure the model to generate valid Python code. See the

752 [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details.

753 

754 - `type: "python"`

755 

756 The type of response format being defined. Always `python`.

757 

758### Responses Model

759 

760- `responses_model: string or ChatModel or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

761 

762 - `union_member_0: string`

763 

764 - `chat_model: "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more`

765 

766 - `"gpt-5.4"`

767 

768 - `"gpt-5.4-mini"`

769 

770 - `"gpt-5.4-nano"`

771 

772 - `"gpt-5.4-mini-2026-03-17"`

773 

774 - `"gpt-5.4-nano-2026-03-17"`

775 

776 - `"gpt-5.3-chat-latest"`

777 

778 - `"gpt-5.2"`

779 

780 - `"gpt-5.2-2025-12-11"`

781 

782 - `"gpt-5.2-chat-latest"`

783 

784 - `"gpt-5.2-pro"`

785 

786 - `"gpt-5.2-pro-2025-12-11"`

787 

788 - `"gpt-5.1"`

789 

790 - `"gpt-5.1-2025-11-13"`

791 

792 - `"gpt-5.1-codex"`

793 

794 - `"gpt-5.1-mini"`

795 

796 - `"gpt-5.1-chat-latest"`

797 

798 - `"gpt-5"`

799 

800 - `"gpt-5-mini"`

801 

802 - `"gpt-5-nano"`

803 

804 - `"gpt-5-2025-08-07"`

805 

806 - `"gpt-5-mini-2025-08-07"`

807 

808 - `"gpt-5-nano-2025-08-07"`

809 

810 - `"gpt-5-chat-latest"`

811 

812 - `"gpt-4.1"`

813 

814 - `"gpt-4.1-mini"`

815 

816 - `"gpt-4.1-nano"`

817 

818 - `"gpt-4.1-2025-04-14"`

819 

820 - `"gpt-4.1-mini-2025-04-14"`

821 

822 - `"gpt-4.1-nano-2025-04-14"`

823 

824 - `"o4-mini"`

825 

826 - `"o4-mini-2025-04-16"`

827 

828 - `"o3"`

829 

830 - `"o3-2025-04-16"`

831 

832 - `"o3-mini"`

833 

834 - `"o3-mini-2025-01-31"`

835 

836 - `"o1"`

837 

838 - `"o1-2024-12-17"`

839 

840 - `"o1-preview"`

841 

842 - `"o1-preview-2024-09-12"`

843 

844 - `"o1-mini"`

845 

846 - `"o1-mini-2024-09-12"`

847 

848 - `"gpt-4o"`

849 

850 - `"gpt-4o-2024-11-20"`

851 

852 - `"gpt-4o-2024-08-06"`

853 

854 - `"gpt-4o-2024-05-13"`

855 

856 - `"gpt-4o-audio-preview"`

857 

858 - `"gpt-4o-audio-preview-2024-10-01"`

859 

860 - `"gpt-4o-audio-preview-2024-12-17"`

861 

862 - `"gpt-4o-audio-preview-2025-06-03"`

863 

864 - `"gpt-4o-mini-audio-preview"`

865 

866 - `"gpt-4o-mini-audio-preview-2024-12-17"`

867 

868 - `"gpt-4o-search-preview"`

869 

870 - `"gpt-4o-mini-search-preview"`

871 

872 - `"gpt-4o-search-preview-2025-03-11"`

873 

874 - `"gpt-4o-mini-search-preview-2025-03-11"`

875 

876 - `"chatgpt-4o-latest"`

877 

878 - `"codex-mini-latest"`

879 

880 - `"gpt-4o-mini"`

881 

882 - `"gpt-4o-mini-2024-07-18"`

883 

884 - `"gpt-4-turbo"`

885 

886 - `"gpt-4-turbo-2024-04-09"`

887 

888 - `"gpt-4-0125-preview"`

889 

890 - `"gpt-4-turbo-preview"`

891 

892 - `"gpt-4-1106-preview"`

893 

894 - `"gpt-4-vision-preview"`

895 

896 - `"gpt-4"`

897 

898 - `"gpt-4-0314"`

899 

900 - `"gpt-4-0613"`

901 

902 - `"gpt-4-32k"`

903 

904 - `"gpt-4-32k-0314"`

905 

906 - `"gpt-4-32k-0613"`

907 

908 - `"gpt-3.5-turbo"`

909 

910 - `"gpt-3.5-turbo-16k"`

911 

912 - `"gpt-3.5-turbo-0301"`

913 

914 - `"gpt-3.5-turbo-0613"`

915 

916 - `"gpt-3.5-turbo-1106"`

917 

918 - `"gpt-3.5-turbo-0125"`

919 

920 - `"gpt-3.5-turbo-16k-0613"`

921 

922 - `ResponsesOnlyModel: "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

923 

924 - `"o1-pro"`

925 

926 - `"o1-pro-2025-03-19"`

927 

928 - `"o3-pro"`

929 

930 - `"o3-pro-2025-06-10"`

931 

932 - `"o3-deep-research"`

933 

934 - `"o3-deep-research-2025-06-26"`

935 

936 - `"o4-mini-deep-research"`

937 

938 - `"o4-mini-deep-research-2025-06-26"`

939 

940 - `"computer-use-preview"`

941 

942 - `"computer-use-preview-2025-03-11"`

943 

944 - `"gpt-5-codex"`

945 

946 - `"gpt-5-pro"`

947 

948 - `"gpt-5-pro-2025-10-06"`

949 

950 - `"gpt-5.1-codex-max"`

Details

10 10 

11- `--name: string`11- `--name: string`

12 12 

13- `--expires-in-seconds: optional number`

14 

15 The number of seconds until the API key expires. Omit this field for a key that does not expire.

16 

13### Returns17### Returns

14 18 

15- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`19- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`


34{38{

35 "id": "key_abc",39 "id": "key_abc",

36 "created_at": 1711471533,40 "created_at": 1711471533,

41 "expires_at": 1714063533,

37 "object": "organization.admin_api_key",42 "object": "organization.admin_api_key",

38 "owner": {43 "owner": {

39 "id": "sa_456",44 "id": "sa_456",

Details

1## List all organization and project API keys.

2 

3`$ openai admin:organization:admin-api-keys list`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `--after: optional string`

12 

13 Return keys with IDs that come after this ID in the pagination order.

14 

15- `--limit: optional number`

16 

17 Maximum number of keys to return.

18 

19- `--order: optional "asc" or "desc"`

20 

21 Order results by creation time, ascending or descending.

22 

23### Returns

24 

25- `ApiKeyList: object { data, has_more, object, 2 more }`

26 

27 - `data: array of AdminAPIKey`

28 

29 - `id: string`

30 

31 The identifier, which can be referenced in API endpoints

32 

33 - `created_at: number`

34 

35 The Unix timestamp (in seconds) of when the API key was created

36 

37 - `expires_at: number`

38 

39 The Unix timestamp (in seconds) of when the API key expires

40 

41 - `object: "organization.admin_api_key"`

42 

43 The object type, which is always `organization.admin_api_key`

44 

45 - `owner: object { id, created_at, name, 3 more }`

46 

47 - `id: optional string`

48 

49 The identifier, which can be referenced in API endpoints

50 

51 - `created_at: optional number`

52 

53 The Unix timestamp (in seconds) of when the user was created

54 

55 - `name: optional string`

56 

57 The name of the user

58 

59 - `object: optional string`

60 

61 The object type, which is always organization.user

62 

63 - `role: optional string`

64 

65 Always `owner`

66 

67 - `type: optional string`

68 

69 Always `user`

70 

71 - `redacted_value: string`

72 

73 The redacted value of the API key

74 

75 - `last_used_at: optional number`

76 

77 The Unix timestamp (in seconds) of when the API key was last used

78 

79 - `name: optional string`

80 

81 The name of the API key

82 

83 - `has_more: boolean`

84 

85 - `object: "list"`

86 

87 - `first_id: optional string`

88 

89 - `last_id: optional string`

90 

91### Example

92 

93```cli

94openai admin:organization:admin-api-keys list \

95 --admin-api-key 'My Admin API Key'

96```

97 

98#### Response

99 

100```json

101{

102 "data": [

103 {

104 "id": "key_abc",

105 "created_at": 1711471533,

106 "expires_at": 1714063533,

107 "object": "organization.admin_api_key",

108 "owner": {

109 "id": "sa_456",

110 "created_at": 1711471533,

111 "name": "My Service Account",

112 "object": "organization.user",

113 "role": "owner",

114 "type": "user"

115 },

116 "redacted_value": "sk-admin...def",

117 "last_used_at": 1711471534,

118 "name": "Administration Key"

119 }

120 ],

121 "has_more": false,

122 "object": "list",

123 "first_id": "key_abc",

124 "last_id": "key_xyz"

125}

126```

Details

1## Retrieve admin API key

2 

3`$ openai admin:organization:admin-api-keys retrieve`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `--key-id: string`

12 

13 The ID of the API key.

14 

15### Returns

16 

17- `admin_api_key: object { id, created_at, expires_at, 5 more }`

18 

19 Represents an individual Admin API key in an org.

20 

21 - `id: string`

22 

23 The identifier, which can be referenced in API endpoints

24 

25 - `created_at: number`

26 

27 The Unix timestamp (in seconds) of when the API key was created

28 

29 - `expires_at: number`

30 

31 The Unix timestamp (in seconds) of when the API key expires

32 

33 - `object: "organization.admin_api_key"`

34 

35 The object type, which is always `organization.admin_api_key`

36 

37 - `owner: object { id, created_at, name, 3 more }`

38 

39 - `id: optional string`

40 

41 The identifier, which can be referenced in API endpoints

42 

43 - `created_at: optional number`

44 

45 The Unix timestamp (in seconds) of when the user was created

46 

47 - `name: optional string`

48 

49 The name of the user

50 

51 - `object: optional string`

52 

53 The object type, which is always organization.user

54 

55 - `role: optional string`

56 

57 Always `owner`

58 

59 - `type: optional string`

60 

61 Always `user`

62 

63 - `redacted_value: string`

64 

65 The redacted value of the API key

66 

67 - `last_used_at: optional number`

68 

69 The Unix timestamp (in seconds) of when the API key was last used

70 

71 - `name: optional string`

72 

73 The name of the API key

74 

75### Example

76 

77```cli

78openai admin:organization:admin-api-keys retrieve \

79 --admin-api-key 'My Admin API Key' \

80 --key-id key_id

81```

82 

83#### Response

84 

85```json

86{

87 "id": "key_abc",

88 "created_at": 1711471533,

89 "expires_at": 1714063533,

90 "object": "organization.admin_api_key",

91 "owner": {

92 "id": "sa_456",

93 "created_at": 1711471533,

94 "name": "My Service Account",

95 "object": "organization.user",

96 "role": "owner",

97 "type": "user"

98 },

99 "redacted_value": "sk-admin...def",

100 "last_used_at": 1711471534,

101 "name": "Administration Key"

102}

103```

Details

28 28 

29 Return only events whose `effective_at` (Unix seconds) is in this range.29 Return only events whose `effective_at` (Unix seconds) is in this range.

30 30 

31- `--event-type: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`31- `--event-type: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

32 32 

33 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).33 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).

34 34 


42 42 

43- `--resource-id: optional array of string`43- `--resource-id: optional array of string`

44 44 

45 Return only events performed on these targets. For example, a project ID updated.45 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

46 

47- `--tenant-only: optional boolean`

48 

49 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

46 50 

47### Returns51### Returns

48 52 

49- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`53- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`

50 54 

51 - `data: array of object { id, effective_at, type, 55 more }`55 - `data: array of object { id, effective_at, type, 57 more }`

52 56 

53 - `id: string`57 - `id: string`

54 58 


58 62 

59 The Unix timestamp (in seconds) of the event.63 The Unix timestamp (in seconds) of the event.

60 64 

61 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`65 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

62 66 

63 The event type.67 The event type.

64 68 


160 164 

161 - `"role.assignment.deleted"`165 - `"role.assignment.deleted"`

162 166 

167 - `"role.bound_to_resource"`

168 

169 - `"role.unbound_from_resource"`

170 

163 - `"scim.enabled"`171 - `"scim.enabled"`

164 172 

165 - `"scim.disabled"`173 - `"scim.disabled"`


780 788 

781 The type of resource the role assignment was scoped to.789 The type of resource the role assignment was scoped to.

782 790 

791 - `role.bound_to_resource: optional object { id, connector_id, connector_name, 7 more }`

792 

793 The details for events with this `type`.

794 

795 - `id: optional string`

796 

797 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

798 

799 - `connector_id: optional string`

800 

801 The connector ID for a ChatGPT workspace connector resource.

802 

803 - `connector_name: optional string`

804 

805 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

806 

807 - `enabled: optional boolean`

808 

809 Whether the connector is enabled for the role.

810 

811 - `permissions: optional array of string`

812 

813 The permissions granted to the role for the resource.

814 

815 - `resource_id: optional string`

816 

817 The ID of the resource the role was bound to.

818 

819 - `resource_type: optional string`

820 

821 The type of resource the role was bound to.

822 

823 - `role_id: optional string`

824 

825 The ID of the role that was bound to the resource.

826 

827 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

828 

829 The connector role mutation path that produced the event.

830 

831 - `"role_toggle"`

832 

833 - `"role_connector_update"`

834 

835 - `"role_delete"`

836 

837 - `"workspace_permissions"`

838 

839 - `"connector_publish"`

840 

841 - `workspace_id: optional string`

842 

843 The workspace ID for a ChatGPT workspace connector resource.

844 

783 - `role.created: optional object { id, permissions, resource_id, 2 more }`845 - `role.created: optional object { id, permissions, resource_id, 2 more }`

784 846 

785 The details for events with this `type`.847 The details for events with this `type`.


812 874 

813 The role ID.875 The role ID.

814 876 

877 - `role.unbound_from_resource: optional object { id, connector_id, connector_name, 7 more }`

878 

879 The details for events with this `type`.

880 

881 - `id: optional string`

882 

883 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

884 

885 - `connector_id: optional string`

886 

887 The connector ID for a ChatGPT workspace connector resource.

888 

889 - `connector_name: optional string`

890 

891 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

892 

893 - `enabled: optional boolean`

894 

895 Whether the connector is enabled for the role.

896 

897 - `permissions: optional array of string`

898 

899 The permissions remaining for the role after the change.

900 

901 - `resource_id: optional string`

902 

903 The ID of the resource the role was unbound from.

904 

905 - `resource_type: optional string`

906 

907 The type of resource the role was unbound from.

908 

909 - `role_id: optional string`

910 

911 The ID of the role that was unbound from the resource.

912 

913 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

914 

915 The connector role mutation path that produced the event.

916 

917 - `"role_toggle"`

918 

919 - `"role_connector_update"`

920 

921 - `"role_delete"`

922 

923 - `"workspace_permissions"`

924 

925 - `"connector_publish"`

926 

927 - `workspace_id: optional string`

928 

929 The workspace ID for a ChatGPT workspace connector resource.

930 

815 - `role.updated: optional object { id, changes_requested }`931 - `role.updated: optional object { id, changes_requested }`

816 932 

817 The details for events with this `type`.933 The details for events with this `type`.


1283 "resource_id": "resource_id",1399 "resource_id": "resource_id",

1284 "resource_type": "resource_type"1400 "resource_type": "resource_type"

1285 },1401 },

1402 "role.bound_to_resource": {

1403 "id": "id",

1404 "connector_id": "connector_id",

1405 "connector_name": "connector_name",

1406 "enabled": true,

1407 "permissions": [

1408 "string"

1409 ],

1410 "resource_id": "resource_id",

1411 "resource_type": "resource_type",

1412 "role_id": "role_id",

1413 "source": "role_toggle",

1414 "workspace_id": "workspace_id"

1415 },

1286 "role.created": {1416 "role.created": {

1287 "id": "id",1417 "id": "id",

1288 "permissions": [1418 "permissions": [


1295 "role.deleted": {1425 "role.deleted": {

1296 "id": "id"1426 "id": "id"

1297 },1427 },

1428 "role.unbound_from_resource": {

1429 "id": "id",

1430 "connector_id": "connector_id",

1431 "connector_name": "connector_name",

1432 "enabled": true,

1433 "permissions": [

1434 "string"

1435 ],

1436 "resource_id": "resource_id",

1437 "resource_type": "resource_type",

1438 "role_id": "role_id",

1439 "source": "role_toggle",

1440 "workspace_id": "workspace_id"

1441 },

1298 "role.updated": {1442 "role.updated": {

1299 "id": "id",1443 "id": "id",

1300 "changes_requested": {1444 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`$ openai admin:organization:projects:spend-alerts retrieve`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `--project-id: string`

12 

13 The ID of the project.

14 

15- `--alert-id: string`

16 

17 The ID of the spend alert to retrieve.

18 

19### Returns

20 

21- `project_spend_alert: object { id, currency, interval, 3 more }`

22 

23 Represents a spend alert configured at the project level.

24 

25 - `id: string`

26 

27 The identifier, which can be referenced in API endpoints.

28 

29 - `currency: "USD"`

30 

31 The currency for the threshold amount.

32 

33 - `"USD"`

34 

35 - `interval: "month"`

36 

37 The time interval for evaluating spend against the threshold.

38 

39 - `"month"`

40 

41 - `notification_channel: object { recipients, type, subject_prefix }`

42 

43 Email notification settings for a spend alert.

44 

45 - `recipients: array of string`

46 

47 Email addresses that receive the spend alert notification.

48 

49 - `type: "email"`

50 

51 The notification channel type. Currently only `email` is supported.

52 

53 - `subject_prefix: optional string`

54 

55 Optional subject prefix for alert emails.

56 

57 - `object: "project.spend_alert"`

58 

59 The object type, which is always `project.spend_alert`.

60 

61 - `threshold_amount: number`

62 

63 The alert threshold amount, in cents.

64 

65### Example

66 

67```cli

68openai admin:organization:projects:spend-alerts retrieve \

69 --admin-api-key 'My Admin API Key' \

70 --project-id project_id \

71 --alert-id alert_id

72```

73 

74#### Response

75 

76```json

77{

78 "id": "id",

79 "currency": "USD",

80 "interval": "month",

81 "notification_channel": {

82 "recipients": [

83 "string"

84 ],

85 "type": "email",

86 "subject_prefix": "subject_prefix"

87 },

88 "object": "project.spend_alert",

89 "threshold_amount": 0

90}

91```

Details

1## Retrieve organization spend alert

2 

3`$ openai admin:organization:spend-alerts retrieve`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `--alert-id: string`

12 

13 The ID of the spend alert to retrieve.

14 

15### Returns

16 

17- `organization_spend_alert: object { id, currency, interval, 3 more }`

18 

19 Represents a spend alert configured at the organization level.

20 

21 - `id: string`

22 

23 The identifier, which can be referenced in API endpoints.

24 

25 - `currency: "USD"`

26 

27 The currency for the threshold amount.

28 

29 - `"USD"`

30 

31 - `interval: "month"`

32 

33 The time interval for evaluating spend against the threshold.

34 

35 - `"month"`

36 

37 - `notification_channel: object { recipients, type, subject_prefix }`

38 

39 Email notification settings for a spend alert.

40 

41 - `recipients: array of string`

42 

43 Email addresses that receive the spend alert notification.

44 

45 - `type: "email"`

46 

47 The notification channel type. Currently only `email` is supported.

48 

49 - `subject_prefix: optional string`

50 

51 Optional subject prefix for alert emails.

52 

53 - `object: "organization.spend_alert"`

54 

55 The object type, which is always `organization.spend_alert`.

56 

57 - `threshold_amount: number`

58 

59 The alert threshold amount, in cents.

60 

61### Example

62 

63```cli

64openai admin:organization:spend-alerts retrieve \

65 --admin-api-key 'My Admin API Key' \

66 --alert-id alert_id

67```

68 

69#### Response

70 

71```json

72{

73 "id": "id",

74 "currency": "USD",

75 "interval": "month",

76 "notification_channel": {

77 "recipients": [

78 "string"

79 ],

80 "type": "email",

81 "subject_prefix": "subject_prefix"

82 },

83 "object": "organization.spend_alert",

84 "threshold_amount": 0

85}

86```

Details

4779 4779 

4780 - `"24h"`4780 - `"24h"`

4781 4781 

4782 - `reasoning: optional object { effort, generate_summary, summary }`4782 - `reasoning: optional object { context, effort, generate_summary, summary }`

4783 4783 

4784 **gpt-5 and o-series models only**4784 **gpt-5 and o-series models only**

4785 4785 

4786 Configuration options for4786 Configuration options for

4787 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4787 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4788 4788 

4789 - `context: optional "auto" or "current_turn" or "all_turns"`

4790 

4791 Controls which reasoning items are rendered back to the model on later turns.

4792 When returned on a response, this is the effective reasoning context mode

4793 used for the response.

4794 

4795 - `"auto"`

4796 

4797 - `"current_turn"`

4798 

4799 - `"all_turns"`

4800 

4789 - `effort: optional "none" or "minimal" or "low" or 3 more`4801 - `effort: optional "none" or "minimal" or "low" or 3 more`

4790 4802 

4791 Constrains effort on reasoning for4803 Constrains effort on reasoning for


5167 "prompt_cache_key": "prompt-cache-key-1234",5179 "prompt_cache_key": "prompt-cache-key-1234",

5168 "prompt_cache_retention": "in_memory",5180 "prompt_cache_retention": "in_memory",

5169 "reasoning": {5181 "reasoning": {

5182 "context": "auto",

5170 "effort": "none",5183 "effort": "none",

5171 "generate_summary": "auto",5184 "generate_summary": "auto",

5172 "summary": "auto"5185 "summary": "auto"

Details

117 - Organizations without ZDR enabled default to `24h`.117 - Organizations without ZDR enabled default to `24h`.

118 - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.118 - Organizations with ZDR enabled default to `in_memory` when `prompt_cache_retention` is not specified.

119 119 

120- `--reasoning: optional object { effort, generate_summary, summary }`120- `--reasoning: optional object { context, effort, generate_summary, summary }`

121 121 

122 **gpt-5 and o-series models only**122 **gpt-5 and o-series models only**

123 123 


4985 4985 

4986 - `"24h"`4986 - `"24h"`

4987 4987 

4988 - `reasoning: optional object { effort, generate_summary, summary }`4988 - `reasoning: optional object { context, effort, generate_summary, summary }`

4989 4989 

4990 **gpt-5 and o-series models only**4990 **gpt-5 and o-series models only**

4991 4991 

4992 Configuration options for4992 Configuration options for

4993 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4993 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4994 4994 

4995 - `context: optional "auto" or "current_turn" or "all_turns"`

4996 

4997 Controls which reasoning items are rendered back to the model on later turns.

4998 When returned on a response, this is the effective reasoning context mode

4999 used for the response.

5000 

5001 - `"auto"`

5002 

5003 - `"current_turn"`

5004 

5005 - `"all_turns"`

5006 

4995 - `effort: optional "none" or "minimal" or "low" or 3 more`5007 - `effort: optional "none" or "minimal" or "low" or 3 more`

4996 5008 

4997 Constrains effort on reasoning for5009 Constrains effort on reasoning for


5372 "prompt_cache_key": "prompt-cache-key-1234",5384 "prompt_cache_key": "prompt-cache-key-1234",

5373 "prompt_cache_retention": "in_memory",5385 "prompt_cache_retention": "in_memory",

5374 "reasoning": {5386 "reasoning": {

5387 "context": "auto",

5375 "effort": "none",5388 "effort": "none",

5376 "generate_summary": "auto",5389 "generate_summary": "auto",

5377 "summary": "auto"5390 "summary": "auto"

Details

4796 4796 

4797 - `"24h"`4797 - `"24h"`

4798 4798 

4799 - `reasoning: optional object { effort, generate_summary, summary }`4799 - `reasoning: optional object { context, effort, generate_summary, summary }`

4800 4800 

4801 **gpt-5 and o-series models only**4801 **gpt-5 and o-series models only**

4802 4802 

4803 Configuration options for4803 Configuration options for

4804 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4804 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4805 4805 

4806 - `context: optional "auto" or "current_turn" or "all_turns"`

4807 

4808 Controls which reasoning items are rendered back to the model on later turns.

4809 When returned on a response, this is the effective reasoning context mode

4810 used for the response.

4811 

4812 - `"auto"`

4813 

4814 - `"current_turn"`

4815 

4816 - `"all_turns"`

4817 

4806 - `effort: optional "none" or "minimal" or "low" or 3 more`4818 - `effort: optional "none" or "minimal" or "low" or 3 more`

4807 4819 

4808 Constrains effort on reasoning for4820 Constrains effort on reasoning for


5184 "prompt_cache_key": "prompt-cache-key-1234",5196 "prompt_cache_key": "prompt-cache-key-1234",

5185 "prompt_cache_retention": "in_memory",5197 "prompt_cache_retention": "in_memory",

5186 "reasoning": {5198 "reasoning": {

5199 "context": "auto",

5187 "effort": "none",5200 "effort": "none",

5188 "generate_summary": "auto",5201 "generate_summary": "auto",

5189 "summary": "auto"5202 "summary": "auto"

Details

40 40 

41 The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.41 The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://platform.openai.com/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.

42 42 

43- `--reasoning: optional object { effort, generate_summary, summary }`43- `--reasoning: optional object { context, effort, generate_summary, summary }`

44 44 

45 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).45 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

46 46 

go/resources/$shared/index.md +978 −0 created

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `type AllModels interface{…}`

8 

9 - `string`

10 

11 - `type ChatModel string`

12 

13 - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"`

14 

15 - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"`

16 

17 - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"`

18 

19 - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"`

20 

21 - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"`

22 

23 - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"`

24 

25 - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"`

26 

27 - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"`

28 

29 - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"`

30 

31 - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"`

32 

33 - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"`

34 

35 - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"`

36 

37 - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"`

38 

39 - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"`

40 

41 - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"`

42 

43 - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"`

44 

45 - `const ChatModelGPT5 ChatModel = "gpt-5"`

46 

47 - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"`

48 

49 - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"`

50 

51 - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"`

52 

53 - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"`

54 

55 - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"`

56 

57 - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"`

58 

59 - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"`

60 

61 - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"`

62 

63 - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"`

64 

65 - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"`

66 

67 - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"`

68 

69 - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"`

70 

71 - `const ChatModelO4Mini ChatModel = "o4-mini"`

72 

73 - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"`

74 

75 - `const ChatModelO3 ChatModel = "o3"`

76 

77 - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"`

78 

79 - `const ChatModelO3Mini ChatModel = "o3-mini"`

80 

81 - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"`

82 

83 - `const ChatModelO1 ChatModel = "o1"`

84 

85 - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"`

86 

87 - `const ChatModelO1Preview ChatModel = "o1-preview"`

88 

89 - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"`

90 

91 - `const ChatModelO1Mini ChatModel = "o1-mini"`

92 

93 - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"`

94 

95 - `const ChatModelGPT4o ChatModel = "gpt-4o"`

96 

97 - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"`

98 

99 - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"`

100 

101 - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"`

102 

103 - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"`

104 

105 - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"`

106 

107 - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"`

108 

109 - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"`

110 

111 - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"`

112 

113 - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"`

116 

117 - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"`

118 

119 - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"`

120 

121 - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"`

124 

125 - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"`

126 

127 - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"`

128 

129 - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"`

130 

131 - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"`

132 

133 - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"`

134 

135 - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"`

136 

137 - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"`

138 

139 - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"`

140 

141 - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"`

142 

143 - `const ChatModelGPT4 ChatModel = "gpt-4"`

144 

145 - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"`

146 

147 - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"`

148 

149 - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"`

150 

151 - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"`

152 

153 - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"`

154 

155 - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"`

156 

157 - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"`

158 

159 - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"`

160 

161 - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"`

162 

163 - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"`

164 

165 - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"`

166 

167 - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"`

168 

169 - `type AllModels string`

170 

171 - `const AllModelsO1Pro AllModels = "o1-pro"`

172 

173 - `const AllModelsO1Pro2025_03_19 AllModels = "o1-pro-2025-03-19"`

174 

175 - `const AllModelsO3Pro AllModels = "o3-pro"`

176 

177 - `const AllModelsO3Pro2025_06_10 AllModels = "o3-pro-2025-06-10"`

178 

179 - `const AllModelsO3DeepResearch AllModels = "o3-deep-research"`

180 

181 - `const AllModelsO3DeepResearch2025_06_26 AllModels = "o3-deep-research-2025-06-26"`

182 

183 - `const AllModelsO4MiniDeepResearch AllModels = "o4-mini-deep-research"`

184 

185 - `const AllModelsO4MiniDeepResearch2025_06_26 AllModels = "o4-mini-deep-research-2025-06-26"`

186 

187 - `const AllModelsComputerUsePreview AllModels = "computer-use-preview"`

188 

189 - `const AllModelsComputerUsePreview2025_03_11 AllModels = "computer-use-preview-2025-03-11"`

190 

191 - `const AllModelsGPT5Codex AllModels = "gpt-5-codex"`

192 

193 - `const AllModelsGPT5Pro AllModels = "gpt-5-pro"`

194 

195 - `const AllModelsGPT5Pro2025_10_06 AllModels = "gpt-5-pro-2025-10-06"`

196 

197 - `const AllModelsGPT5_1CodexMax AllModels = "gpt-5.1-codex-max"`

198 

199### Chat Model

200 

201- `type ChatModel string`

202 

203 - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"`

204 

205 - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"`

206 

207 - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"`

208 

209 - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"`

210 

211 - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"`

212 

213 - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"`

214 

215 - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"`

216 

217 - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"`

218 

219 - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"`

220 

221 - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"`

222 

223 - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"`

224 

225 - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"`

226 

227 - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"`

228 

229 - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"`

230 

231 - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"`

232 

233 - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"`

234 

235 - `const ChatModelGPT5 ChatModel = "gpt-5"`

236 

237 - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"`

238 

239 - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"`

240 

241 - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"`

242 

243 - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"`

244 

245 - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"`

246 

247 - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"`

248 

249 - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"`

250 

251 - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"`

252 

253 - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"`

254 

255 - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"`

256 

257 - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"`

258 

259 - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"`

260 

261 - `const ChatModelO4Mini ChatModel = "o4-mini"`

262 

263 - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"`

264 

265 - `const ChatModelO3 ChatModel = "o3"`

266 

267 - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"`

268 

269 - `const ChatModelO3Mini ChatModel = "o3-mini"`

270 

271 - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"`

272 

273 - `const ChatModelO1 ChatModel = "o1"`

274 

275 - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"`

276 

277 - `const ChatModelO1Preview ChatModel = "o1-preview"`

278 

279 - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"`

280 

281 - `const ChatModelO1Mini ChatModel = "o1-mini"`

282 

283 - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"`

284 

285 - `const ChatModelGPT4o ChatModel = "gpt-4o"`

286 

287 - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"`

288 

289 - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"`

290 

291 - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"`

292 

293 - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"`

294 

295 - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"`

296 

297 - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"`

298 

299 - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"`

300 

301 - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"`

302 

303 - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"`

304 

305 - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"`

306 

307 - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"`

308 

309 - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"`

310 

311 - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"`

312 

313 - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"`

314 

315 - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"`

316 

317 - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"`

318 

319 - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"`

320 

321 - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"`

322 

323 - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"`

324 

325 - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"`

326 

327 - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"`

328 

329 - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"`

330 

331 - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"`

332 

333 - `const ChatModelGPT4 ChatModel = "gpt-4"`

334 

335 - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"`

336 

337 - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"`

338 

339 - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"`

340 

341 - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"`

342 

343 - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"`

344 

345 - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"`

346 

347 - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"`

348 

349 - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"`

350 

351 - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"`

352 

353 - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"`

354 

355 - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"`

356 

357 - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"`

358 

359### Comparison Filter

360 

361- `type ComparisonFilter struct{…}`

362 

363 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

364 

365 - `Key string`

366 

367 The key to compare against the value.

368 

369 - `Type ComparisonFilterType`

370 

371 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

372 

373 - `eq`: equals

374 - `ne`: not equal

375 - `gt`: greater than

376 - `gte`: greater than or equal

377 - `lt`: less than

378 - `lte`: less than or equal

379 - `in`: in

380 - `nin`: not in

381 

382 - `const ComparisonFilterTypeEq ComparisonFilterType = "eq"`

383 

384 - `const ComparisonFilterTypeNe ComparisonFilterType = "ne"`

385 

386 - `const ComparisonFilterTypeGt ComparisonFilterType = "gt"`

387 

388 - `const ComparisonFilterTypeGte ComparisonFilterType = "gte"`

389 

390 - `const ComparisonFilterTypeLt ComparisonFilterType = "lt"`

391 

392 - `const ComparisonFilterTypeLte ComparisonFilterType = "lte"`

393 

394 - `const ComparisonFilterTypeIn ComparisonFilterType = "in"`

395 

396 - `const ComparisonFilterTypeNin ComparisonFilterType = "nin"`

397 

398 - `Value ComparisonFilterValueUnion`

399 

400 The value to compare against the attribute key; supports string, number, or boolean types.

401 

402 - `string`

403 

404 - `float64`

405 

406 - `bool`

407 

408 - `type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion`

409 

410 - `string`

411 

412 - `float64`

413 

414### Compound Filter

415 

416- `type CompoundFilter struct{…}`

417 

418 Combine multiple filters using `and` or `or`.

419 

420 - `Filters []ComparisonFilter`

421 

422 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

423 

424 - `type ComparisonFilter struct{…}`

425 

426 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

427 

428 - `Key string`

429 

430 The key to compare against the value.

431 

432 - `Type ComparisonFilterType`

433 

434 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

435 

436 - `eq`: equals

437 - `ne`: not equal

438 - `gt`: greater than

439 - `gte`: greater than or equal

440 - `lt`: less than

441 - `lte`: less than or equal

442 - `in`: in

443 - `nin`: not in

444 

445 - `const ComparisonFilterTypeEq ComparisonFilterType = "eq"`

446 

447 - `const ComparisonFilterTypeNe ComparisonFilterType = "ne"`

448 

449 - `const ComparisonFilterTypeGt ComparisonFilterType = "gt"`

450 

451 - `const ComparisonFilterTypeGte ComparisonFilterType = "gte"`

452 

453 - `const ComparisonFilterTypeLt ComparisonFilterType = "lt"`

454 

455 - `const ComparisonFilterTypeLte ComparisonFilterType = "lte"`

456 

457 - `const ComparisonFilterTypeIn ComparisonFilterType = "in"`

458 

459 - `const ComparisonFilterTypeNin ComparisonFilterType = "nin"`

460 

461 - `Value ComparisonFilterValueUnion`

462 

463 The value to compare against the attribute key; supports string, number, or boolean types.

464 

465 - `string`

466 

467 - `float64`

468 

469 - `bool`

470 

471 - `type ComparisonFilterValueArray []ComparisonFilterValueArrayItemUnion`

472 

473 - `string`

474 

475 - `float64`

476 

477 - `Type CompoundFilterType`

478 

479 Type of operation: `and` or `or`.

480 

481 - `const CompoundFilterTypeAnd CompoundFilterType = "and"`

482 

483 - `const CompoundFilterTypeOr CompoundFilterType = "or"`

484 

485### Custom Tool Input Format

486 

487- `type CustomToolInputFormatUnion interface{…}`

488 

489 The input format for the custom tool. Default is unconstrained text.

490 

491 - `type CustomToolInputFormatText struct{…}`

492 

493 Unconstrained free-form text.

494 

495 - `Type Text`

496 

497 Unconstrained text format. Always `text`.

498 

499 - `const TextText Text = "text"`

500 

501 - `type CustomToolInputFormatGrammar struct{…}`

502 

503 A grammar defined by the user.

504 

505 - `Definition string`

506 

507 The grammar definition.

508 

509 - `Syntax string`

510 

511 The syntax of the grammar definition. One of `lark` or `regex`.

512 

513 - `const CustomToolInputFormatGrammarSyntaxLark CustomToolInputFormatGrammarSyntax = "lark"`

514 

515 - `const CustomToolInputFormatGrammarSyntaxRegex CustomToolInputFormatGrammarSyntax = "regex"`

516 

517 - `Type Grammar`

518 

519 Grammar format. Always `grammar`.

520 

521 - `const GrammarGrammar Grammar = "grammar"`

522 

523### Error Object

524 

525- `type ErrorObject struct{…}`

526 

527 - `Code string`

528 

529 - `Message string`

530 

531 - `Param string`

532 

533 - `Type string`

534 

535### Function Definition

536 

537- `type FunctionDefinition struct{…}`

538 

539 - `Name string`

540 

541 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

542 

543 - `Description string`

544 

545 A description of what the function does, used by the model to choose when and how to call the function.

546 

547 - `Parameters FunctionParameters`

548 

549 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

550 

551 Omitting `parameters` defines a function with an empty parameter list.

552 

553 - `Strict bool`

554 

555 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).

556 

557### Function Parameters

558 

559- `type FunctionParameters map[string, any]`

560 

561 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

562 

563 Omitting `parameters` defines a function with an empty parameter list.

564 

565### Metadata

566 

567- `type Metadata map[string, string]`

568 

569 Set of 16 key-value pairs that can be attached to an object. This can be

570 useful for storing additional information about the object in a structured

571 format, and querying for objects via API or the dashboard.

572 

573 Keys are strings with a maximum length of 64 characters. Values are strings

574 with a maximum length of 512 characters.

575 

576### OAuth Error Code

577 

578- `type OAuthErrorCode interface{…}`

579 

580 - `type OAuthErrorCode string`

581 

582 - `const OAuthErrorCodeInvalidGrant OAuthErrorCode = "invalid_grant"`

583 

584 - `const OAuthErrorCodeInvalidSubjectToken OAuthErrorCode = "invalid_subject_token"`

585 

586 - `string`

587 

588### Reasoning

589 

590- `type Reasoning struct{…}`

591 

592 **gpt-5 and o-series models only**

593 

594 Configuration options for

595 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

596 

597 - `Context ReasoningContext`

598 

599 Controls which reasoning items are rendered back to the model on later turns.

600 When returned on a response, this is the effective reasoning context mode

601 used for the response.

602 

603 - `const ReasoningContextAuto ReasoningContext = "auto"`

604 

605 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

606 

607 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

608 

609 - `Effort ReasoningEffort`

610 

611 Constrains effort on reasoning for

612 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

613 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

614 reasoning effort can result in faster responses and fewer tokens used

615 on reasoning in a response.

616 

617 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

618 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

619 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

620 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

621 

622 - `const ReasoningEffortNone ReasoningEffort = "none"`

623 

624 - `const ReasoningEffortMinimal ReasoningEffort = "minimal"`

625 

626 - `const ReasoningEffortLow ReasoningEffort = "low"`

627 

628 - `const ReasoningEffortMedium ReasoningEffort = "medium"`

629 

630 - `const ReasoningEffortHigh ReasoningEffort = "high"`

631 

632 - `const ReasoningEffortXhigh ReasoningEffort = "xhigh"`

633 

634 - `GenerateSummary ReasoningGenerateSummary`

635 

636 **Deprecated:** use `summary` instead.

637 

638 A summary of the reasoning performed by the model. This can be

639 useful for debugging and understanding the model's reasoning process.

640 One of `auto`, `concise`, or `detailed`.

641 

642 - `const ReasoningGenerateSummaryAuto ReasoningGenerateSummary = "auto"`

643 

644 - `const ReasoningGenerateSummaryConcise ReasoningGenerateSummary = "concise"`

645 

646 - `const ReasoningGenerateSummaryDetailed ReasoningGenerateSummary = "detailed"`

647 

648 - `Summary ReasoningSummary`

649 

650 A summary of the reasoning performed by the model. This can be

651 useful for debugging and understanding the model's reasoning process.

652 One of `auto`, `concise`, or `detailed`.

653 

654 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

655 

656 - `const ReasoningSummaryAuto ReasoningSummary = "auto"`

657 

658 - `const ReasoningSummaryConcise ReasoningSummary = "concise"`

659 

660 - `const ReasoningSummaryDetailed ReasoningSummary = "detailed"`

661 

662### Reasoning Effort

663 

664- `type ReasoningEffort string`

665 

666 Constrains effort on reasoning for

667 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

668 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

669 reasoning effort can result in faster responses and fewer tokens used

670 on reasoning in a response.

671 

672 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

673 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

674 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

675 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

676 

677 - `const ReasoningEffortNone ReasoningEffort = "none"`

678 

679 - `const ReasoningEffortMinimal ReasoningEffort = "minimal"`

680 

681 - `const ReasoningEffortLow ReasoningEffort = "low"`

682 

683 - `const ReasoningEffortMedium ReasoningEffort = "medium"`

684 

685 - `const ReasoningEffortHigh ReasoningEffort = "high"`

686 

687 - `const ReasoningEffortXhigh ReasoningEffort = "xhigh"`

688 

689### Response Format JSON Object

690 

691- `type ResponseFormatJSONObject struct{…}`

692 

693 JSON object response format. An older method of generating JSON responses.

694 Using `json_schema` is recommended for models that support it. Note that the

695 model will not generate JSON without a system or user message instructing it

696 to do so.

697 

698 - `Type JSONObject`

699 

700 The type of response format being defined. Always `json_object`.

701 

702 - `const JSONObjectJSONObject JSONObject = "json_object"`

703 

704### Response Format JSON Schema

705 

706- `type ResponseFormatJSONSchema struct{…}`

707 

708 JSON Schema response format. Used to generate structured JSON responses.

709 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

710 

711 - `JSONSchema ResponseFormatJSONSchemaJSONSchema`

712 

713 Structured Outputs configuration options, including a JSON Schema.

714 

715 - `Name string`

716 

717 The name of the response format. Must be a-z, A-Z, 0-9, or contain

718 underscores and dashes, with a maximum length of 64.

719 

720 - `Description string`

721 

722 A description of what the response format is for, used by the model to

723 determine how to respond in the format.

724 

725 - `Schema map[string, any]`

726 

727 The schema for the response format, described as a JSON Schema object.

728 Learn how to build JSON schemas [here](https://json-schema.org/).

729 

730 - `Strict bool`

731 

732 Whether to enable strict schema adherence when generating the output.

733 If set to true, the model will always follow the exact schema defined

734 in the `schema` field. Only a subset of JSON Schema is supported when

735 `strict` is `true`. To learn more, read the [Structured Outputs

736 guide](https://platform.openai.com/docs/guides/structured-outputs).

737 

738 - `Type JSONSchema`

739 

740 The type of response format being defined. Always `json_schema`.

741 

742 - `const JSONSchemaJSONSchema JSONSchema = "json_schema"`

743 

744### Response Format Text

745 

746- `type ResponseFormatText struct{…}`

747 

748 Default response format. Used to generate text responses.

749 

750 - `Type Text`

751 

752 The type of response format being defined. Always `text`.

753 

754 - `const TextText Text = "text"`

755 

756### Response Format Text Grammar

757 

758- `type ResponseFormatTextGrammar struct{…}`

759 

760 A custom grammar for the model to follow when generating text.

761 Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).

762 

763 - `Grammar string`

764 

765 The custom grammar for the model to follow.

766 

767 - `Type Grammar`

768 

769 The type of response format being defined. Always `grammar`.

770 

771 - `const GrammarGrammar Grammar = "grammar"`

772 

773### Response Format Text Python

774 

775- `type ResponseFormatTextPython struct{…}`

776 

777 Configure the model to generate valid Python code. See the

778 [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details.

779 

780 - `Type Python`

781 

782 The type of response format being defined. Always `python`.

783 

784 - `const PythonPython Python = "python"`

785 

786### Responses Model

787 

788- `type ResponsesModel interface{…}`

789 

790 - `string`

791 

792 - `type ChatModel string`

793 

794 - `const ChatModelGPT5_4 ChatModel = "gpt-5.4"`

795 

796 - `const ChatModelGPT5_4Mini ChatModel = "gpt-5.4-mini"`

797 

798 - `const ChatModelGPT5_4Nano ChatModel = "gpt-5.4-nano"`

799 

800 - `const ChatModelGPT5_4Mini2026_03_17 ChatModel = "gpt-5.4-mini-2026-03-17"`

801 

802 - `const ChatModelGPT5_4Nano2026_03_17 ChatModel = "gpt-5.4-nano-2026-03-17"`

803 

804 - `const ChatModelGPT5_3ChatLatest ChatModel = "gpt-5.3-chat-latest"`

805 

806 - `const ChatModelGPT5_2 ChatModel = "gpt-5.2"`

807 

808 - `const ChatModelGPT5_2_2025_12_11 ChatModel = "gpt-5.2-2025-12-11"`

809 

810 - `const ChatModelGPT5_2ChatLatest ChatModel = "gpt-5.2-chat-latest"`

811 

812 - `const ChatModelGPT5_2Pro ChatModel = "gpt-5.2-pro"`

813 

814 - `const ChatModelGPT5_2Pro2025_12_11 ChatModel = "gpt-5.2-pro-2025-12-11"`

815 

816 - `const ChatModelGPT5_1 ChatModel = "gpt-5.1"`

817 

818 - `const ChatModelGPT5_1_2025_11_13 ChatModel = "gpt-5.1-2025-11-13"`

819 

820 - `const ChatModelGPT5_1Codex ChatModel = "gpt-5.1-codex"`

821 

822 - `const ChatModelGPT5_1Mini ChatModel = "gpt-5.1-mini"`

823 

824 - `const ChatModelGPT5_1ChatLatest ChatModel = "gpt-5.1-chat-latest"`

825 

826 - `const ChatModelGPT5 ChatModel = "gpt-5"`

827 

828 - `const ChatModelGPT5Mini ChatModel = "gpt-5-mini"`

829 

830 - `const ChatModelGPT5Nano ChatModel = "gpt-5-nano"`

831 

832 - `const ChatModelGPT5_2025_08_07 ChatModel = "gpt-5-2025-08-07"`

833 

834 - `const ChatModelGPT5Mini2025_08_07 ChatModel = "gpt-5-mini-2025-08-07"`

835 

836 - `const ChatModelGPT5Nano2025_08_07 ChatModel = "gpt-5-nano-2025-08-07"`

837 

838 - `const ChatModelGPT5ChatLatest ChatModel = "gpt-5-chat-latest"`

839 

840 - `const ChatModelGPT4_1 ChatModel = "gpt-4.1"`

841 

842 - `const ChatModelGPT4_1Mini ChatModel = "gpt-4.1-mini"`

843 

844 - `const ChatModelGPT4_1Nano ChatModel = "gpt-4.1-nano"`

845 

846 - `const ChatModelGPT4_1_2025_04_14 ChatModel = "gpt-4.1-2025-04-14"`

847 

848 - `const ChatModelGPT4_1Mini2025_04_14 ChatModel = "gpt-4.1-mini-2025-04-14"`

849 

850 - `const ChatModelGPT4_1Nano2025_04_14 ChatModel = "gpt-4.1-nano-2025-04-14"`

851 

852 - `const ChatModelO4Mini ChatModel = "o4-mini"`

853 

854 - `const ChatModelO4Mini2025_04_16 ChatModel = "o4-mini-2025-04-16"`

855 

856 - `const ChatModelO3 ChatModel = "o3"`

857 

858 - `const ChatModelO3_2025_04_16 ChatModel = "o3-2025-04-16"`

859 

860 - `const ChatModelO3Mini ChatModel = "o3-mini"`

861 

862 - `const ChatModelO3Mini2025_01_31 ChatModel = "o3-mini-2025-01-31"`

863 

864 - `const ChatModelO1 ChatModel = "o1"`

865 

866 - `const ChatModelO1_2024_12_17 ChatModel = "o1-2024-12-17"`

867 

868 - `const ChatModelO1Preview ChatModel = "o1-preview"`

869 

870 - `const ChatModelO1Preview2024_09_12 ChatModel = "o1-preview-2024-09-12"`

871 

872 - `const ChatModelO1Mini ChatModel = "o1-mini"`

873 

874 - `const ChatModelO1Mini2024_09_12 ChatModel = "o1-mini-2024-09-12"`

875 

876 - `const ChatModelGPT4o ChatModel = "gpt-4o"`

877 

878 - `const ChatModelGPT4o2024_11_20 ChatModel = "gpt-4o-2024-11-20"`

879 

880 - `const ChatModelGPT4o2024_08_06 ChatModel = "gpt-4o-2024-08-06"`

881 

882 - `const ChatModelGPT4o2024_05_13 ChatModel = "gpt-4o-2024-05-13"`

883 

884 - `const ChatModelGPT4oAudioPreview ChatModel = "gpt-4o-audio-preview"`

885 

886 - `const ChatModelGPT4oAudioPreview2024_10_01 ChatModel = "gpt-4o-audio-preview-2024-10-01"`

887 

888 - `const ChatModelGPT4oAudioPreview2024_12_17 ChatModel = "gpt-4o-audio-preview-2024-12-17"`

889 

890 - `const ChatModelGPT4oAudioPreview2025_06_03 ChatModel = "gpt-4o-audio-preview-2025-06-03"`

891 

892 - `const ChatModelGPT4oMiniAudioPreview ChatModel = "gpt-4o-mini-audio-preview"`

893 

894 - `const ChatModelGPT4oMiniAudioPreview2024_12_17 ChatModel = "gpt-4o-mini-audio-preview-2024-12-17"`

895 

896 - `const ChatModelGPT4oSearchPreview ChatModel = "gpt-4o-search-preview"`

897 

898 - `const ChatModelGPT4oMiniSearchPreview ChatModel = "gpt-4o-mini-search-preview"`

899 

900 - `const ChatModelGPT4oSearchPreview2025_03_11 ChatModel = "gpt-4o-search-preview-2025-03-11"`

901 

902 - `const ChatModelGPT4oMiniSearchPreview2025_03_11 ChatModel = "gpt-4o-mini-search-preview-2025-03-11"`

903 

904 - `const ChatModelChatgpt4oLatest ChatModel = "chatgpt-4o-latest"`

905 

906 - `const ChatModelCodexMiniLatest ChatModel = "codex-mini-latest"`

907 

908 - `const ChatModelGPT4oMini ChatModel = "gpt-4o-mini"`

909 

910 - `const ChatModelGPT4oMini2024_07_18 ChatModel = "gpt-4o-mini-2024-07-18"`

911 

912 - `const ChatModelGPT4Turbo ChatModel = "gpt-4-turbo"`

913 

914 - `const ChatModelGPT4Turbo2024_04_09 ChatModel = "gpt-4-turbo-2024-04-09"`

915 

916 - `const ChatModelGPT4_0125Preview ChatModel = "gpt-4-0125-preview"`

917 

918 - `const ChatModelGPT4TurboPreview ChatModel = "gpt-4-turbo-preview"`

919 

920 - `const ChatModelGPT4_1106Preview ChatModel = "gpt-4-1106-preview"`

921 

922 - `const ChatModelGPT4VisionPreview ChatModel = "gpt-4-vision-preview"`

923 

924 - `const ChatModelGPT4 ChatModel = "gpt-4"`

925 

926 - `const ChatModelGPT4_0314 ChatModel = "gpt-4-0314"`

927 

928 - `const ChatModelGPT4_0613 ChatModel = "gpt-4-0613"`

929 

930 - `const ChatModelGPT4_32k ChatModel = "gpt-4-32k"`

931 

932 - `const ChatModelGPT4_32k0314 ChatModel = "gpt-4-32k-0314"`

933 

934 - `const ChatModelGPT4_32k0613 ChatModel = "gpt-4-32k-0613"`

935 

936 - `const ChatModelGPT3_5Turbo ChatModel = "gpt-3.5-turbo"`

937 

938 - `const ChatModelGPT3_5Turbo16k ChatModel = "gpt-3.5-turbo-16k"`

939 

940 - `const ChatModelGPT3_5Turbo0301 ChatModel = "gpt-3.5-turbo-0301"`

941 

942 - `const ChatModelGPT3_5Turbo0613 ChatModel = "gpt-3.5-turbo-0613"`

943 

944 - `const ChatModelGPT3_5Turbo1106 ChatModel = "gpt-3.5-turbo-1106"`

945 

946 - `const ChatModelGPT3_5Turbo0125 ChatModel = "gpt-3.5-turbo-0125"`

947 

948 - `const ChatModelGPT3_5Turbo16k0613 ChatModel = "gpt-3.5-turbo-16k-0613"`

949 

950 - `type ResponsesModel string`

951 

952 - `const ResponsesModelO1Pro ResponsesModel = "o1-pro"`

953 

954 - `const ResponsesModelO1Pro2025_03_19 ResponsesModel = "o1-pro-2025-03-19"`

955 

956 - `const ResponsesModelO3Pro ResponsesModel = "o3-pro"`

957 

958 - `const ResponsesModelO3Pro2025_06_10 ResponsesModel = "o3-pro-2025-06-10"`

959 

960 - `const ResponsesModelO3DeepResearch ResponsesModel = "o3-deep-research"`

961 

962 - `const ResponsesModelO3DeepResearch2025_06_26 ResponsesModel = "o3-deep-research-2025-06-26"`

963 

964 - `const ResponsesModelO4MiniDeepResearch ResponsesModel = "o4-mini-deep-research"`

965 

966 - `const ResponsesModelO4MiniDeepResearch2025_06_26 ResponsesModel = "o4-mini-deep-research-2025-06-26"`

967 

968 - `const ResponsesModelComputerUsePreview ResponsesModel = "computer-use-preview"`

969 

970 - `const ResponsesModelComputerUsePreview2025_03_11 ResponsesModel = "computer-use-preview-2025-03-11"`

971 

972 - `const ResponsesModelGPT5Codex ResponsesModel = "gpt-5-codex"`

973 

974 - `const ResponsesModelGPT5Pro ResponsesModel = "gpt-5-pro"`

975 

976 - `const ResponsesModelGPT5Pro2025_10_06 ResponsesModel = "gpt-5-pro-2025-10-06"`

977 

978 - `const ResponsesModelGPT5_1CodexMax ResponsesModel = "gpt-5.1-codex-max"`

Details

1## Create admin API key

2 

3`client.Admin.Organization.AdminAPIKeys.New(ctx, body) (*AdminOrganizationAdminAPIKeyNewResponse, error)`

4 

5**post** `/organization/admin_api_keys`

6 

7Create an organization admin API key

8 

9### Parameters

10 

11- `body AdminOrganizationAdminAPIKeyNewParams`

12 

13 - `Name param.Field[string]`

14 

15 - `ExpiresInSeconds param.Field[int64]`

16 

17 The number of seconds until the API key expires. Omit this field for a key that does not expire.

18 

19### Returns

20 

21- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`

22 

23 Represents an individual Admin API key in an org.

24 

25 - `Value string`

26 

27 The value of the API key. Only shown on create.

28 

29### Example

30 

31```go

32package main

33 

34import (

35 "context"

36 "fmt"

37 

38 "github.com/openai/openai-go"

39 "github.com/openai/openai-go/option"

40)

41 

42func main() {

43 client := openai.NewClient(

44 option.WithAdminAPIKey("My Admin API Key"),

45 )

46 adminAPIKey, err := client.Admin.Organization.AdminAPIKeys.New(context.TODO(), openai.AdminOrganizationAdminAPIKeyNewParams{

47 Name: "New Admin Key",

48 })

49 if err != nil {

50 panic(err.Error())

51 }

52 fmt.Printf("%+v\n", adminAPIKey)

53}

54```

55 

56#### Response

57 

58```json

59{

60 "id": "key_abc",

61 "created_at": 1711471533,

62 "expires_at": 1714063533,

63 "object": "organization.admin_api_key",

64 "owner": {

65 "id": "sa_456",

66 "created_at": 1711471533,

67 "name": "My Service Account",

68 "object": "organization.user",

69 "role": "owner",

70 "type": "user"

71 },

72 "redacted_value": "sk-admin...def",

73 "last_used_at": 1711471534,

74 "name": "Administration Key",

75 "value": "sk-admin-1234abcd"

76}

77```

Details

1## List all organization and project API keys.

2 

3`client.Admin.Organization.AdminAPIKeys.List(ctx, query) (*CursorPage[AdminAPIKey], error)`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `query AdminOrganizationAdminAPIKeyListParams`

12 

13 - `After param.Field[string]`

14 

15 Return keys with IDs that come after this ID in the pagination order.

16 

17 - `Limit param.Field[int64]`

18 

19 Maximum number of keys to return.

20 

21 - `Order param.Field[AdminOrganizationAdminAPIKeyListParamsOrder]`

22 

23 Order results by creation time, ascending or descending.

24 

25 - `const AdminOrganizationAdminAPIKeyListParamsOrderAsc AdminOrganizationAdminAPIKeyListParamsOrder = "asc"`

26 

27 - `const AdminOrganizationAdminAPIKeyListParamsOrderDesc AdminOrganizationAdminAPIKeyListParamsOrder = "desc"`

28 

29### Returns

30 

31- `type AdminAPIKey struct{…}`

32 

33 Represents an individual Admin API key in an org.

34 

35 - `ID string`

36 

37 The identifier, which can be referenced in API endpoints

38 

39 - `CreatedAt int64`

40 

41 The Unix timestamp (in seconds) of when the API key was created

42 

43 - `ExpiresAt int64`

44 

45 The Unix timestamp (in seconds) of when the API key expires

46 

47 - `Object OrganizationAdminAPIKey`

48 

49 The object type, which is always `organization.admin_api_key`

50 

51 - `const OrganizationAdminAPIKeyOrganizationAdminAPIKey OrganizationAdminAPIKey = "organization.admin_api_key"`

52 

53 - `Owner AdminAPIKeyOwner`

54 

55 - `ID string`

56 

57 The identifier, which can be referenced in API endpoints

58 

59 - `CreatedAt int64`

60 

61 The Unix timestamp (in seconds) of when the user was created

62 

63 - `Name string`

64 

65 The name of the user

66 

67 - `Object string`

68 

69 The object type, which is always organization.user

70 

71 - `Role string`

72 

73 Always `owner`

74 

75 - `Type string`

76 

77 Always `user`

78 

79 - `RedactedValue string`

80 

81 The redacted value of the API key

82 

83 - `LastUsedAt int64`

84 

85 The Unix timestamp (in seconds) of when the API key was last used

86 

87 - `Name string`

88 

89 The name of the API key

90 

91### Example

92 

93```go

94package main

95 

96import (

97 "context"

98 "fmt"

99 

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

101 "github.com/openai/openai-go/option"

102)

103 

104func main() {

105 client := openai.NewClient(

106 option.WithAdminAPIKey("My Admin API Key"),

107 )

108 page, err := client.Admin.Organization.AdminAPIKeys.List(context.TODO(), openai.AdminOrganizationAdminAPIKeyListParams{

109 

110 })

111 if err != nil {

112 panic(err.Error())

113 }

114 fmt.Printf("%+v\n", page)

115}

116```

117 

118#### Response

119 

120```json

121{

122 "data": [

123 {

124 "id": "key_abc",

125 "created_at": 1711471533,

126 "expires_at": 1714063533,

127 "object": "organization.admin_api_key",

128 "owner": {

129 "id": "sa_456",

130 "created_at": 1711471533,

131 "name": "My Service Account",

132 "object": "organization.user",

133 "role": "owner",

134 "type": "user"

135 },

136 "redacted_value": "sk-admin...def",

137 "last_used_at": 1711471534,

138 "name": "Administration Key"

139 }

140 ],

141 "has_more": false,

142 "object": "list",

143 "first_id": "key_abc",

144 "last_id": "key_xyz"

145}

146```

Details

1## Retrieve admin API key

2 

3`client.Admin.Organization.AdminAPIKeys.Get(ctx, keyID) (*AdminAPIKey, error)`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `keyID string`

12 

13 The ID of the API key.

14 

15### Returns

16 

17- `type AdminAPIKey struct{…}`

18 

19 Represents an individual Admin API key in an org.

20 

21 - `ID string`

22 

23 The identifier, which can be referenced in API endpoints

24 

25 - `CreatedAt int64`

26 

27 The Unix timestamp (in seconds) of when the API key was created

28 

29 - `ExpiresAt int64`

30 

31 The Unix timestamp (in seconds) of when the API key expires

32 

33 - `Object OrganizationAdminAPIKey`

34 

35 The object type, which is always `organization.admin_api_key`

36 

37 - `const OrganizationAdminAPIKeyOrganizationAdminAPIKey OrganizationAdminAPIKey = "organization.admin_api_key"`

38 

39 - `Owner AdminAPIKeyOwner`

40 

41 - `ID string`

42 

43 The identifier, which can be referenced in API endpoints

44 

45 - `CreatedAt int64`

46 

47 The Unix timestamp (in seconds) of when the user was created

48 

49 - `Name string`

50 

51 The name of the user

52 

53 - `Object string`

54 

55 The object type, which is always organization.user

56 

57 - `Role string`

58 

59 Always `owner`

60 

61 - `Type string`

62 

63 Always `user`

64 

65 - `RedactedValue string`

66 

67 The redacted value of the API key

68 

69 - `LastUsedAt int64`

70 

71 The Unix timestamp (in seconds) of when the API key was last used

72 

73 - `Name string`

74 

75 The name of the API key

76 

77### Example

78 

79```go

80package main

81 

82import (

83 "context"

84 "fmt"

85 

86 "github.com/openai/openai-go"

87 "github.com/openai/openai-go/option"

88)

89 

90func main() {

91 client := openai.NewClient(

92 option.WithAdminAPIKey("My Admin API Key"),

93 )

94 adminAPIKey, err := client.Admin.Organization.AdminAPIKeys.Get(context.TODO(), "key_id")

95 if err != nil {

96 panic(err.Error())

97 }

98 fmt.Printf("%+v\n", adminAPIKey.ID)

99}

100```

101 

102#### Response

103 

104```json

105{

106 "id": "key_abc",

107 "created_at": 1711471533,

108 "expires_at": 1714063533,

109 "object": "organization.admin_api_key",

110 "owner": {

111 "id": "sa_456",

112 "created_at": 1711471533,

113 "name": "My Service Account",

114 "object": "organization.user",

115 "role": "owner",

116 "type": "user"

117 },

118 "redacted_value": "sk-admin...def",

119 "last_used_at": 1711471534,

120 "name": "Administration Key"

121}

122```

Details

148 148 

149 - `const AdminOrganizationAuditLogListParamsEventTypeRoleAssignmentDeleted AdminOrganizationAuditLogListParamsEventType = "role.assignment.deleted"`149 - `const AdminOrganizationAuditLogListParamsEventTypeRoleAssignmentDeleted AdminOrganizationAuditLogListParamsEventType = "role.assignment.deleted"`

150 150 

151 - `const AdminOrganizationAuditLogListParamsEventTypeRoleBoundToResource AdminOrganizationAuditLogListParamsEventType = "role.bound_to_resource"`

152 

153 - `const AdminOrganizationAuditLogListParamsEventTypeRoleUnboundFromResource AdminOrganizationAuditLogListParamsEventType = "role.unbound_from_resource"`

154 

151 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`155 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`

152 156 

153 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`157 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`


174 178 

175 - `ResourceIDs param.Field[[]string]`179 - `ResourceIDs param.Field[[]string]`

176 180 

177 Return only events performed on these targets. For example, a project ID updated.181 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

182 

183 - `TenantOnly param.Field[bool]`

184 

185 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

178 186 

179### Returns187### Returns

180 188 


292 300 

293 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`301 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`

294 302 

303 - `const AdminOrganizationAuditLogListResponseTypeRoleBoundToResource AdminOrganizationAuditLogListResponseType = "role.bound_to_resource"`

304 

305 - `const AdminOrganizationAuditLogListResponseTypeRoleUnboundFromResource AdminOrganizationAuditLogListResponseType = "role.unbound_from_resource"`

306 

295 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`307 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`

296 308 

297 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`309 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`


912 924 

913 The type of resource the role assignment was scoped to.925 The type of resource the role assignment was scoped to.

914 926 

927 - `RoleBoundToResource AdminOrganizationAuditLogListResponseRoleBoundToResource`

928 

929 The details for events with this `type`.

930 

931 - `ID string`

932 

933 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

934 

935 - `ConnectorID string`

936 

937 The connector ID for a ChatGPT workspace connector resource.

938 

939 - `ConnectorName string`

940 

941 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

942 

943 - `Enabled bool`

944 

945 Whether the connector is enabled for the role.

946 

947 - `Permissions []string`

948 

949 The permissions granted to the role for the resource.

950 

951 - `ResourceID string`

952 

953 The ID of the resource the role was bound to.

954 

955 - `ResourceType string`

956 

957 The type of resource the role was bound to.

958 

959 - `RoleID string`

960 

961 The ID of the role that was bound to the resource.

962 

963 - `Source string`

964 

965 The connector role mutation path that produced the event.

966 

967 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_toggle"`

968 

969 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_connector_update"`

970 

971 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_delete"`

972 

973 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "workspace_permissions"`

974 

975 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "connector_publish"`

976 

977 - `WorkspaceID string`

978 

979 The workspace ID for a ChatGPT workspace connector resource.

980 

915 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`981 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`

916 982 

917 The details for events with this `type`.983 The details for events with this `type`.


944 1010 

945 The role ID.1011 The role ID.

946 1012 

1013 - `RoleUnboundFromResource AdminOrganizationAuditLogListResponseRoleUnboundFromResource`

1014 

1015 The details for events with this `type`.

1016 

1017 - `ID string`

1018 

1019 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1020 

1021 - `ConnectorID string`

1022 

1023 The connector ID for a ChatGPT workspace connector resource.

1024 

1025 - `ConnectorName string`

1026 

1027 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1028 

1029 - `Enabled bool`

1030 

1031 Whether the connector is enabled for the role.

1032 

1033 - `Permissions []string`

1034 

1035 The permissions remaining for the role after the change.

1036 

1037 - `ResourceID string`

1038 

1039 The ID of the resource the role was unbound from.

1040 

1041 - `ResourceType string`

1042 

1043 The type of resource the role was unbound from.

1044 

1045 - `RoleID string`

1046 

1047 The ID of the role that was unbound from the resource.

1048 

1049 - `Source string`

1050 

1051 The connector role mutation path that produced the event.

1052 

1053 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_toggle"`

1054 

1055 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_connector_update"`

1056 

1057 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_delete"`

1058 

1059 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "workspace_permissions"`

1060 

1061 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "connector_publish"`

1062 

1063 - `WorkspaceID string`

1064 

1065 The workspace ID for a ChatGPT workspace connector resource.

1066 

947 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`1067 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`

948 1068 

949 The details for events with this `type`.1069 The details for events with this `type`.


1427 "resource_id": "resource_id",1547 "resource_id": "resource_id",

1428 "resource_type": "resource_type"1548 "resource_type": "resource_type"

1429 },1549 },

1550 "role.bound_to_resource": {

1551 "id": "id",

1552 "connector_id": "connector_id",

1553 "connector_name": "connector_name",

1554 "enabled": true,

1555 "permissions": [

1556 "string"

1557 ],

1558 "resource_id": "resource_id",

1559 "resource_type": "resource_type",

1560 "role_id": "role_id",

1561 "source": "role_toggle",

1562 "workspace_id": "workspace_id"

1563 },

1430 "role.created": {1564 "role.created": {

1431 "id": "id",1565 "id": "id",

1432 "permissions": [1566 "permissions": [


1439 "role.deleted": {1573 "role.deleted": {

1440 "id": "id"1574 "id": "id"

1441 },1575 },

1576 "role.unbound_from_resource": {

1577 "id": "id",

1578 "connector_id": "connector_id",

1579 "connector_name": "connector_name",

1580 "enabled": true,

1581 "permissions": [

1582 "string"

1583 ],

1584 "resource_id": "resource_id",

1585 "resource_type": "resource_type",

1586 "role_id": "role_id",

1587 "source": "role_toggle",

1588 "workspace_id": "workspace_id"

1589 },

1442 "role.updated": {1590 "role.updated": {

1443 "id": "id",1591 "id": "id",

1444 "changes_requested": {1592 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `projectID string`

12 

13- `alertID string`

14 

15### Returns

16 

17- `type ProjectSpendAlert struct{…}`

18 

19 Represents a spend alert configured at the project level.

20 

21 - `ID string`

22 

23 The identifier, which can be referenced in API endpoints.

24 

25 - `Currency ProjectSpendAlertCurrency`

26 

27 The currency for the threshold amount.

28 

29 - `const ProjectSpendAlertCurrencyUsd ProjectSpendAlertCurrency = "USD"`

30 

31 - `Interval ProjectSpendAlertInterval`

32 

33 The time interval for evaluating spend against the threshold.

34 

35 - `const ProjectSpendAlertIntervalMonth ProjectSpendAlertInterval = "month"`

36 

37 - `NotificationChannel ProjectSpendAlertNotificationChannel`

38 

39 Email notification settings for a spend alert.

40 

41 - `Recipients []string`

42 

43 Email addresses that receive the spend alert notification.

44 

45 - `Type Email`

46 

47 The notification channel type. Currently only `email` is supported.

48 

49 - `const EmailEmail Email = "email"`

50 

51 - `SubjectPrefix string`

52 

53 Optional subject prefix for alert emails.

54 

55 - `Object ProjectSpendAlert`

56 

57 The object type, which is always `project.spend_alert`.

58 

59 - `const ProjectSpendAlertProjectSpendAlert ProjectSpendAlert = "project.spend_alert"`

60 

61 - `ThresholdAmount int64`

62 

63 The alert threshold amount, in cents.

64 

65### Example

66 

67```go

68package main

69 

70import (

71 "context"

72 "fmt"

73 

74 "github.com/openai/openai-go"

75 "github.com/openai/openai-go/option"

76)

77 

78func main() {

79 client := openai.NewClient(

80 option.WithAdminAPIKey("My Admin API Key"),

81 )

82 projectSpendAlert, err := client.Admin.Organization.Projects.SpendAlerts.Get(

83 context.TODO(),

84 "project_id",

85 "alert_id",

86 )

87 if err != nil {

88 panic(err.Error())

89 }

90 fmt.Printf("%+v\n", projectSpendAlert.ID)

91}

92```

93 

94#### Response

95 

96```json

97{

98 "id": "id",

99 "currency": "USD",

100 "interval": "month",

101 "notification_channel": {

102 "recipients": [

103 "string"

104 ],

105 "type": "email",

106 "subject_prefix": "subject_prefix"

107 },

108 "object": "project.spend_alert",

109 "threshold_amount": 0

110}

111```

Details

1## Retrieve organization spend alert

2 

3`client.Admin.Organization.SpendAlerts.Get(ctx, alertID) (*OrganizationSpendAlert, error)`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `alertID string`

12 

13### Returns

14 

15- `type OrganizationSpendAlert struct{…}`

16 

17 Represents a spend alert configured at the organization level.

18 

19 - `ID string`

20 

21 The identifier, which can be referenced in API endpoints.

22 

23 - `Currency OrganizationSpendAlertCurrency`

24 

25 The currency for the threshold amount.

26 

27 - `const OrganizationSpendAlertCurrencyUsd OrganizationSpendAlertCurrency = "USD"`

28 

29 - `Interval OrganizationSpendAlertInterval`

30 

31 The time interval for evaluating spend against the threshold.

32 

33 - `const OrganizationSpendAlertIntervalMonth OrganizationSpendAlertInterval = "month"`

34 

35 - `NotificationChannel OrganizationSpendAlertNotificationChannel`

36 

37 Email notification settings for a spend alert.

38 

39 - `Recipients []string`

40 

41 Email addresses that receive the spend alert notification.

42 

43 - `Type Email`

44 

45 The notification channel type. Currently only `email` is supported.

46 

47 - `const EmailEmail Email = "email"`

48 

49 - `SubjectPrefix string`

50 

51 Optional subject prefix for alert emails.

52 

53 - `Object OrganizationSpendAlert`

54 

55 The object type, which is always `organization.spend_alert`.

56 

57 - `const OrganizationSpendAlertOrganizationSpendAlert OrganizationSpendAlert = "organization.spend_alert"`

58 

59 - `ThresholdAmount int64`

60 

61 The alert threshold amount, in cents.

62 

63### Example

64 

65```go

66package main

67 

68import (

69 "context"

70 "fmt"

71 

72 "github.com/openai/openai-go"

73 "github.com/openai/openai-go/option"

74)

75 

76func main() {

77 client := openai.NewClient(

78 option.WithAdminAPIKey("My Admin API Key"),

79 )

80 organizationSpendAlert, err := client.Admin.Organization.SpendAlerts.Get(context.TODO(), "alert_id")

81 if err != nil {

82 panic(err.Error())

83 }

84 fmt.Printf("%+v\n", organizationSpendAlert.ID)

85}

86```

87 

88#### Response

89 

90```json

91{

92 "id": "id",

93 "currency": "USD",

94 "interval": "month",

95 "notification_channel": {

96 "recipients": [

97 "string"

98 ],

99 "type": "email",

100 "subject_prefix": "subject_prefix"

101 },

102 "object": "organization.spend_alert",

103 "threshold_amount": 0

104}

105```

Details

4793 Configuration options for4793 Configuration options for

4794 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4794 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4795 4795 

4796 - `Context ReasoningContext`

4797 

4798 Controls which reasoning items are rendered back to the model on later turns.

4799 When returned on a response, this is the effective reasoning context mode

4800 used for the response.

4801 

4802 - `const ReasoningContextAuto ReasoningContext = "auto"`

4803 

4804 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

4805 

4806 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

4807 

4796 - `Effort ReasoningEffort`4808 - `Effort ReasoningEffort`

4797 4809 

4798 Constrains effort on reasoning for4810 Constrains effort on reasoning for


5197 "prompt_cache_key": "prompt-cache-key-1234",5209 "prompt_cache_key": "prompt-cache-key-1234",

5198 "prompt_cache_retention": "in_memory",5210 "prompt_cache_retention": "in_memory",

5199 "reasoning": {5211 "reasoning": {

5212 "context": "auto",

5200 "effort": "none",5213 "effort": "none",

5201 "generate_summary": "auto",5214 "generate_summary": "auto",

5202 "summary": "auto"5215 "summary": "auto"

Details

8330 Configuration options for8330 Configuration options for

8331 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8331 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8332 8332 

8333 - `Context ReasoningContext`

8334 

8335 Controls which reasoning items are rendered back to the model on later turns.

8336 When returned on a response, this is the effective reasoning context mode

8337 used for the response.

8338 

8339 - `const ReasoningContextAuto ReasoningContext = "auto"`

8340 

8341 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

8342 

8343 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

8344 

8333 - `Effort ReasoningEffort`8345 - `Effort ReasoningEffort`

8334 8346 

8335 Constrains effort on reasoning for8347 Constrains effort on reasoning for


8737 "prompt_cache_key": "prompt-cache-key-1234",8749 "prompt_cache_key": "prompt-cache-key-1234",

8738 "prompt_cache_retention": "in_memory",8750 "prompt_cache_retention": "in_memory",

8739 "reasoning": {8751 "reasoning": {

8752 "context": "auto",

8740 "effort": "none",8753 "effort": "none",

8741 "generate_summary": "auto",8754 "generate_summary": "auto",

8742 "summary": "auto"8755 "summary": "auto"

Details

4830 Configuration options for4830 Configuration options for

4831 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4831 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4832 4832 

4833 - `Context ReasoningContext`

4834 

4835 Controls which reasoning items are rendered back to the model on later turns.

4836 When returned on a response, this is the effective reasoning context mode

4837 used for the response.

4838 

4839 - `const ReasoningContextAuto ReasoningContext = "auto"`

4840 

4841 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

4842 

4843 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

4844 

4833 - `Effort ReasoningEffort`4845 - `Effort ReasoningEffort`

4834 4846 

4835 Constrains effort on reasoning for4847 Constrains effort on reasoning for


5241 "prompt_cache_key": "prompt-cache-key-1234",5253 "prompt_cache_key": "prompt-cache-key-1234",

5242 "prompt_cache_retention": "in_memory",5254 "prompt_cache_retention": "in_memory",

5243 "reasoning": {5255 "reasoning": {

5256 "context": "auto",

5244 "effort": "none",5257 "effort": "none",

5245 "generate_summary": "auto",5258 "generate_summary": "auto",

5246 "summary": "auto"5259 "summary": "auto"

Details

22 22 

23 - `type VideoEditParamsVideoVideoReferenceInputParam struct{…}`23 - `type VideoEditParamsVideoVideoReferenceInputParam struct{…}`

24 24 

25 Reference to the completed video.25 Reference to the completed video to edit.

26 26 

27 - `ID string`27 - `ID string`

28 28 

index.md +4 −0

Details

408 408 

409 - [Create](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/create/index.md)409 - [Create](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/create/index.md)

410 410 

411 - [Retrieve](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/retrieve/index.md)

412 

411 - [Update](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/update/index.md)413 - [Update](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/update/index.md)

412 414 

413 - [Delete](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/delete/index.md)415 - [Delete](/api/reference/resources/admin/subresources/organization/subresources/spend_alerts/methods/delete/index.md)


546 548 

547 - [Create](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/create/index.md)549 - [Create](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/create/index.md)

548 550 

551 - [Retrieve](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/retrieve/index.md)

552 

549 - [Update](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/update/index.md)553 - [Update](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/update/index.md)

550 554 

551 - [Delete](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/delete/index.md)555 - [Delete](/api/reference/resources/admin/subresources/organization/subresources/projects/subresources/spend_alerts/methods/delete/index.md)

Details

577 Configuration options for577 Configuration options for

578 [reasoning models](https://platform.openai.com/docs/guides/reasoning).578 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

579 579 

580 - `Optional<Context> context`

581 

582 Controls which reasoning items are rendered back to the model on later turns.

583 When returned on a response, this is the effective reasoning context mode

584 used for the response.

585 

586 - `AUTO("auto")`

587 

588 - `CURRENT_TURN("current_turn")`

589 

590 - `ALL_TURNS("all_turns")`

591 

580 - `Optional<ReasoningEffort> effort`592 - `Optional<ReasoningEffort> effort`

581 593 

582 Constrains effort on reasoning for594 Constrains effort on reasoning for

Details

1## Create admin API key

2 

3`AdminApiKeyCreateResponse admin().organization().adminApiKeys().create(AdminApiKeyCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

4 

5**post** `/organization/admin_api_keys`

6 

7Create an organization admin API key

8 

9### Parameters

10 

11- `AdminApiKeyCreateParams params`

12 

13 - `String name`

14 

15 - `Optional<Long> expiresInSeconds`

16 

17 The number of seconds until the API key expires. Omit this field for a key that does not expire.

18 

19### Returns

20 

21- `class AdminApiKeyCreateResponse:`

22 

23 Represents an individual Admin API key in an org.

24 

25 - `String value`

26 

27 The value of the API key. Only shown on create.

28 

29### Example

30 

31```java

32package com.openai.example;

33 

34import com.openai.client.OpenAIClient;

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

36import com.openai.models.admin.organization.adminapikeys.AdminApiKeyCreateParams;

37import com.openai.models.admin.organization.adminapikeys.AdminApiKeyCreateResponse;

38 

39public final class Main {

40 private Main() {}

41 

42 public static void main(String[] args) {

43 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

44 

45 AdminApiKeyCreateParams params = AdminApiKeyCreateParams.builder()

46 .name("New Admin Key")

47 .build();

48 AdminApiKeyCreateResponse adminApiKey = client.admin().organization().adminApiKeys().create(params);

49 }

50}

51```

52 

53#### Response

54 

55```json

56{

57 "id": "key_abc",

58 "created_at": 1711471533,

59 "expires_at": 1714063533,

60 "object": "organization.admin_api_key",

61 "owner": {

62 "id": "sa_456",

63 "created_at": 1711471533,

64 "name": "My Service Account",

65 "object": "organization.user",

66 "role": "owner",

67 "type": "user"

68 },

69 "redacted_value": "sk-admin...def",

70 "last_used_at": 1711471534,

71 "name": "Administration Key",

72 "value": "sk-admin-1234abcd"

73}

74```

Details

1## List all organization and project API keys.

2 

3`AdminApiKeyListPage admin().organization().adminApiKeys().list(AdminApiKeyListParamsparams = AdminApiKeyListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `AdminApiKeyListParams params`

12 

13 - `Optional<String> after`

14 

15 Return keys with IDs that come after this ID in the pagination order.

16 

17 - `Optional<Long> limit`

18 

19 Maximum number of keys to return.

20 

21 - `Optional<Order> order`

22 

23 Order results by creation time, ascending or descending.

24 

25 - `ASC("asc")`

26 

27 - `DESC("desc")`

28 

29### Returns

30 

31- `class AdminApiKey:`

32 

33 Represents an individual Admin API key in an org.

34 

35 - `String id`

36 

37 The identifier, which can be referenced in API endpoints

38 

39 - `long createdAt`

40 

41 The Unix timestamp (in seconds) of when the API key was created

42 

43 - `Optional<Long> expiresAt`

44 

45 The Unix timestamp (in seconds) of when the API key expires

46 

47 - `JsonValue; object_ "organization.admin_api_key"constant`

48 

49 The object type, which is always `organization.admin_api_key`

50 

51 - `ORGANIZATION_ADMIN_API_KEY("organization.admin_api_key")`

52 

53 - `Owner owner`

54 

55 - `Optional<String> id`

56 

57 The identifier, which can be referenced in API endpoints

58 

59 - `Optional<Long> createdAt`

60 

61 The Unix timestamp (in seconds) of when the user was created

62 

63 - `Optional<String> name`

64 

65 The name of the user

66 

67 - `Optional<String> object_`

68 

69 The object type, which is always organization.user

70 

71 - `Optional<String> role`

72 

73 Always `owner`

74 

75 - `Optional<String> type`

76 

77 Always `user`

78 

79 - `String redactedValue`

80 

81 The redacted value of the API key

82 

83 - `Optional<Long> lastUsedAt`

84 

85 The Unix timestamp (in seconds) of when the API key was last used

86 

87 - `Optional<String> name`

88 

89 The name of the API key

90 

91### Example

92 

93```java

94package com.openai.example;

95 

96import com.openai.client.OpenAIClient;

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

98import com.openai.models.admin.organization.adminapikeys.AdminApiKeyListPage;

99import com.openai.models.admin.organization.adminapikeys.AdminApiKeyListParams;

100 

101public final class Main {

102 private Main() {}

103 

104 public static void main(String[] args) {

105 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

106 

107 AdminApiKeyListPage page = client.admin().organization().adminApiKeys().list();

108 }

109}

110```

111 

112#### Response

113 

114```json

115{

116 "data": [

117 {

118 "id": "key_abc",

119 "created_at": 1711471533,

120 "expires_at": 1714063533,

121 "object": "organization.admin_api_key",

122 "owner": {

123 "id": "sa_456",

124 "created_at": 1711471533,

125 "name": "My Service Account",

126 "object": "organization.user",

127 "role": "owner",

128 "type": "user"

129 },

130 "redacted_value": "sk-admin...def",

131 "last_used_at": 1711471534,

132 "name": "Administration Key"

133 }

134 ],

135 "has_more": false,

136 "object": "list",

137 "first_id": "key_abc",

138 "last_id": "key_xyz"

139}

140```

Details

1## Retrieve admin API key

2 

3`AdminApiKey admin().organization().adminApiKeys().retrieve(AdminApiKeyRetrieveParamsparams = AdminApiKeyRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `AdminApiKeyRetrieveParams params`

12 

13 - `Optional<String> keyId`

14 

15 The ID of the API key.

16 

17### Returns

18 

19- `class AdminApiKey:`

20 

21 Represents an individual Admin API key in an org.

22 

23 - `String id`

24 

25 The identifier, which can be referenced in API endpoints

26 

27 - `long createdAt`

28 

29 The Unix timestamp (in seconds) of when the API key was created

30 

31 - `Optional<Long> expiresAt`

32 

33 The Unix timestamp (in seconds) of when the API key expires

34 

35 - `JsonValue; object_ "organization.admin_api_key"constant`

36 

37 The object type, which is always `organization.admin_api_key`

38 

39 - `ORGANIZATION_ADMIN_API_KEY("organization.admin_api_key")`

40 

41 - `Owner owner`

42 

43 - `Optional<String> id`

44 

45 The identifier, which can be referenced in API endpoints

46 

47 - `Optional<Long> createdAt`

48 

49 The Unix timestamp (in seconds) of when the user was created

50 

51 - `Optional<String> name`

52 

53 The name of the user

54 

55 - `Optional<String> object_`

56 

57 The object type, which is always organization.user

58 

59 - `Optional<String> role`

60 

61 Always `owner`

62 

63 - `Optional<String> type`

64 

65 Always `user`

66 

67 - `String redactedValue`

68 

69 The redacted value of the API key

70 

71 - `Optional<Long> lastUsedAt`

72 

73 The Unix timestamp (in seconds) of when the API key was last used

74 

75 - `Optional<String> name`

76 

77 The name of the API key

78 

79### Example

80 

81```java

82package com.openai.example;

83 

84import com.openai.client.OpenAIClient;

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

86import com.openai.models.admin.organization.adminapikeys.AdminApiKey;

87import com.openai.models.admin.organization.adminapikeys.AdminApiKeyRetrieveParams;

88 

89public final class Main {

90 private Main() {}

91 

92 public static void main(String[] args) {

93 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

94 

95 AdminApiKey adminApiKey = client.admin().organization().adminApiKeys().retrieve("key_id");

96 }

97}

98```

99 

100#### Response

101 

102```json

103{

104 "id": "key_abc",

105 "created_at": 1711471533,

106 "expires_at": 1714063533,

107 "object": "organization.admin_api_key",

108 "owner": {

109 "id": "sa_456",

110 "created_at": 1711471533,

111 "name": "My Service Account",

112 "object": "organization.user",

113 "role": "owner",

114 "type": "user"

115 },

116 "redacted_value": "sk-admin...def",

117 "last_used_at": 1711471534,

118 "name": "Administration Key"

119}

120```

Details

148 148 

149 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`149 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

150 150 

151 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

152 

153 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

154 

151 - `SCIM_ENABLED("scim.enabled")`155 - `SCIM_ENABLED("scim.enabled")`

152 156 

153 - `SCIM_DISABLED("scim.disabled")`157 - `SCIM_DISABLED("scim.disabled")`


174 178 

175 - `Optional<List<String>> resourceIds`179 - `Optional<List<String>> resourceIds`

176 180 

177 Return only events performed on these targets. For example, a project ID updated.181 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

182 

183 - `Optional<Boolean> tenantOnly`

184 

185 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

178 186 

179### Returns187### Returns

180 188 


292 300 

293 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`301 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

294 302 

303 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

304 

305 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

306 

295 - `SCIM_ENABLED("scim.enabled")`307 - `SCIM_ENABLED("scim.enabled")`

296 308 

297 - `SCIM_DISABLED("scim.disabled")`309 - `SCIM_DISABLED("scim.disabled")`


912 924 

913 The type of resource the role assignment was scoped to.925 The type of resource the role assignment was scoped to.

914 926 

927 - `Optional<RoleBoundToResource> roleBoundToResource`

928 

929 The details for events with this `type`.

930 

931 - `Optional<String> id`

932 

933 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

934 

935 - `Optional<String> connectorId`

936 

937 The connector ID for a ChatGPT workspace connector resource.

938 

939 - `Optional<String> connectorName`

940 

941 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

942 

943 - `Optional<Boolean> enabled`

944 

945 Whether the connector is enabled for the role.

946 

947 - `Optional<List<String>> permissions`

948 

949 The permissions granted to the role for the resource.

950 

951 - `Optional<String> resourceId`

952 

953 The ID of the resource the role was bound to.

954 

955 - `Optional<String> resourceType`

956 

957 The type of resource the role was bound to.

958 

959 - `Optional<String> roleId`

960 

961 The ID of the role that was bound to the resource.

962 

963 - `Optional<Source> source`

964 

965 The connector role mutation path that produced the event.

966 

967 - `ROLE_TOGGLE("role_toggle")`

968 

969 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

970 

971 - `ROLE_DELETE("role_delete")`

972 

973 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

974 

975 - `CONNECTOR_PUBLISH("connector_publish")`

976 

977 - `Optional<String> workspaceId`

978 

979 The workspace ID for a ChatGPT workspace connector resource.

980 

915 - `Optional<RoleCreated> roleCreated`981 - `Optional<RoleCreated> roleCreated`

916 982 

917 The details for events with this `type`.983 The details for events with this `type`.


944 1010 

945 The role ID.1011 The role ID.

946 1012 

1013 - `Optional<RoleUnboundFromResource> roleUnboundFromResource`

1014 

1015 The details for events with this `type`.

1016 

1017 - `Optional<String> id`

1018 

1019 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1020 

1021 - `Optional<String> connectorId`

1022 

1023 The connector ID for a ChatGPT workspace connector resource.

1024 

1025 - `Optional<String> connectorName`

1026 

1027 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1028 

1029 - `Optional<Boolean> enabled`

1030 

1031 Whether the connector is enabled for the role.

1032 

1033 - `Optional<List<String>> permissions`

1034 

1035 The permissions remaining for the role after the change.

1036 

1037 - `Optional<String> resourceId`

1038 

1039 The ID of the resource the role was unbound from.

1040 

1041 - `Optional<String> resourceType`

1042 

1043 The type of resource the role was unbound from.

1044 

1045 - `Optional<String> roleId`

1046 

1047 The ID of the role that was unbound from the resource.

1048 

1049 - `Optional<Source> source`

1050 

1051 The connector role mutation path that produced the event.

1052 

1053 - `ROLE_TOGGLE("role_toggle")`

1054 

1055 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

1056 

1057 - `ROLE_DELETE("role_delete")`

1058 

1059 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

1060 

1061 - `CONNECTOR_PUBLISH("connector_publish")`

1062 

1063 - `Optional<String> workspaceId`

1064 

1065 The workspace ID for a ChatGPT workspace connector resource.

1066 

947 - `Optional<RoleUpdated> roleUpdated`1067 - `Optional<RoleUpdated> roleUpdated`

948 1068 

949 The details for events with this `type`.1069 The details for events with this `type`.


1421 "resource_id": "resource_id",1541 "resource_id": "resource_id",

1422 "resource_type": "resource_type"1542 "resource_type": "resource_type"

1423 },1543 },

1544 "role.bound_to_resource": {

1545 "id": "id",

1546 "connector_id": "connector_id",

1547 "connector_name": "connector_name",

1548 "enabled": true,

1549 "permissions": [

1550 "string"

1551 ],

1552 "resource_id": "resource_id",

1553 "resource_type": "resource_type",

1554 "role_id": "role_id",

1555 "source": "role_toggle",

1556 "workspace_id": "workspace_id"

1557 },

1424 "role.created": {1558 "role.created": {

1425 "id": "id",1559 "id": "id",

1426 "permissions": [1560 "permissions": [


1433 "role.deleted": {1567 "role.deleted": {

1434 "id": "id"1568 "id": "id"

1435 },1569 },

1570 "role.unbound_from_resource": {

1571 "id": "id",

1572 "connector_id": "connector_id",

1573 "connector_name": "connector_name",

1574 "enabled": true,

1575 "permissions": [

1576 "string"

1577 ],

1578 "resource_id": "resource_id",

1579 "resource_type": "resource_type",

1580 "role_id": "role_id",

1581 "source": "role_toggle",

1582 "workspace_id": "workspace_id"

1583 },

1436 "role.updated": {1584 "role.updated": {

1437 "id": "id",1585 "id": "id",

1438 "changes_requested": {1586 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`ProjectSpendAlert admin().organization().projects().spendAlerts().retrieve(SpendAlertRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `SpendAlertRetrieveParams params`

12 

13 - `String projectId`

14 

15 - `Optional<String> alertId`

16 

17### Returns

18 

19- `class ProjectSpendAlert:`

20 

21 Represents a spend alert configured at the project level.

22 

23 - `String id`

24 

25 The identifier, which can be referenced in API endpoints.

26 

27 - `Currency currency`

28 

29 The currency for the threshold amount.

30 

31 - `USD("USD")`

32 

33 - `Interval interval`

34 

35 The time interval for evaluating spend against the threshold.

36 

37 - `MONTH("month")`

38 

39 - `NotificationChannel notificationChannel`

40 

41 Email notification settings for a spend alert.

42 

43 - `List<String> recipients`

44 

45 Email addresses that receive the spend alert notification.

46 

47 - `JsonValue; type "email"constant`

48 

49 The notification channel type. Currently only `email` is supported.

50 

51 - `EMAIL("email")`

52 

53 - `Optional<String> subjectPrefix`

54 

55 Optional subject prefix for alert emails.

56 

57 - `JsonValue; object_ "project.spend_alert"constant`

58 

59 The object type, which is always `project.spend_alert`.

60 

61 - `PROJECT_SPEND_ALERT("project.spend_alert")`

62 

63 - `long thresholdAmount`

64 

65 The alert threshold amount, in cents.

66 

67### Example

68 

69```java

70package com.openai.example;

71 

72import com.openai.client.OpenAIClient;

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

74import com.openai.models.admin.organization.projects.spendalerts.ProjectSpendAlert;

75import com.openai.models.admin.organization.projects.spendalerts.SpendAlertRetrieveParams;

76 

77public final class Main {

78 private Main() {}

79 

80 public static void main(String[] args) {

81 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

82 

83 SpendAlertRetrieveParams params = SpendAlertRetrieveParams.builder()

84 .projectId("project_id")

85 .alertId("alert_id")

86 .build();

87 ProjectSpendAlert projectSpendAlert = client.admin().organization().projects().spendAlerts().retrieve(params);

88 }

89}

90```

91 

92#### Response

93 

94```json

95{

96 "id": "id",

97 "currency": "USD",

98 "interval": "month",

99 "notification_channel": {

100 "recipients": [

101 "string"

102 ],

103 "type": "email",

104 "subject_prefix": "subject_prefix"

105 },

106 "object": "project.spend_alert",

107 "threshold_amount": 0

108}

109```

Details

1## Retrieve organization spend alert

2 

3`OrganizationSpendAlert admin().organization().spendAlerts().retrieve(SpendAlertRetrieveParamsparams = SpendAlertRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `SpendAlertRetrieveParams params`

12 

13 - `Optional<String> alertId`

14 

15### Returns

16 

17- `class OrganizationSpendAlert:`

18 

19 Represents a spend alert configured at the organization level.

20 

21 - `String id`

22 

23 The identifier, which can be referenced in API endpoints.

24 

25 - `Currency currency`

26 

27 The currency for the threshold amount.

28 

29 - `USD("USD")`

30 

31 - `Interval interval`

32 

33 The time interval for evaluating spend against the threshold.

34 

35 - `MONTH("month")`

36 

37 - `NotificationChannel notificationChannel`

38 

39 Email notification settings for a spend alert.

40 

41 - `List<String> recipients`

42 

43 Email addresses that receive the spend alert notification.

44 

45 - `JsonValue; type "email"constant`

46 

47 The notification channel type. Currently only `email` is supported.

48 

49 - `EMAIL("email")`

50 

51 - `Optional<String> subjectPrefix`

52 

53 Optional subject prefix for alert emails.

54 

55 - `JsonValue; object_ "organization.spend_alert"constant`

56 

57 The object type, which is always `organization.spend_alert`.

58 

59 - `ORGANIZATION_SPEND_ALERT("organization.spend_alert")`

60 

61 - `long thresholdAmount`

62 

63 The alert threshold amount, in cents.

64 

65### Example

66 

67```java

68package com.openai.example;

69 

70import com.openai.client.OpenAIClient;

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

72import com.openai.models.admin.organization.spendalerts.OrganizationSpendAlert;

73import com.openai.models.admin.organization.spendalerts.SpendAlertRetrieveParams;

74 

75public final class Main {

76 private Main() {}

77 

78 public static void main(String[] args) {

79 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

80 

81 OrganizationSpendAlert organizationSpendAlert = client.admin().organization().spendAlerts().retrieve("alert_id");

82 }

83}

84```

85 

86#### Response

87 

88```json

89{

90 "id": "id",

91 "currency": "USD",

92 "interval": "month",

93 "notification_channel": {

94 "recipients": [

95 "string"

96 ],

97 "type": "email",

98 "subject_prefix": "subject_prefix"

99 },

100 "object": "organization.spend_alert",

101 "threshold_amount": 0

102}

103```

Details

4664 Configuration options for4664 Configuration options for

4665 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4665 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4666 4666 

4667 - `Optional<Context> context`

4668 

4669 Controls which reasoning items are rendered back to the model on later turns.

4670 When returned on a response, this is the effective reasoning context mode

4671 used for the response.

4672 

4673 - `AUTO("auto")`

4674 

4675 - `CURRENT_TURN("current_turn")`

4676 

4677 - `ALL_TURNS("all_turns")`

4678 

4667 - `Optional<ReasoningEffort> effort`4679 - `Optional<ReasoningEffort> effort`

4668 4680 

4669 Constrains effort on reasoning for4681 Constrains effort on reasoning for


5064 "prompt_cache_key": "prompt-cache-key-1234",5076 "prompt_cache_key": "prompt-cache-key-1234",

5065 "prompt_cache_retention": "in_memory",5077 "prompt_cache_retention": "in_memory",

5066 "reasoning": {5078 "reasoning": {

5079 "context": "auto",

5067 "effort": "none",5080 "effort": "none",

5068 "generate_summary": "auto",5081 "generate_summary": "auto",

5069 "summary": "auto"5082 "summary": "auto"

Details

8102 Configuration options for8102 Configuration options for

8103 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8103 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8104 8104 

8105 - `Optional<Context> context`

8106 

8107 Controls which reasoning items are rendered back to the model on later turns.

8108 When returned on a response, this is the effective reasoning context mode

8109 used for the response.

8110 

8111 - `AUTO("auto")`

8112 

8113 - `CURRENT_TURN("current_turn")`

8114 

8115 - `ALL_TURNS("all_turns")`

8116 

8105 - `Optional<ReasoningEffort> effort`8117 - `Optional<ReasoningEffort> effort`

8106 8118 

8107 Constrains effort on reasoning for8119 Constrains effort on reasoning for


8502 "prompt_cache_key": "prompt-cache-key-1234",8514 "prompt_cache_key": "prompt-cache-key-1234",

8503 "prompt_cache_retention": "in_memory",8515 "prompt_cache_retention": "in_memory",

8504 "reasoning": {8516 "reasoning": {

8517 "context": "auto",

8505 "effort": "none",8518 "effort": "none",

8506 "generate_summary": "auto",8519 "generate_summary": "auto",

8507 "summary": "auto"8520 "summary": "auto"

Details

4697 Configuration options for4697 Configuration options for

4698 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4698 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4699 4699 

4700 - `Optional<Context> context`

4701 

4702 Controls which reasoning items are rendered back to the model on later turns.

4703 When returned on a response, this is the effective reasoning context mode

4704 used for the response.

4705 

4706 - `AUTO("auto")`

4707 

4708 - `CURRENT_TURN("current_turn")`

4709 

4710 - `ALL_TURNS("all_turns")`

4711 

4700 - `Optional<ReasoningEffort> effort`4712 - `Optional<ReasoningEffort> effort`

4701 4713 

4702 Constrains effort on reasoning for4714 Constrains effort on reasoning for


5097 "prompt_cache_key": "prompt-cache-key-1234",5109 "prompt_cache_key": "prompt-cache-key-1234",

5098 "prompt_cache_retention": "in_memory",5110 "prompt_cache_retention": "in_memory",

5099 "reasoning": {5111 "reasoning": {

5112 "context": "auto",

5100 "effort": "none",5113 "effort": "none",

5101 "generate_summary": "auto",5114 "generate_summary": "auto",

5102 "summary": "auto"5115 "summary": "auto"

Details

22 22 

23 - `class VideoReferenceInputParam:`23 - `class VideoReferenceInputParam:`

24 24 

25 Reference to the completed video.25 Reference to the completed video to edit.

26 26 

27 - `String id`27 - `String id`

28 28 

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `Union[str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "o3-pro", 11 more]]`

8 

9 - `str`

10 

11 - `Literal["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", 75 more]`

12 

13 - `"gpt-5.4"`

14 

15 - `"gpt-5.4-mini"`

16 

17 - `"gpt-5.4-nano"`

18 

19 - `"gpt-5.4-mini-2026-03-17"`

20 

21 - `"gpt-5.4-nano-2026-03-17"`

22 

23 - `"gpt-5.3-chat-latest"`

24 

25 - `"gpt-5.2"`

26 

27 - `"gpt-5.2-2025-12-11"`

28 

29 - `"gpt-5.2-chat-latest"`

30 

31 - `"gpt-5.2-pro"`

32 

33 - `"gpt-5.2-pro-2025-12-11"`

34 

35 - `"gpt-5.1"`

36 

37 - `"gpt-5.1-2025-11-13"`

38 

39 - `"gpt-5.1-codex"`

40 

41 - `"gpt-5.1-mini"`

42 

43 - `"gpt-5.1-chat-latest"`

44 

45 - `"gpt-5"`

46 

47 - `"gpt-5-mini"`

48 

49 - `"gpt-5-nano"`

50 

51 - `"gpt-5-2025-08-07"`

52 

53 - `"gpt-5-mini-2025-08-07"`

54 

55 - `"gpt-5-nano-2025-08-07"`

56 

57 - `"gpt-5-chat-latest"`

58 

59 - `"gpt-4.1"`

60 

61 - `"gpt-4.1-mini"`

62 

63 - `"gpt-4.1-nano"`

64 

65 - `"gpt-4.1-2025-04-14"`

66 

67 - `"gpt-4.1-mini-2025-04-14"`

68 

69 - `"gpt-4.1-nano-2025-04-14"`

70 

71 - `"o4-mini"`

72 

73 - `"o4-mini-2025-04-16"`

74 

75 - `"o3"`

76 

77 - `"o3-2025-04-16"`

78 

79 - `"o3-mini"`

80 

81 - `"o3-mini-2025-01-31"`

82 

83 - `"o1"`

84 

85 - `"o1-2024-12-17"`

86 

87 - `"o1-preview"`

88 

89 - `"o1-preview-2024-09-12"`

90 

91 - `"o1-mini"`

92 

93 - `"o1-mini-2024-09-12"`

94 

95 - `"gpt-4o"`

96 

97 - `"gpt-4o-2024-11-20"`

98 

99 - `"gpt-4o-2024-08-06"`

100 

101 - `"gpt-4o-2024-05-13"`

102 

103 - `"gpt-4o-audio-preview"`

104 

105 - `"gpt-4o-audio-preview-2024-10-01"`

106 

107 - `"gpt-4o-audio-preview-2024-12-17"`

108 

109 - `"gpt-4o-audio-preview-2025-06-03"`

110 

111 - `"gpt-4o-mini-audio-preview"`

112 

113 - `"gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `"gpt-4o-search-preview"`

116 

117 - `"gpt-4o-mini-search-preview"`

118 

119 - `"gpt-4o-search-preview-2025-03-11"`

120 

121 - `"gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `"chatgpt-4o-latest"`

124 

125 - `"codex-mini-latest"`

126 

127 - `"gpt-4o-mini"`

128 

129 - `"gpt-4o-mini-2024-07-18"`

130 

131 - `"gpt-4-turbo"`

132 

133 - `"gpt-4-turbo-2024-04-09"`

134 

135 - `"gpt-4-0125-preview"`

136 

137 - `"gpt-4-turbo-preview"`

138 

139 - `"gpt-4-1106-preview"`

140 

141 - `"gpt-4-vision-preview"`

142 

143 - `"gpt-4"`

144 

145 - `"gpt-4-0314"`

146 

147 - `"gpt-4-0613"`

148 

149 - `"gpt-4-32k"`

150 

151 - `"gpt-4-32k-0314"`

152 

153 - `"gpt-4-32k-0613"`

154 

155 - `"gpt-3.5-turbo"`

156 

157 - `"gpt-3.5-turbo-16k"`

158 

159 - `"gpt-3.5-turbo-0301"`

160 

161 - `"gpt-3.5-turbo-0613"`

162 

163 - `"gpt-3.5-turbo-1106"`

164 

165 - `"gpt-3.5-turbo-0125"`

166 

167 - `"gpt-3.5-turbo-16k-0613"`

168 

169 - `Literal["o1-pro", "o1-pro-2025-03-19", "o3-pro", 11 more]`

170 

171 - `"o1-pro"`

172 

173 - `"o1-pro-2025-03-19"`

174 

175 - `"o3-pro"`

176 

177 - `"o3-pro-2025-06-10"`

178 

179 - `"o3-deep-research"`

180 

181 - `"o3-deep-research-2025-06-26"`

182 

183 - `"o4-mini-deep-research"`

184 

185 - `"o4-mini-deep-research-2025-06-26"`

186 

187 - `"computer-use-preview"`

188 

189 - `"computer-use-preview-2025-03-11"`

190 

191 - `"gpt-5-codex"`

192 

193 - `"gpt-5-pro"`

194 

195 - `"gpt-5-pro-2025-10-06"`

196 

197 - `"gpt-5.1-codex-max"`

198 

199### Chat Model

200 

201- `Literal["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", 75 more]`

202 

203 - `"gpt-5.4"`

204 

205 - `"gpt-5.4-mini"`

206 

207 - `"gpt-5.4-nano"`

208 

209 - `"gpt-5.4-mini-2026-03-17"`

210 

211 - `"gpt-5.4-nano-2026-03-17"`

212 

213 - `"gpt-5.3-chat-latest"`

214 

215 - `"gpt-5.2"`

216 

217 - `"gpt-5.2-2025-12-11"`

218 

219 - `"gpt-5.2-chat-latest"`

220 

221 - `"gpt-5.2-pro"`

222 

223 - `"gpt-5.2-pro-2025-12-11"`

224 

225 - `"gpt-5.1"`

226 

227 - `"gpt-5.1-2025-11-13"`

228 

229 - `"gpt-5.1-codex"`

230 

231 - `"gpt-5.1-mini"`

232 

233 - `"gpt-5.1-chat-latest"`

234 

235 - `"gpt-5"`

236 

237 - `"gpt-5-mini"`

238 

239 - `"gpt-5-nano"`

240 

241 - `"gpt-5-2025-08-07"`

242 

243 - `"gpt-5-mini-2025-08-07"`

244 

245 - `"gpt-5-nano-2025-08-07"`

246 

247 - `"gpt-5-chat-latest"`

248 

249 - `"gpt-4.1"`

250 

251 - `"gpt-4.1-mini"`

252 

253 - `"gpt-4.1-nano"`

254 

255 - `"gpt-4.1-2025-04-14"`

256 

257 - `"gpt-4.1-mini-2025-04-14"`

258 

259 - `"gpt-4.1-nano-2025-04-14"`

260 

261 - `"o4-mini"`

262 

263 - `"o4-mini-2025-04-16"`

264 

265 - `"o3"`

266 

267 - `"o3-2025-04-16"`

268 

269 - `"o3-mini"`

270 

271 - `"o3-mini-2025-01-31"`

272 

273 - `"o1"`

274 

275 - `"o1-2024-12-17"`

276 

277 - `"o1-preview"`

278 

279 - `"o1-preview-2024-09-12"`

280 

281 - `"o1-mini"`

282 

283 - `"o1-mini-2024-09-12"`

284 

285 - `"gpt-4o"`

286 

287 - `"gpt-4o-2024-11-20"`

288 

289 - `"gpt-4o-2024-08-06"`

290 

291 - `"gpt-4o-2024-05-13"`

292 

293 - `"gpt-4o-audio-preview"`

294 

295 - `"gpt-4o-audio-preview-2024-10-01"`

296 

297 - `"gpt-4o-audio-preview-2024-12-17"`

298 

299 - `"gpt-4o-audio-preview-2025-06-03"`

300 

301 - `"gpt-4o-mini-audio-preview"`

302 

303 - `"gpt-4o-mini-audio-preview-2024-12-17"`

304 

305 - `"gpt-4o-search-preview"`

306 

307 - `"gpt-4o-mini-search-preview"`

308 

309 - `"gpt-4o-search-preview-2025-03-11"`

310 

311 - `"gpt-4o-mini-search-preview-2025-03-11"`

312 

313 - `"chatgpt-4o-latest"`

314 

315 - `"codex-mini-latest"`

316 

317 - `"gpt-4o-mini"`

318 

319 - `"gpt-4o-mini-2024-07-18"`

320 

321 - `"gpt-4-turbo"`

322 

323 - `"gpt-4-turbo-2024-04-09"`

324 

325 - `"gpt-4-0125-preview"`

326 

327 - `"gpt-4-turbo-preview"`

328 

329 - `"gpt-4-1106-preview"`

330 

331 - `"gpt-4-vision-preview"`

332 

333 - `"gpt-4"`

334 

335 - `"gpt-4-0314"`

336 

337 - `"gpt-4-0613"`

338 

339 - `"gpt-4-32k"`

340 

341 - `"gpt-4-32k-0314"`

342 

343 - `"gpt-4-32k-0613"`

344 

345 - `"gpt-3.5-turbo"`

346 

347 - `"gpt-3.5-turbo-16k"`

348 

349 - `"gpt-3.5-turbo-0301"`

350 

351 - `"gpt-3.5-turbo-0613"`

352 

353 - `"gpt-3.5-turbo-1106"`

354 

355 - `"gpt-3.5-turbo-0125"`

356 

357 - `"gpt-3.5-turbo-16k-0613"`

358 

359### Comparison Filter

360 

361- `class ComparisonFilter: …`

362 

363 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

364 

365 - `key: str`

366 

367 The key to compare against the value.

368 

369 - `type: Literal["eq", "ne", "gt", 5 more]`

370 

371 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

372 

373 - `eq`: equals

374 - `ne`: not equal

375 - `gt`: greater than

376 - `gte`: greater than or equal

377 - `lt`: less than

378 - `lte`: less than or equal

379 - `in`: in

380 - `nin`: not in

381 

382 - `"eq"`

383 

384 - `"ne"`

385 

386 - `"gt"`

387 

388 - `"gte"`

389 

390 - `"lt"`

391 

392 - `"lte"`

393 

394 - `"in"`

395 

396 - `"nin"`

397 

398 - `value: Union[str, float, bool, List[Union[str, float]]]`

399 

400 The value to compare against the attribute key; supports string, number, or boolean types.

401 

402 - `str`

403 

404 - `float`

405 

406 - `bool`

407 

408 - `List[Union[str, float]]`

409 

410 - `str`

411 

412 - `float`

413 

414### Compound Filter

415 

416- `class CompoundFilter: …`

417 

418 Combine multiple filters using `and` or `or`.

419 

420 - `filters: List[Filter]`

421 

422 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

423 

424 - `class ComparisonFilter: …`

425 

426 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

427 

428 - `key: str`

429 

430 The key to compare against the value.

431 

432 - `type: Literal["eq", "ne", "gt", 5 more]`

433 

434 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

435 

436 - `eq`: equals

437 - `ne`: not equal

438 - `gt`: greater than

439 - `gte`: greater than or equal

440 - `lt`: less than

441 - `lte`: less than or equal

442 - `in`: in

443 - `nin`: not in

444 

445 - `"eq"`

446 

447 - `"ne"`

448 

449 - `"gt"`

450 

451 - `"gte"`

452 

453 - `"lt"`

454 

455 - `"lte"`

456 

457 - `"in"`

458 

459 - `"nin"`

460 

461 - `value: Union[str, float, bool, List[Union[str, float]]]`

462 

463 The value to compare against the attribute key; supports string, number, or boolean types.

464 

465 - `str`

466 

467 - `float`

468 

469 - `bool`

470 

471 - `List[Union[str, float]]`

472 

473 - `str`

474 

475 - `float`

476 

477 - `object`

478 

479 - `type: Literal["and", "or"]`

480 

481 Type of operation: `and` or `or`.

482 

483 - `"and"`

484 

485 - `"or"`

486 

487### Custom Tool Input Format

488 

489- `CustomToolInputFormat`

490 

491 The input format for the custom tool. Default is unconstrained text.

492 

493 - `class Text: …`

494 

495 Unconstrained free-form text.

496 

497 - `type: Literal["text"]`

498 

499 Unconstrained text format. Always `text`.

500 

501 - `"text"`

502 

503 - `class Grammar: …`

504 

505 A grammar defined by the user.

506 

507 - `definition: str`

508 

509 The grammar definition.

510 

511 - `syntax: Literal["lark", "regex"]`

512 

513 The syntax of the grammar definition. One of `lark` or `regex`.

514 

515 - `"lark"`

516 

517 - `"regex"`

518 

519 - `type: Literal["grammar"]`

520 

521 Grammar format. Always `grammar`.

522 

523 - `"grammar"`

524 

525### Error Object

526 

527- `class ErrorObject: …`

528 

529 - `code: Optional[str]`

530 

531 - `message: str`

532 

533 - `param: Optional[str]`

534 

535 - `type: str`

536 

537### Function Definition

538 

539- `class FunctionDefinition: …`

540 

541 - `name: str`

542 

543 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

544 

545 - `description: Optional[str]`

546 

547 A description of what the function does, used by the model to choose when and how to call the function.

548 

549 - `parameters: Optional[FunctionParameters]`

550 

551 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

552 

553 Omitting `parameters` defines a function with an empty parameter list.

554 

555 - `strict: Optional[bool]`

556 

557 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).

558 

559### Function Parameters

560 

561- `Dict[str, object]`

562 

563 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

564 

565 Omitting `parameters` defines a function with an empty parameter list.

566 

567### Metadata

568 

569- `Optional[Dict[str, str]]`

570 

571 Set of 16 key-value pairs that can be attached to an object. This can be

572 useful for storing additional information about the object in a structured

573 format, and querying for objects via API or the dashboard.

574 

575 Keys are strings with a maximum length of 64 characters. Values are strings

576 with a maximum length of 512 characters.

577 

578### OAuth Error Code

579 

580- `Union[Literal["invalid_grant", "invalid_subject_token"], str]`

581 

582 - `Literal["invalid_grant", "invalid_subject_token"]`

583 

584 - `"invalid_grant"`

585 

586 - `"invalid_subject_token"`

587 

588 - `str`

589 

590### Reasoning

591 

592- `class Reasoning: …`

593 

594 **gpt-5 and o-series models only**

595 

596 Configuration options for

597 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

598 

599 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

600 

601 Controls which reasoning items are rendered back to the model on later turns.

602 When returned on a response, this is the effective reasoning context mode

603 used for the response.

604 

605 - `"auto"`

606 

607 - `"current_turn"`

608 

609 - `"all_turns"`

610 

611 - `effort: Optional[ReasoningEffort]`

612 

613 Constrains effort on reasoning for

614 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

615 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

616 reasoning effort can result in faster responses and fewer tokens used

617 on reasoning in a response.

618 

619 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

620 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

621 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

622 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

623 

624 - `"none"`

625 

626 - `"minimal"`

627 

628 - `"low"`

629 

630 - `"medium"`

631 

632 - `"high"`

633 

634 - `"xhigh"`

635 

636 - `generate_summary: Optional[Literal["auto", "concise", "detailed"]]`

637 

638 **Deprecated:** use `summary` instead.

639 

640 A summary of the reasoning performed by the model. This can be

641 useful for debugging and understanding the model's reasoning process.

642 One of `auto`, `concise`, or `detailed`.

643 

644 - `"auto"`

645 

646 - `"concise"`

647 

648 - `"detailed"`

649 

650 - `summary: Optional[Literal["auto", "concise", "detailed"]]`

651 

652 A summary of the reasoning performed by the model. This can be

653 useful for debugging and understanding the model's reasoning process.

654 One of `auto`, `concise`, or `detailed`.

655 

656 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

657 

658 - `"auto"`

659 

660 - `"concise"`

661 

662 - `"detailed"`

663 

664### Reasoning Effort

665 

666- `Optional[Literal["none", "minimal", "low", 3 more]]`

667 

668 Constrains effort on reasoning for

669 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

670 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

671 reasoning effort can result in faster responses and fewer tokens used

672 on reasoning in a response.

673 

674 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

675 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

676 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

677 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

678 

679 - `"none"`

680 

681 - `"minimal"`

682 

683 - `"low"`

684 

685 - `"medium"`

686 

687 - `"high"`

688 

689 - `"xhigh"`

690 

691### Response Format JSON Object

692 

693- `class ResponseFormatJSONObject: …`

694 

695 JSON object response format. An older method of generating JSON responses.

696 Using `json_schema` is recommended for models that support it. Note that the

697 model will not generate JSON without a system or user message instructing it

698 to do so.

699 

700 - `type: Literal["json_object"]`

701 

702 The type of response format being defined. Always `json_object`.

703 

704 - `"json_object"`

705 

706### Response Format JSON Schema

707 

708- `class ResponseFormatJSONSchema: …`

709 

710 JSON Schema response format. Used to generate structured JSON responses.

711 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

712 

713 - `json_schema: JSONSchema`

714 

715 Structured Outputs configuration options, including a JSON Schema.

716 

717 - `name: str`

718 

719 The name of the response format. Must be a-z, A-Z, 0-9, or contain

720 underscores and dashes, with a maximum length of 64.

721 

722 - `description: Optional[str]`

723 

724 A description of what the response format is for, used by the model to

725 determine how to respond in the format.

726 

727 - `schema: Optional[Dict[str, object]]`

728 

729 The schema for the response format, described as a JSON Schema object.

730 Learn how to build JSON schemas [here](https://json-schema.org/).

731 

732 - `strict: Optional[bool]`

733 

734 Whether to enable strict schema adherence when generating the output.

735 If set to true, the model will always follow the exact schema defined

736 in the `schema` field. Only a subset of JSON Schema is supported when

737 `strict` is `true`. To learn more, read the [Structured Outputs

738 guide](https://platform.openai.com/docs/guides/structured-outputs).

739 

740 - `type: Literal["json_schema"]`

741 

742 The type of response format being defined. Always `json_schema`.

743 

744 - `"json_schema"`

745 

746### Response Format Text

747 

748- `class ResponseFormatText: …`

749 

750 Default response format. Used to generate text responses.

751 

752 - `type: Literal["text"]`

753 

754 The type of response format being defined. Always `text`.

755 

756 - `"text"`

757 

758### Response Format Text Grammar

759 

760- `class ResponseFormatTextGrammar: …`

761 

762 A custom grammar for the model to follow when generating text.

763 Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).

764 

765 - `grammar: str`

766 

767 The custom grammar for the model to follow.

768 

769 - `type: Literal["grammar"]`

770 

771 The type of response format being defined. Always `grammar`.

772 

773 - `"grammar"`

774 

775### Response Format Text Python

776 

777- `class ResponseFormatTextPython: …`

778 

779 Configure the model to generate valid Python code. See the

780 [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details.

781 

782 - `type: Literal["python"]`

783 

784 The type of response format being defined. Always `python`.

785 

786 - `"python"`

787 

788### Responses Model

789 

790- `Union[str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "o3-pro", 11 more]]`

791 

792 - `str`

793 

794 - `Literal["gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", 75 more]`

795 

796 - `"gpt-5.4"`

797 

798 - `"gpt-5.4-mini"`

799 

800 - `"gpt-5.4-nano"`

801 

802 - `"gpt-5.4-mini-2026-03-17"`

803 

804 - `"gpt-5.4-nano-2026-03-17"`

805 

806 - `"gpt-5.3-chat-latest"`

807 

808 - `"gpt-5.2"`

809 

810 - `"gpt-5.2-2025-12-11"`

811 

812 - `"gpt-5.2-chat-latest"`

813 

814 - `"gpt-5.2-pro"`

815 

816 - `"gpt-5.2-pro-2025-12-11"`

817 

818 - `"gpt-5.1"`

819 

820 - `"gpt-5.1-2025-11-13"`

821 

822 - `"gpt-5.1-codex"`

823 

824 - `"gpt-5.1-mini"`

825 

826 - `"gpt-5.1-chat-latest"`

827 

828 - `"gpt-5"`

829 

830 - `"gpt-5-mini"`

831 

832 - `"gpt-5-nano"`

833 

834 - `"gpt-5-2025-08-07"`

835 

836 - `"gpt-5-mini-2025-08-07"`

837 

838 - `"gpt-5-nano-2025-08-07"`

839 

840 - `"gpt-5-chat-latest"`

841 

842 - `"gpt-4.1"`

843 

844 - `"gpt-4.1-mini"`

845 

846 - `"gpt-4.1-nano"`

847 

848 - `"gpt-4.1-2025-04-14"`

849 

850 - `"gpt-4.1-mini-2025-04-14"`

851 

852 - `"gpt-4.1-nano-2025-04-14"`

853 

854 - `"o4-mini"`

855 

856 - `"o4-mini-2025-04-16"`

857 

858 - `"o3"`

859 

860 - `"o3-2025-04-16"`

861 

862 - `"o3-mini"`

863 

864 - `"o3-mini-2025-01-31"`

865 

866 - `"o1"`

867 

868 - `"o1-2024-12-17"`

869 

870 - `"o1-preview"`

871 

872 - `"o1-preview-2024-09-12"`

873 

874 - `"o1-mini"`

875 

876 - `"o1-mini-2024-09-12"`

877 

878 - `"gpt-4o"`

879 

880 - `"gpt-4o-2024-11-20"`

881 

882 - `"gpt-4o-2024-08-06"`

883 

884 - `"gpt-4o-2024-05-13"`

885 

886 - `"gpt-4o-audio-preview"`

887 

888 - `"gpt-4o-audio-preview-2024-10-01"`

889 

890 - `"gpt-4o-audio-preview-2024-12-17"`

891 

892 - `"gpt-4o-audio-preview-2025-06-03"`

893 

894 - `"gpt-4o-mini-audio-preview"`

895 

896 - `"gpt-4o-mini-audio-preview-2024-12-17"`

897 

898 - `"gpt-4o-search-preview"`

899 

900 - `"gpt-4o-mini-search-preview"`

901 

902 - `"gpt-4o-search-preview-2025-03-11"`

903 

904 - `"gpt-4o-mini-search-preview-2025-03-11"`

905 

906 - `"chatgpt-4o-latest"`

907 

908 - `"codex-mini-latest"`

909 

910 - `"gpt-4o-mini"`

911 

912 - `"gpt-4o-mini-2024-07-18"`

913 

914 - `"gpt-4-turbo"`

915 

916 - `"gpt-4-turbo-2024-04-09"`

917 

918 - `"gpt-4-0125-preview"`

919 

920 - `"gpt-4-turbo-preview"`

921 

922 - `"gpt-4-1106-preview"`

923 

924 - `"gpt-4-vision-preview"`

925 

926 - `"gpt-4"`

927 

928 - `"gpt-4-0314"`

929 

930 - `"gpt-4-0613"`

931 

932 - `"gpt-4-32k"`

933 

934 - `"gpt-4-32k-0314"`

935 

936 - `"gpt-4-32k-0613"`

937 

938 - `"gpt-3.5-turbo"`

939 

940 - `"gpt-3.5-turbo-16k"`

941 

942 - `"gpt-3.5-turbo-0301"`

943 

944 - `"gpt-3.5-turbo-0613"`

945 

946 - `"gpt-3.5-turbo-1106"`

947 

948 - `"gpt-3.5-turbo-0125"`

949 

950 - `"gpt-3.5-turbo-16k-0613"`

951 

952 - `Literal["o1-pro", "o1-pro-2025-03-19", "o3-pro", 11 more]`

953 

954 - `"o1-pro"`

955 

956 - `"o1-pro-2025-03-19"`

957 

958 - `"o3-pro"`

959 

960 - `"o3-pro-2025-06-10"`

961 

962 - `"o3-deep-research"`

963 

964 - `"o3-deep-research-2025-06-26"`

965 

966 - `"o4-mini-deep-research"`

967 

968 - `"o4-mini-deep-research-2025-06-26"`

969 

970 - `"computer-use-preview"`

971 

972 - `"computer-use-preview-2025-03-11"`

973 

974 - `"gpt-5-codex"`

975 

976 - `"gpt-5-pro"`

977 

978 - `"gpt-5-pro-2025-10-06"`

979 

980 - `"gpt-5.1-codex-max"`

Details

1## Create admin API key

2 

3`admin.organization.admin_api_keys.create(AdminAPIKeyCreateParams**kwargs) -> AdminAPIKeyCreateResponse`

4 

5**post** `/organization/admin_api_keys`

6 

7Create an organization admin API key

8 

9### Parameters

10 

11- `name: str`

12 

13- `expires_in_seconds: Optional[int]`

14 

15 The number of seconds until the API key expires. Omit this field for a key that does not expire.

16 

17### Returns

18 

19- `class AdminAPIKeyCreateResponse: …`

20 

21 Represents an individual Admin API key in an org.

22 

23 - `value: str`

24 

25 The value of the API key. Only shown on create.

26 

27### Example

28 

29```python

30import os

31from openai import OpenAI

32 

33client = OpenAI(

34 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

35)

36admin_api_key = client.admin.organization.admin_api_keys.create(

37 name="New Admin Key",

38)

39print(admin_api_key)

40```

41 

42#### Response

43 

44```json

45{

46 "id": "key_abc",

47 "created_at": 1711471533,

48 "expires_at": 1714063533,

49 "object": "organization.admin_api_key",

50 "owner": {

51 "id": "sa_456",

52 "created_at": 1711471533,

53 "name": "My Service Account",

54 "object": "organization.user",

55 "role": "owner",

56 "type": "user"

57 },

58 "redacted_value": "sk-admin...def",

59 "last_used_at": 1711471534,

60 "name": "Administration Key",

61 "value": "sk-admin-1234abcd"

62}

63```

Details

1## List all organization and project API keys.

2 

3`admin.organization.admin_api_keys.list(AdminAPIKeyListParams**kwargs) -> SyncCursorPage[AdminAPIKey]`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `after: Optional[str]`

12 

13 Return keys with IDs that come after this ID in the pagination order.

14 

15- `limit: Optional[int]`

16 

17 Maximum number of keys to return.

18 

19- `order: Optional[Literal["asc", "desc"]]`

20 

21 Order results by creation time, ascending or descending.

22 

23 - `"asc"`

24 

25 - `"desc"`

26 

27### Returns

28 

29- `class AdminAPIKey: …`

30 

31 Represents an individual Admin API key in an org.

32 

33 - `id: str`

34 

35 The identifier, which can be referenced in API endpoints

36 

37 - `created_at: int`

38 

39 The Unix timestamp (in seconds) of when the API key was created

40 

41 - `expires_at: Optional[int]`

42 

43 The Unix timestamp (in seconds) of when the API key expires

44 

45 - `object: Literal["organization.admin_api_key"]`

46 

47 The object type, which is always `organization.admin_api_key`

48 

49 - `"organization.admin_api_key"`

50 

51 - `owner: Owner`

52 

53 - `id: Optional[str]`

54 

55 The identifier, which can be referenced in API endpoints

56 

57 - `created_at: Optional[int]`

58 

59 The Unix timestamp (in seconds) of when the user was created

60 

61 - `name: Optional[str]`

62 

63 The name of the user

64 

65 - `object: Optional[str]`

66 

67 The object type, which is always organization.user

68 

69 - `role: Optional[str]`

70 

71 Always `owner`

72 

73 - `type: Optional[str]`

74 

75 Always `user`

76 

77 - `redacted_value: str`

78 

79 The redacted value of the API key

80 

81 - `last_used_at: Optional[int]`

82 

83 The Unix timestamp (in seconds) of when the API key was last used

84 

85 - `name: Optional[str]`

86 

87 The name of the API key

88 

89### Example

90 

91```python

92import os

93from openai import OpenAI

94 

95client = OpenAI(

96 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

97)

98page = client.admin.organization.admin_api_keys.list()

99page = page.data[0]

100print(page.id)

101```

102 

103#### Response

104 

105```json

106{

107 "data": [

108 {

109 "id": "key_abc",

110 "created_at": 1711471533,

111 "expires_at": 1714063533,

112 "object": "organization.admin_api_key",

113 "owner": {

114 "id": "sa_456",

115 "created_at": 1711471533,

116 "name": "My Service Account",

117 "object": "organization.user",

118 "role": "owner",

119 "type": "user"

120 },

121 "redacted_value": "sk-admin...def",

122 "last_used_at": 1711471534,

123 "name": "Administration Key"

124 }

125 ],

126 "has_more": false,

127 "object": "list",

128 "first_id": "key_abc",

129 "last_id": "key_xyz"

130}

131```

Details

1## Retrieve admin API key

2 

3`admin.organization.admin_api_keys.retrieve(strkey_id) -> AdminAPIKey`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `key_id: str`

12 

13 The ID of the API key.

14 

15### Returns

16 

17- `class AdminAPIKey: …`

18 

19 Represents an individual Admin API key in an org.

20 

21 - `id: str`

22 

23 The identifier, which can be referenced in API endpoints

24 

25 - `created_at: int`

26 

27 The Unix timestamp (in seconds) of when the API key was created

28 

29 - `expires_at: Optional[int]`

30 

31 The Unix timestamp (in seconds) of when the API key expires

32 

33 - `object: Literal["organization.admin_api_key"]`

34 

35 The object type, which is always `organization.admin_api_key`

36 

37 - `"organization.admin_api_key"`

38 

39 - `owner: Owner`

40 

41 - `id: Optional[str]`

42 

43 The identifier, which can be referenced in API endpoints

44 

45 - `created_at: Optional[int]`

46 

47 The Unix timestamp (in seconds) of when the user was created

48 

49 - `name: Optional[str]`

50 

51 The name of the user

52 

53 - `object: Optional[str]`

54 

55 The object type, which is always organization.user

56 

57 - `role: Optional[str]`

58 

59 Always `owner`

60 

61 - `type: Optional[str]`

62 

63 Always `user`

64 

65 - `redacted_value: str`

66 

67 The redacted value of the API key

68 

69 - `last_used_at: Optional[int]`

70 

71 The Unix timestamp (in seconds) of when the API key was last used

72 

73 - `name: Optional[str]`

74 

75 The name of the API key

76 

77### Example

78 

79```python

80import os

81from openai import OpenAI

82 

83client = OpenAI(

84 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

85)

86admin_api_key = client.admin.organization.admin_api_keys.retrieve(

87 "key_id",

88)

89print(admin_api_key.id)

90```

91 

92#### Response

93 

94```json

95{

96 "id": "key_abc",

97 "created_at": 1711471533,

98 "expires_at": 1714063533,

99 "object": "organization.admin_api_key",

100 "owner": {

101 "id": "sa_456",

102 "created_at": 1711471533,

103 "name": "My Service Account",

104 "object": "organization.user",

105 "role": "owner",

106 "type": "user"

107 },

108 "redacted_value": "sk-admin...def",

109 "last_used_at": 1711471534,

110 "name": "Administration Key"

111}

112```

Details

44 44 

45 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.45 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

46 46 

47- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]]]`47- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]]]`

48 48 

49 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).49 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).

50 50 


146 146 

147 - `"role.assignment.deleted"`147 - `"role.assignment.deleted"`

148 148 

149 - `"role.bound_to_resource"`

150 

151 - `"role.unbound_from_resource"`

152 

149 - `"scim.enabled"`153 - `"scim.enabled"`

150 154 

151 - `"scim.disabled"`155 - `"scim.disabled"`


172 176 

173- `resource_ids: Optional[Sequence[str]]`177- `resource_ids: Optional[Sequence[str]]`

174 178 

175 Return only events performed on these targets. For example, a project ID updated.179 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

180 

181- `tenant_only: Optional[bool]`

182 

183 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

176 184 

177### Returns185### Returns

178 186 


188 196 

189 The Unix timestamp (in seconds) of the event.197 The Unix timestamp (in seconds) of the event.

190 198 

191 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`199 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

192 200 

193 The event type.201 The event type.

194 202 


290 298 

291 - `"role.assignment.deleted"`299 - `"role.assignment.deleted"`

292 300 

301 - `"role.bound_to_resource"`

302 

303 - `"role.unbound_from_resource"`

304 

293 - `"scim.enabled"`305 - `"scim.enabled"`

294 306 

295 - `"scim.disabled"`307 - `"scim.disabled"`


910 922 

911 The type of resource the role assignment was scoped to.923 The type of resource the role assignment was scoped to.

912 924 

925 - `role_bound_to_resource: Optional[RoleBoundToResource]`

926 

927 The details for events with this `type`.

928 

929 - `id: Optional[str]`

930 

931 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

932 

933 - `connector_id: Optional[str]`

934 

935 The connector ID for a ChatGPT workspace connector resource.

936 

937 - `connector_name: Optional[str]`

938 

939 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

940 

941 - `enabled: Optional[bool]`

942 

943 Whether the connector is enabled for the role.

944 

945 - `permissions: Optional[List[str]]`

946 

947 The permissions granted to the role for the resource.

948 

949 - `resource_id: Optional[str]`

950 

951 The ID of the resource the role was bound to.

952 

953 - `resource_type: Optional[str]`

954 

955 The type of resource the role was bound to.

956 

957 - `role_id: Optional[str]`

958 

959 The ID of the role that was bound to the resource.

960 

961 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

962 

963 The connector role mutation path that produced the event.

964 

965 - `"role_toggle"`

966 

967 - `"role_connector_update"`

968 

969 - `"role_delete"`

970 

971 - `"workspace_permissions"`

972 

973 - `"connector_publish"`

974 

975 - `workspace_id: Optional[str]`

976 

977 The workspace ID for a ChatGPT workspace connector resource.

978 

913 - `role_created: Optional[RoleCreated]`979 - `role_created: Optional[RoleCreated]`

914 980 

915 The details for events with this `type`.981 The details for events with this `type`.


942 1008 

943 The role ID.1009 The role ID.

944 1010 

1011 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

1012 

1013 The details for events with this `type`.

1014 

1015 - `id: Optional[str]`

1016 

1017 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1018 

1019 - `connector_id: Optional[str]`

1020 

1021 The connector ID for a ChatGPT workspace connector resource.

1022 

1023 - `connector_name: Optional[str]`

1024 

1025 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1026 

1027 - `enabled: Optional[bool]`

1028 

1029 Whether the connector is enabled for the role.

1030 

1031 - `permissions: Optional[List[str]]`

1032 

1033 The permissions remaining for the role after the change.

1034 

1035 - `resource_id: Optional[str]`

1036 

1037 The ID of the resource the role was unbound from.

1038 

1039 - `resource_type: Optional[str]`

1040 

1041 The type of resource the role was unbound from.

1042 

1043 - `role_id: Optional[str]`

1044 

1045 The ID of the role that was unbound from the resource.

1046 

1047 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

1048 

1049 The connector role mutation path that produced the event.

1050 

1051 - `"role_toggle"`

1052 

1053 - `"role_connector_update"`

1054 

1055 - `"role_delete"`

1056 

1057 - `"workspace_permissions"`

1058 

1059 - `"connector_publish"`

1060 

1061 - `workspace_id: Optional[str]`

1062 

1063 The workspace ID for a ChatGPT workspace connector resource.

1064 

945 - `role_updated: Optional[RoleUpdated]`1065 - `role_updated: Optional[RoleUpdated]`

946 1066 

947 The details for events with this `type`.1067 The details for events with this `type`.


1412 "resource_id": "resource_id",1532 "resource_id": "resource_id",

1413 "resource_type": "resource_type"1533 "resource_type": "resource_type"

1414 },1534 },

1535 "role.bound_to_resource": {

1536 "id": "id",

1537 "connector_id": "connector_id",

1538 "connector_name": "connector_name",

1539 "enabled": true,

1540 "permissions": [

1541 "string"

1542 ],

1543 "resource_id": "resource_id",

1544 "resource_type": "resource_type",

1545 "role_id": "role_id",

1546 "source": "role_toggle",

1547 "workspace_id": "workspace_id"

1548 },

1415 "role.created": {1549 "role.created": {

1416 "id": "id",1550 "id": "id",

1417 "permissions": [1551 "permissions": [


1424 "role.deleted": {1558 "role.deleted": {

1425 "id": "id"1559 "id": "id"

1426 },1560 },

1561 "role.unbound_from_resource": {

1562 "id": "id",

1563 "connector_id": "connector_id",

1564 "connector_name": "connector_name",

1565 "enabled": true,

1566 "permissions": [

1567 "string"

1568 ],

1569 "resource_id": "resource_id",

1570 "resource_type": "resource_type",

1571 "role_id": "role_id",

1572 "source": "role_toggle",

1573 "workspace_id": "workspace_id"

1574 },

1427 "role.updated": {1575 "role.updated": {

1428 "id": "id",1576 "id": "id",

1429 "changes_requested": {1577 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`admin.organization.projects.spend_alerts.retrieve(stralert_id, SpendAlertRetrieveParams**kwargs) -> ProjectSpendAlert`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `project_id: str`

12 

13- `alert_id: str`

14 

15### Returns

16 

17- `class ProjectSpendAlert: …`

18 

19 Represents a spend alert configured at the project level.

20 

21 - `id: str`

22 

23 The identifier, which can be referenced in API endpoints.

24 

25 - `currency: Literal["USD"]`

26 

27 The currency for the threshold amount.

28 

29 - `"USD"`

30 

31 - `interval: Literal["month"]`

32 

33 The time interval for evaluating spend against the threshold.

34 

35 - `"month"`

36 

37 - `notification_channel: NotificationChannel`

38 

39 Email notification settings for a spend alert.

40 

41 - `recipients: List[str]`

42 

43 Email addresses that receive the spend alert notification.

44 

45 - `type: Literal["email"]`

46 

47 The notification channel type. Currently only `email` is supported.

48 

49 - `"email"`

50 

51 - `subject_prefix: Optional[str]`

52 

53 Optional subject prefix for alert emails.

54 

55 - `object: Literal["project.spend_alert"]`

56 

57 The object type, which is always `project.spend_alert`.

58 

59 - `"project.spend_alert"`

60 

61 - `threshold_amount: int`

62 

63 The alert threshold amount, in cents.

64 

65### Example

66 

67```python

68import os

69from openai import OpenAI

70 

71client = OpenAI(

72 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

73)

74project_spend_alert = client.admin.organization.projects.spend_alerts.retrieve(

75 alert_id="alert_id",

76 project_id="project_id",

77)

78print(project_spend_alert.id)

79```

80 

81#### Response

82 

83```json

84{

85 "id": "id",

86 "currency": "USD",

87 "interval": "month",

88 "notification_channel": {

89 "recipients": [

90 "string"

91 ],

92 "type": "email",

93 "subject_prefix": "subject_prefix"

94 },

95 "object": "project.spend_alert",

96 "threshold_amount": 0

97}

98```

Details

1## Retrieve organization spend alert

2 

3`admin.organization.spend_alerts.retrieve(stralert_id) -> OrganizationSpendAlert`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `alert_id: str`

12 

13### Returns

14 

15- `class OrganizationSpendAlert: …`

16 

17 Represents a spend alert configured at the organization level.

18 

19 - `id: str`

20 

21 The identifier, which can be referenced in API endpoints.

22 

23 - `currency: Literal["USD"]`

24 

25 The currency for the threshold amount.

26 

27 - `"USD"`

28 

29 - `interval: Literal["month"]`

30 

31 The time interval for evaluating spend against the threshold.

32 

33 - `"month"`

34 

35 - `notification_channel: NotificationChannel`

36 

37 Email notification settings for a spend alert.

38 

39 - `recipients: List[str]`

40 

41 Email addresses that receive the spend alert notification.

42 

43 - `type: Literal["email"]`

44 

45 The notification channel type. Currently only `email` is supported.

46 

47 - `"email"`

48 

49 - `subject_prefix: Optional[str]`

50 

51 Optional subject prefix for alert emails.

52 

53 - `object: Literal["organization.spend_alert"]`

54 

55 The object type, which is always `organization.spend_alert`.

56 

57 - `"organization.spend_alert"`

58 

59 - `threshold_amount: int`

60 

61 The alert threshold amount, in cents.

62 

63### Example

64 

65```python

66import os

67from openai import OpenAI

68 

69client = OpenAI(

70 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

71)

72organization_spend_alert = client.admin.organization.spend_alerts.retrieve(

73 "alert_id",

74)

75print(organization_spend_alert.id)

76```

77 

78#### Response

79 

80```json

81{

82 "id": "id",

83 "currency": "USD",

84 "interval": "month",

85 "notification_channel": {

86 "recipients": [

87 "string"

88 ],

89 "type": "email",

90 "subject_prefix": "subject_prefix"

91 },

92 "object": "organization.spend_alert",

93 "threshold_amount": 0

94}

95```

Details

4810 Configuration options for4810 Configuration options for

4811 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4811 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4812 4812 

4813 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

4814 

4815 Controls which reasoning items are rendered back to the model on later turns.

4816 When returned on a response, this is the effective reasoning context mode

4817 used for the response.

4818 

4819 - `"auto"`

4820 

4821 - `"current_turn"`

4822 

4823 - `"all_turns"`

4824 

4813 - `effort: Optional[ReasoningEffort]`4825 - `effort: Optional[ReasoningEffort]`

4814 4826 

4815 Constrains effort on reasoning for4827 Constrains effort on reasoning for


5204 "prompt_cache_key": "prompt-cache-key-1234",5216 "prompt_cache_key": "prompt-cache-key-1234",

5205 "prompt_cache_retention": "in_memory",5217 "prompt_cache_retention": "in_memory",

5206 "reasoning": {5218 "reasoning": {

5219 "context": "auto",

5207 "effort": "none",5220 "effort": "none",

5208 "generate_summary": "auto",5221 "generate_summary": "auto",

5209 "summary": "auto"5222 "summary": "auto"

Details

3448 Configuration options for3448 Configuration options for

3449 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3449 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3450 3450 

3451 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

3452 

3453 Controls which reasoning items are rendered back to the model on later turns.

3454 When returned on a response, this is the effective reasoning context mode

3455 used for the response.

3456 

3457 - `"auto"`

3458 

3459 - `"current_turn"`

3460 

3461 - `"all_turns"`

3462 

3451 - `effort: Optional[ReasoningEffort]`3463 - `effort: Optional[ReasoningEffort]`

3452 3464 

3453 Constrains effort on reasoning for3465 Constrains effort on reasoning for


8722 Configuration options for8734 Configuration options for

8723 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8735 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8724 8736 

8737 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

8738 

8739 Controls which reasoning items are rendered back to the model on later turns.

8740 When returned on a response, this is the effective reasoning context mode

8741 used for the response.

8742 

8743 - `"auto"`

8744 

8745 - `"current_turn"`

8746 

8747 - `"all_turns"`

8748 

8725 - `effort: Optional[ReasoningEffort]`8749 - `effort: Optional[ReasoningEffort]`

8726 8750 

8727 Constrains effort on reasoning for8751 Constrains effort on reasoning for


9114 "prompt_cache_key": "prompt-cache-key-1234",9138 "prompt_cache_key": "prompt-cache-key-1234",

9115 "prompt_cache_retention": "in_memory",9139 "prompt_cache_retention": "in_memory",

9116 "reasoning": {9140 "reasoning": {

9141 "context": "auto",

9117 "effort": "none",9142 "effort": "none",

9118 "generate_summary": "auto",9143 "generate_summary": "auto",

9119 "summary": "auto"9144 "summary": "auto"

Details

4852 Configuration options for4852 Configuration options for

4853 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4853 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4854 4854 

4855 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

4856 

4857 Controls which reasoning items are rendered back to the model on later turns.

4858 When returned on a response, this is the effective reasoning context mode

4859 used for the response.

4860 

4861 - `"auto"`

4862 

4863 - `"current_turn"`

4864 

4865 - `"all_turns"`

4866 

4855 - `effort: Optional[ReasoningEffort]`4867 - `effort: Optional[ReasoningEffort]`

4856 4868 

4857 Constrains effort on reasoning for4869 Constrains effort on reasoning for


5246 "prompt_cache_key": "prompt-cache-key-1234",5258 "prompt_cache_key": "prompt-cache-key-1234",

5247 "prompt_cache_retention": "in_memory",5259 "prompt_cache_retention": "in_memory",

5248 "reasoning": {5260 "reasoning": {

5261 "context": "auto",

5249 "effort": "none",5262 "effort": "none",

5250 "generate_summary": "auto",5263 "generate_summary": "auto",

5251 "summary": "auto"5264 "summary": "auto"

Details

3129 3129 

3130 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3130 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3131 3131 

3132 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

3133 

3134 Controls which reasoning items are rendered back to the model on later turns.

3135 When returned on a response, this is the effective reasoning context mode

3136 used for the response.

3137 

3138 - `"auto"`

3139 

3140 - `"current_turn"`

3141 

3142 - `"all_turns"`

3143 

3132 - `effort: Optional[ReasoningEffort]`3144 - `effort: Optional[ReasoningEffort]`

3133 3145 

3134 Constrains effort on reasoning for3146 Constrains effort on reasoning for

Details

22 22 

23 - `class VideoVideoReferenceInputParam: …`23 - `class VideoVideoReferenceInputParam: …`

24 24 

25 Reference to the completed video.25 Reference to the completed video to edit.

26 26 

27 - `id: str`27 - `id: str`

28 28 

resources/$shared/index.md +808 −0 created

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `AllModels = string or "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

8 

9 - `string`

10 

11 - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more`

12 

13 - `"gpt-5.4"`

14 

15 - `"gpt-5.4-mini"`

16 

17 - `"gpt-5.4-nano"`

18 

19 - `"gpt-5.4-mini-2026-03-17"`

20 

21 - `"gpt-5.4-nano-2026-03-17"`

22 

23 - `"gpt-5.3-chat-latest"`

24 

25 - `"gpt-5.2"`

26 

27 - `"gpt-5.2-2025-12-11"`

28 

29 - `"gpt-5.2-chat-latest"`

30 

31 - `"gpt-5.2-pro"`

32 

33 - `"gpt-5.2-pro-2025-12-11"`

34 

35 - `"gpt-5.1"`

36 

37 - `"gpt-5.1-2025-11-13"`

38 

39 - `"gpt-5.1-codex"`

40 

41 - `"gpt-5.1-mini"`

42 

43 - `"gpt-5.1-chat-latest"`

44 

45 - `"gpt-5"`

46 

47 - `"gpt-5-mini"`

48 

49 - `"gpt-5-nano"`

50 

51 - `"gpt-5-2025-08-07"`

52 

53 - `"gpt-5-mini-2025-08-07"`

54 

55 - `"gpt-5-nano-2025-08-07"`

56 

57 - `"gpt-5-chat-latest"`

58 

59 - `"gpt-4.1"`

60 

61 - `"gpt-4.1-mini"`

62 

63 - `"gpt-4.1-nano"`

64 

65 - `"gpt-4.1-2025-04-14"`

66 

67 - `"gpt-4.1-mini-2025-04-14"`

68 

69 - `"gpt-4.1-nano-2025-04-14"`

70 

71 - `"o4-mini"`

72 

73 - `"o4-mini-2025-04-16"`

74 

75 - `"o3"`

76 

77 - `"o3-2025-04-16"`

78 

79 - `"o3-mini"`

80 

81 - `"o3-mini-2025-01-31"`

82 

83 - `"o1"`

84 

85 - `"o1-2024-12-17"`

86 

87 - `"o1-preview"`

88 

89 - `"o1-preview-2024-09-12"`

90 

91 - `"o1-mini"`

92 

93 - `"o1-mini-2024-09-12"`

94 

95 - `"gpt-4o"`

96 

97 - `"gpt-4o-2024-11-20"`

98 

99 - `"gpt-4o-2024-08-06"`

100 

101 - `"gpt-4o-2024-05-13"`

102 

103 - `"gpt-4o-audio-preview"`

104 

105 - `"gpt-4o-audio-preview-2024-10-01"`

106 

107 - `"gpt-4o-audio-preview-2024-12-17"`

108 

109 - `"gpt-4o-audio-preview-2025-06-03"`

110 

111 - `"gpt-4o-mini-audio-preview"`

112 

113 - `"gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `"gpt-4o-search-preview"`

116 

117 - `"gpt-4o-mini-search-preview"`

118 

119 - `"gpt-4o-search-preview-2025-03-11"`

120 

121 - `"gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `"chatgpt-4o-latest"`

124 

125 - `"codex-mini-latest"`

126 

127 - `"gpt-4o-mini"`

128 

129 - `"gpt-4o-mini-2024-07-18"`

130 

131 - `"gpt-4-turbo"`

132 

133 - `"gpt-4-turbo-2024-04-09"`

134 

135 - `"gpt-4-0125-preview"`

136 

137 - `"gpt-4-turbo-preview"`

138 

139 - `"gpt-4-1106-preview"`

140 

141 - `"gpt-4-vision-preview"`

142 

143 - `"gpt-4"`

144 

145 - `"gpt-4-0314"`

146 

147 - `"gpt-4-0613"`

148 

149 - `"gpt-4-32k"`

150 

151 - `"gpt-4-32k-0314"`

152 

153 - `"gpt-4-32k-0613"`

154 

155 - `"gpt-3.5-turbo"`

156 

157 - `"gpt-3.5-turbo-16k"`

158 

159 - `"gpt-3.5-turbo-0301"`

160 

161 - `"gpt-3.5-turbo-0613"`

162 

163 - `"gpt-3.5-turbo-1106"`

164 

165 - `"gpt-3.5-turbo-0125"`

166 

167 - `"gpt-3.5-turbo-16k-0613"`

168 

169 - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

170 

171 - `"o1-pro"`

172 

173 - `"o1-pro-2025-03-19"`

174 

175 - `"o3-pro"`

176 

177 - `"o3-pro-2025-06-10"`

178 

179 - `"o3-deep-research"`

180 

181 - `"o3-deep-research-2025-06-26"`

182 

183 - `"o4-mini-deep-research"`

184 

185 - `"o4-mini-deep-research-2025-06-26"`

186 

187 - `"computer-use-preview"`

188 

189 - `"computer-use-preview-2025-03-11"`

190 

191 - `"gpt-5-codex"`

192 

193 - `"gpt-5-pro"`

194 

195 - `"gpt-5-pro-2025-10-06"`

196 

197 - `"gpt-5.1-codex-max"`

198 

199### Comparison Filter

200 

201- `ComparisonFilter object { key, type, value }`

202 

203 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

204 

205 - `key: string`

206 

207 The key to compare against the value.

208 

209 - `type: "eq" or "ne" or "gt" or 5 more`

210 

211 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

212 

213 - `eq`: equals

214 - `ne`: not equal

215 - `gt`: greater than

216 - `gte`: greater than or equal

217 - `lt`: less than

218 - `lte`: less than or equal

219 - `in`: in

220 - `nin`: not in

221 

222 - `"eq"`

223 

224 - `"ne"`

225 

226 - `"gt"`

227 

228 - `"gte"`

229 

230 - `"lt"`

231 

232 - `"lte"`

233 

234 - `"in"`

235 

236 - `"nin"`

237 

238 - `value: string or number or boolean or array of string or number`

239 

240 The value to compare against the attribute key; supports string, number, or boolean types.

241 

242 - `string`

243 

244 - `number`

245 

246 - `boolean`

247 

248 - `array of string or number`

249 

250 - `string`

251 

252 - `number`

253 

254### Compound Filter

255 

256- `CompoundFilter object { filters, type }`

257 

258 Combine multiple filters using `and` or `or`.

259 

260 - `filters: array of ComparisonFilter or unknown`

261 

262 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

263 

264 - `ComparisonFilter object { key, type, value }`

265 

266 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

267 

268 - `key: string`

269 

270 The key to compare against the value.

271 

272 - `type: "eq" or "ne" or "gt" or 5 more`

273 

274 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

275 

276 - `eq`: equals

277 - `ne`: not equal

278 - `gt`: greater than

279 - `gte`: greater than or equal

280 - `lt`: less than

281 - `lte`: less than or equal

282 - `in`: in

283 - `nin`: not in

284 

285 - `"eq"`

286 

287 - `"ne"`

288 

289 - `"gt"`

290 

291 - `"gte"`

292 

293 - `"lt"`

294 

295 - `"lte"`

296 

297 - `"in"`

298 

299 - `"nin"`

300 

301 - `value: string or number or boolean or array of string or number`

302 

303 The value to compare against the attribute key; supports string, number, or boolean types.

304 

305 - `string`

306 

307 - `number`

308 

309 - `boolean`

310 

311 - `array of string or number`

312 

313 - `string`

314 

315 - `number`

316 

317 - `unknown`

318 

319 - `type: "and" or "or"`

320 

321 Type of operation: `and` or `or`.

322 

323 - `"and"`

324 

325 - `"or"`

326 

327### Custom Tool Input Format

328 

329- `CustomToolInputFormat = object { type } or object { definition, syntax, type }`

330 

331 The input format for the custom tool. Default is unconstrained text.

332 

333 - `Text object { type }`

334 

335 Unconstrained free-form text.

336 

337 - `type: "text"`

338 

339 Unconstrained text format. Always `text`.

340 

341 - `"text"`

342 

343 - `Grammar object { definition, syntax, type }`

344 

345 A grammar defined by the user.

346 

347 - `definition: string`

348 

349 The grammar definition.

350 

351 - `syntax: "lark" or "regex"`

352 

353 The syntax of the grammar definition. One of `lark` or `regex`.

354 

355 - `"lark"`

356 

357 - `"regex"`

358 

359 - `type: "grammar"`

360 

361 Grammar format. Always `grammar`.

362 

363 - `"grammar"`

364 

365### Error Object

366 

367- `ErrorObject object { code, message, param, type }`

368 

369 - `code: string`

370 

371 - `message: string`

372 

373 - `param: string`

374 

375 - `type: string`

376 

377### Function Definition

378 

379- `FunctionDefinition object { name, description, parameters, strict }`

380 

381 - `name: string`

382 

383 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

384 

385 - `description: optional string`

386 

387 A description of what the function does, used by the model to choose when and how to call the function.

388 

389 - `parameters: optional FunctionParameters`

390 

391 The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

392 

393 Omitting `parameters` defines a function with an empty parameter list.

394 

395 - `strict: optional boolean`

396 

397 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](/docs/guides/function-calling).

398 

399### Function Parameters

400 

401- `FunctionParameters = map[unknown]`

402 

403 The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

404 

405 Omitting `parameters` defines a function with an empty parameter list.

406 

407### Metadata

408 

409- `Metadata = map[string]`

410 

411 Set of 16 key-value pairs that can be attached to an object. This can be

412 useful for storing additional information about the object in a structured

413 format, and querying for objects via API or the dashboard.

414 

415 Keys are strings with a maximum length of 64 characters. Values are strings

416 with a maximum length of 512 characters.

417 

418### Reasoning

419 

420- `Reasoning object { context, effort, generate_summary, summary }`

421 

422 **gpt-5 and o-series models only**

423 

424 Configuration options for

425 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

426 

427 - `context: optional "auto" or "current_turn" or "all_turns"`

428 

429 Controls which reasoning items are rendered back to the model on later turns.

430 When returned on a response, this is the effective reasoning context mode

431 used for the response.

432 

433 - `"auto"`

434 

435 - `"current_turn"`

436 

437 - `"all_turns"`

438 

439 - `effort: optional ReasoningEffort`

440 

441 Constrains effort on reasoning for

442 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

443 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

444 reasoning effort can result in faster responses and fewer tokens used

445 on reasoning in a response.

446 

447 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

448 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

449 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

450 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

451 

452 - `"none"`

453 

454 - `"minimal"`

455 

456 - `"low"`

457 

458 - `"medium"`

459 

460 - `"high"`

461 

462 - `"xhigh"`

463 

464 - `generate_summary: optional "auto" or "concise" or "detailed"`

465 

466 **Deprecated:** use `summary` instead.

467 

468 A summary of the reasoning performed by the model. This can be

469 useful for debugging and understanding the model's reasoning process.

470 One of `auto`, `concise`, or `detailed`.

471 

472 - `"auto"`

473 

474 - `"concise"`

475 

476 - `"detailed"`

477 

478 - `summary: optional "auto" or "concise" or "detailed"`

479 

480 A summary of the reasoning performed by the model. This can be

481 useful for debugging and understanding the model's reasoning process.

482 One of `auto`, `concise`, or `detailed`.

483 

484 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

485 

486 - `"auto"`

487 

488 - `"concise"`

489 

490 - `"detailed"`

491 

492### Reasoning Effort

493 

494- `ReasoningEffort = "none" or "minimal" or "low" or 3 more`

495 

496 Constrains effort on reasoning for

497 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

498 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

499 reasoning effort can result in faster responses and fewer tokens used

500 on reasoning in a response.

501 

502 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

503 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

504 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

505 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

506 

507 - `"none"`

508 

509 - `"minimal"`

510 

511 - `"low"`

512 

513 - `"medium"`

514 

515 - `"high"`

516 

517 - `"xhigh"`

518 

519### Response Format JSON Object

520 

521- `ResponseFormatJSONObject object { type }`

522 

523 JSON object response format. An older method of generating JSON responses.

524 Using `json_schema` is recommended for models that support it. Note that the

525 model will not generate JSON without a system or user message instructing it

526 to do so.

527 

528 - `type: "json_object"`

529 

530 The type of response format being defined. Always `json_object`.

531 

532 - `"json_object"`

533 

534### Response Format JSON Schema

535 

536- `ResponseFormatJSONSchema object { json_schema, type }`

537 

538 JSON Schema response format. Used to generate structured JSON responses.

539 Learn more about [Structured Outputs](/docs/guides/structured-outputs).

540 

541 - `json_schema: object { name, description, schema, strict }`

542 

543 Structured Outputs configuration options, including a JSON Schema.

544 

545 - `name: string`

546 

547 The name of the response format. Must be a-z, A-Z, 0-9, or contain

548 underscores and dashes, with a maximum length of 64.

549 

550 - `description: optional string`

551 

552 A description of what the response format is for, used by the model to

553 determine how to respond in the format.

554 

555 - `schema: optional map[unknown]`

556 

557 The schema for the response format, described as a JSON Schema object.

558 Learn how to build JSON schemas [here](https://json-schema.org/).

559 

560 - `strict: optional boolean`

561 

562 Whether to enable strict schema adherence when generating the output.

563 If set to true, the model will always follow the exact schema defined

564 in the `schema` field. Only a subset of JSON Schema is supported when

565 `strict` is `true`. To learn more, read the [Structured Outputs

566 guide](/docs/guides/structured-outputs).

567 

568 - `type: "json_schema"`

569 

570 The type of response format being defined. Always `json_schema`.

571 

572 - `"json_schema"`

573 

574### Response Format Text

575 

576- `ResponseFormatText object { type }`

577 

578 Default response format. Used to generate text responses.

579 

580 - `type: "text"`

581 

582 The type of response format being defined. Always `text`.

583 

584 - `"text"`

585 

586### Response Format Text Grammar

587 

588- `ResponseFormatTextGrammar object { grammar, type }`

589 

590 A custom grammar for the model to follow when generating text.

591 Learn more in the [custom grammars guide](/docs/guides/custom-grammars).

592 

593 - `grammar: string`

594 

595 The custom grammar for the model to follow.

596 

597 - `type: "grammar"`

598 

599 The type of response format being defined. Always `grammar`.

600 

601 - `"grammar"`

602 

603### Response Format Text Python

604 

605- `ResponseFormatTextPython object { type }`

606 

607 Configure the model to generate valid Python code. See the

608 [custom grammars guide](/docs/guides/custom-grammars) for more details.

609 

610 - `type: "python"`

611 

612 The type of response format being defined. Always `python`.

613 

614 - `"python"`

615 

616### Responses Model

617 

618- `ResponsesModel = string or "gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more or "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

619 

620 - `string`

621 

622 - `"gpt-5.4" or "gpt-5.4-mini" or "gpt-5.4-nano" or 75 more`

623 

624 - `"gpt-5.4"`

625 

626 - `"gpt-5.4-mini"`

627 

628 - `"gpt-5.4-nano"`

629 

630 - `"gpt-5.4-mini-2026-03-17"`

631 

632 - `"gpt-5.4-nano-2026-03-17"`

633 

634 - `"gpt-5.3-chat-latest"`

635 

636 - `"gpt-5.2"`

637 

638 - `"gpt-5.2-2025-12-11"`

639 

640 - `"gpt-5.2-chat-latest"`

641 

642 - `"gpt-5.2-pro"`

643 

644 - `"gpt-5.2-pro-2025-12-11"`

645 

646 - `"gpt-5.1"`

647 

648 - `"gpt-5.1-2025-11-13"`

649 

650 - `"gpt-5.1-codex"`

651 

652 - `"gpt-5.1-mini"`

653 

654 - `"gpt-5.1-chat-latest"`

655 

656 - `"gpt-5"`

657 

658 - `"gpt-5-mini"`

659 

660 - `"gpt-5-nano"`

661 

662 - `"gpt-5-2025-08-07"`

663 

664 - `"gpt-5-mini-2025-08-07"`

665 

666 - `"gpt-5-nano-2025-08-07"`

667 

668 - `"gpt-5-chat-latest"`

669 

670 - `"gpt-4.1"`

671 

672 - `"gpt-4.1-mini"`

673 

674 - `"gpt-4.1-nano"`

675 

676 - `"gpt-4.1-2025-04-14"`

677 

678 - `"gpt-4.1-mini-2025-04-14"`

679 

680 - `"gpt-4.1-nano-2025-04-14"`

681 

682 - `"o4-mini"`

683 

684 - `"o4-mini-2025-04-16"`

685 

686 - `"o3"`

687 

688 - `"o3-2025-04-16"`

689 

690 - `"o3-mini"`

691 

692 - `"o3-mini-2025-01-31"`

693 

694 - `"o1"`

695 

696 - `"o1-2024-12-17"`

697 

698 - `"o1-preview"`

699 

700 - `"o1-preview-2024-09-12"`

701 

702 - `"o1-mini"`

703 

704 - `"o1-mini-2024-09-12"`

705 

706 - `"gpt-4o"`

707 

708 - `"gpt-4o-2024-11-20"`

709 

710 - `"gpt-4o-2024-08-06"`

711 

712 - `"gpt-4o-2024-05-13"`

713 

714 - `"gpt-4o-audio-preview"`

715 

716 - `"gpt-4o-audio-preview-2024-10-01"`

717 

718 - `"gpt-4o-audio-preview-2024-12-17"`

719 

720 - `"gpt-4o-audio-preview-2025-06-03"`

721 

722 - `"gpt-4o-mini-audio-preview"`

723 

724 - `"gpt-4o-mini-audio-preview-2024-12-17"`

725 

726 - `"gpt-4o-search-preview"`

727 

728 - `"gpt-4o-mini-search-preview"`

729 

730 - `"gpt-4o-search-preview-2025-03-11"`

731 

732 - `"gpt-4o-mini-search-preview-2025-03-11"`

733 

734 - `"chatgpt-4o-latest"`

735 

736 - `"codex-mini-latest"`

737 

738 - `"gpt-4o-mini"`

739 

740 - `"gpt-4o-mini-2024-07-18"`

741 

742 - `"gpt-4-turbo"`

743 

744 - `"gpt-4-turbo-2024-04-09"`

745 

746 - `"gpt-4-0125-preview"`

747 

748 - `"gpt-4-turbo-preview"`

749 

750 - `"gpt-4-1106-preview"`

751 

752 - `"gpt-4-vision-preview"`

753 

754 - `"gpt-4"`

755 

756 - `"gpt-4-0314"`

757 

758 - `"gpt-4-0613"`

759 

760 - `"gpt-4-32k"`

761 

762 - `"gpt-4-32k-0314"`

763 

764 - `"gpt-4-32k-0613"`

765 

766 - `"gpt-3.5-turbo"`

767 

768 - `"gpt-3.5-turbo-16k"`

769 

770 - `"gpt-3.5-turbo-0301"`

771 

772 - `"gpt-3.5-turbo-0613"`

773 

774 - `"gpt-3.5-turbo-1106"`

775 

776 - `"gpt-3.5-turbo-0125"`

777 

778 - `"gpt-3.5-turbo-16k-0613"`

779 

780 - `ResponsesOnlyModel = "o1-pro" or "o1-pro-2025-03-19" or "o3-pro" or 11 more`

781 

782 - `"o1-pro"`

783 

784 - `"o1-pro-2025-03-19"`

785 

786 - `"o3-pro"`

787 

788 - `"o3-pro-2025-06-10"`

789 

790 - `"o3-deep-research"`

791 

792 - `"o3-deep-research-2025-06-26"`

793 

794 - `"o4-mini-deep-research"`

795 

796 - `"o4-mini-deep-research-2025-06-26"`

797 

798 - `"computer-use-preview"`

799 

800 - `"computer-use-preview-2025-03-11"`

801 

802 - `"gpt-5-codex"`

803 

804 - `"gpt-5-pro"`

805 

806 - `"gpt-5-pro-2025-10-06"`

807 

808 - `"gpt-5.1-codex-max"`

Details

8 8 

9- `name: string`9- `name: string`

10 10 

11- `expires_in_seconds: optional number`

12 

13 The number of seconds until the API key expires. Omit this field for a key that does not expire.

14 

11### Returns15### Returns

12 16 

13- `value: string`17- `value: string`


21 -H 'Content-Type: application/json' \25 -H 'Content-Type: application/json' \

22 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \26 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

23 -d '{27 -d '{

24 "name": "New Admin Key"28 "name": "New Admin Key",

29 "expires_in_seconds": 2592000

25 }'30 }'

26```31```

27 32 


31{36{

32 "id": "key_abc",37 "id": "key_abc",

33 "created_at": 1711471533,38 "created_at": 1711471533,

39 "expires_at": 1714063533,

34 "object": "organization.admin_api_key",40 "object": "organization.admin_api_key",

35 "owner": {41 "owner": {

36 "id": "sa_456",42 "id": "sa_456",


54 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \60 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

55 -H "Content-Type: application/json" \61 -H "Content-Type: application/json" \

56 -d '{62 -d '{

57 "name": "New Admin Key"63 "name": "New Admin Key",

64 "expires_in_seconds": 2592000

58 }'65 }'

59```66```

60 67 


67 "name": "New Admin Key",74 "name": "New Admin Key",

68 "redacted_value": "sk-admin...xyz",75 "redacted_value": "sk-admin...xyz",

69 "created_at": 1711471533,76 "created_at": 1711471533,

77 "expires_at": 1714063533,

70 "last_used_at": 1711471534,78 "last_used_at": 1711471534,

71 "owner": {79 "owner": {

72 "type": "user",80 "type": "user",

Details

34 34 

35 The Unix timestamp (in seconds) of when the API key was created35 The Unix timestamp (in seconds) of when the API key was created

36 36 

37 - `expires_at: number`

38 

39 The Unix timestamp (in seconds) of when the API key expires

40 

37 - `object: "organization.admin_api_key"`41 - `object: "organization.admin_api_key"`

38 42 

39 The object type, which is always `organization.admin_api_key`43 The object type, which is always `organization.admin_api_key`


103 {107 {

104 "id": "key_abc",108 "id": "key_abc",

105 "created_at": 1711471533,109 "created_at": 1711471533,

110 "expires_at": 1714063533,

106 "object": "organization.admin_api_key",111 "object": "organization.admin_api_key",

107 "owner": {112 "owner": {

108 "id": "sa_456",113 "id": "sa_456",


144 "name": "Main Admin Key",149 "name": "Main Admin Key",

145 "redacted_value": "sk-admin...def",150 "redacted_value": "sk-admin...def",

146 "created_at": 1711471533,151 "created_at": 1711471533,

152 "expires_at": 1714063533,

147 "last_used_at": 1711471534,153 "last_used_at": 1711471534,

148 "owner": {154 "owner": {

149 "type": "service_account",155 "type": "service_account",

Details

12 12 

13### Returns13### Returns

14 14 

15- `AdminAPIKey object { id, created_at, object, 4 more }`15- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

16 16 

17 Represents an individual Admin API key in an org.17 Represents an individual Admin API key in an org.

18 18 


24 24 

25 The Unix timestamp (in seconds) of when the API key was created25 The Unix timestamp (in seconds) of when the API key was created

26 26 

27 - `expires_at: number`

28 

29 The Unix timestamp (in seconds) of when the API key expires

30 

27 - `object: "organization.admin_api_key"`31 - `object: "organization.admin_api_key"`

28 32 

29 The object type, which is always `organization.admin_api_key`33 The object type, which is always `organization.admin_api_key`


81{85{

82 "id": "key_abc",86 "id": "key_abc",

83 "created_at": 1711471533,87 "created_at": 1711471533,

88 "expires_at": 1714063533,

84 "object": "organization.admin_api_key",89 "object": "organization.admin_api_key",

85 "owner": {90 "owner": {

86 "id": "sa_456",91 "id": "sa_456",

Details

42 42 

43 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.43 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

44 44 

45- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`45- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

46 46 

47 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](/docs/api-reference/audit-logs/object).47 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](/docs/api-reference/audit-logs/object).

48 48 


144 144 

145 - `"role.assignment.deleted"`145 - `"role.assignment.deleted"`

146 146 

147 - `"role.bound_to_resource"`

148 

149 - `"role.unbound_from_resource"`

150 

147 - `"scim.enabled"`151 - `"scim.enabled"`

148 152 

149 - `"scim.disabled"`153 - `"scim.disabled"`


170 174 

171- `resource_ids: optional array of string`175- `resource_ids: optional array of string`

172 176 

173 Return only events performed on these targets. For example, a project ID updated.177 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

178 

179- `tenant_only: optional boolean`

180 

181 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

174 182 

175### Returns183### Returns

176 184 

177- `data: array of object { id, effective_at, type, 55 more }`185- `data: array of object { id, effective_at, type, 57 more }`

178 186 

179 - `id: string`187 - `id: string`

180 188 


184 192 

185 The Unix timestamp (in seconds) of the event.193 The Unix timestamp (in seconds) of the event.

186 194 

187 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`195 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

188 196 

189 The event type.197 The event type.

190 198 


286 294 

287 - `"role.assignment.deleted"`295 - `"role.assignment.deleted"`

288 296 

297 - `"role.bound_to_resource"`

298 

299 - `"role.unbound_from_resource"`

300 

289 - `"scim.enabled"`301 - `"scim.enabled"`

290 302 

291 - `"scim.disabled"`303 - `"scim.disabled"`


906 918 

907 The type of resource the role assignment was scoped to.919 The type of resource the role assignment was scoped to.

908 920 

921 - `"role.bound_to_resource": optional object { id, connector_id, connector_name, 7 more }`

922 

923 The details for events with this `type`.

924 

925 - `id: optional string`

926 

927 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

928 

929 - `connector_id: optional string`

930 

931 The connector ID for a ChatGPT workspace connector resource.

932 

933 - `connector_name: optional string`

934 

935 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

936 

937 - `enabled: optional boolean`

938 

939 Whether the connector is enabled for the role.

940 

941 - `permissions: optional array of string`

942 

943 The permissions granted to the role for the resource.

944 

945 - `resource_id: optional string`

946 

947 The ID of the resource the role was bound to.

948 

949 - `resource_type: optional string`

950 

951 The type of resource the role was bound to.

952 

953 - `role_id: optional string`

954 

955 The ID of the role that was bound to the resource.

956 

957 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

958 

959 The connector role mutation path that produced the event.

960 

961 - `"role_toggle"`

962 

963 - `"role_connector_update"`

964 

965 - `"role_delete"`

966 

967 - `"workspace_permissions"`

968 

969 - `"connector_publish"`

970 

971 - `workspace_id: optional string`

972 

973 The workspace ID for a ChatGPT workspace connector resource.

974 

909 - `"role.created": optional object { id, permissions, resource_id, 2 more }`975 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

910 976 

911 The details for events with this `type`.977 The details for events with this `type`.


938 1004 

939 The role ID.1005 The role ID.

940 1006 

1007 - `"role.unbound_from_resource": optional object { id, connector_id, connector_name, 7 more }`

1008 

1009 The details for events with this `type`.

1010 

1011 - `id: optional string`

1012 

1013 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1014 

1015 - `connector_id: optional string`

1016 

1017 The connector ID for a ChatGPT workspace connector resource.

1018 

1019 - `connector_name: optional string`

1020 

1021 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1022 

1023 - `enabled: optional boolean`

1024 

1025 Whether the connector is enabled for the role.

1026 

1027 - `permissions: optional array of string`

1028 

1029 The permissions remaining for the role after the change.

1030 

1031 - `resource_id: optional string`

1032 

1033 The ID of the resource the role was unbound from.

1034 

1035 - `resource_type: optional string`

1036 

1037 The type of resource the role was unbound from.

1038 

1039 - `role_id: optional string`

1040 

1041 The ID of the role that was unbound from the resource.

1042 

1043 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

1044 

1045 The connector role mutation path that produced the event.

1046 

1047 - `"role_toggle"`

1048 

1049 - `"role_connector_update"`

1050 

1051 - `"role_delete"`

1052 

1053 - `"workspace_permissions"`

1054 

1055 - `"connector_publish"`

1056 

1057 - `workspace_id: optional string`

1058 

1059 The workspace ID for a ChatGPT workspace connector resource.

1060 

941 - `"role.updated": optional object { id, changes_requested }`1061 - `"role.updated": optional object { id, changes_requested }`

942 1062 

943 The details for events with this `type`.1063 The details for events with this `type`.


1411 "resource_id": "resource_id",1531 "resource_id": "resource_id",

1412 "resource_type": "resource_type"1532 "resource_type": "resource_type"

1413 },1533 },

1534 "role.bound_to_resource": {

1535 "id": "id",

1536 "connector_id": "connector_id",

1537 "connector_name": "connector_name",

1538 "enabled": true,

1539 "permissions": [

1540 "string"

1541 ],

1542 "resource_id": "resource_id",

1543 "resource_type": "resource_type",

1544 "role_id": "role_id",

1545 "source": "role_toggle",

1546 "workspace_id": "workspace_id"

1547 },

1414 "role.created": {1548 "role.created": {

1415 "id": "id",1549 "id": "id",

1416 "permissions": [1550 "permissions": [


1423 "role.deleted": {1557 "role.deleted": {

1424 "id": "id"1558 "id": "id"

1425 },1559 },

1560 "role.unbound_from_resource": {

1561 "id": "id",

1562 "connector_id": "connector_id",

1563 "connector_name": "connector_name",

1564 "enabled": true,

1565 "permissions": [

1566 "string"

1567 ],

1568 "resource_id": "resource_id",

1569 "resource_type": "resource_type",

1570 "role_id": "role_id",

1571 "source": "role_toggle",

1572 "workspace_id": "workspace_id"

1573 },

1426 "role.updated": {1574 "role.updated": {

1427 "id": "id",1575 "id": "id",

1428 "changes_requested": {1576 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

4 

5Retrieves a project spend alert.

6 

7### Path Parameters

8 

9- `project_id: string`

10 

11- `alert_id: string`

12 

13### Returns

14 

15- `ProjectSpendAlert object { id, currency, interval, 3 more }`

16 

17 Represents a spend alert configured at the project level.

18 

19 - `id: string`

20 

21 The identifier, which can be referenced in API endpoints.

22 

23 - `currency: "USD"`

24 

25 The currency for the threshold amount.

26 

27 - `"USD"`

28 

29 - `interval: "month"`

30 

31 The time interval for evaluating spend against the threshold.

32 

33 - `"month"`

34 

35 - `notification_channel: object { recipients, type, subject_prefix }`

36 

37 Email notification settings for a spend alert.

38 

39 - `recipients: array of string`

40 

41 Email addresses that receive the spend alert notification.

42 

43 - `type: "email"`

44 

45 The notification channel type. Currently only `email` is supported.

46 

47 - `"email"`

48 

49 - `subject_prefix: optional string`

50 

51 Optional subject prefix for alert emails.

52 

53 - `object: "project.spend_alert"`

54 

55 The object type, which is always `project.spend_alert`.

56 

57 - `"project.spend_alert"`

58 

59 - `threshold_amount: number`

60 

61 The alert threshold amount, in cents.

62 

63### Example

64 

65```http

66curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

67 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

68```

69 

70#### Response

71 

72```json

73{

74 "id": "id",

75 "currency": "USD",

76 "interval": "month",

77 "notification_channel": {

78 "recipients": [

79 "string"

80 ],

81 "type": "email",

82 "subject_prefix": "subject_prefix"

83 },

84 "object": "project.spend_alert",

85 "threshold_amount": 0

86}

87```

88 

89### Example

90 

91```http

92curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

93 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

94 -H "Content-Type: application/json"

95```

96 

97#### Response

98 

99```json

100{

101 "id": "alert_abc123",

102 "object": "project.spend_alert",

103 "threshold_amount": 150000,

104 "currency": "USD",

105 "interval": "month",

106 "notification_channel": {

107 "type": "email",

108 "recipients": ["finance@example.com"],

109 "subject_prefix": "OpenAI spend alert"

110 }

111}

112```

Details

1## Retrieve organization spend alert

2 

3**get** `/organization/spend_alerts/{alert_id}`

4 

5Retrieves an organization spend alert.

6 

7### Path Parameters

8 

9- `alert_id: string`

10 

11### Returns

12 

13- `OrganizationSpendAlert object { id, currency, interval, 3 more }`

14 

15 Represents a spend alert configured at the organization level.

16 

17 - `id: string`

18 

19 The identifier, which can be referenced in API endpoints.

20 

21 - `currency: "USD"`

22 

23 The currency for the threshold amount.

24 

25 - `"USD"`

26 

27 - `interval: "month"`

28 

29 The time interval for evaluating spend against the threshold.

30 

31 - `"month"`

32 

33 - `notification_channel: object { recipients, type, subject_prefix }`

34 

35 Email notification settings for a spend alert.

36 

37 - `recipients: array of string`

38 

39 Email addresses that receive the spend alert notification.

40 

41 - `type: "email"`

42 

43 The notification channel type. Currently only `email` is supported.

44 

45 - `"email"`

46 

47 - `subject_prefix: optional string`

48 

49 Optional subject prefix for alert emails.

50 

51 - `object: "organization.spend_alert"`

52 

53 The object type, which is always `organization.spend_alert`.

54 

55 - `"organization.spend_alert"`

56 

57 - `threshold_amount: number`

58 

59 The alert threshold amount, in cents.

60 

61### Example

62 

63```http

64curl https://api.openai.com/v1/organization/spend_alerts/$ALERT_ID \

65 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

66```

67 

68#### Response

69 

70```json

71{

72 "id": "id",

73 "currency": "USD",

74 "interval": "month",

75 "notification_channel": {

76 "recipients": [

77 "string"

78 ],

79 "type": "email",

80 "subject_prefix": "subject_prefix"

81 },

82 "object": "organization.spend_alert",

83 "threshold_amount": 0

84}

85```

86 

87### Example

88 

89```http

90curl https://api.openai.com/v1/organization/spend_alerts/alert_abc123 \

91 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

92 -H "Content-Type: application/json"

93```

94 

95#### Response

96 

97```json

98{

99 "id": "alert_abc123",

100 "object": "organization.spend_alert",

101 "threshold_amount": 150000,

102 "currency": "USD",

103 "interval": "month",

104 "notification_channel": {

105 "type": "email",

106 "recipients": ["finance@example.com"],

107 "subject_prefix": "OpenAI spend alert"

108 }

109}

110```

Details

7723 Configuration options for7723 Configuration options for

7724 [reasoning models](https://platform.openai.com/docs/guides/reasoning).7724 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

7725 7725 

7726 - `context: optional "auto" or "current_turn" or "all_turns"`

7727 

7728 Controls which reasoning items are rendered back to the model on later turns.

7729 When returned on a response, this is the effective reasoning context mode

7730 used for the response.

7731 

7732 - `"auto"`

7733 

7734 - `"current_turn"`

7735 

7736 - `"all_turns"`

7737 

7726 - `effort: optional ReasoningEffort`7738 - `effort: optional ReasoningEffort`

7727 7739 

7728 Constrains effort on reasoning for7740 Constrains effort on reasoning for


8110 "prompt_cache_key": "prompt-cache-key-1234",8122 "prompt_cache_key": "prompt-cache-key-1234",

8111 "prompt_cache_retention": "in_memory",8123 "prompt_cache_retention": "in_memory",

8112 "reasoning": {8124 "reasoning": {

8125 "context": "auto",

8113 "effort": "none",8126 "effort": "none",

8114 "generate_summary": "auto",8127 "generate_summary": "auto",

8115 "summary": "auto"8128 "summary": "auto"

Details

3952 Configuration options for3952 Configuration options for

3953 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3953 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3954 3954 

3955 - `context: optional "auto" or "current_turn" or "all_turns"`

3956 

3957 Controls which reasoning items are rendered back to the model on later turns.

3958 When returned on a response, this is the effective reasoning context mode

3959 used for the response.

3960 

3961 - `"auto"`

3962 

3963 - `"current_turn"`

3964 

3965 - `"all_turns"`

3966 

3955 - `effort: optional ReasoningEffort`3967 - `effort: optional ReasoningEffort`

3956 3968 

3957 Constrains effort on reasoning for3969 Constrains effort on reasoning for


12808 Configuration options for12820 Configuration options for

12809 [reasoning models](https://platform.openai.com/docs/guides/reasoning).12821 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

12810 12822 

12823 - `context: optional "auto" or "current_turn" or "all_turns"`

12824 

12825 Controls which reasoning items are rendered back to the model on later turns.

12826 When returned on a response, this is the effective reasoning context mode

12827 used for the response.

12828 

12829 - `"auto"`

12830 

12831 - `"current_turn"`

12832 

12833 - `"all_turns"`

12834 

12811 - `effort: optional ReasoningEffort`12835 - `effort: optional ReasoningEffort`

12812 12836 

12813 Constrains effort on reasoning for12837 Constrains effort on reasoning for


13203 "prompt_cache_key": "prompt-cache-key-1234",13227 "prompt_cache_key": "prompt-cache-key-1234",

13204 "prompt_cache_retention": "in_memory",13228 "prompt_cache_retention": "in_memory",

13205 "reasoning": {13229 "reasoning": {

13230 "context": "auto",

13206 "effort": "none",13231 "effort": "none",

13207 "generate_summary": "auto",13232 "generate_summary": "auto",

13208 "summary": "auto"13233 "summary": "auto"

Details

7767 Configuration options for7767 Configuration options for

7768 [reasoning models](https://platform.openai.com/docs/guides/reasoning).7768 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

7769 7769 

7770 - `context: optional "auto" or "current_turn" or "all_turns"`

7771 

7772 Controls which reasoning items are rendered back to the model on later turns.

7773 When returned on a response, this is the effective reasoning context mode

7774 used for the response.

7775 

7776 - `"auto"`

7777 

7778 - `"current_turn"`

7779 

7780 - `"all_turns"`

7781 

7770 - `effort: optional ReasoningEffort`7782 - `effort: optional ReasoningEffort`

7771 7783 

7772 Constrains effort on reasoning for7784 Constrains effort on reasoning for


8153 "prompt_cache_key": "prompt-cache-key-1234",8165 "prompt_cache_key": "prompt-cache-key-1234",

8154 "prompt_cache_retention": "in_memory",8166 "prompt_cache_retention": "in_memory",

8155 "reasoning": {8167 "reasoning": {

8168 "context": "auto",

8156 "effort": "none",8169 "effort": "none",

8157 "generate_summary": "auto",8170 "generate_summary": "auto",

8158 "summary": "auto"8171 "summary": "auto"

Details

3630 3630 

3631 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3631 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3632 3632 

3633 - `context: optional "auto" or "current_turn" or "all_turns"`

3634 

3635 Controls which reasoning items are rendered back to the model on later turns.

3636 When returned on a response, this is the effective reasoning context mode

3637 used for the response.

3638 

3639 - `"auto"`

3640 

3641 - `"current_turn"`

3642 

3643 - `"all_turns"`

3644 

3633 - `effort: optional ReasoningEffort`3645 - `effort: optional ReasoningEffort`

3634 3646 

3635 Constrains effort on reasoning for3647 Constrains effort on reasoning for

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `AllModels = String | ChatModel | :"o1-pro" | :"o1-pro-2025-03-19" | :"o3-pro" | 11 more`

8 

9 - `String = String`

10 

11 - `ChatModel = :"gpt-5.4" | :"gpt-5.4-mini" | :"gpt-5.4-nano" | 75 more`

12 

13 - `:"gpt-5.4"`

14 

15 - `:"gpt-5.4-mini"`

16 

17 - `:"gpt-5.4-nano"`

18 

19 - `:"gpt-5.4-mini-2026-03-17"`

20 

21 - `:"gpt-5.4-nano-2026-03-17"`

22 

23 - `:"gpt-5.3-chat-latest"`

24 

25 - `:"gpt-5.2"`

26 

27 - `:"gpt-5.2-2025-12-11"`

28 

29 - `:"gpt-5.2-chat-latest"`

30 

31 - `:"gpt-5.2-pro"`

32 

33 - `:"gpt-5.2-pro-2025-12-11"`

34 

35 - `:"gpt-5.1"`

36 

37 - `:"gpt-5.1-2025-11-13"`

38 

39 - `:"gpt-5.1-codex"`

40 

41 - `:"gpt-5.1-mini"`

42 

43 - `:"gpt-5.1-chat-latest"`

44 

45 - `:"gpt-5"`

46 

47 - `:"gpt-5-mini"`

48 

49 - `:"gpt-5-nano"`

50 

51 - `:"gpt-5-2025-08-07"`

52 

53 - `:"gpt-5-mini-2025-08-07"`

54 

55 - `:"gpt-5-nano-2025-08-07"`

56 

57 - `:"gpt-5-chat-latest"`

58 

59 - `:"gpt-4.1"`

60 

61 - `:"gpt-4.1-mini"`

62 

63 - `:"gpt-4.1-nano"`

64 

65 - `:"gpt-4.1-2025-04-14"`

66 

67 - `:"gpt-4.1-mini-2025-04-14"`

68 

69 - `:"gpt-4.1-nano-2025-04-14"`

70 

71 - `:"o4-mini"`

72 

73 - `:"o4-mini-2025-04-16"`

74 

75 - `:o3`

76 

77 - `:"o3-2025-04-16"`

78 

79 - `:"o3-mini"`

80 

81 - `:"o3-mini-2025-01-31"`

82 

83 - `:o1`

84 

85 - `:"o1-2024-12-17"`

86 

87 - `:"o1-preview"`

88 

89 - `:"o1-preview-2024-09-12"`

90 

91 - `:"o1-mini"`

92 

93 - `:"o1-mini-2024-09-12"`

94 

95 - `:"gpt-4o"`

96 

97 - `:"gpt-4o-2024-11-20"`

98 

99 - `:"gpt-4o-2024-08-06"`

100 

101 - `:"gpt-4o-2024-05-13"`

102 

103 - `:"gpt-4o-audio-preview"`

104 

105 - `:"gpt-4o-audio-preview-2024-10-01"`

106 

107 - `:"gpt-4o-audio-preview-2024-12-17"`

108 

109 - `:"gpt-4o-audio-preview-2025-06-03"`

110 

111 - `:"gpt-4o-mini-audio-preview"`

112 

113 - `:"gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `:"gpt-4o-search-preview"`

116 

117 - `:"gpt-4o-mini-search-preview"`

118 

119 - `:"gpt-4o-search-preview-2025-03-11"`

120 

121 - `:"gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `:"chatgpt-4o-latest"`

124 

125 - `:"codex-mini-latest"`

126 

127 - `:"gpt-4o-mini"`

128 

129 - `:"gpt-4o-mini-2024-07-18"`

130 

131 - `:"gpt-4-turbo"`

132 

133 - `:"gpt-4-turbo-2024-04-09"`

134 

135 - `:"gpt-4-0125-preview"`

136 

137 - `:"gpt-4-turbo-preview"`

138 

139 - `:"gpt-4-1106-preview"`

140 

141 - `:"gpt-4-vision-preview"`

142 

143 - `:"gpt-4"`

144 

145 - `:"gpt-4-0314"`

146 

147 - `:"gpt-4-0613"`

148 

149 - `:"gpt-4-32k"`

150 

151 - `:"gpt-4-32k-0314"`

152 

153 - `:"gpt-4-32k-0613"`

154 

155 - `:"gpt-3.5-turbo"`

156 

157 - `:"gpt-3.5-turbo-16k"`

158 

159 - `:"gpt-3.5-turbo-0301"`

160 

161 - `:"gpt-3.5-turbo-0613"`

162 

163 - `:"gpt-3.5-turbo-1106"`

164 

165 - `:"gpt-3.5-turbo-0125"`

166 

167 - `:"gpt-3.5-turbo-16k-0613"`

168 

169 - `ResponsesOnlyModel = :"o1-pro" | :"o1-pro-2025-03-19" | :"o3-pro" | 11 more`

170 

171 - `:"o1-pro"`

172 

173 - `:"o1-pro-2025-03-19"`

174 

175 - `:"o3-pro"`

176 

177 - `:"o3-pro-2025-06-10"`

178 

179 - `:"o3-deep-research"`

180 

181 - `:"o3-deep-research-2025-06-26"`

182 

183 - `:"o4-mini-deep-research"`

184 

185 - `:"o4-mini-deep-research-2025-06-26"`

186 

187 - `:"computer-use-preview"`

188 

189 - `:"computer-use-preview-2025-03-11"`

190 

191 - `:"gpt-5-codex"`

192 

193 - `:"gpt-5-pro"`

194 

195 - `:"gpt-5-pro-2025-10-06"`

196 

197 - `:"gpt-5.1-codex-max"`

198 

199### Chat Model

200 

201- `ChatModel = :"gpt-5.4" | :"gpt-5.4-mini" | :"gpt-5.4-nano" | 75 more`

202 

203 - `:"gpt-5.4"`

204 

205 - `:"gpt-5.4-mini"`

206 

207 - `:"gpt-5.4-nano"`

208 

209 - `:"gpt-5.4-mini-2026-03-17"`

210 

211 - `:"gpt-5.4-nano-2026-03-17"`

212 

213 - `:"gpt-5.3-chat-latest"`

214 

215 - `:"gpt-5.2"`

216 

217 - `:"gpt-5.2-2025-12-11"`

218 

219 - `:"gpt-5.2-chat-latest"`

220 

221 - `:"gpt-5.2-pro"`

222 

223 - `:"gpt-5.2-pro-2025-12-11"`

224 

225 - `:"gpt-5.1"`

226 

227 - `:"gpt-5.1-2025-11-13"`

228 

229 - `:"gpt-5.1-codex"`

230 

231 - `:"gpt-5.1-mini"`

232 

233 - `:"gpt-5.1-chat-latest"`

234 

235 - `:"gpt-5"`

236 

237 - `:"gpt-5-mini"`

238 

239 - `:"gpt-5-nano"`

240 

241 - `:"gpt-5-2025-08-07"`

242 

243 - `:"gpt-5-mini-2025-08-07"`

244 

245 - `:"gpt-5-nano-2025-08-07"`

246 

247 - `:"gpt-5-chat-latest"`

248 

249 - `:"gpt-4.1"`

250 

251 - `:"gpt-4.1-mini"`

252 

253 - `:"gpt-4.1-nano"`

254 

255 - `:"gpt-4.1-2025-04-14"`

256 

257 - `:"gpt-4.1-mini-2025-04-14"`

258 

259 - `:"gpt-4.1-nano-2025-04-14"`

260 

261 - `:"o4-mini"`

262 

263 - `:"o4-mini-2025-04-16"`

264 

265 - `:o3`

266 

267 - `:"o3-2025-04-16"`

268 

269 - `:"o3-mini"`

270 

271 - `:"o3-mini-2025-01-31"`

272 

273 - `:o1`

274 

275 - `:"o1-2024-12-17"`

276 

277 - `:"o1-preview"`

278 

279 - `:"o1-preview-2024-09-12"`

280 

281 - `:"o1-mini"`

282 

283 - `:"o1-mini-2024-09-12"`

284 

285 - `:"gpt-4o"`

286 

287 - `:"gpt-4o-2024-11-20"`

288 

289 - `:"gpt-4o-2024-08-06"`

290 

291 - `:"gpt-4o-2024-05-13"`

292 

293 - `:"gpt-4o-audio-preview"`

294 

295 - `:"gpt-4o-audio-preview-2024-10-01"`

296 

297 - `:"gpt-4o-audio-preview-2024-12-17"`

298 

299 - `:"gpt-4o-audio-preview-2025-06-03"`

300 

301 - `:"gpt-4o-mini-audio-preview"`

302 

303 - `:"gpt-4o-mini-audio-preview-2024-12-17"`

304 

305 - `:"gpt-4o-search-preview"`

306 

307 - `:"gpt-4o-mini-search-preview"`

308 

309 - `:"gpt-4o-search-preview-2025-03-11"`

310 

311 - `:"gpt-4o-mini-search-preview-2025-03-11"`

312 

313 - `:"chatgpt-4o-latest"`

314 

315 - `:"codex-mini-latest"`

316 

317 - `:"gpt-4o-mini"`

318 

319 - `:"gpt-4o-mini-2024-07-18"`

320 

321 - `:"gpt-4-turbo"`

322 

323 - `:"gpt-4-turbo-2024-04-09"`

324 

325 - `:"gpt-4-0125-preview"`

326 

327 - `:"gpt-4-turbo-preview"`

328 

329 - `:"gpt-4-1106-preview"`

330 

331 - `:"gpt-4-vision-preview"`

332 

333 - `:"gpt-4"`

334 

335 - `:"gpt-4-0314"`

336 

337 - `:"gpt-4-0613"`

338 

339 - `:"gpt-4-32k"`

340 

341 - `:"gpt-4-32k-0314"`

342 

343 - `:"gpt-4-32k-0613"`

344 

345 - `:"gpt-3.5-turbo"`

346 

347 - `:"gpt-3.5-turbo-16k"`

348 

349 - `:"gpt-3.5-turbo-0301"`

350 

351 - `:"gpt-3.5-turbo-0613"`

352 

353 - `:"gpt-3.5-turbo-1106"`

354 

355 - `:"gpt-3.5-turbo-0125"`

356 

357 - `:"gpt-3.5-turbo-16k-0613"`

358 

359### Comparison Filter

360 

361- `class ComparisonFilter`

362 

363 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

364 

365 - `key: String`

366 

367 The key to compare against the value.

368 

369 - `type: :eq | :ne | :gt | 5 more`

370 

371 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

372 

373 - `eq`: equals

374 - `ne`: not equal

375 - `gt`: greater than

376 - `gte`: greater than or equal

377 - `lt`: less than

378 - `lte`: less than or equal

379 - `in`: in

380 - `nin`: not in

381 

382 - `:eq`

383 

384 - `:ne`

385 

386 - `:gt`

387 

388 - `:gte`

389 

390 - `:lt`

391 

392 - `:lte`

393 

394 - `:in`

395 

396 - `:nin`

397 

398 - `value: String | Float | bool | Array[String | Float]`

399 

400 The value to compare against the attribute key; supports string, number, or boolean types.

401 

402 - `String = String`

403 

404 - `Float = Float`

405 

406 - `UnionMember2 = bool`

407 

408 - `UnionMember3 = Array[String | Float]`

409 

410 - `String = String`

411 

412 - `Float = Float`

413 

414### Compound Filter

415 

416- `class CompoundFilter`

417 

418 Combine multiple filters using `and` or `or`.

419 

420 - `filters: Array[ComparisonFilter | untyped]`

421 

422 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

423 

424 - `class ComparisonFilter`

425 

426 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

427 

428 - `key: String`

429 

430 The key to compare against the value.

431 

432 - `type: :eq | :ne | :gt | 5 more`

433 

434 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

435 

436 - `eq`: equals

437 - `ne`: not equal

438 - `gt`: greater than

439 - `gte`: greater than or equal

440 - `lt`: less than

441 - `lte`: less than or equal

442 - `in`: in

443 - `nin`: not in

444 

445 - `:eq`

446 

447 - `:ne`

448 

449 - `:gt`

450 

451 - `:gte`

452 

453 - `:lt`

454 

455 - `:lte`

456 

457 - `:in`

458 

459 - `:nin`

460 

461 - `value: String | Float | bool | Array[String | Float]`

462 

463 The value to compare against the attribute key; supports string, number, or boolean types.

464 

465 - `String = String`

466 

467 - `Float = Float`

468 

469 - `UnionMember2 = bool`

470 

471 - `UnionMember3 = Array[String | Float]`

472 

473 - `String = String`

474 

475 - `Float = Float`

476 

477 - `UnionMember1 = untyped`

478 

479 - `type: :and | :or`

480 

481 Type of operation: `and` or `or`.

482 

483 - `:and`

484 

485 - `:or`

486 

487### Custom Tool Input Format

488 

489- `CustomToolInputFormat = Text{ type} | Grammar{ definition, syntax, type}`

490 

491 The input format for the custom tool. Default is unconstrained text.

492 

493 - `class Text`

494 

495 Unconstrained free-form text.

496 

497 - `type: :text`

498 

499 Unconstrained text format. Always `text`.

500 

501 - `:text`

502 

503 - `class Grammar`

504 

505 A grammar defined by the user.

506 

507 - `definition: String`

508 

509 The grammar definition.

510 

511 - `syntax: :lark | :regex`

512 

513 The syntax of the grammar definition. One of `lark` or `regex`.

514 

515 - `:lark`

516 

517 - `:regex`

518 

519 - `type: :grammar`

520 

521 Grammar format. Always `grammar`.

522 

523 - `:grammar`

524 

525### Error Object

526 

527- `class ErrorObject`

528 

529 - `code: String`

530 

531 - `message: String`

532 

533 - `param: String`

534 

535 - `type: String`

536 

537### Function Definition

538 

539- `class FunctionDefinition`

540 

541 - `name: String`

542 

543 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

544 

545 - `description: String`

546 

547 A description of what the function does, used by the model to choose when and how to call the function.

548 

549 - `parameters: FunctionParameters`

550 

551 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

552 

553 Omitting `parameters` defines a function with an empty parameter list.

554 

555 - `strict: bool`

556 

557 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).

558 

559### Function Parameters

560 

561- `FunctionParameters = Hash[Symbol, untyped]`

562 

563 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

564 

565 Omitting `parameters` defines a function with an empty parameter list.

566 

567### Metadata

568 

569- `Metadata = Hash[Symbol, String]`

570 

571 Set of 16 key-value pairs that can be attached to an object. This can be

572 useful for storing additional information about the object in a structured

573 format, and querying for objects via API or the dashboard.

574 

575 Keys are strings with a maximum length of 64 characters. Values are strings

576 with a maximum length of 512 characters.

577 

578### OAuth Error Code

579 

580- `OAuthErrorCode = :invalid_grant | :invalid_subject_token | String`

581 

582 - `OAuthErrorCode = :invalid_grant | :invalid_subject_token`

583 

584 - `:invalid_grant`

585 

586 - `:invalid_subject_token`

587 

588 - `String = String`

589 

590### Reasoning

591 

592- `class Reasoning`

593 

594 **gpt-5 and o-series models only**

595 

596 Configuration options for

597 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

598 

599 - `context: :auto | :current_turn | :all_turns`

600 

601 Controls which reasoning items are rendered back to the model on later turns.

602 When returned on a response, this is the effective reasoning context mode

603 used for the response.

604 

605 - `:auto`

606 

607 - `:current_turn`

608 

609 - `:all_turns`

610 

611 - `effort: ReasoningEffort`

612 

613 Constrains effort on reasoning for

614 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

615 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

616 reasoning effort can result in faster responses and fewer tokens used

617 on reasoning in a response.

618 

619 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

620 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

621 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

622 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

623 

624 - `:none`

625 

626 - `:minimal`

627 

628 - `:low`

629 

630 - `:medium`

631 

632 - `:high`

633 

634 - `:xhigh`

635 

636 - `generate_summary: :auto | :concise | :detailed`

637 

638 **Deprecated:** use `summary` instead.

639 

640 A summary of the reasoning performed by the model. This can be

641 useful for debugging and understanding the model's reasoning process.

642 One of `auto`, `concise`, or `detailed`.

643 

644 - `:auto`

645 

646 - `:concise`

647 

648 - `:detailed`

649 

650 - `summary: :auto | :concise | :detailed`

651 

652 A summary of the reasoning performed by the model. This can be

653 useful for debugging and understanding the model's reasoning process.

654 One of `auto`, `concise`, or `detailed`.

655 

656 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

657 

658 - `:auto`

659 

660 - `:concise`

661 

662 - `:detailed`

663 

664### Reasoning Effort

665 

666- `ReasoningEffort = :none | :minimal | :low | 3 more`

667 

668 Constrains effort on reasoning for

669 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

670 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

671 reasoning effort can result in faster responses and fewer tokens used

672 on reasoning in a response.

673 

674 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

675 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

676 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

677 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

678 

679 - `:none`

680 

681 - `:minimal`

682 

683 - `:low`

684 

685 - `:medium`

686 

687 - `:high`

688 

689 - `:xhigh`

690 

691### Response Format JSON Object

692 

693- `class ResponseFormatJSONObject`

694 

695 JSON object response format. An older method of generating JSON responses.

696 Using `json_schema` is recommended for models that support it. Note that the

697 model will not generate JSON without a system or user message instructing it

698 to do so.

699 

700 - `type: :json_object`

701 

702 The type of response format being defined. Always `json_object`.

703 

704 - `:json_object`

705 

706### Response Format JSON Schema

707 

708- `class ResponseFormatJSONSchema`

709 

710 JSON Schema response format. Used to generate structured JSON responses.

711 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

712 

713 - `json_schema: JSONSchema{ name, description, schema, strict}`

714 

715 Structured Outputs configuration options, including a JSON Schema.

716 

717 - `name: String`

718 

719 The name of the response format. Must be a-z, A-Z, 0-9, or contain

720 underscores and dashes, with a maximum length of 64.

721 

722 - `description: String`

723 

724 A description of what the response format is for, used by the model to

725 determine how to respond in the format.

726 

727 - `schema: Hash[Symbol, untyped]`

728 

729 The schema for the response format, described as a JSON Schema object.

730 Learn how to build JSON schemas [here](https://json-schema.org/).

731 

732 - `strict: bool`

733 

734 Whether to enable strict schema adherence when generating the output.

735 If set to true, the model will always follow the exact schema defined

736 in the `schema` field. Only a subset of JSON Schema is supported when

737 `strict` is `true`. To learn more, read the [Structured Outputs

738 guide](https://platform.openai.com/docs/guides/structured-outputs).

739 

740 - `type: :json_schema`

741 

742 The type of response format being defined. Always `json_schema`.

743 

744 - `:json_schema`

745 

746### Response Format Text

747 

748- `class ResponseFormatText`

749 

750 Default response format. Used to generate text responses.

751 

752 - `type: :text`

753 

754 The type of response format being defined. Always `text`.

755 

756 - `:text`

757 

758### Response Format Text Grammar

759 

760- `class ResponseFormatTextGrammar`

761 

762 A custom grammar for the model to follow when generating text.

763 Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).

764 

765 - `grammar: String`

766 

767 The custom grammar for the model to follow.

768 

769 - `type: :grammar`

770 

771 The type of response format being defined. Always `grammar`.

772 

773 - `:grammar`

774 

775### Response Format Text Python

776 

777- `class ResponseFormatTextPython`

778 

779 Configure the model to generate valid Python code. See the

780 [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details.

781 

782 - `type: :python`

783 

784 The type of response format being defined. Always `python`.

785 

786 - `:python`

787 

788### Responses Model

789 

790- `ResponsesModel = String | ChatModel | :"o1-pro" | :"o1-pro-2025-03-19" | :"o3-pro" | 11 more`

791 

792 - `String = String`

793 

794 - `ChatModel = :"gpt-5.4" | :"gpt-5.4-mini" | :"gpt-5.4-nano" | 75 more`

795 

796 - `:"gpt-5.4"`

797 

798 - `:"gpt-5.4-mini"`

799 

800 - `:"gpt-5.4-nano"`

801 

802 - `:"gpt-5.4-mini-2026-03-17"`

803 

804 - `:"gpt-5.4-nano-2026-03-17"`

805 

806 - `:"gpt-5.3-chat-latest"`

807 

808 - `:"gpt-5.2"`

809 

810 - `:"gpt-5.2-2025-12-11"`

811 

812 - `:"gpt-5.2-chat-latest"`

813 

814 - `:"gpt-5.2-pro"`

815 

816 - `:"gpt-5.2-pro-2025-12-11"`

817 

818 - `:"gpt-5.1"`

819 

820 - `:"gpt-5.1-2025-11-13"`

821 

822 - `:"gpt-5.1-codex"`

823 

824 - `:"gpt-5.1-mini"`

825 

826 - `:"gpt-5.1-chat-latest"`

827 

828 - `:"gpt-5"`

829 

830 - `:"gpt-5-mini"`

831 

832 - `:"gpt-5-nano"`

833 

834 - `:"gpt-5-2025-08-07"`

835 

836 - `:"gpt-5-mini-2025-08-07"`

837 

838 - `:"gpt-5-nano-2025-08-07"`

839 

840 - `:"gpt-5-chat-latest"`

841 

842 - `:"gpt-4.1"`

843 

844 - `:"gpt-4.1-mini"`

845 

846 - `:"gpt-4.1-nano"`

847 

848 - `:"gpt-4.1-2025-04-14"`

849 

850 - `:"gpt-4.1-mini-2025-04-14"`

851 

852 - `:"gpt-4.1-nano-2025-04-14"`

853 

854 - `:"o4-mini"`

855 

856 - `:"o4-mini-2025-04-16"`

857 

858 - `:o3`

859 

860 - `:"o3-2025-04-16"`

861 

862 - `:"o3-mini"`

863 

864 - `:"o3-mini-2025-01-31"`

865 

866 - `:o1`

867 

868 - `:"o1-2024-12-17"`

869 

870 - `:"o1-preview"`

871 

872 - `:"o1-preview-2024-09-12"`

873 

874 - `:"o1-mini"`

875 

876 - `:"o1-mini-2024-09-12"`

877 

878 - `:"gpt-4o"`

879 

880 - `:"gpt-4o-2024-11-20"`

881 

882 - `:"gpt-4o-2024-08-06"`

883 

884 - `:"gpt-4o-2024-05-13"`

885 

886 - `:"gpt-4o-audio-preview"`

887 

888 - `:"gpt-4o-audio-preview-2024-10-01"`

889 

890 - `:"gpt-4o-audio-preview-2024-12-17"`

891 

892 - `:"gpt-4o-audio-preview-2025-06-03"`

893 

894 - `:"gpt-4o-mini-audio-preview"`

895 

896 - `:"gpt-4o-mini-audio-preview-2024-12-17"`

897 

898 - `:"gpt-4o-search-preview"`

899 

900 - `:"gpt-4o-mini-search-preview"`

901 

902 - `:"gpt-4o-search-preview-2025-03-11"`

903 

904 - `:"gpt-4o-mini-search-preview-2025-03-11"`

905 

906 - `:"chatgpt-4o-latest"`

907 

908 - `:"codex-mini-latest"`

909 

910 - `:"gpt-4o-mini"`

911 

912 - `:"gpt-4o-mini-2024-07-18"`

913 

914 - `:"gpt-4-turbo"`

915 

916 - `:"gpt-4-turbo-2024-04-09"`

917 

918 - `:"gpt-4-0125-preview"`

919 

920 - `:"gpt-4-turbo-preview"`

921 

922 - `:"gpt-4-1106-preview"`

923 

924 - `:"gpt-4-vision-preview"`

925 

926 - `:"gpt-4"`

927 

928 - `:"gpt-4-0314"`

929 

930 - `:"gpt-4-0613"`

931 

932 - `:"gpt-4-32k"`

933 

934 - `:"gpt-4-32k-0314"`

935 

936 - `:"gpt-4-32k-0613"`

937 

938 - `:"gpt-3.5-turbo"`

939 

940 - `:"gpt-3.5-turbo-16k"`

941 

942 - `:"gpt-3.5-turbo-0301"`

943 

944 - `:"gpt-3.5-turbo-0613"`

945 

946 - `:"gpt-3.5-turbo-1106"`

947 

948 - `:"gpt-3.5-turbo-0125"`

949 

950 - `:"gpt-3.5-turbo-16k-0613"`

951 

952 - `ResponsesOnlyModel = :"o1-pro" | :"o1-pro-2025-03-19" | :"o3-pro" | 11 more`

953 

954 - `:"o1-pro"`

955 

956 - `:"o1-pro-2025-03-19"`

957 

958 - `:"o3-pro"`

959 

960 - `:"o3-pro-2025-06-10"`

961 

962 - `:"o3-deep-research"`

963 

964 - `:"o3-deep-research-2025-06-26"`

965 

966 - `:"o4-mini-deep-research"`

967 

968 - `:"o4-mini-deep-research-2025-06-26"`

969 

970 - `:"computer-use-preview"`

971 

972 - `:"computer-use-preview-2025-03-11"`

973 

974 - `:"gpt-5-codex"`

975 

976 - `:"gpt-5-pro"`

977 

978 - `:"gpt-5-pro-2025-10-06"`

979 

980 - `:"gpt-5.1-codex-max"`

Details

1## Create admin API key

2 

3`admin.organization.admin_api_keys.create(**kwargs) -> AdminAPIKeyCreateResponse`

4 

5**post** `/organization/admin_api_keys`

6 

7Create an organization admin API key

8 

9### Parameters

10 

11- `name: String`

12 

13- `expires_in_seconds: Integer`

14 

15 The number of seconds until the API key expires. Omit this field for a key that does not expire.

16 

17### Returns

18 

19- `class AdminAPIKeyCreateResponse`

20 

21 Represents an individual Admin API key in an org.

22 

23 - `value: String`

24 

25 The value of the API key. Only shown on create.

26 

27### Example

28 

29```ruby

30require "openai"

31 

32openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

33 

34admin_api_key = openai.admin.organization.admin_api_keys.create(name: "New Admin Key")

35 

36puts(admin_api_key)

37```

38 

39#### Response

40 

41```json

42{

43 "id": "key_abc",

44 "created_at": 1711471533,

45 "expires_at": 1714063533,

46 "object": "organization.admin_api_key",

47 "owner": {

48 "id": "sa_456",

49 "created_at": 1711471533,

50 "name": "My Service Account",

51 "object": "organization.user",

52 "role": "owner",

53 "type": "user"

54 },

55 "redacted_value": "sk-admin...def",

56 "last_used_at": 1711471534,

57 "name": "Administration Key",

58 "value": "sk-admin-1234abcd"

59}

60```

Details

1## List all organization and project API keys.

2 

3`admin.organization.admin_api_keys.list(**kwargs) -> CursorPage<AdminAPIKey>`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `after: String`

12 

13 Return keys with IDs that come after this ID in the pagination order.

14 

15- `limit: Integer`

16 

17 Maximum number of keys to return.

18 

19- `order: :asc | :desc`

20 

21 Order results by creation time, ascending or descending.

22 

23 - `:asc`

24 

25 - `:desc`

26 

27### Returns

28 

29- `class AdminAPIKey`

30 

31 Represents an individual Admin API key in an org.

32 

33 - `id: String`

34 

35 The identifier, which can be referenced in API endpoints

36 

37 - `created_at: Integer`

38 

39 The Unix timestamp (in seconds) of when the API key was created

40 

41 - `expires_at: Integer`

42 

43 The Unix timestamp (in seconds) of when the API key expires

44 

45 - `object: :"organization.admin_api_key"`

46 

47 The object type, which is always `organization.admin_api_key`

48 

49 - `:"organization.admin_api_key"`

50 

51 - `owner: Owner{ id, created_at, name, 3 more}`

52 

53 - `id: String`

54 

55 The identifier, which can be referenced in API endpoints

56 

57 - `created_at: Integer`

58 

59 The Unix timestamp (in seconds) of when the user was created

60 

61 - `name: String`

62 

63 The name of the user

64 

65 - `object: String`

66 

67 The object type, which is always organization.user

68 

69 - `role: String`

70 

71 Always `owner`

72 

73 - `type: String`

74 

75 Always `user`

76 

77 - `redacted_value: String`

78 

79 The redacted value of the API key

80 

81 - `last_used_at: Integer`

82 

83 The Unix timestamp (in seconds) of when the API key was last used

84 

85 - `name: String`

86 

87 The name of the API key

88 

89### Example

90 

91```ruby

92require "openai"

93 

94openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

95 

96page = openai.admin.organization.admin_api_keys.list

97 

98puts(page)

99```

100 

101#### Response

102 

103```json

104{

105 "data": [

106 {

107 "id": "key_abc",

108 "created_at": 1711471533,

109 "expires_at": 1714063533,

110 "object": "organization.admin_api_key",

111 "owner": {

112 "id": "sa_456",

113 "created_at": 1711471533,

114 "name": "My Service Account",

115 "object": "organization.user",

116 "role": "owner",

117 "type": "user"

118 },

119 "redacted_value": "sk-admin...def",

120 "last_used_at": 1711471534,

121 "name": "Administration Key"

122 }

123 ],

124 "has_more": false,

125 "object": "list",

126 "first_id": "key_abc",

127 "last_id": "key_xyz"

128}

129```

Details

1## Retrieve admin API key

2 

3`admin.organization.admin_api_keys.retrieve(key_id) -> AdminAPIKey`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `key_id: String`

12 

13 The ID of the API key.

14 

15### Returns

16 

17- `class AdminAPIKey`

18 

19 Represents an individual Admin API key in an org.

20 

21 - `id: String`

22 

23 The identifier, which can be referenced in API endpoints

24 

25 - `created_at: Integer`

26 

27 The Unix timestamp (in seconds) of when the API key was created

28 

29 - `expires_at: Integer`

30 

31 The Unix timestamp (in seconds) of when the API key expires

32 

33 - `object: :"organization.admin_api_key"`

34 

35 The object type, which is always `organization.admin_api_key`

36 

37 - `:"organization.admin_api_key"`

38 

39 - `owner: Owner{ id, created_at, name, 3 more}`

40 

41 - `id: String`

42 

43 The identifier, which can be referenced in API endpoints

44 

45 - `created_at: Integer`

46 

47 The Unix timestamp (in seconds) of when the user was created

48 

49 - `name: String`

50 

51 The name of the user

52 

53 - `object: String`

54 

55 The object type, which is always organization.user

56 

57 - `role: String`

58 

59 Always `owner`

60 

61 - `type: String`

62 

63 Always `user`

64 

65 - `redacted_value: String`

66 

67 The redacted value of the API key

68 

69 - `last_used_at: Integer`

70 

71 The Unix timestamp (in seconds) of when the API key was last used

72 

73 - `name: String`

74 

75 The name of the API key

76 

77### Example

78 

79```ruby

80require "openai"

81 

82openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

83 

84admin_api_key = openai.admin.organization.admin_api_keys.retrieve("key_id")

85 

86puts(admin_api_key)

87```

88 

89#### Response

90 

91```json

92{

93 "id": "key_abc",

94 "created_at": 1711471533,

95 "expires_at": 1714063533,

96 "object": "organization.admin_api_key",

97 "owner": {

98 "id": "sa_456",

99 "created_at": 1711471533,

100 "name": "My Service Account",

101 "object": "organization.user",

102 "role": "owner",

103 "type": "user"

104 },

105 "redacted_value": "sk-admin...def",

106 "last_used_at": 1711471534,

107 "name": "Administration Key"

108}

109```

Details

44 44 

45 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.45 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

46 46 

47- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more]`47- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more]`

48 48 

49 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).49 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).

50 50 


146 146 

147 - `:"role.assignment.deleted"`147 - `:"role.assignment.deleted"`

148 148 

149 - `:"role.bound_to_resource"`

150 

151 - `:"role.unbound_from_resource"`

152 

149 - `:"scim.enabled"`153 - `:"scim.enabled"`

150 154 

151 - `:"scim.disabled"`155 - `:"scim.disabled"`


172 176 

173- `resource_ids: Array[String]`177- `resource_ids: Array[String]`

174 178 

175 Return only events performed on these targets. For example, a project ID updated.179 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

180 

181- `tenant_only: bool`

182 

183 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

176 184 

177### Returns185### Returns

178 186 


188 196 

189 The Unix timestamp (in seconds) of the event.197 The Unix timestamp (in seconds) of the event.

190 198 

191 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`199 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

192 200 

193 The event type.201 The event type.

194 202 


290 298 

291 - `:"role.assignment.deleted"`299 - `:"role.assignment.deleted"`

292 300 

301 - `:"role.bound_to_resource"`

302 

303 - `:"role.unbound_from_resource"`

304 

293 - `:"scim.enabled"`305 - `:"scim.enabled"`

294 306 

295 - `:"scim.disabled"`307 - `:"scim.disabled"`


910 922 

911 The type of resource the role assignment was scoped to.923 The type of resource the role assignment was scoped to.

912 924 

925 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

926 

927 The details for events with this `type`.

928 

929 - `id: String`

930 

931 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

932 

933 - `connector_id: String`

934 

935 The connector ID for a ChatGPT workspace connector resource.

936 

937 - `connector_name: String`

938 

939 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

940 

941 - `enabled: bool`

942 

943 Whether the connector is enabled for the role.

944 

945 - `permissions: Array[String]`

946 

947 The permissions granted to the role for the resource.

948 

949 - `resource_id: String`

950 

951 The ID of the resource the role was bound to.

952 

953 - `resource_type: String`

954 

955 The type of resource the role was bound to.

956 

957 - `role_id: String`

958 

959 The ID of the role that was bound to the resource.

960 

961 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

962 

963 The connector role mutation path that produced the event.

964 

965 - `:role_toggle`

966 

967 - `:role_connector_update`

968 

969 - `:role_delete`

970 

971 - `:workspace_permissions`

972 

973 - `:connector_publish`

974 

975 - `workspace_id: String`

976 

977 The workspace ID for a ChatGPT workspace connector resource.

978 

913 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`979 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

914 980 

915 The details for events with this `type`.981 The details for events with this `type`.


942 1008 

943 The role ID.1009 The role ID.

944 1010 

1011 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

1012 

1013 The details for events with this `type`.

1014 

1015 - `id: String`

1016 

1017 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1018 

1019 - `connector_id: String`

1020 

1021 The connector ID for a ChatGPT workspace connector resource.

1022 

1023 - `connector_name: String`

1024 

1025 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1026 

1027 - `enabled: bool`

1028 

1029 Whether the connector is enabled for the role.

1030 

1031 - `permissions: Array[String]`

1032 

1033 The permissions remaining for the role after the change.

1034 

1035 - `resource_id: String`

1036 

1037 The ID of the resource the role was unbound from.

1038 

1039 - `resource_type: String`

1040 

1041 The type of resource the role was unbound from.

1042 

1043 - `role_id: String`

1044 

1045 The ID of the role that was unbound from the resource.

1046 

1047 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

1048 

1049 The connector role mutation path that produced the event.

1050 

1051 - `:role_toggle`

1052 

1053 - `:role_connector_update`

1054 

1055 - `:role_delete`

1056 

1057 - `:workspace_permissions`

1058 

1059 - `:connector_publish`

1060 

1061 - `workspace_id: String`

1062 

1063 The workspace ID for a ChatGPT workspace connector resource.

1064 

945 - `role_updated: RoleUpdated{ id, changes_requested}`1065 - `role_updated: RoleUpdated{ id, changes_requested}`

946 1066 

947 The details for events with this `type`.1067 The details for events with this `type`.


1410 "resource_id": "resource_id",1530 "resource_id": "resource_id",

1411 "resource_type": "resource_type"1531 "resource_type": "resource_type"

1412 },1532 },

1533 "role.bound_to_resource": {

1534 "id": "id",

1535 "connector_id": "connector_id",

1536 "connector_name": "connector_name",

1537 "enabled": true,

1538 "permissions": [

1539 "string"

1540 ],

1541 "resource_id": "resource_id",

1542 "resource_type": "resource_type",

1543 "role_id": "role_id",

1544 "source": "role_toggle",

1545 "workspace_id": "workspace_id"

1546 },

1413 "role.created": {1547 "role.created": {

1414 "id": "id",1548 "id": "id",

1415 "permissions": [1549 "permissions": [


1422 "role.deleted": {1556 "role.deleted": {

1423 "id": "id"1557 "id": "id"

1424 },1558 },

1559 "role.unbound_from_resource": {

1560 "id": "id",

1561 "connector_id": "connector_id",

1562 "connector_name": "connector_name",

1563 "enabled": true,

1564 "permissions": [

1565 "string"

1566 ],

1567 "resource_id": "resource_id",

1568 "resource_type": "resource_type",

1569 "role_id": "role_id",

1570 "source": "role_toggle",

1571 "workspace_id": "workspace_id"

1572 },

1425 "role.updated": {1573 "role.updated": {

1426 "id": "id",1574 "id": "id",

1427 "changes_requested": {1575 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `project_id: String`

12 

13- `alert_id: String`

14 

15### Returns

16 

17- `class ProjectSpendAlert`

18 

19 Represents a spend alert configured at the project level.

20 

21 - `id: String`

22 

23 The identifier, which can be referenced in API endpoints.

24 

25 - `currency: :USD`

26 

27 The currency for the threshold amount.

28 

29 - `:USD`

30 

31 - `interval: :month`

32 

33 The time interval for evaluating spend against the threshold.

34 

35 - `:month`

36 

37 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

38 

39 Email notification settings for a spend alert.

40 

41 - `recipients: Array[String]`

42 

43 Email addresses that receive the spend alert notification.

44 

45 - `type: :email`

46 

47 The notification channel type. Currently only `email` is supported.

48 

49 - `:email`

50 

51 - `subject_prefix: String`

52 

53 Optional subject prefix for alert emails.

54 

55 - `object: :"project.spend_alert"`

56 

57 The object type, which is always `project.spend_alert`.

58 

59 - `:"project.spend_alert"`

60 

61 - `threshold_amount: Integer`

62 

63 The alert threshold amount, in cents.

64 

65### Example

66 

67```ruby

68require "openai"

69 

70openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

71 

72project_spend_alert = openai.admin.organization.projects.spend_alerts.retrieve("alert_id", project_id: "project_id")

73 

74puts(project_spend_alert)

75```

76 

77#### Response

78 

79```json

80{

81 "id": "id",

82 "currency": "USD",

83 "interval": "month",

84 "notification_channel": {

85 "recipients": [

86 "string"

87 ],

88 "type": "email",

89 "subject_prefix": "subject_prefix"

90 },

91 "object": "project.spend_alert",

92 "threshold_amount": 0

93}

94```

Details

1## Retrieve organization spend alert

2 

3`admin.organization.spend_alerts.retrieve(alert_id) -> OrganizationSpendAlert`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `alert_id: String`

12 

13### Returns

14 

15- `class OrganizationSpendAlert`

16 

17 Represents a spend alert configured at the organization level.

18 

19 - `id: String`

20 

21 The identifier, which can be referenced in API endpoints.

22 

23 - `currency: :USD`

24 

25 The currency for the threshold amount.

26 

27 - `:USD`

28 

29 - `interval: :month`

30 

31 The time interval for evaluating spend against the threshold.

32 

33 - `:month`

34 

35 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

36 

37 Email notification settings for a spend alert.

38 

39 - `recipients: Array[String]`

40 

41 Email addresses that receive the spend alert notification.

42 

43 - `type: :email`

44 

45 The notification channel type. Currently only `email` is supported.

46 

47 - `:email`

48 

49 - `subject_prefix: String`

50 

51 Optional subject prefix for alert emails.

52 

53 - `object: :"organization.spend_alert"`

54 

55 The object type, which is always `organization.spend_alert`.

56 

57 - `:"organization.spend_alert"`

58 

59 - `threshold_amount: Integer`

60 

61 The alert threshold amount, in cents.

62 

63### Example

64 

65```ruby

66require "openai"

67 

68openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

69 

70organization_spend_alert = openai.admin.organization.spend_alerts.retrieve("alert_id")

71 

72puts(organization_spend_alert)

73```

74 

75#### Response

76 

77```json

78{

79 "id": "id",

80 "currency": "USD",

81 "interval": "month",

82 "notification_channel": {

83 "recipients": [

84 "string"

85 ],

86 "type": "email",

87 "subject_prefix": "subject_prefix"

88 },

89 "object": "organization.spend_alert",

90 "threshold_amount": 0

91}

92```

Details

4812 Configuration options for4812 Configuration options for

4813 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4813 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4814 4814 

4815 - `context: :auto | :current_turn | :all_turns`

4816 

4817 Controls which reasoning items are rendered back to the model on later turns.

4818 When returned on a response, this is the effective reasoning context mode

4819 used for the response.

4820 

4821 - `:auto`

4822 

4823 - `:current_turn`

4824 

4825 - `:all_turns`

4826 

4815 - `effort: ReasoningEffort`4827 - `effort: ReasoningEffort`

4816 4828 

4817 Constrains effort on reasoning for4829 Constrains effort on reasoning for


5203 "prompt_cache_key": "prompt-cache-key-1234",5215 "prompt_cache_key": "prompt-cache-key-1234",

5204 "prompt_cache_retention": "in_memory",5216 "prompt_cache_retention": "in_memory",

5205 "reasoning": {5217 "reasoning": {

5218 "context": "auto",

5206 "effort": "none",5219 "effort": "none",

5207 "generate_summary": "auto",5220 "generate_summary": "auto",

5208 "summary": "auto"5221 "summary": "auto"

Details

3444 Configuration options for3444 Configuration options for

3445 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3445 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3446 3446 

3447 - `context: :auto | :current_turn | :all_turns`

3448 

3449 Controls which reasoning items are rendered back to the model on later turns.

3450 When returned on a response, this is the effective reasoning context mode

3451 used for the response.

3452 

3453 - `:auto`

3454 

3455 - `:current_turn`

3456 

3457 - `:all_turns`

3458 

3447 - `effort: ReasoningEffort`3459 - `effort: ReasoningEffort`

3448 3460 

3449 Constrains effort on reasoning for3461 Constrains effort on reasoning for


8727 Configuration options for8739 Configuration options for

8728 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8740 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8729 8741 

8742 - `context: :auto | :current_turn | :all_turns`

8743 

8744 Controls which reasoning items are rendered back to the model on later turns.

8745 When returned on a response, this is the effective reasoning context mode

8746 used for the response.

8747 

8748 - `:auto`

8749 

8750 - `:current_turn`

8751 

8752 - `:all_turns`

8753 

8730 - `effort: ReasoningEffort`8754 - `effort: ReasoningEffort`

8731 8755 

8732 Constrains effort on reasoning for8756 Constrains effort on reasoning for


9118 "prompt_cache_key": "prompt-cache-key-1234",9142 "prompt_cache_key": "prompt-cache-key-1234",

9119 "prompt_cache_retention": "in_memory",9143 "prompt_cache_retention": "in_memory",

9120 "reasoning": {9144 "reasoning": {

9145 "context": "auto",

9121 "effort": "none",9146 "effort": "none",

9122 "generate_summary": "auto",9147 "generate_summary": "auto",

9123 "summary": "auto"9148 "summary": "auto"

Details

4852 Configuration options for4852 Configuration options for

4853 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4853 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4854 4854 

4855 - `context: :auto | :current_turn | :all_turns`

4856 

4857 Controls which reasoning items are rendered back to the model on later turns.

4858 When returned on a response, this is the effective reasoning context mode

4859 used for the response.

4860 

4861 - `:auto`

4862 

4863 - `:current_turn`

4864 

4865 - `:all_turns`

4866 

4855 - `effort: ReasoningEffort`4867 - `effort: ReasoningEffort`

4856 4868 

4857 Constrains effort on reasoning for4869 Constrains effort on reasoning for


5243 "prompt_cache_key": "prompt-cache-key-1234",5255 "prompt_cache_key": "prompt-cache-key-1234",

5244 "prompt_cache_retention": "in_memory",5256 "prompt_cache_retention": "in_memory",

5245 "reasoning": {5257 "reasoning": {

5258 "context": "auto",

5246 "effort": "none",5259 "effort": "none",

5247 "generate_summary": "auto",5260 "generate_summary": "auto",

5248 "summary": "auto"5261 "summary": "auto"

Details

3122 3122 

3123 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3123 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3124 3124 

3125 - `context: :auto | :current_turn | :all_turns`

3126 

3127 Controls which reasoning items are rendered back to the model on later turns.

3128 When returned on a response, this is the effective reasoning context mode

3129 used for the response.

3130 

3131 - `:auto`

3132 

3133 - `:current_turn`

3134 

3135 - `:all_turns`

3136 

3125 - `effort: ReasoningEffort`3137 - `effort: ReasoningEffort`

3126 3138 

3127 Constrains effort on reasoning for3139 Constrains effort on reasoning for

Details

22 22 

23 - `class VideoReferenceInputParam`23 - `class VideoReferenceInputParam`

24 24 

25 Reference to the completed video.25 Reference to the completed video to edit.

26 26 

27 - `id: String`27 - `id: String`

28 28 

Details

1# Shared

2 

3## Domain Types

4 

5### All Models

6 

7- `AllModels = (string & {}) | ChatModel | "o1-pro" | "o1-pro-2025-03-19" | "o3-pro" | 11 more`

8 

9 - `(string & {})`

10 

11 - `ChatModel = "gpt-5.4" | "gpt-5.4-mini" | "gpt-5.4-nano" | 75 more`

12 

13 - `"gpt-5.4"`

14 

15 - `"gpt-5.4-mini"`

16 

17 - `"gpt-5.4-nano"`

18 

19 - `"gpt-5.4-mini-2026-03-17"`

20 

21 - `"gpt-5.4-nano-2026-03-17"`

22 

23 - `"gpt-5.3-chat-latest"`

24 

25 - `"gpt-5.2"`

26 

27 - `"gpt-5.2-2025-12-11"`

28 

29 - `"gpt-5.2-chat-latest"`

30 

31 - `"gpt-5.2-pro"`

32 

33 - `"gpt-5.2-pro-2025-12-11"`

34 

35 - `"gpt-5.1"`

36 

37 - `"gpt-5.1-2025-11-13"`

38 

39 - `"gpt-5.1-codex"`

40 

41 - `"gpt-5.1-mini"`

42 

43 - `"gpt-5.1-chat-latest"`

44 

45 - `"gpt-5"`

46 

47 - `"gpt-5-mini"`

48 

49 - `"gpt-5-nano"`

50 

51 - `"gpt-5-2025-08-07"`

52 

53 - `"gpt-5-mini-2025-08-07"`

54 

55 - `"gpt-5-nano-2025-08-07"`

56 

57 - `"gpt-5-chat-latest"`

58 

59 - `"gpt-4.1"`

60 

61 - `"gpt-4.1-mini"`

62 

63 - `"gpt-4.1-nano"`

64 

65 - `"gpt-4.1-2025-04-14"`

66 

67 - `"gpt-4.1-mini-2025-04-14"`

68 

69 - `"gpt-4.1-nano-2025-04-14"`

70 

71 - `"o4-mini"`

72 

73 - `"o4-mini-2025-04-16"`

74 

75 - `"o3"`

76 

77 - `"o3-2025-04-16"`

78 

79 - `"o3-mini"`

80 

81 - `"o3-mini-2025-01-31"`

82 

83 - `"o1"`

84 

85 - `"o1-2024-12-17"`

86 

87 - `"o1-preview"`

88 

89 - `"o1-preview-2024-09-12"`

90 

91 - `"o1-mini"`

92 

93 - `"o1-mini-2024-09-12"`

94 

95 - `"gpt-4o"`

96 

97 - `"gpt-4o-2024-11-20"`

98 

99 - `"gpt-4o-2024-08-06"`

100 

101 - `"gpt-4o-2024-05-13"`

102 

103 - `"gpt-4o-audio-preview"`

104 

105 - `"gpt-4o-audio-preview-2024-10-01"`

106 

107 - `"gpt-4o-audio-preview-2024-12-17"`

108 

109 - `"gpt-4o-audio-preview-2025-06-03"`

110 

111 - `"gpt-4o-mini-audio-preview"`

112 

113 - `"gpt-4o-mini-audio-preview-2024-12-17"`

114 

115 - `"gpt-4o-search-preview"`

116 

117 - `"gpt-4o-mini-search-preview"`

118 

119 - `"gpt-4o-search-preview-2025-03-11"`

120 

121 - `"gpt-4o-mini-search-preview-2025-03-11"`

122 

123 - `"chatgpt-4o-latest"`

124 

125 - `"codex-mini-latest"`

126 

127 - `"gpt-4o-mini"`

128 

129 - `"gpt-4o-mini-2024-07-18"`

130 

131 - `"gpt-4-turbo"`

132 

133 - `"gpt-4-turbo-2024-04-09"`

134 

135 - `"gpt-4-0125-preview"`

136 

137 - `"gpt-4-turbo-preview"`

138 

139 - `"gpt-4-1106-preview"`

140 

141 - `"gpt-4-vision-preview"`

142 

143 - `"gpt-4"`

144 

145 - `"gpt-4-0314"`

146 

147 - `"gpt-4-0613"`

148 

149 - `"gpt-4-32k"`

150 

151 - `"gpt-4-32k-0314"`

152 

153 - `"gpt-4-32k-0613"`

154 

155 - `"gpt-3.5-turbo"`

156 

157 - `"gpt-3.5-turbo-16k"`

158 

159 - `"gpt-3.5-turbo-0301"`

160 

161 - `"gpt-3.5-turbo-0613"`

162 

163 - `"gpt-3.5-turbo-1106"`

164 

165 - `"gpt-3.5-turbo-0125"`

166 

167 - `"gpt-3.5-turbo-16k-0613"`

168 

169 - `"o1-pro" | "o1-pro-2025-03-19" | "o3-pro" | 11 more`

170 

171 - `"o1-pro"`

172 

173 - `"o1-pro-2025-03-19"`

174 

175 - `"o3-pro"`

176 

177 - `"o3-pro-2025-06-10"`

178 

179 - `"o3-deep-research"`

180 

181 - `"o3-deep-research-2025-06-26"`

182 

183 - `"o4-mini-deep-research"`

184 

185 - `"o4-mini-deep-research-2025-06-26"`

186 

187 - `"computer-use-preview"`

188 

189 - `"computer-use-preview-2025-03-11"`

190 

191 - `"gpt-5-codex"`

192 

193 - `"gpt-5-pro"`

194 

195 - `"gpt-5-pro-2025-10-06"`

196 

197 - `"gpt-5.1-codex-max"`

198 

199### Chat Model

200 

201- `ChatModel = "gpt-5.4" | "gpt-5.4-mini" | "gpt-5.4-nano" | 75 more`

202 

203 - `"gpt-5.4"`

204 

205 - `"gpt-5.4-mini"`

206 

207 - `"gpt-5.4-nano"`

208 

209 - `"gpt-5.4-mini-2026-03-17"`

210 

211 - `"gpt-5.4-nano-2026-03-17"`

212 

213 - `"gpt-5.3-chat-latest"`

214 

215 - `"gpt-5.2"`

216 

217 - `"gpt-5.2-2025-12-11"`

218 

219 - `"gpt-5.2-chat-latest"`

220 

221 - `"gpt-5.2-pro"`

222 

223 - `"gpt-5.2-pro-2025-12-11"`

224 

225 - `"gpt-5.1"`

226 

227 - `"gpt-5.1-2025-11-13"`

228 

229 - `"gpt-5.1-codex"`

230 

231 - `"gpt-5.1-mini"`

232 

233 - `"gpt-5.1-chat-latest"`

234 

235 - `"gpt-5"`

236 

237 - `"gpt-5-mini"`

238 

239 - `"gpt-5-nano"`

240 

241 - `"gpt-5-2025-08-07"`

242 

243 - `"gpt-5-mini-2025-08-07"`

244 

245 - `"gpt-5-nano-2025-08-07"`

246 

247 - `"gpt-5-chat-latest"`

248 

249 - `"gpt-4.1"`

250 

251 - `"gpt-4.1-mini"`

252 

253 - `"gpt-4.1-nano"`

254 

255 - `"gpt-4.1-2025-04-14"`

256 

257 - `"gpt-4.1-mini-2025-04-14"`

258 

259 - `"gpt-4.1-nano-2025-04-14"`

260 

261 - `"o4-mini"`

262 

263 - `"o4-mini-2025-04-16"`

264 

265 - `"o3"`

266 

267 - `"o3-2025-04-16"`

268 

269 - `"o3-mini"`

270 

271 - `"o3-mini-2025-01-31"`

272 

273 - `"o1"`

274 

275 - `"o1-2024-12-17"`

276 

277 - `"o1-preview"`

278 

279 - `"o1-preview-2024-09-12"`

280 

281 - `"o1-mini"`

282 

283 - `"o1-mini-2024-09-12"`

284 

285 - `"gpt-4o"`

286 

287 - `"gpt-4o-2024-11-20"`

288 

289 - `"gpt-4o-2024-08-06"`

290 

291 - `"gpt-4o-2024-05-13"`

292 

293 - `"gpt-4o-audio-preview"`

294 

295 - `"gpt-4o-audio-preview-2024-10-01"`

296 

297 - `"gpt-4o-audio-preview-2024-12-17"`

298 

299 - `"gpt-4o-audio-preview-2025-06-03"`

300 

301 - `"gpt-4o-mini-audio-preview"`

302 

303 - `"gpt-4o-mini-audio-preview-2024-12-17"`

304 

305 - `"gpt-4o-search-preview"`

306 

307 - `"gpt-4o-mini-search-preview"`

308 

309 - `"gpt-4o-search-preview-2025-03-11"`

310 

311 - `"gpt-4o-mini-search-preview-2025-03-11"`

312 

313 - `"chatgpt-4o-latest"`

314 

315 - `"codex-mini-latest"`

316 

317 - `"gpt-4o-mini"`

318 

319 - `"gpt-4o-mini-2024-07-18"`

320 

321 - `"gpt-4-turbo"`

322 

323 - `"gpt-4-turbo-2024-04-09"`

324 

325 - `"gpt-4-0125-preview"`

326 

327 - `"gpt-4-turbo-preview"`

328 

329 - `"gpt-4-1106-preview"`

330 

331 - `"gpt-4-vision-preview"`

332 

333 - `"gpt-4"`

334 

335 - `"gpt-4-0314"`

336 

337 - `"gpt-4-0613"`

338 

339 - `"gpt-4-32k"`

340 

341 - `"gpt-4-32k-0314"`

342 

343 - `"gpt-4-32k-0613"`

344 

345 - `"gpt-3.5-turbo"`

346 

347 - `"gpt-3.5-turbo-16k"`

348 

349 - `"gpt-3.5-turbo-0301"`

350 

351 - `"gpt-3.5-turbo-0613"`

352 

353 - `"gpt-3.5-turbo-1106"`

354 

355 - `"gpt-3.5-turbo-0125"`

356 

357 - `"gpt-3.5-turbo-16k-0613"`

358 

359### Comparison Filter

360 

361- `ComparisonFilter`

362 

363 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

364 

365 - `key: string`

366 

367 The key to compare against the value.

368 

369 - `type: "eq" | "ne" | "gt" | 5 more`

370 

371 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

372 

373 - `eq`: equals

374 - `ne`: not equal

375 - `gt`: greater than

376 - `gte`: greater than or equal

377 - `lt`: less than

378 - `lte`: less than or equal

379 - `in`: in

380 - `nin`: not in

381 

382 - `"eq"`

383 

384 - `"ne"`

385 

386 - `"gt"`

387 

388 - `"gte"`

389 

390 - `"lt"`

391 

392 - `"lte"`

393 

394 - `"in"`

395 

396 - `"nin"`

397 

398 - `value: string | number | boolean | Array<string | number>`

399 

400 The value to compare against the attribute key; supports string, number, or boolean types.

401 

402 - `string`

403 

404 - `number`

405 

406 - `boolean`

407 

408 - `Array<string | number>`

409 

410 - `string`

411 

412 - `number`

413 

414### Compound Filter

415 

416- `CompoundFilter`

417 

418 Combine multiple filters using `and` or `or`.

419 

420 - `filters: Array<ComparisonFilter | unknown>`

421 

422 Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.

423 

424 - `ComparisonFilter`

425 

426 A filter used to compare a specified attribute key to a given value using a defined comparison operation.

427 

428 - `key: string`

429 

430 The key to compare against the value.

431 

432 - `type: "eq" | "ne" | "gt" | 5 more`

433 

434 Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.

435 

436 - `eq`: equals

437 - `ne`: not equal

438 - `gt`: greater than

439 - `gte`: greater than or equal

440 - `lt`: less than

441 - `lte`: less than or equal

442 - `in`: in

443 - `nin`: not in

444 

445 - `"eq"`

446 

447 - `"ne"`

448 

449 - `"gt"`

450 

451 - `"gte"`

452 

453 - `"lt"`

454 

455 - `"lte"`

456 

457 - `"in"`

458 

459 - `"nin"`

460 

461 - `value: string | number | boolean | Array<string | number>`

462 

463 The value to compare against the attribute key; supports string, number, or boolean types.

464 

465 - `string`

466 

467 - `number`

468 

469 - `boolean`

470 

471 - `Array<string | number>`

472 

473 - `string`

474 

475 - `number`

476 

477 - `unknown`

478 

479 - `type: "and" | "or"`

480 

481 Type of operation: `and` or `or`.

482 

483 - `"and"`

484 

485 - `"or"`

486 

487### Custom Tool Input Format

488 

489- `CustomToolInputFormat = Text | Grammar`

490 

491 The input format for the custom tool. Default is unconstrained text.

492 

493 - `Text`

494 

495 Unconstrained free-form text.

496 

497 - `type: "text"`

498 

499 Unconstrained text format. Always `text`.

500 

501 - `"text"`

502 

503 - `Grammar`

504 

505 A grammar defined by the user.

506 

507 - `definition: string`

508 

509 The grammar definition.

510 

511 - `syntax: "lark" | "regex"`

512 

513 The syntax of the grammar definition. One of `lark` or `regex`.

514 

515 - `"lark"`

516 

517 - `"regex"`

518 

519 - `type: "grammar"`

520 

521 Grammar format. Always `grammar`.

522 

523 - `"grammar"`

524 

525### Error Object

526 

527- `ErrorObject`

528 

529 - `code: string | null`

530 

531 - `message: string`

532 

533 - `param: string | null`

534 

535 - `type: string`

536 

537### Function Definition

538 

539- `FunctionDefinition`

540 

541 - `name: string`

542 

543 The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

544 

545 - `description?: string`

546 

547 A description of what the function does, used by the model to choose when and how to call the function.

548 

549 - `parameters?: FunctionParameters`

550 

551 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

552 

553 Omitting `parameters` defines a function with an empty parameter list.

554 

555 - `strict?: boolean | null`

556 

557 Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling).

558 

559### Function Parameters

560 

561- `FunctionParameters = Record<string, unknown>`

562 

563 The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.

564 

565 Omitting `parameters` defines a function with an empty parameter list.

566 

567### Metadata

568 

569- `Metadata = Record<string, string> | null`

570 

571 Set of 16 key-value pairs that can be attached to an object. This can be

572 useful for storing additional information about the object in a structured

573 format, and querying for objects via API or the dashboard.

574 

575 Keys are strings with a maximum length of 64 characters. Values are strings

576 with a maximum length of 512 characters.

577 

578### OAuth Error Code

579 

580- `OAuthErrorCode = "invalid_grant" | "invalid_subject_token" | (string & {})`

581 

582 - `"invalid_grant" | "invalid_subject_token"`

583 

584 - `"invalid_grant"`

585 

586 - `"invalid_subject_token"`

587 

588 - `(string & {})`

589 

590### Reasoning

591 

592- `Reasoning`

593 

594 **gpt-5 and o-series models only**

595 

596 Configuration options for

597 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

598 

599 - `context?: "auto" | "current_turn" | "all_turns" | null`

600 

601 Controls which reasoning items are rendered back to the model on later turns.

602 When returned on a response, this is the effective reasoning context mode

603 used for the response.

604 

605 - `"auto"`

606 

607 - `"current_turn"`

608 

609 - `"all_turns"`

610 

611 - `effort?: ReasoningEffort | null`

612 

613 Constrains effort on reasoning for

614 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

615 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

616 reasoning effort can result in faster responses and fewer tokens used

617 on reasoning in a response.

618 

619 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

620 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

621 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

622 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

623 

624 - `"none"`

625 

626 - `"minimal"`

627 

628 - `"low"`

629 

630 - `"medium"`

631 

632 - `"high"`

633 

634 - `"xhigh"`

635 

636 - `generate_summary?: "auto" | "concise" | "detailed" | null`

637 

638 **Deprecated:** use `summary` instead.

639 

640 A summary of the reasoning performed by the model. This can be

641 useful for debugging and understanding the model's reasoning process.

642 One of `auto`, `concise`, or `detailed`.

643 

644 - `"auto"`

645 

646 - `"concise"`

647 

648 - `"detailed"`

649 

650 - `summary?: "auto" | "concise" | "detailed" | null`

651 

652 A summary of the reasoning performed by the model. This can be

653 useful for debugging and understanding the model's reasoning process.

654 One of `auto`, `concise`, or `detailed`.

655 

656 `concise` is supported for `computer-use-preview` models and all reasoning models after `gpt-5`.

657 

658 - `"auto"`

659 

660 - `"concise"`

661 

662 - `"detailed"`

663 

664### Reasoning Effort

665 

666- `ReasoningEffort = "none" | "minimal" | "low" | 3 more | null`

667 

668 Constrains effort on reasoning for

669 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

670 Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing

671 reasoning effort can result in faster responses and fewer tokens used

672 on reasoning in a response.

673 

674 - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.

675 - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.

676 - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.

677 - `xhigh` is supported for all models after `gpt-5.1-codex-max`.

678 

679 - `"none"`

680 

681 - `"minimal"`

682 

683 - `"low"`

684 

685 - `"medium"`

686 

687 - `"high"`

688 

689 - `"xhigh"`

690 

691### Response Format JSON Object

692 

693- `ResponseFormatJSONObject`

694 

695 JSON object response format. An older method of generating JSON responses.

696 Using `json_schema` is recommended for models that support it. Note that the

697 model will not generate JSON without a system or user message instructing it

698 to do so.

699 

700 - `type: "json_object"`

701 

702 The type of response format being defined. Always `json_object`.

703 

704 - `"json_object"`

705 

706### Response Format JSON Schema

707 

708- `ResponseFormatJSONSchema`

709 

710 JSON Schema response format. Used to generate structured JSON responses.

711 Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).

712 

713 - `json_schema: JSONSchema`

714 

715 Structured Outputs configuration options, including a JSON Schema.

716 

717 - `name: string`

718 

719 The name of the response format. Must be a-z, A-Z, 0-9, or contain

720 underscores and dashes, with a maximum length of 64.

721 

722 - `description?: string`

723 

724 A description of what the response format is for, used by the model to

725 determine how to respond in the format.

726 

727 - `schema?: Record<string, unknown>`

728 

729 The schema for the response format, described as a JSON Schema object.

730 Learn how to build JSON schemas [here](https://json-schema.org/).

731 

732 - `strict?: boolean | null`

733 

734 Whether to enable strict schema adherence when generating the output.

735 If set to true, the model will always follow the exact schema defined

736 in the `schema` field. Only a subset of JSON Schema is supported when

737 `strict` is `true`. To learn more, read the [Structured Outputs

738 guide](https://platform.openai.com/docs/guides/structured-outputs).

739 

740 - `type: "json_schema"`

741 

742 The type of response format being defined. Always `json_schema`.

743 

744 - `"json_schema"`

745 

746### Response Format Text

747 

748- `ResponseFormatText`

749 

750 Default response format. Used to generate text responses.

751 

752 - `type: "text"`

753 

754 The type of response format being defined. Always `text`.

755 

756 - `"text"`

757 

758### Response Format Text Grammar

759 

760- `ResponseFormatTextGrammar`

761 

762 A custom grammar for the model to follow when generating text.

763 Learn more in the [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).

764 

765 - `grammar: string`

766 

767 The custom grammar for the model to follow.

768 

769 - `type: "grammar"`

770 

771 The type of response format being defined. Always `grammar`.

772 

773 - `"grammar"`

774 

775### Response Format Text Python

776 

777- `ResponseFormatTextPython`

778 

779 Configure the model to generate valid Python code. See the

780 [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars) for more details.

781 

782 - `type: "python"`

783 

784 The type of response format being defined. Always `python`.

785 

786 - `"python"`

787 

788### Responses Model

789 

790- `ResponsesModel = (string & {}) | ChatModel | "o1-pro" | "o1-pro-2025-03-19" | "o3-pro" | 11 more`

791 

792 - `(string & {})`

793 

794 - `ChatModel = "gpt-5.4" | "gpt-5.4-mini" | "gpt-5.4-nano" | 75 more`

795 

796 - `"gpt-5.4"`

797 

798 - `"gpt-5.4-mini"`

799 

800 - `"gpt-5.4-nano"`

801 

802 - `"gpt-5.4-mini-2026-03-17"`

803 

804 - `"gpt-5.4-nano-2026-03-17"`

805 

806 - `"gpt-5.3-chat-latest"`

807 

808 - `"gpt-5.2"`

809 

810 - `"gpt-5.2-2025-12-11"`

811 

812 - `"gpt-5.2-chat-latest"`

813 

814 - `"gpt-5.2-pro"`

815 

816 - `"gpt-5.2-pro-2025-12-11"`

817 

818 - `"gpt-5.1"`

819 

820 - `"gpt-5.1-2025-11-13"`

821 

822 - `"gpt-5.1-codex"`

823 

824 - `"gpt-5.1-mini"`

825 

826 - `"gpt-5.1-chat-latest"`

827 

828 - `"gpt-5"`

829 

830 - `"gpt-5-mini"`

831 

832 - `"gpt-5-nano"`

833 

834 - `"gpt-5-2025-08-07"`

835 

836 - `"gpt-5-mini-2025-08-07"`

837 

838 - `"gpt-5-nano-2025-08-07"`

839 

840 - `"gpt-5-chat-latest"`

841 

842 - `"gpt-4.1"`

843 

844 - `"gpt-4.1-mini"`

845 

846 - `"gpt-4.1-nano"`

847 

848 - `"gpt-4.1-2025-04-14"`

849 

850 - `"gpt-4.1-mini-2025-04-14"`

851 

852 - `"gpt-4.1-nano-2025-04-14"`

853 

854 - `"o4-mini"`

855 

856 - `"o4-mini-2025-04-16"`

857 

858 - `"o3"`

859 

860 - `"o3-2025-04-16"`

861 

862 - `"o3-mini"`

863 

864 - `"o3-mini-2025-01-31"`

865 

866 - `"o1"`

867 

868 - `"o1-2024-12-17"`

869 

870 - `"o1-preview"`

871 

872 - `"o1-preview-2024-09-12"`

873 

874 - `"o1-mini"`

875 

876 - `"o1-mini-2024-09-12"`

877 

878 - `"gpt-4o"`

879 

880 - `"gpt-4o-2024-11-20"`

881 

882 - `"gpt-4o-2024-08-06"`

883 

884 - `"gpt-4o-2024-05-13"`

885 

886 - `"gpt-4o-audio-preview"`

887 

888 - `"gpt-4o-audio-preview-2024-10-01"`

889 

890 - `"gpt-4o-audio-preview-2024-12-17"`

891 

892 - `"gpt-4o-audio-preview-2025-06-03"`

893 

894 - `"gpt-4o-mini-audio-preview"`

895 

896 - `"gpt-4o-mini-audio-preview-2024-12-17"`

897 

898 - `"gpt-4o-search-preview"`

899 

900 - `"gpt-4o-mini-search-preview"`

901 

902 - `"gpt-4o-search-preview-2025-03-11"`

903 

904 - `"gpt-4o-mini-search-preview-2025-03-11"`

905 

906 - `"chatgpt-4o-latest"`

907 

908 - `"codex-mini-latest"`

909 

910 - `"gpt-4o-mini"`

911 

912 - `"gpt-4o-mini-2024-07-18"`

913 

914 - `"gpt-4-turbo"`

915 

916 - `"gpt-4-turbo-2024-04-09"`

917 

918 - `"gpt-4-0125-preview"`

919 

920 - `"gpt-4-turbo-preview"`

921 

922 - `"gpt-4-1106-preview"`

923 

924 - `"gpt-4-vision-preview"`

925 

926 - `"gpt-4"`

927 

928 - `"gpt-4-0314"`

929 

930 - `"gpt-4-0613"`

931 

932 - `"gpt-4-32k"`

933 

934 - `"gpt-4-32k-0314"`

935 

936 - `"gpt-4-32k-0613"`

937 

938 - `"gpt-3.5-turbo"`

939 

940 - `"gpt-3.5-turbo-16k"`

941 

942 - `"gpt-3.5-turbo-0301"`

943 

944 - `"gpt-3.5-turbo-0613"`

945 

946 - `"gpt-3.5-turbo-1106"`

947 

948 - `"gpt-3.5-turbo-0125"`

949 

950 - `"gpt-3.5-turbo-16k-0613"`

951 

952 - `"o1-pro" | "o1-pro-2025-03-19" | "o3-pro" | 11 more`

953 

954 - `"o1-pro"`

955 

956 - `"o1-pro-2025-03-19"`

957 

958 - `"o3-pro"`

959 

960 - `"o3-pro-2025-06-10"`

961 

962 - `"o3-deep-research"`

963 

964 - `"o3-deep-research-2025-06-26"`

965 

966 - `"o4-mini-deep-research"`

967 

968 - `"o4-mini-deep-research-2025-06-26"`

969 

970 - `"computer-use-preview"`

971 

972 - `"computer-use-preview-2025-03-11"`

973 

974 - `"gpt-5-codex"`

975 

976 - `"gpt-5-pro"`

977 

978 - `"gpt-5-pro-2025-10-06"`

979 

980 - `"gpt-5.1-codex-max"`

Details

1## Create admin API key

2 

3`client.admin.organization.adminAPIKeys.create(AdminAPIKeyCreateParamsbody, RequestOptionsoptions?): AdminAPIKeyCreateResponse`

4 

5**post** `/organization/admin_api_keys`

6 

7Create an organization admin API key

8 

9### Parameters

10 

11- `body: AdminAPIKeyCreateParams`

12 

13 - `name: string`

14 

15 - `expires_in_seconds?: number`

16 

17 The number of seconds until the API key expires. Omit this field for a key that does not expire.

18 

19### Returns

20 

21- `AdminAPIKeyCreateResponse extends AdminAPIKey`

22 

23 Represents an individual Admin API key in an org.

24 

25 - `value: string`

26 

27 The value of the API key. Only shown on create.

28 

29### Example

30 

31```typescript

32import OpenAI from 'openai';

33 

34const client = new OpenAI({

35 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

36});

37 

38const adminAPIKey = await client.admin.organization.adminAPIKeys.create({ name: 'New Admin Key' });

39 

40console.log(adminAPIKey);

41```

42 

43#### Response

44 

45```json

46{

47 "id": "key_abc",

48 "created_at": 1711471533,

49 "expires_at": 1714063533,

50 "object": "organization.admin_api_key",

51 "owner": {

52 "id": "sa_456",

53 "created_at": 1711471533,

54 "name": "My Service Account",

55 "object": "organization.user",

56 "role": "owner",

57 "type": "user"

58 },

59 "redacted_value": "sk-admin...def",

60 "last_used_at": 1711471534,

61 "name": "Administration Key",

62 "value": "sk-admin-1234abcd"

63}

64```

Details

1## List all organization and project API keys.

2 

3`client.admin.organization.adminAPIKeys.list(AdminAPIKeyListParamsquery?, RequestOptionsoptions?): CursorPage<AdminAPIKey>`

4 

5**get** `/organization/admin_api_keys`

6 

7List organization API keys

8 

9### Parameters

10 

11- `query: AdminAPIKeyListParams`

12 

13 - `after?: string | null`

14 

15 Return keys with IDs that come after this ID in the pagination order.

16 

17 - `limit?: number`

18 

19 Maximum number of keys to return.

20 

21 - `order?: "asc" | "desc"`

22 

23 Order results by creation time, ascending or descending.

24 

25 - `"asc"`

26 

27 - `"desc"`

28 

29### Returns

30 

31- `AdminAPIKey`

32 

33 Represents an individual Admin API key in an org.

34 

35 - `id: string`

36 

37 The identifier, which can be referenced in API endpoints

38 

39 - `created_at: number`

40 

41 The Unix timestamp (in seconds) of when the API key was created

42 

43 - `expires_at: number | null`

44 

45 The Unix timestamp (in seconds) of when the API key expires

46 

47 - `object: "organization.admin_api_key"`

48 

49 The object type, which is always `organization.admin_api_key`

50 

51 - `"organization.admin_api_key"`

52 

53 - `owner: Owner`

54 

55 - `id?: string`

56 

57 The identifier, which can be referenced in API endpoints

58 

59 - `created_at?: number`

60 

61 The Unix timestamp (in seconds) of when the user was created

62 

63 - `name?: string`

64 

65 The name of the user

66 

67 - `object?: string`

68 

69 The object type, which is always organization.user

70 

71 - `role?: string`

72 

73 Always `owner`

74 

75 - `type?: string`

76 

77 Always `user`

78 

79 - `redacted_value: string`

80 

81 The redacted value of the API key

82 

83 - `last_used_at?: number | null`

84 

85 The Unix timestamp (in seconds) of when the API key was last used

86 

87 - `name?: string | null`

88 

89 The name of the API key

90 

91### Example

92 

93```typescript

94import OpenAI from 'openai';

95 

96const client = new OpenAI({

97 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

98});

99 

100// Automatically fetches more pages as needed.

101for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {

102 console.log(adminAPIKey.id);

103}

104```

105 

106#### Response

107 

108```json

109{

110 "data": [

111 {

112 "id": "key_abc",

113 "created_at": 1711471533,

114 "expires_at": 1714063533,

115 "object": "organization.admin_api_key",

116 "owner": {

117 "id": "sa_456",

118 "created_at": 1711471533,

119 "name": "My Service Account",

120 "object": "organization.user",

121 "role": "owner",

122 "type": "user"

123 },

124 "redacted_value": "sk-admin...def",

125 "last_used_at": 1711471534,

126 "name": "Administration Key"

127 }

128 ],

129 "has_more": false,

130 "object": "list",

131 "first_id": "key_abc",

132 "last_id": "key_xyz"

133}

134```

Details

1## Retrieve admin API key

2 

3`client.admin.organization.adminAPIKeys.retrieve(stringkeyID, RequestOptionsoptions?): AdminAPIKey`

4 

5**get** `/organization/admin_api_keys/{key_id}`

6 

7Retrieve a single organization API key

8 

9### Parameters

10 

11- `keyID: string`

12 

13 The ID of the API key.

14 

15### Returns

16 

17- `AdminAPIKey`

18 

19 Represents an individual Admin API key in an org.

20 

21 - `id: string`

22 

23 The identifier, which can be referenced in API endpoints

24 

25 - `created_at: number`

26 

27 The Unix timestamp (in seconds) of when the API key was created

28 

29 - `expires_at: number | null`

30 

31 The Unix timestamp (in seconds) of when the API key expires

32 

33 - `object: "organization.admin_api_key"`

34 

35 The object type, which is always `organization.admin_api_key`

36 

37 - `"organization.admin_api_key"`

38 

39 - `owner: Owner`

40 

41 - `id?: string`

42 

43 The identifier, which can be referenced in API endpoints

44 

45 - `created_at?: number`

46 

47 The Unix timestamp (in seconds) of when the user was created

48 

49 - `name?: string`

50 

51 The name of the user

52 

53 - `object?: string`

54 

55 The object type, which is always organization.user

56 

57 - `role?: string`

58 

59 Always `owner`

60 

61 - `type?: string`

62 

63 Always `user`

64 

65 - `redacted_value: string`

66 

67 The redacted value of the API key

68 

69 - `last_used_at?: number | null`

70 

71 The Unix timestamp (in seconds) of when the API key was last used

72 

73 - `name?: string | null`

74 

75 The name of the API key

76 

77### Example

78 

79```typescript

80import OpenAI from 'openai';

81 

82const client = new OpenAI({

83 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

84});

85 

86const adminAPIKey = await client.admin.organization.adminAPIKeys.retrieve('key_id');

87 

88console.log(adminAPIKey.id);

89```

90 

91#### Response

92 

93```json

94{

95 "id": "key_abc",

96 "created_at": 1711471533,

97 "expires_at": 1714063533,

98 "object": "organization.admin_api_key",

99 "owner": {

100 "id": "sa_456",

101 "created_at": 1711471533,

102 "name": "My Service Account",

103 "object": "organization.user",

104 "role": "owner",

105 "type": "user"

106 },

107 "redacted_value": "sk-admin...def",

108 "last_used_at": 1711471534,

109 "name": "Administration Key"

110}

111```

Details

46 46 

47 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.47 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

48 48 

49 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more>`49 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more>`

50 50 

51 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).51 Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object).

52 52 


148 148 

149 - `"role.assignment.deleted"`149 - `"role.assignment.deleted"`

150 150 

151 - `"role.bound_to_resource"`

152 

153 - `"role.unbound_from_resource"`

154 

151 - `"scim.enabled"`155 - `"scim.enabled"`

152 156 

153 - `"scim.disabled"`157 - `"scim.disabled"`


174 178 

175 - `resource_ids?: Array<string>`179 - `resource_ids?: Array<string>`

176 180 

177 Return only events performed on these targets. For example, a project ID updated.181 Return only events performed on these targets. For example, a project ID updated. For ChatGPT connector role events, use the workspace connector resource ID shown in `details.id`, such as `<workspace_id>__<connector_id>`.

182 

183 - `tenant_only?: boolean`

184 

185 Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as `role.bound_to_resource` and `role.unbound_from_resource`. When `true`, all supplied event types must be tenant-scoped.

178 186 

179### Returns187### Returns

180 188 


190 198 

191 The Unix timestamp (in seconds) of the event.199 The Unix timestamp (in seconds) of the event.

192 200 

193 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`201 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

194 202 

195 The event type.203 The event type.

196 204 


292 300 

293 - `"role.assignment.deleted"`301 - `"role.assignment.deleted"`

294 302 

303 - `"role.bound_to_resource"`

304 

305 - `"role.unbound_from_resource"`

306 

295 - `"scim.enabled"`307 - `"scim.enabled"`

296 308 

297 - `"scim.disabled"`309 - `"scim.disabled"`


912 924 

913 The type of resource the role assignment was scoped to.925 The type of resource the role assignment was scoped to.

914 926 

927 - `"role.bound_to_resource"?: RoleBoundToResource`

928 

929 The details for events with this `type`.

930 

931 - `id?: string`

932 

933 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

934 

935 - `connector_id?: string`

936 

937 The connector ID for a ChatGPT workspace connector resource.

938 

939 - `connector_name?: string`

940 

941 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

942 

943 - `enabled?: boolean`

944 

945 Whether the connector is enabled for the role.

946 

947 - `permissions?: Array<string>`

948 

949 The permissions granted to the role for the resource.

950 

951 - `resource_id?: string`

952 

953 The ID of the resource the role was bound to.

954 

955 - `resource_type?: string`

956 

957 The type of resource the role was bound to.

958 

959 - `role_id?: string`

960 

961 The ID of the role that was bound to the resource.

962 

963 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

964 

965 The connector role mutation path that produced the event.

966 

967 - `"role_toggle"`

968 

969 - `"role_connector_update"`

970 

971 - `"role_delete"`

972 

973 - `"workspace_permissions"`

974 

975 - `"connector_publish"`

976 

977 - `workspace_id?: string`

978 

979 The workspace ID for a ChatGPT workspace connector resource.

980 

915 - `"role.created"?: RoleCreated`981 - `"role.created"?: RoleCreated`

916 982 

917 The details for events with this `type`.983 The details for events with this `type`.


944 1010 

945 The role ID.1011 The role ID.

946 1012 

1013 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

1014 

1015 The details for events with this `type`.

1016 

1017 - `id?: string`

1018 

1019 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1020 

1021 - `connector_id?: string`

1022 

1023 The connector ID for a ChatGPT workspace connector resource.

1024 

1025 - `connector_name?: string`

1026 

1027 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1028 

1029 - `enabled?: boolean`

1030 

1031 Whether the connector is enabled for the role.

1032 

1033 - `permissions?: Array<string>`

1034 

1035 The permissions remaining for the role after the change.

1036 

1037 - `resource_id?: string`

1038 

1039 The ID of the resource the role was unbound from.

1040 

1041 - `resource_type?: string`

1042 

1043 The type of resource the role was unbound from.

1044 

1045 - `role_id?: string`

1046 

1047 The ID of the role that was unbound from the resource.

1048 

1049 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

1050 

1051 The connector role mutation path that produced the event.

1052 

1053 - `"role_toggle"`

1054 

1055 - `"role_connector_update"`

1056 

1057 - `"role_delete"`

1058 

1059 - `"workspace_permissions"`

1060 

1061 - `"connector_publish"`

1062 

1063 - `workspace_id?: string`

1064 

1065 The workspace ID for a ChatGPT workspace connector resource.

1066 

947 - `"role.updated"?: RoleUpdated`1067 - `"role.updated"?: RoleUpdated`

948 1068 

949 The details for events with this `type`.1069 The details for events with this `type`.


1415 "resource_id": "resource_id",1535 "resource_id": "resource_id",

1416 "resource_type": "resource_type"1536 "resource_type": "resource_type"

1417 },1537 },

1538 "role.bound_to_resource": {

1539 "id": "id",

1540 "connector_id": "connector_id",

1541 "connector_name": "connector_name",

1542 "enabled": true,

1543 "permissions": [

1544 "string"

1545 ],

1546 "resource_id": "resource_id",

1547 "resource_type": "resource_type",

1548 "role_id": "role_id",

1549 "source": "role_toggle",

1550 "workspace_id": "workspace_id"

1551 },

1418 "role.created": {1552 "role.created": {

1419 "id": "id",1553 "id": "id",

1420 "permissions": [1554 "permissions": [


1427 "role.deleted": {1561 "role.deleted": {

1428 "id": "id"1562 "id": "id"

1429 },1563 },

1564 "role.unbound_from_resource": {

1565 "id": "id",

1566 "connector_id": "connector_id",

1567 "connector_name": "connector_name",

1568 "enabled": true,

1569 "permissions": [

1570 "string"

1571 ],

1572 "resource_id": "resource_id",

1573 "resource_type": "resource_type",

1574 "role_id": "role_id",

1575 "source": "role_toggle",

1576 "workspace_id": "workspace_id"

1577 },

1430 "role.updated": {1578 "role.updated": {

1431 "id": "id",1579 "id": "id",

1432 "changes_requested": {1580 "changes_requested": {

Details

1## Retrieve project spend alert

2 

3`client.admin.organization.projects.spendAlerts.retrieve(stringalertID, SpendAlertRetrieveParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

4 

5**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6 

7Retrieves a project spend alert.

8 

9### Parameters

10 

11- `alertID: string`

12 

13- `params: SpendAlertRetrieveParams`

14 

15 - `project_id: string`

16 

17 The ID of the project.

18 

19### Returns

20 

21- `ProjectSpendAlert`

22 

23 Represents a spend alert configured at the project level.

24 

25 - `id: string`

26 

27 The identifier, which can be referenced in API endpoints.

28 

29 - `currency: "USD"`

30 

31 The currency for the threshold amount.

32 

33 - `"USD"`

34 

35 - `interval: "month"`

36 

37 The time interval for evaluating spend against the threshold.

38 

39 - `"month"`

40 

41 - `notification_channel: NotificationChannel`

42 

43 Email notification settings for a spend alert.

44 

45 - `recipients: Array<string>`

46 

47 Email addresses that receive the spend alert notification.

48 

49 - `type: "email"`

50 

51 The notification channel type. Currently only `email` is supported.

52 

53 - `"email"`

54 

55 - `subject_prefix?: string | null`

56 

57 Optional subject prefix for alert emails.

58 

59 - `object: "project.spend_alert"`

60 

61 The object type, which is always `project.spend_alert`.

62 

63 - `"project.spend_alert"`

64 

65 - `threshold_amount: number`

66 

67 The alert threshold amount, in cents.

68 

69### Example

70 

71```typescript

72import OpenAI from 'openai';

73 

74const client = new OpenAI({

75 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

76});

77 

78const projectSpendAlert = await client.admin.organization.projects.spendAlerts.retrieve(

79 'alert_id',

80 { project_id: 'project_id' },

81);

82 

83console.log(projectSpendAlert.id);

84```

85 

86#### Response

87 

88```json

89{

90 "id": "id",

91 "currency": "USD",

92 "interval": "month",

93 "notification_channel": {

94 "recipients": [

95 "string"

96 ],

97 "type": "email",

98 "subject_prefix": "subject_prefix"

99 },

100 "object": "project.spend_alert",

101 "threshold_amount": 0

102}

103```

Details

1## Retrieve organization spend alert

2 

3`client.admin.organization.spendAlerts.retrieve(stringalertID, RequestOptionsoptions?): OrganizationSpendAlert`

4 

5**get** `/organization/spend_alerts/{alert_id}`

6 

7Retrieves an organization spend alert.

8 

9### Parameters

10 

11- `alertID: string`

12 

13### Returns

14 

15- `OrganizationSpendAlert`

16 

17 Represents a spend alert configured at the organization level.

18 

19 - `id: string`

20 

21 The identifier, which can be referenced in API endpoints.

22 

23 - `currency: "USD"`

24 

25 The currency for the threshold amount.

26 

27 - `"USD"`

28 

29 - `interval: "month"`

30 

31 The time interval for evaluating spend against the threshold.

32 

33 - `"month"`

34 

35 - `notification_channel: NotificationChannel`

36 

37 Email notification settings for a spend alert.

38 

39 - `recipients: Array<string>`

40 

41 Email addresses that receive the spend alert notification.

42 

43 - `type: "email"`

44 

45 The notification channel type. Currently only `email` is supported.

46 

47 - `"email"`

48 

49 - `subject_prefix?: string | null`

50 

51 Optional subject prefix for alert emails.

52 

53 - `object: "organization.spend_alert"`

54 

55 The object type, which is always `organization.spend_alert`.

56 

57 - `"organization.spend_alert"`

58 

59 - `threshold_amount: number`

60 

61 The alert threshold amount, in cents.

62 

63### Example

64 

65```typescript

66import OpenAI from 'openai';

67 

68const client = new OpenAI({

69 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

70});

71 

72const organizationSpendAlert = await client.admin.organization.spendAlerts.retrieve('alert_id');

73 

74console.log(organizationSpendAlert.id);

75```

76 

77#### Response

78 

79```json

80{

81 "id": "id",

82 "currency": "USD",

83 "interval": "month",

84 "notification_channel": {

85 "recipients": [

86 "string"

87 ],

88 "type": "email",

89 "subject_prefix": "subject_prefix"

90 },

91 "object": "organization.spend_alert",

92 "threshold_amount": 0

93}

94```

Details

4782 Configuration options for4782 Configuration options for

4783 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4783 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4784 4784 

4785 - `context?: "auto" | "current_turn" | "all_turns" | null`

4786 

4787 Controls which reasoning items are rendered back to the model on later turns.

4788 When returned on a response, this is the effective reasoning context mode

4789 used for the response.

4790 

4791 - `"auto"`

4792 

4793 - `"current_turn"`

4794 

4795 - `"all_turns"`

4796 

4785 - `effort?: ReasoningEffort | null`4797 - `effort?: ReasoningEffort | null`

4786 4798 

4787 Constrains effort on reasoning for4799 Constrains effort on reasoning for


5175 "prompt_cache_key": "prompt-cache-key-1234",5187 "prompt_cache_key": "prompt-cache-key-1234",

5176 "prompt_cache_retention": "in_memory",5188 "prompt_cache_retention": "in_memory",

5177 "reasoning": {5189 "reasoning": {

5190 "context": "auto",

5178 "effort": "none",5191 "effort": "none",

5179 "generate_summary": "auto",5192 "generate_summary": "auto",

5180 "summary": "auto"5193 "summary": "auto"

Details

3423 Configuration options for3423 Configuration options for

3424 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3424 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3425 3425 

3426 - `context?: "auto" | "current_turn" | "all_turns" | null`

3427 

3428 Controls which reasoning items are rendered back to the model on later turns.

3429 When returned on a response, this is the effective reasoning context mode

3430 used for the response.

3431 

3432 - `"auto"`

3433 

3434 - `"current_turn"`

3435 

3436 - `"all_turns"`

3437 

3426 - `effort?: ReasoningEffort | null`3438 - `effort?: ReasoningEffort | null`

3427 3439 

3428 Constrains effort on reasoning for3440 Constrains effort on reasoning for


8698 Configuration options for8710 Configuration options for

8699 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8711 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8700 8712 

8713 - `context?: "auto" | "current_turn" | "all_turns" | null`

8714 

8715 Controls which reasoning items are rendered back to the model on later turns.

8716 When returned on a response, this is the effective reasoning context mode

8717 used for the response.

8718 

8719 - `"auto"`

8720 

8721 - `"current_turn"`

8722 

8723 - `"all_turns"`

8724 

8701 - `effort?: ReasoningEffort | null`8725 - `effort?: ReasoningEffort | null`

8702 8726 

8703 Constrains effort on reasoning for8727 Constrains effort on reasoning for


9091 "prompt_cache_key": "prompt-cache-key-1234",9115 "prompt_cache_key": "prompt-cache-key-1234",

9092 "prompt_cache_retention": "in_memory",9116 "prompt_cache_retention": "in_memory",

9093 "reasoning": {9117 "reasoning": {

9118 "context": "auto",

9094 "effort": "none",9119 "effort": "none",

9095 "generate_summary": "auto",9120 "generate_summary": "auto",

9096 "summary": "auto"9121 "summary": "auto"

Details

4848 Configuration options for4848 Configuration options for

4849 [reasoning models](https://platform.openai.com/docs/guides/reasoning).4849 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

4850 4850 

4851 - `context?: "auto" | "current_turn" | "all_turns" | null`

4852 

4853 Controls which reasoning items are rendered back to the model on later turns.

4854 When returned on a response, this is the effective reasoning context mode

4855 used for the response.

4856 

4857 - `"auto"`

4858 

4859 - `"current_turn"`

4860 

4861 - `"all_turns"`

4862 

4851 - `effort?: ReasoningEffort | null`4863 - `effort?: ReasoningEffort | null`

4852 4864 

4853 Constrains effort on reasoning for4865 Constrains effort on reasoning for


5241 "prompt_cache_key": "prompt-cache-key-1234",5253 "prompt_cache_key": "prompt-cache-key-1234",

5242 "prompt_cache_retention": "in_memory",5254 "prompt_cache_retention": "in_memory",

5243 "reasoning": {5255 "reasoning": {

5256 "context": "auto",

5244 "effort": "none",5257 "effort": "none",

5245 "generate_summary": "auto",5258 "generate_summary": "auto",

5246 "summary": "auto"5259 "summary": "auto"

Details

3096 3096 

3097 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3097 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3098 3098 

3099 - `context?: "auto" | "current_turn" | "all_turns" | null`

3100 

3101 Controls which reasoning items are rendered back to the model on later turns.

3102 When returned on a response, this is the effective reasoning context mode

3103 used for the response.

3104 

3105 - `"auto"`

3106 

3107 - `"current_turn"`

3108 

3109 - `"all_turns"`

3110 

3099 - `effort?: ReasoningEffort | null`3111 - `effort?: ReasoningEffort | null`

3100 3112 

3101 Constrains effort on reasoning for3113 Constrains effort on reasoning for