SpyBara
Go Premium

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

147 files changed +24,122 −151. View all changes and history on the product overview
2026
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

34 34 

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

36 36 

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

38 38 

39 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).39 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).

40 40 


48 48 

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

50 50 

51 Return only events performed on these targets. For example, a project ID updated.51 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>`.

52 

53- `--tenant-only: optional boolean`

54 

55 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.

52 56 

53### Returns57### Returns

54 58 

55- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`59- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`

56 60 

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

58 62 

59 - `id: string`63 - `id: string`

60 64 


64 68 

65 The Unix timestamp (in seconds) of the event.69 The Unix timestamp (in seconds) of the event.

66 70 

67 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`71 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

68 72 

69 The event type.73 The event type.

70 74 


166 170 

167 - `"role.assignment.deleted"`171 - `"role.assignment.deleted"`

168 172 

173 - `"role.bound_to_resource"`

174 

175 - `"role.unbound_from_resource"`

176 

169 - `"scim.enabled"`177 - `"scim.enabled"`

170 178 

171 - `"scim.disabled"`179 - `"scim.disabled"`


786 794 

787 The type of resource the role assignment was scoped to.795 The type of resource the role assignment was scoped to.

788 796 

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

798 

799 The details for events with this `type`.

800 

801 - `id: optional string`

802 

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

804 

805 - `connector_id: optional string`

806 

807 The connector ID for a ChatGPT workspace connector resource.

808 

809 - `connector_name: optional string`

810 

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

812 

813 - `enabled: optional boolean`

814 

815 Whether the connector is enabled for the role.

816 

817 - `permissions: optional array of string`

818 

819 The permissions granted to the role for the resource.

820 

821 - `resource_id: optional string`

822 

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

824 

825 - `resource_type: optional string`

826 

827 The type of resource the role was bound to.

828 

829 - `role_id: optional string`

830 

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

832 

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

834 

835 The connector role mutation path that produced the event.

836 

837 - `"role_toggle"`

838 

839 - `"role_connector_update"`

840 

841 - `"role_delete"`

842 

843 - `"workspace_permissions"`

844 

845 - `"connector_publish"`

846 

847 - `workspace_id: optional string`

848 

849 The workspace ID for a ChatGPT workspace connector resource.

850 

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

790 852 

791 The details for events with this `type`.853 The details for events with this `type`.


818 880 

819 The role ID.881 The role ID.

820 882 

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

884 

885 The details for events with this `type`.

886 

887 - `id: optional string`

888 

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

890 

891 - `connector_id: optional string`

892 

893 The connector ID for a ChatGPT workspace connector resource.

894 

895 - `connector_name: optional string`

896 

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

898 

899 - `enabled: optional boolean`

900 

901 Whether the connector is enabled for the role.

902 

903 - `permissions: optional array of string`

904 

905 The permissions remaining for the role after the change.

906 

907 - `resource_id: optional string`

908 

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

910 

911 - `resource_type: optional string`

912 

913 The type of resource the role was unbound from.

914 

915 - `role_id: optional string`

916 

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

918 

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

920 

921 The connector role mutation path that produced the event.

922 

923 - `"role_toggle"`

924 

925 - `"role_connector_update"`

926 

927 - `"role_delete"`

928 

929 - `"workspace_permissions"`

930 

931 - `"connector_publish"`

932 

933 - `workspace_id: optional string`

934 

935 The workspace ID for a ChatGPT workspace connector resource.

936 

821 - `role.updated: optional object { id, changes_requested }`937 - `role.updated: optional object { id, changes_requested }`

822 938 

823 The details for events with this `type`.939 The details for events with this `type`.


1289 "resource_id": "resource_id",1405 "resource_id": "resource_id",

1290 "resource_type": "resource_type"1406 "resource_type": "resource_type"

1291 },1407 },

1408 "role.bound_to_resource": {

1409 "id": "id",

1410 "connector_id": "connector_id",

1411 "connector_name": "connector_name",

1412 "enabled": true,

1413 "permissions": [

1414 "string"

1415 ],

1416 "resource_id": "resource_id",

1417 "resource_type": "resource_type",

1418 "role_id": "role_id",

1419 "source": "role_toggle",

1420 "workspace_id": "workspace_id"

1421 },

1292 "role.created": {1422 "role.created": {

1293 "id": "id",1423 "id": "id",

1294 "permissions": [1424 "permissions": [


1301 "role.deleted": {1431 "role.deleted": {

1302 "id": "id"1432 "id": "id"

1303 },1433 },

1434 "role.unbound_from_resource": {

1435 "id": "id",

1436 "connector_id": "connector_id",

1437 "connector_name": "connector_name",

1438 "enabled": true,

1439 "permissions": [

1440 "string"

1441 ],

1442 "resource_id": "resource_id",

1443 "resource_type": "resource_type",

1444 "role_id": "role_id",

1445 "source": "role_toggle",

1446 "workspace_id": "workspace_id"

1447 },

1304 "role.updated": {1448 "role.updated": {

1305 "id": "id",1449 "id": "id",

1306 "changes_requested": {1450 "changes_requested": {


1428 1572 

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

1430 1574 

1575 - `expires_at: number`

1576 

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

1578 

1431 - `object: "organization.admin_api_key"`1579 - `object: "organization.admin_api_key"`

1432 1580 

1433 The object type, which is always `organization.admin_api_key`1581 The object type, which is always `organization.admin_api_key`


1493 {1641 {

1494 "id": "key_abc",1642 "id": "key_abc",

1495 "created_at": 1711471533,1643 "created_at": 1711471533,

1644 "expires_at": 1714063533,

1496 "object": "organization.admin_api_key",1645 "object": "organization.admin_api_key",

1497 "owner": {1646 "owner": {

1498 "id": "sa_456",1647 "id": "sa_456",


1526 1675 

1527- `--name: string`1676- `--name: string`

1528 1677 

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

1679 

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

1681 

1529### Returns1682### Returns

1530 1683 

1531- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`1684- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`


1550{1703{

1551 "id": "key_abc",1704 "id": "key_abc",

1552 "created_at": 1711471533,1705 "created_at": 1711471533,

1706 "expires_at": 1714063533,

1553 "object": "organization.admin_api_key",1707 "object": "organization.admin_api_key",

1554 "owner": {1708 "owner": {

1555 "id": "sa_456",1709 "id": "sa_456",


1582 1736 

1583### Returns1737### Returns

1584 1738 

1585- `admin_api_key: object { id, created_at, object, 4 more }`1739- `admin_api_key: object { id, created_at, expires_at, 5 more }`

1586 1740 

1587 Represents an individual Admin API key in an org.1741 Represents an individual Admin API key in an org.

1588 1742 


1594 1748 

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

1596 1750 

1751 - `expires_at: number`

1752 

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

1754 

1597 - `object: "organization.admin_api_key"`1755 - `object: "organization.admin_api_key"`

1598 1756 

1599 The object type, which is always `organization.admin_api_key`1757 The object type, which is always `organization.admin_api_key`


1650{1808{

1651 "id": "key_abc",1809 "id": "key_abc",

1652 "created_at": 1711471533,1810 "created_at": 1711471533,

1811 "expires_at": 1714063533,

1653 "object": "organization.admin_api_key",1812 "object": "organization.admin_api_key",

1654 "owner": {1813 "owner": {

1655 "id": "sa_456",1814 "id": "sa_456",


1711 1870 

1712### Admin API Key1871### Admin API Key

1713 1872 

1714- `admin_api_key: object { id, created_at, object, 4 more }`1873- `admin_api_key: object { id, created_at, expires_at, 5 more }`

1715 1874 

1716 Represents an individual Admin API key in an org.1875 Represents an individual Admin API key in an org.

1717 1876 


1723 1882 

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

1725 1884 

1885 - `expires_at: number`

1886 

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

1888 

1726 - `object: "organization.admin_api_key"`1889 - `object: "organization.admin_api_key"`

1727 1890 

1728 The object type, which is always `organization.admin_api_key`1891 The object type, which is always `organization.admin_api_key`


10219}10382}

10220```10383```

10221 10384 

10385## Retrieve organization spend alert

10386 

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

10388 

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

10390 

10391Retrieves an organization spend alert.

10392 

10393### Parameters

10394 

10395- `--alert-id: string`

10396 

10397 The ID of the spend alert to retrieve.

10398 

10399### Returns

10400 

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

10402 

10403 Represents a spend alert configured at the organization level.

10404 

10405 - `id: string`

10406 

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

10408 

10409 - `currency: "USD"`

10410 

10411 The currency for the threshold amount.

10412 

10413 - `"USD"`

10414 

10415 - `interval: "month"`

10416 

10417 The time interval for evaluating spend against the threshold.

10418 

10419 - `"month"`

10420 

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

10422 

10423 Email notification settings for a spend alert.

10424 

10425 - `recipients: array of string`

10426 

10427 Email addresses that receive the spend alert notification.

10428 

10429 - `type: "email"`

10430 

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

10432 

10433 - `subject_prefix: optional string`

10434 

10435 Optional subject prefix for alert emails.

10436 

10437 - `object: "organization.spend_alert"`

10438 

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

10440 

10441 - `threshold_amount: number`

10442 

10443 The alert threshold amount, in cents.

10444 

10445### Example

10446 

10447```cli

10448openai admin:organization:spend-alerts retrieve \

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

10450 --alert-id alert_id

10451```

10452 

10453#### Response

10454 

10455```json

10456{

10457 "id": "id",

10458 "currency": "USD",

10459 "interval": "month",

10460 "notification_channel": {

10461 "recipients": [

10462 "string"

10463 ],

10464 "type": "email",

10465 "subject_prefix": "subject_prefix"

10466 },

10467 "object": "organization.spend_alert",

10468 "threshold_amount": 0

10469}

10470```

10471 

10222## Update organization spend alert10472## Update organization spend alert

10223 10473 

10224`$ openai admin:organization:spend-alerts update`10474`$ openai admin:organization:spend-alerts update`


15619}15869}

15620```15870```

15621 15871 

15872## Retrieve project spend alert

15873 

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

15875 

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

15877 

15878Retrieves a project spend alert.

15879 

15880### Parameters

15881 

15882- `--project-id: string`

15883 

15884 The ID of the project.

15885 

15886- `--alert-id: string`

15887 

15888 The ID of the spend alert to retrieve.

15889 

15890### Returns

15891 

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

15893 

15894 Represents a spend alert configured at the project level.

15895 

15896 - `id: string`

15897 

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

15899 

15900 - `currency: "USD"`

15901 

15902 The currency for the threshold amount.

15903 

15904 - `"USD"`

15905 

15906 - `interval: "month"`

15907 

15908 The time interval for evaluating spend against the threshold.

15909 

15910 - `"month"`

15911 

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

15913 

15914 Email notification settings for a spend alert.

15915 

15916 - `recipients: array of string`

15917 

15918 Email addresses that receive the spend alert notification.

15919 

15920 - `type: "email"`

15921 

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

15923 

15924 - `subject_prefix: optional string`

15925 

15926 Optional subject prefix for alert emails.

15927 

15928 - `object: "project.spend_alert"`

15929 

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

15931 

15932 - `threshold_amount: number`

15933 

15934 The alert threshold amount, in cents.

15935 

15936### Example

15937 

15938```cli

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

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

15941 --project-id project_id \

15942 --alert-id alert_id

15943```

15944 

15945#### Response

15946 

15947```json

15948{

15949 "id": "id",

15950 "currency": "USD",

15951 "interval": "month",

15952 "notification_channel": {

15953 "recipients": [

15954 "string"

15955 ],

15956 "type": "email",

15957 "subject_prefix": "subject_prefix"

15958 },

15959 "object": "project.spend_alert",

15960 "threshold_amount": 0

15961}

15962```

15963 

15622## Update project spend alert15964## Update project spend alert

15623 15965 

15624`$ openai admin:organization:projects:spend-alerts update`15966`$ openai admin:organization:projects:spend-alerts update`

Details

32 32 

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

34 34 

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

36 36 

37 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).37 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).

38 38 


46 46 

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

48 48 

49 Return only events performed on these targets. For example, a project ID updated.49 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>`.

50 

51- `--tenant-only: optional boolean`

52 

53 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.

50 54 

51### Returns55### Returns

52 56 

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

54 58 

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

56 60 

57 - `id: string`61 - `id: string`

58 62 


62 66 

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

64 68 

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

66 70 

67 The event type.71 The event type.

68 72 


164 168 

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

166 170 

171 - `"role.bound_to_resource"`

172 

173 - `"role.unbound_from_resource"`

174 

167 - `"scim.enabled"`175 - `"scim.enabled"`

168 176 

169 - `"scim.disabled"`177 - `"scim.disabled"`


784 792 

785 The type of resource the role assignment was scoped to.793 The type of resource the role assignment was scoped to.

786 794 

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

796 

797 The details for events with this `type`.

798 

799 - `id: optional string`

800 

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

802 

803 - `connector_id: optional string`

804 

805 The connector ID for a ChatGPT workspace connector resource.

806 

807 - `connector_name: optional string`

808 

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

810 

811 - `enabled: optional boolean`

812 

813 Whether the connector is enabled for the role.

814 

815 - `permissions: optional array of string`

816 

817 The permissions granted to the role for the resource.

818 

819 - `resource_id: optional string`

820 

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

822 

823 - `resource_type: optional string`

824 

825 The type of resource the role was bound to.

826 

827 - `role_id: optional string`

828 

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

830 

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

832 

833 The connector role mutation path that produced the event.

834 

835 - `"role_toggle"`

836 

837 - `"role_connector_update"`

838 

839 - `"role_delete"`

840 

841 - `"workspace_permissions"`

842 

843 - `"connector_publish"`

844 

845 - `workspace_id: optional string`

846 

847 The workspace ID for a ChatGPT workspace connector resource.

848 

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

788 850 

789 The details for events with this `type`.851 The details for events with this `type`.


816 878 

817 The role ID.879 The role ID.

818 880 

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

882 

883 The details for events with this `type`.

884 

885 - `id: optional string`

886 

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

888 

889 - `connector_id: optional string`

890 

891 The connector ID for a ChatGPT workspace connector resource.

892 

893 - `connector_name: optional string`

894 

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

896 

897 - `enabled: optional boolean`

898 

899 Whether the connector is enabled for the role.

900 

901 - `permissions: optional array of string`

902 

903 The permissions remaining for the role after the change.

904 

905 - `resource_id: optional string`

906 

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

908 

909 - `resource_type: optional string`

910 

911 The type of resource the role was unbound from.

912 

913 - `role_id: optional string`

914 

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

916 

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

918 

919 The connector role mutation path that produced the event.

920 

921 - `"role_toggle"`

922 

923 - `"role_connector_update"`

924 

925 - `"role_delete"`

926 

927 - `"workspace_permissions"`

928 

929 - `"connector_publish"`

930 

931 - `workspace_id: optional string`

932 

933 The workspace ID for a ChatGPT workspace connector resource.

934 

819 - `role.updated: optional object { id, changes_requested }`935 - `role.updated: optional object { id, changes_requested }`

820 936 

821 The details for events with this `type`.937 The details for events with this `type`.


1287 "resource_id": "resource_id",1403 "resource_id": "resource_id",

1288 "resource_type": "resource_type"1404 "resource_type": "resource_type"

1289 },1405 },

1406 "role.bound_to_resource": {

1407 "id": "id",

1408 "connector_id": "connector_id",

1409 "connector_name": "connector_name",

1410 "enabled": true,

1411 "permissions": [

1412 "string"

1413 ],

1414 "resource_id": "resource_id",

1415 "resource_type": "resource_type",

1416 "role_id": "role_id",

1417 "source": "role_toggle",

1418 "workspace_id": "workspace_id"

1419 },

1290 "role.created": {1420 "role.created": {

1291 "id": "id",1421 "id": "id",

1292 "permissions": [1422 "permissions": [


1299 "role.deleted": {1429 "role.deleted": {

1300 "id": "id"1430 "id": "id"

1301 },1431 },

1432 "role.unbound_from_resource": {

1433 "id": "id",

1434 "connector_id": "connector_id",

1435 "connector_name": "connector_name",

1436 "enabled": true,

1437 "permissions": [

1438 "string"

1439 ],

1440 "resource_id": "resource_id",

1441 "resource_type": "resource_type",

1442 "role_id": "role_id",

1443 "source": "role_toggle",

1444 "workspace_id": "workspace_id"

1445 },

1302 "role.updated": {1446 "role.updated": {

1303 "id": "id",1447 "id": "id",

1304 "changes_requested": {1448 "changes_requested": {


1426 1570 

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

1428 1572 

1573 - `expires_at: number`

1574 

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

1576 

1429 - `object: "organization.admin_api_key"`1577 - `object: "organization.admin_api_key"`

1430 1578 

1431 The object type, which is always `organization.admin_api_key`1579 The object type, which is always `organization.admin_api_key`


1491 {1639 {

1492 "id": "key_abc",1640 "id": "key_abc",

1493 "created_at": 1711471533,1641 "created_at": 1711471533,

1642 "expires_at": 1714063533,

1494 "object": "organization.admin_api_key",1643 "object": "organization.admin_api_key",

1495 "owner": {1644 "owner": {

1496 "id": "sa_456",1645 "id": "sa_456",


1524 1673 

1525- `--name: string`1674- `--name: string`

1526 1675 

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

1677 

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

1679 

1527### Returns1680### Returns

1528 1681 

1529- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`1682- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`


1548{1701{

1549 "id": "key_abc",1702 "id": "key_abc",

1550 "created_at": 1711471533,1703 "created_at": 1711471533,

1704 "expires_at": 1714063533,

1551 "object": "organization.admin_api_key",1705 "object": "organization.admin_api_key",

1552 "owner": {1706 "owner": {

1553 "id": "sa_456",1707 "id": "sa_456",


1580 1734 

1581### Returns1735### Returns

1582 1736 

1583- `admin_api_key: object { id, created_at, object, 4 more }`1737- `admin_api_key: object { id, created_at, expires_at, 5 more }`

1584 1738 

1585 Represents an individual Admin API key in an org.1739 Represents an individual Admin API key in an org.

1586 1740 


1592 1746 

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

1594 1748 

1749 - `expires_at: number`

1750 

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

1752 

1595 - `object: "organization.admin_api_key"`1753 - `object: "organization.admin_api_key"`

1596 1754 

1597 The object type, which is always `organization.admin_api_key`1755 The object type, which is always `organization.admin_api_key`


1648{1806{

1649 "id": "key_abc",1807 "id": "key_abc",

1650 "created_at": 1711471533,1808 "created_at": 1711471533,

1809 "expires_at": 1714063533,

1651 "object": "organization.admin_api_key",1810 "object": "organization.admin_api_key",

1652 "owner": {1811 "owner": {

1653 "id": "sa_456",1812 "id": "sa_456",


1709 1868 

1710### Admin API Key1869### Admin API Key

1711 1870 

1712- `admin_api_key: object { id, created_at, object, 4 more }`1871- `admin_api_key: object { id, created_at, expires_at, 5 more }`

1713 1872 

1714 Represents an individual Admin API key in an org.1873 Represents an individual Admin API key in an org.

1715 1874 


1721 1880 

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

1723 1882 

1883 - `expires_at: number`

1884 

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

1886 

1724 - `object: "organization.admin_api_key"`1887 - `object: "organization.admin_api_key"`

1725 1888 

1726 The object type, which is always `organization.admin_api_key`1889 The object type, which is always `organization.admin_api_key`


10217}10380}

10218```10381```

10219 10382 

10383## Retrieve organization spend alert

10384 

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

10386 

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

10388 

10389Retrieves an organization spend alert.

10390 

10391### Parameters

10392 

10393- `--alert-id: string`

10394 

10395 The ID of the spend alert to retrieve.

10396 

10397### Returns

10398 

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

10400 

10401 Represents a spend alert configured at the organization level.

10402 

10403 - `id: string`

10404 

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

10406 

10407 - `currency: "USD"`

10408 

10409 The currency for the threshold amount.

10410 

10411 - `"USD"`

10412 

10413 - `interval: "month"`

10414 

10415 The time interval for evaluating spend against the threshold.

10416 

10417 - `"month"`

10418 

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

10420 

10421 Email notification settings for a spend alert.

10422 

10423 - `recipients: array of string`

10424 

10425 Email addresses that receive the spend alert notification.

10426 

10427 - `type: "email"`

10428 

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

10430 

10431 - `subject_prefix: optional string`

10432 

10433 Optional subject prefix for alert emails.

10434 

10435 - `object: "organization.spend_alert"`

10436 

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

10438 

10439 - `threshold_amount: number`

10440 

10441 The alert threshold amount, in cents.

10442 

10443### Example

10444 

10445```cli

10446openai admin:organization:spend-alerts retrieve \

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

10448 --alert-id alert_id

10449```

10450 

10451#### Response

10452 

10453```json

10454{

10455 "id": "id",

10456 "currency": "USD",

10457 "interval": "month",

10458 "notification_channel": {

10459 "recipients": [

10460 "string"

10461 ],

10462 "type": "email",

10463 "subject_prefix": "subject_prefix"

10464 },

10465 "object": "organization.spend_alert",

10466 "threshold_amount": 0

10467}

10468```

10469 

10220## Update organization spend alert10470## Update organization spend alert

10221 10471 

10222`$ openai admin:organization:spend-alerts update`10472`$ openai admin:organization:spend-alerts update`


15617}15867}

15618```15868```

15619 15869 

15870## Retrieve project spend alert

15871 

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

15873 

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

15875 

15876Retrieves a project spend alert.

15877 

15878### Parameters

15879 

15880- `--project-id: string`

15881 

15882 The ID of the project.

15883 

15884- `--alert-id: string`

15885 

15886 The ID of the spend alert to retrieve.

15887 

15888### Returns

15889 

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

15891 

15892 Represents a spend alert configured at the project level.

15893 

15894 - `id: string`

15895 

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

15897 

15898 - `currency: "USD"`

15899 

15900 The currency for the threshold amount.

15901 

15902 - `"USD"`

15903 

15904 - `interval: "month"`

15905 

15906 The time interval for evaluating spend against the threshold.

15907 

15908 - `"month"`

15909 

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

15911 

15912 Email notification settings for a spend alert.

15913 

15914 - `recipients: array of string`

15915 

15916 Email addresses that receive the spend alert notification.

15917 

15918 - `type: "email"`

15919 

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

15921 

15922 - `subject_prefix: optional string`

15923 

15924 Optional subject prefix for alert emails.

15925 

15926 - `object: "project.spend_alert"`

15927 

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

15929 

15930 - `threshold_amount: number`

15931 

15932 The alert threshold amount, in cents.

15933 

15934### Example

15935 

15936```cli

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

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

15939 --project-id project_id \

15940 --alert-id alert_id

15941```

15942 

15943#### Response

15944 

15945```json

15946{

15947 "id": "id",

15948 "currency": "USD",

15949 "interval": "month",

15950 "notification_channel": {

15951 "recipients": [

15952 "string"

15953 ],

15954 "type": "email",

15955 "subject_prefix": "subject_prefix"

15956 },

15957 "object": "project.spend_alert",

15958 "threshold_amount": 0

15959}

15960```

15961 

15620## Update project spend alert15962## Update project spend alert

15621 15963 

15622`$ openai admin:organization:projects:spend-alerts update`15964`$ openai admin:organization:projects:spend-alerts update`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

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

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `--after: optional string`

14 

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

16 

17- `--limit: optional number`

18 

19 Maximum number of keys to return.

20 

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

22 

23 Order results by creation time, ascending or descending.

24 

25### Returns

26 

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

28 

29 - `data: array of AdminAPIKey`

30 

31 - `id: string`

32 

33 The identifier, which can be referenced in API endpoints

34 

35 - `created_at: number`

36 

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

38 

39 - `expires_at: number`

40 

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

42 

43 - `object: "organization.admin_api_key"`

44 

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

46 

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

48 

49 - `id: optional string`

50 

51 The identifier, which can be referenced in API endpoints

52 

53 - `created_at: optional number`

54 

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

56 

57 - `name: optional string`

58 

59 The name of the user

60 

61 - `object: optional string`

62 

63 The object type, which is always organization.user

64 

65 - `role: optional string`

66 

67 Always `owner`

68 

69 - `type: optional string`

70 

71 Always `user`

72 

73 - `redacted_value: string`

74 

75 The redacted value of the API key

76 

77 - `last_used_at: optional number`

78 

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

80 

81 - `name: optional string`

82 

83 The name of the API key

84 

85 - `has_more: boolean`

86 

87 - `object: "list"`

88 

89 - `first_id: optional string`

90 

91 - `last_id: optional string`

92 

93### Example

94 

95```cli

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

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

98```

99 

100#### Response

101 

102```json

103{

104 "data": [

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 ],

123 "has_more": false,

124 "object": "list",

125 "first_id": "key_abc",

126 "last_id": "key_xyz"

127}

128```

129 

130## Create admin API key

131 

132`$ openai admin:organization:admin-api-keys create`

133 

134**post** `/organization/admin_api_keys`

135 

136Create an organization admin API key

137 

138### Parameters

139 

140- `--name: string`

141 

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

143 

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

145 

146### Returns

147 

148- `AdminOrganizationAdminAPIKeyNewResponse: AdminAPIKey`

149 

150 Represents an individual Admin API key in an org.

151 

152 - `value: string`

153 

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

155 

156### Example

157 

158```cli

159openai admin:organization:admin-api-keys create \

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

161 --name 'New Admin Key'

162```

163 

164#### Response

165 

166```json

167{

168 "id": "key_abc",

169 "created_at": 1711471533,

170 "expires_at": 1714063533,

171 "object": "organization.admin_api_key",

172 "owner": {

173 "id": "sa_456",

174 "created_at": 1711471533,

175 "name": "My Service Account",

176 "object": "organization.user",

177 "role": "owner",

178 "type": "user"

179 },

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

181 "last_used_at": 1711471534,

182 "name": "Administration Key",

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

184}

185```

186 

187## Retrieve admin API key

188 

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

190 

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

192 

193Retrieve a single organization API key

194 

195### Parameters

196 

197- `--key-id: string`

198 

199 The ID of the API key.

200 

201### Returns

202 

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

204 

205 Represents an individual Admin API key in an org.

206 

207 - `id: string`

208 

209 The identifier, which can be referenced in API endpoints

210 

211 - `created_at: number`

212 

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

214 

215 - `expires_at: number`

216 

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

218 

219 - `object: "organization.admin_api_key"`

220 

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

222 

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

224 

225 - `id: optional string`

226 

227 The identifier, which can be referenced in API endpoints

228 

229 - `created_at: optional number`

230 

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

232 

233 - `name: optional string`

234 

235 The name of the user

236 

237 - `object: optional string`

238 

239 The object type, which is always organization.user

240 

241 - `role: optional string`

242 

243 Always `owner`

244 

245 - `type: optional string`

246 

247 Always `user`

248 

249 - `redacted_value: string`

250 

251 The redacted value of the API key

252 

253 - `last_used_at: optional number`

254 

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

256 

257 - `name: optional string`

258 

259 The name of the API key

260 

261### Example

262 

263```cli

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

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

266 --key-id key_id

267```

268 

269#### Response

270 

271```json

272{

273 "id": "key_abc",

274 "created_at": 1711471533,

275 "expires_at": 1714063533,

276 "object": "organization.admin_api_key",

277 "owner": {

278 "id": "sa_456",

279 "created_at": 1711471533,

280 "name": "My Service Account",

281 "object": "organization.user",

282 "role": "owner",

283 "type": "user"

284 },

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

286 "last_used_at": 1711471534,

287 "name": "Administration Key"

288}

289```

290 

291## Delete admin API key

292 

293`$ openai admin:organization:admin-api-keys delete`

294 

295**delete** `/organization/admin_api_keys/{key_id}`

296 

297Delete an organization admin API key

298 

299### Parameters

300 

301- `--key-id: string`

302 

303 The ID of the API key to be deleted.

304 

305### Returns

306 

307- `AdminOrganizationAdminAPIKeyDeleteResponse: object { id, deleted, object }`

308 

309 - `id: string`

310 

311 - `deleted: boolean`

312 

313 - `object: "organization.admin_api_key.deleted"`

314 

315### Example

316 

317```cli

318openai admin:organization:admin-api-keys delete \

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

320 --key-id key_id

321```

322 

323#### Response

324 

325```json

326{

327 "id": "key_abc",

328 "deleted": true,

329 "object": "organization.admin_api_key.deleted"

330}

331```

332 

333## Domain Types

334 

335### Admin API Key

336 

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

338 

339 Represents an individual Admin API key in an org.

340 

341 - `id: string`

342 

343 The identifier, which can be referenced in API endpoints

344 

345 - `created_at: number`

346 

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

348 

349 - `expires_at: number`

350 

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

352 

353 - `object: "organization.admin_api_key"`

354 

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

356 

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

358 

359 - `id: optional string`

360 

361 The identifier, which can be referenced in API endpoints

362 

363 - `created_at: optional number`

364 

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

366 

367 - `name: optional string`

368 

369 The name of the user

370 

371 - `object: optional string`

372 

373 The object type, which is always organization.user

374 

375 - `role: optional string`

376 

377 Always `owner`

378 

379 - `type: optional string`

380 

381 Always `user`

382 

383 - `redacted_value: string`

384 

385 The redacted value of the API key

386 

387 - `last_used_at: optional number`

388 

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

390 

391 - `name: optional string`

392 

393 The name of the API key

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

30 30 

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

32 32 

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

34 34 

35 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).35 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).

36 36 


44 44 

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

46 46 

47 Return only events performed on these targets. For example, a project ID updated.47 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>`.

48 

49- `--tenant-only: optional boolean`

50 

51 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.

48 52 

49### Returns53### Returns

50 54 

51- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`55- `ListAuditLogsResponse: object { data, has_more, object, 2 more }`

52 56 

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

54 58 

55 - `id: string`59 - `id: string`

56 60 


60 64 

61 The Unix timestamp (in seconds) of the event.65 The Unix timestamp (in seconds) of the event.

62 66 

63 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`67 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

64 68 

65 The event type.69 The event type.

66 70 


162 166 

163 - `"role.assignment.deleted"`167 - `"role.assignment.deleted"`

164 168 

169 - `"role.bound_to_resource"`

170 

171 - `"role.unbound_from_resource"`

172 

165 - `"scim.enabled"`173 - `"scim.enabled"`

166 174 

167 - `"scim.disabled"`175 - `"scim.disabled"`


782 790 

783 The type of resource the role assignment was scoped to.791 The type of resource the role assignment was scoped to.

784 792 

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

794 

795 The details for events with this `type`.

796 

797 - `id: optional string`

798 

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

800 

801 - `connector_id: optional string`

802 

803 The connector ID for a ChatGPT workspace connector resource.

804 

805 - `connector_name: optional string`

806 

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

808 

809 - `enabled: optional boolean`

810 

811 Whether the connector is enabled for the role.

812 

813 - `permissions: optional array of string`

814 

815 The permissions granted to the role for the resource.

816 

817 - `resource_id: optional string`

818 

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

820 

821 - `resource_type: optional string`

822 

823 The type of resource the role was bound to.

824 

825 - `role_id: optional string`

826 

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

828 

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

830 

831 The connector role mutation path that produced the event.

832 

833 - `"role_toggle"`

834 

835 - `"role_connector_update"`

836 

837 - `"role_delete"`

838 

839 - `"workspace_permissions"`

840 

841 - `"connector_publish"`

842 

843 - `workspace_id: optional string`

844 

845 The workspace ID for a ChatGPT workspace connector resource.

846 

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

786 848 

787 The details for events with this `type`.849 The details for events with this `type`.


814 876 

815 The role ID.877 The role ID.

816 878 

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

880 

881 The details for events with this `type`.

882 

883 - `id: optional string`

884 

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

886 

887 - `connector_id: optional string`

888 

889 The connector ID for a ChatGPT workspace connector resource.

890 

891 - `connector_name: optional string`

892 

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

894 

895 - `enabled: optional boolean`

896 

897 Whether the connector is enabled for the role.

898 

899 - `permissions: optional array of string`

900 

901 The permissions remaining for the role after the change.

902 

903 - `resource_id: optional string`

904 

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

906 

907 - `resource_type: optional string`

908 

909 The type of resource the role was unbound from.

910 

911 - `role_id: optional string`

912 

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

914 

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

916 

917 The connector role mutation path that produced the event.

918 

919 - `"role_toggle"`

920 

921 - `"role_connector_update"`

922 

923 - `"role_delete"`

924 

925 - `"workspace_permissions"`

926 

927 - `"connector_publish"`

928 

929 - `workspace_id: optional string`

930 

931 The workspace ID for a ChatGPT workspace connector resource.

932 

817 - `role.updated: optional object { id, changes_requested }`933 - `role.updated: optional object { id, changes_requested }`

818 934 

819 The details for events with this `type`.935 The details for events with this `type`.


1285 "resource_id": "resource_id",1401 "resource_id": "resource_id",

1286 "resource_type": "resource_type"1402 "resource_type": "resource_type"

1287 },1403 },

1404 "role.bound_to_resource": {

1405 "id": "id",

1406 "connector_id": "connector_id",

1407 "connector_name": "connector_name",

1408 "enabled": true,

1409 "permissions": [

1410 "string"

1411 ],

1412 "resource_id": "resource_id",

1413 "resource_type": "resource_type",

1414 "role_id": "role_id",

1415 "source": "role_toggle",

1416 "workspace_id": "workspace_id"

1417 },

1288 "role.created": {1418 "role.created": {

1289 "id": "id",1419 "id": "id",

1290 "permissions": [1420 "permissions": [


1297 "role.deleted": {1427 "role.deleted": {

1298 "id": "id"1428 "id": "id"

1299 },1429 },

1430 "role.unbound_from_resource": {

1431 "id": "id",

1432 "connector_id": "connector_id",

1433 "connector_name": "connector_name",

1434 "enabled": true,

1435 "permissions": [

1436 "string"

1437 ],

1438 "resource_id": "resource_id",

1439 "resource_type": "resource_type",

1440 "role_id": "role_id",

1441 "source": "role_toggle",

1442 "workspace_id": "workspace_id"

1443 },

1300 "role.updated": {1444 "role.updated": {

1301 "id": "id",1445 "id": "id",

1302 "changes_requested": {1446 "changes_requested": {

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

4530}4530}

4531```4531```

4532 4532 

4533## Retrieve project spend alert

4534 

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

4536 

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

4538 

4539Retrieves a project spend alert.

4540 

4541### Parameters

4542 

4543- `--project-id: string`

4544 

4545 The ID of the project.

4546 

4547- `--alert-id: string`

4548 

4549 The ID of the spend alert to retrieve.

4550 

4551### Returns

4552 

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

4554 

4555 Represents a spend alert configured at the project level.

4556 

4557 - `id: string`

4558 

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

4560 

4561 - `currency: "USD"`

4562 

4563 The currency for the threshold amount.

4564 

4565 - `"USD"`

4566 

4567 - `interval: "month"`

4568 

4569 The time interval for evaluating spend against the threshold.

4570 

4571 - `"month"`

4572 

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

4574 

4575 Email notification settings for a spend alert.

4576 

4577 - `recipients: array of string`

4578 

4579 Email addresses that receive the spend alert notification.

4580 

4581 - `type: "email"`

4582 

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

4584 

4585 - `subject_prefix: optional string`

4586 

4587 Optional subject prefix for alert emails.

4588 

4589 - `object: "project.spend_alert"`

4590 

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

4592 

4593 - `threshold_amount: number`

4594 

4595 The alert threshold amount, in cents.

4596 

4597### Example

4598 

4599```cli

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

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

4602 --project-id project_id \

4603 --alert-id alert_id

4604```

4605 

4606#### Response

4607 

4608```json

4609{

4610 "id": "id",

4611 "currency": "USD",

4612 "interval": "month",

4613 "notification_channel": {

4614 "recipients": [

4615 "string"

4616 ],

4617 "type": "email",

4618 "subject_prefix": "subject_prefix"

4619 },

4620 "object": "project.spend_alert",

4621 "threshold_amount": 0

4622}

4623```

4624 

4533## Update project spend alert4625## Update project spend alert

4534 4626 

4535`$ openai admin:organization:projects:spend-alerts update`4627`$ openai admin:organization:projects:spend-alerts update`

Details

238}238}

239```239```

240 240 

241## Retrieve project spend alert

242 

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

244 

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

246 

247Retrieves a project spend alert.

248 

249### Parameters

250 

251- `--project-id: string`

252 

253 The ID of the project.

254 

255- `--alert-id: string`

256 

257 The ID of the spend alert to retrieve.

258 

259### Returns

260 

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

262 

263 Represents a spend alert configured at the project level.

264 

265 - `id: string`

266 

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

268 

269 - `currency: "USD"`

270 

271 The currency for the threshold amount.

272 

273 - `"USD"`

274 

275 - `interval: "month"`

276 

277 The time interval for evaluating spend against the threshold.

278 

279 - `"month"`

280 

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

282 

283 Email notification settings for a spend alert.

284 

285 - `recipients: array of string`

286 

287 Email addresses that receive the spend alert notification.

288 

289 - `type: "email"`

290 

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

292 

293 - `subject_prefix: optional string`

294 

295 Optional subject prefix for alert emails.

296 

297 - `object: "project.spend_alert"`

298 

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

300 

301 - `threshold_amount: number`

302 

303 The alert threshold amount, in cents.

304 

305### Example

306 

307```cli

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

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

310 --project-id project_id \

311 --alert-id alert_id

312```

313 

314#### Response

315 

316```json

317{

318 "id": "id",

319 "currency": "USD",

320 "interval": "month",

321 "notification_channel": {

322 "recipients": [

323 "string"

324 ],

325 "type": "email",

326 "subject_prefix": "subject_prefix"

327 },

328 "object": "project.spend_alert",

329 "threshold_amount": 0

330}

331```

332 

241## Update project spend alert333## Update project spend alert

242 334 

243`$ openai admin:organization:projects:spend-alerts update`335`$ openai admin:organization:projects:spend-alerts update`

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

228}228}

229```229```

230 230 

231## Retrieve organization spend alert

232 

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

234 

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

236 

237Retrieves an organization spend alert.

238 

239### Parameters

240 

241- `--alert-id: string`

242 

243 The ID of the spend alert to retrieve.

244 

245### Returns

246 

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

248 

249 Represents a spend alert configured at the organization level.

250 

251 - `id: string`

252 

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

254 

255 - `currency: "USD"`

256 

257 The currency for the threshold amount.

258 

259 - `"USD"`

260 

261 - `interval: "month"`

262 

263 The time interval for evaluating spend against the threshold.

264 

265 - `"month"`

266 

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

268 

269 Email notification settings for a spend alert.

270 

271 - `recipients: array of string`

272 

273 Email addresses that receive the spend alert notification.

274 

275 - `type: "email"`

276 

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

278 

279 - `subject_prefix: optional string`

280 

281 Optional subject prefix for alert emails.

282 

283 - `object: "organization.spend_alert"`

284 

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

286 

287 - `threshold_amount: number`

288 

289 The alert threshold amount, in cents.

290 

291### Example

292 

293```cli

294openai admin:organization:spend-alerts retrieve \

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

296 --alert-id alert_id

297```

298 

299#### Response

300 

301```json

302{

303 "id": "id",

304 "currency": "USD",

305 "interval": "month",

306 "notification_channel": {

307 "recipients": [

308 "string"

309 ],

310 "type": "email",

311 "subject_prefix": "subject_prefix"

312 },

313 "object": "organization.spend_alert",

314 "threshold_amount": 0

315}

316```

317 

231## Update organization spend alert318## Update organization spend alert

232 319 

233`$ openai admin:organization:spend-alerts update`320`$ openai admin:organization:spend-alerts update`

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

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

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

121 121 

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

123 123 

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

125 125 


4987 4987 

4988 - `"24h"`4988 - `"24h"`

4989 4989 

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

4991 4991 

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

4993 4993 

4994 Configuration options for4994 Configuration options for

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

4996 4996 

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

4998 

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

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

5001 used for the response.

5002 

5003 - `"auto"`

5004 

5005 - `"current_turn"`

5006 

5007 - `"all_turns"`

5008 

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

4998 5010 

4999 Constrains effort on reasoning for5011 Constrains effort on reasoning for


5374 "prompt_cache_key": "prompt-cache-key-1234",5386 "prompt_cache_key": "prompt-cache-key-1234",

5375 "prompt_cache_retention": "in_memory",5387 "prompt_cache_retention": "in_memory",

5376 "reasoning": {5388 "reasoning": {

5389 "context": "auto",

5377 "effort": "none",5390 "effort": "none",

5378 "generate_summary": "auto",5391 "generate_summary": "auto",

5379 "summary": "auto"5392 "summary": "auto"


10202 10215 

10203 - `"24h"`10216 - `"24h"`

10204 10217 

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

10206 10219 

10207 **gpt-5 and o-series models only**10220 **gpt-5 and o-series models only**

10208 10221 

10209 Configuration options for10222 Configuration options for

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

10211 10224 

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

10226 

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

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

10229 used for the response.

10230 

10231 - `"auto"`

10232 

10233 - `"current_turn"`

10234 

10235 - `"all_turns"`

10236 

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

10213 10238 

10214 Constrains effort on reasoning for10239 Constrains effort on reasoning for


10590 "prompt_cache_key": "prompt-cache-key-1234",10615 "prompt_cache_key": "prompt-cache-key-1234",

10591 "prompt_cache_retention": "in_memory",10616 "prompt_cache_retention": "in_memory",

10592 "reasoning": {10617 "reasoning": {

10618 "context": "auto",

10593 "effort": "none",10619 "effort": "none",

10594 "generate_summary": "auto",10620 "generate_summary": "auto",

10595 "summary": "auto"10621 "summary": "auto"


15423 15449 

15424 - `"24h"`15450 - `"24h"`

15425 15451 

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

15427 15453 

15428 **gpt-5 and o-series models only**15454 **gpt-5 and o-series models only**

15429 15455 

15430 Configuration options for15456 Configuration options for

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

15432 15458 

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

15460 

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

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

15463 used for the response.

15464 

15465 - `"auto"`

15466 

15467 - `"current_turn"`

15468 

15469 - `"all_turns"`

15470 

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

15434 15472 

15435 Constrains effort on reasoning for15473 Constrains effort on reasoning for


15811 "prompt_cache_key": "prompt-cache-key-1234",15849 "prompt_cache_key": "prompt-cache-key-1234",

15812 "prompt_cache_retention": "in_memory",15850 "prompt_cache_retention": "in_memory",

15813 "reasoning": {15851 "reasoning": {

15852 "context": "auto",

15814 "effort": "none",15853 "effort": "none",

15815 "generate_summary": "auto",15854 "generate_summary": "auto",

15816 "summary": "auto"15855 "summary": "auto"


27442 27481 

27443 - `"24h"`27482 - `"24h"`

27444 27483 

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

27446 27485 

27447 **gpt-5 and o-series models only**27486 **gpt-5 and o-series models only**

27448 27487 

27449 Configuration options for27488 Configuration options for

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

27451 27490 

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

27492 

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

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

27495 used for the response.

27496 

27497 - `"auto"`

27498 

27499 - `"current_turn"`

27500 

27501 - `"all_turns"`

27502 

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

27453 27504 

27454 Constrains effort on reasoning for27505 Constrains effort on reasoning for


32863 32914 

32864 - `"24h"`32915 - `"24h"`

32865 32916 

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

32867 32918 

32868 **gpt-5 and o-series models only**32919 **gpt-5 and o-series models only**

32869 32920 

32870 Configuration options for32921 Configuration options for

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

32872 32923 

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

32925 

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

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

32928 used for the response.

32929 

32930 - `"auto"`

32931 

32932 - `"current_turn"`

32933 

32934 - `"all_turns"`

32935 

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

32874 32937 

32875 Constrains effort on reasoning for32938 Constrains effort on reasoning for


38958 39021 

38959 - `"24h"`39022 - `"24h"`

38960 39023 

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

38962 39025 

38963 **gpt-5 and o-series models only**39026 **gpt-5 and o-series models only**

38964 39027 

38965 Configuration options for39028 Configuration options for

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

38967 39030 

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

39032 

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

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

39035 used for the response.

39036 

39037 - `"auto"`

39038 

39039 - `"current_turn"`

39040 

39041 - `"all_turns"`

39042 

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

38969 39044 

38970 Constrains effort on reasoning for39045 Constrains effort on reasoning for


44299 44374 

44300 - `"24h"`44375 - `"24h"`

44301 44376 

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

44303 44378 

44304 **gpt-5 and o-series models only**44379 **gpt-5 and o-series models only**

44305 44380 

44306 Configuration options for44381 Configuration options for

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

44308 44383 

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

44385 

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

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

44388 used for the response.

44389 

44390 - `"auto"`

44391 

44392 - `"current_turn"`

44393 

44394 - `"all_turns"`

44395 

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

44310 44397 

44311 Constrains effort on reasoning for44398 Constrains effort on reasoning for


50318 50405 

50319 - `"24h"`50406 - `"24h"`

50320 50407 

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

50322 50409 

50323 **gpt-5 and o-series models only**50410 **gpt-5 and o-series models only**

50324 50411 

50325 Configuration options for50412 Configuration options for

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

50327 50414 

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

50416 

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

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

50419 used for the response.

50420 

50421 - `"auto"`

50422 

50423 - `"current_turn"`

50424 

50425 - `"all_turns"`

50426 

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

50329 50428 

50330 Constrains effort on reasoning for50429 Constrains effort on reasoning for


55379 55478 

55380 - `"24h"`55479 - `"24h"`

55381 55480 

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

55383 55482 

55384 **gpt-5 and o-series models only**55483 **gpt-5 and o-series models only**

55385 55484 

55386 Configuration options for55485 Configuration options for

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

55388 55487 

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

55489 

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

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

55492 used for the response.

55493 

55494 - `"auto"`

55495 

55496 - `"current_turn"`

55497 

55498 - `"all_turns"`

55499 

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

55390 55501 

55391 Constrains effort on reasoning for55502 Constrains effort on reasoning for


78213 78324 

78214 - `"24h"`78325 - `"24h"`

78215 78326 

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

78217 78328 

78218 **gpt-5 and o-series models only**78329 **gpt-5 and o-series models only**

78219 78330 

78220 Configuration options for78331 Configuration options for

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

78222 78333 

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

78335 

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

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

78338 used for the response.

78339 

78340 - `"auto"`

78341 

78342 - `"current_turn"`

78343 

78344 - `"all_turns"`

78345 

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

78224 78347 

78225 Constrains effort on reasoning for78348 Constrains effort on reasoning for


83743 83866 

83744 - `"24h"`83867 - `"24h"`

83745 83868 

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

83747 83870 

83748 **gpt-5 and o-series models only**83871 **gpt-5 and o-series models only**

83749 83872 

83750 Configuration options for83873 Configuration options for

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

83752 83875 

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

83877 

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

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

83880 used for the response.

83881 

83882 - `"auto"`

83883 

83884 - `"current_turn"`

83885 

83886 - `"all_turns"`

83887 

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

83754 83889 

83755 Constrains effort on reasoning for83890 Constrains effort on reasoning for


84256 - Organizations without ZDR enabled default to `24h`.84391 - Organizations without ZDR enabled default to `24h`.

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

84258 84393 

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

84260 84395 

84261 **gpt-5 and o-series models only**84396 **gpt-5 and o-series models only**

84262 84397 


84620 - Organizations without ZDR enabled default to `24h`.84755 - Organizations without ZDR enabled default to `24h`.

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

84622 84757 

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

84624 84759 

84625 **gpt-5 and o-series models only**84760 **gpt-5 and o-series models only**

84626 84761 


84850 - Organizations without ZDR enabled default to `24h`.84985 - Organizations without ZDR enabled default to `24h`.

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

84852 84987 

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

84854 84989 

84855 **gpt-5 and o-series models only**84990 **gpt-5 and o-series models only**

84856 84991 


85080 - Organizations without ZDR enabled default to `24h`.85215 - Organizations without ZDR enabled default to `24h`.

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

85082 85217 

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

85084 85219 

85085 **gpt-5 and o-series models only**85220 **gpt-5 and o-series models only**

85086 85221 


86244 - Organizations without ZDR enabled default to `24h`.86379 - Organizations without ZDR enabled default to `24h`.

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

86246 86381 

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

86248 86383 

86249 **gpt-5 and o-series models only**86384 **gpt-5 and o-series models only**

86250 86385 


91876 92011 

91877 - `"24h"`92012 - `"24h"`

91878 92013 

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

91880 92015 

91881 **gpt-5 and o-series models only**92016 **gpt-5 and o-series models only**

91882 92017 

91883 Configuration options for92018 Configuration options for

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

91885 92020 

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

92022 

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

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

92025 used for the response.

92026 

92027 - `"auto"`

92028 

92029 - `"current_turn"`

92030 

92031 - `"all_turns"`

92032 

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

91887 92034 

91888 Constrains effort on reasoning for92035 Constrains effort on reasoning for


97287 97434 

97288 - `"24h"`97435 - `"24h"`

97289 97436 

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

97291 97438 

97292 **gpt-5 and o-series models only**97439 **gpt-5 and o-series models only**

97293 97440 

97294 Configuration options for97441 Configuration options for

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

97296 97443 

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

97445 

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

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

97448 used for the response.

97449 

97450 - `"auto"`

97451 

97452 - `"current_turn"`

97453 

97454 - `"all_turns"`

97455 

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

97298 97457 

97299 Constrains effort on reasoning for97458 Constrains effort on reasoning for


97800 - Organizations without ZDR enabled default to `24h`.97959 - Organizations without ZDR enabled default to `24h`.

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

97802 97961 

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

97804 97963 

97805 **gpt-5 and o-series models only**97964 **gpt-5 and o-series models only**

97806 97965 


98164 - Organizations without ZDR enabled default to `24h`.98323 - Organizations without ZDR enabled default to `24h`.

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

98166 98325 

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

98168 98327 

98169 **gpt-5 and o-series models only**98328 **gpt-5 and o-series models only**

98170 98329 


98394 - Organizations without ZDR enabled default to `24h`.98553 - Organizations without ZDR enabled default to `24h`.

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

98396 98555 

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

98398 98557 

98399 **gpt-5 and o-series models only**98558 **gpt-5 and o-series models only**

98400 98559 


98624 - Organizations without ZDR enabled default to `24h`.98783 - Organizations without ZDR enabled default to `24h`.

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

98626 98785 

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

98628 98787 

98629 **gpt-5 and o-series models only**98788 **gpt-5 and o-series models only**

98630 98789 


99788 - Organizations without ZDR enabled default to `24h`.99947 - Organizations without ZDR enabled default to `24h`.

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

99790 99949 

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

99792 99951 

99793 **gpt-5 and o-series models only**99952 **gpt-5 and o-series models only**

99794 99953 


106856 107015 

106857 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`.107016 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`.

106858 107017 

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

106860 107019 

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

106862 107021 

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

42 42 

43 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`.43 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`.

44 44 

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

46 46 

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

48 48 

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

154 154 

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

156 156 

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

158 

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

160 

157 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`161 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`

158 162 

159 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`163 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`


180 184 

181 - `ResourceIDs param.Field[[]string]`185 - `ResourceIDs param.Field[[]string]`

182 186 

183 Return only events performed on these targets. For example, a project ID updated.187 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>`.

188 

189 - `TenantOnly param.Field[bool]`

190 

191 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.

184 192 

185### Returns193### Returns

186 194 


298 306 

299 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`307 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`

300 308 

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

310 

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

312 

301 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`313 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`

302 314 

303 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`315 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`


918 930 

919 The type of resource the role assignment was scoped to.931 The type of resource the role assignment was scoped to.

920 932 

933 - `RoleBoundToResource AdminOrganizationAuditLogListResponseRoleBoundToResource`

934 

935 The details for events with this `type`.

936 

937 - `ID string`

938 

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

940 

941 - `ConnectorID string`

942 

943 The connector ID for a ChatGPT workspace connector resource.

944 

945 - `ConnectorName string`

946 

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

948 

949 - `Enabled bool`

950 

951 Whether the connector is enabled for the role.

952 

953 - `Permissions []string`

954 

955 The permissions granted to the role for the resource.

956 

957 - `ResourceID string`

958 

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

960 

961 - `ResourceType string`

962 

963 The type of resource the role was bound to.

964 

965 - `RoleID string`

966 

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

968 

969 - `Source string`

970 

971 The connector role mutation path that produced the event.

972 

973 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_toggle"`

974 

975 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_connector_update"`

976 

977 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_delete"`

978 

979 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "workspace_permissions"`

980 

981 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "connector_publish"`

982 

983 - `WorkspaceID string`

984 

985 The workspace ID for a ChatGPT workspace connector resource.

986 

921 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`987 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`

922 988 

923 The details for events with this `type`.989 The details for events with this `type`.


950 1016 

951 The role ID.1017 The role ID.

952 1018 

1019 - `RoleUnboundFromResource AdminOrganizationAuditLogListResponseRoleUnboundFromResource`

1020 

1021 The details for events with this `type`.

1022 

1023 - `ID string`

1024 

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

1026 

1027 - `ConnectorID string`

1028 

1029 The connector ID for a ChatGPT workspace connector resource.

1030 

1031 - `ConnectorName string`

1032 

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

1034 

1035 - `Enabled bool`

1036 

1037 Whether the connector is enabled for the role.

1038 

1039 - `Permissions []string`

1040 

1041 The permissions remaining for the role after the change.

1042 

1043 - `ResourceID string`

1044 

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

1046 

1047 - `ResourceType string`

1048 

1049 The type of resource the role was unbound from.

1050 

1051 - `RoleID string`

1052 

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

1054 

1055 - `Source string`

1056 

1057 The connector role mutation path that produced the event.

1058 

1059 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_toggle"`

1060 

1061 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_connector_update"`

1062 

1063 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_delete"`

1064 

1065 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "workspace_permissions"`

1066 

1067 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "connector_publish"`

1068 

1069 - `WorkspaceID string`

1070 

1071 The workspace ID for a ChatGPT workspace connector resource.

1072 

953 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`1073 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`

954 1074 

955 The details for events with this `type`.1075 The details for events with this `type`.


1433 "resource_id": "resource_id",1553 "resource_id": "resource_id",

1434 "resource_type": "resource_type"1554 "resource_type": "resource_type"

1435 },1555 },

1556 "role.bound_to_resource": {

1557 "id": "id",

1558 "connector_id": "connector_id",

1559 "connector_name": "connector_name",

1560 "enabled": true,

1561 "permissions": [

1562 "string"

1563 ],

1564 "resource_id": "resource_id",

1565 "resource_type": "resource_type",

1566 "role_id": "role_id",

1567 "source": "role_toggle",

1568 "workspace_id": "workspace_id"

1569 },

1436 "role.created": {1570 "role.created": {

1437 "id": "id",1571 "id": "id",

1438 "permissions": [1572 "permissions": [


1445 "role.deleted": {1579 "role.deleted": {

1446 "id": "id"1580 "id": "id"

1447 },1581 },

1582 "role.unbound_from_resource": {

1583 "id": "id",

1584 "connector_id": "connector_id",

1585 "connector_name": "connector_name",

1586 "enabled": true,

1587 "permissions": [

1588 "string"

1589 ],

1590 "resource_id": "resource_id",

1591 "resource_type": "resource_type",

1592 "role_id": "role_id",

1593 "source": "role_toggle",

1594 "workspace_id": "workspace_id"

1595 },

1448 "role.updated": {1596 "role.updated": {

1449 "id": "id",1597 "id": "id",

1450 "changes_requested": {1598 "changes_requested": {


1578 1726 

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

1580 1728 

1729 - `ExpiresAt int64`

1730 

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

1732 

1581 - `Object OrganizationAdminAPIKey`1733 - `Object OrganizationAdminAPIKey`

1582 1734 

1583 The object type, which is always `organization.admin_api_key`1735 The object type, which is always `organization.admin_api_key`


1657 {1809 {

1658 "id": "key_abc",1810 "id": "key_abc",

1659 "created_at": 1711471533,1811 "created_at": 1711471533,

1812 "expires_at": 1714063533,

1660 "object": "organization.admin_api_key",1813 "object": "organization.admin_api_key",

1661 "owner": {1814 "owner": {

1662 "id": "sa_456",1815 "id": "sa_456",


1692 1845 

1693 - `Name param.Field[string]`1846 - `Name param.Field[string]`

1694 1847 

1848 - `ExpiresInSeconds param.Field[int64]`

1849 

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

1851 

1695### Returns1852### Returns

1696 1853 

1697- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`1854- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`


1735{1892{

1736 "id": "key_abc",1893 "id": "key_abc",

1737 "created_at": 1711471533,1894 "created_at": 1711471533,

1895 "expires_at": 1714063533,

1738 "object": "organization.admin_api_key",1896 "object": "organization.admin_api_key",

1739 "owner": {1897 "owner": {

1740 "id": "sa_456",1898 "id": "sa_456",


1779 1937 

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

1781 1939 

1940 - `ExpiresAt int64`

1941 

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

1943 

1782 - `Object OrganizationAdminAPIKey`1944 - `Object OrganizationAdminAPIKey`

1783 1945 

1784 The object type, which is always `organization.admin_api_key`1946 The object type, which is always `organization.admin_api_key`


1854{2016{

1855 "id": "key_abc",2017 "id": "key_abc",

1856 "created_at": 1711471533,2018 "created_at": 1711471533,

2019 "expires_at": 1714063533,

1857 "object": "organization.admin_api_key",2020 "object": "organization.admin_api_key",

1858 "owner": {2021 "owner": {

1859 "id": "sa_456",2022 "id": "sa_456",


1946 2109 

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

1948 2111 

2112 - `ExpiresAt int64`

2113 

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

2115 

1949 - `Object OrganizationAdminAPIKey`2116 - `Object OrganizationAdminAPIKey`

1950 2117 

1951 The object type, which is always `organization.admin_api_key`2118 The object type, which is always `organization.admin_api_key`


11809}11976}

11810```11977```

11811 11978 

11979## Retrieve organization spend alert

11980 

11981`client.Admin.Organization.SpendAlerts.Get(ctx, alertID) (*OrganizationSpendAlert, error)`

11982 

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

11984 

11985Retrieves an organization spend alert.

11986 

11987### Parameters

11988 

11989- `alertID string`

11990 

11991### Returns

11992 

11993- `type OrganizationSpendAlert struct{…}`

11994 

11995 Represents a spend alert configured at the organization level.

11996 

11997 - `ID string`

11998 

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

12000 

12001 - `Currency OrganizationSpendAlertCurrency`

12002 

12003 The currency for the threshold amount.

12004 

12005 - `const OrganizationSpendAlertCurrencyUsd OrganizationSpendAlertCurrency = "USD"`

12006 

12007 - `Interval OrganizationSpendAlertInterval`

12008 

12009 The time interval for evaluating spend against the threshold.

12010 

12011 - `const OrganizationSpendAlertIntervalMonth OrganizationSpendAlertInterval = "month"`

12012 

12013 - `NotificationChannel OrganizationSpendAlertNotificationChannel`

12014 

12015 Email notification settings for a spend alert.

12016 

12017 - `Recipients []string`

12018 

12019 Email addresses that receive the spend alert notification.

12020 

12021 - `Type Email`

12022 

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

12024 

12025 - `const EmailEmail Email = "email"`

12026 

12027 - `SubjectPrefix string`

12028 

12029 Optional subject prefix for alert emails.

12030 

12031 - `Object OrganizationSpendAlert`

12032 

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

12034 

12035 - `const OrganizationSpendAlertOrganizationSpendAlert OrganizationSpendAlert = "organization.spend_alert"`

12036 

12037 - `ThresholdAmount int64`

12038 

12039 The alert threshold amount, in cents.

12040 

12041### Example

12042 

12043```go

12044package main

12045 

12046import (

12047 "context"

12048 "fmt"

12049 

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

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

12052)

12053 

12054func main() {

12055 client := openai.NewClient(

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

12057 )

12058 organizationSpendAlert, err := client.Admin.Organization.SpendAlerts.Get(context.TODO(), "alert_id")

12059 if err != nil {

12060 panic(err.Error())

12061 }

12062 fmt.Printf("%+v\n", organizationSpendAlert.ID)

12063}

12064```

12065 

12066#### Response

12067 

12068```json

12069{

12070 "id": "id",

12071 "currency": "USD",

12072 "interval": "month",

12073 "notification_channel": {

12074 "recipients": [

12075 "string"

12076 ],

12077 "type": "email",

12078 "subject_prefix": "subject_prefix"

12079 },

12080 "object": "organization.spend_alert",

12081 "threshold_amount": 0

12082}

12083```

12084 

11812## Update organization spend alert12085## Update organization spend alert

11813 12086 

11814`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`12087`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`


18377}18650}

18378```18651```

18379 18652 

18653## Retrieve project spend alert

18654 

18655`client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)`

18656 

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

18658 

18659Retrieves a project spend alert.

18660 

18661### Parameters

18662 

18663- `projectID string`

18664 

18665- `alertID string`

18666 

18667### Returns

18668 

18669- `type ProjectSpendAlert struct{…}`

18670 

18671 Represents a spend alert configured at the project level.

18672 

18673 - `ID string`

18674 

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

18676 

18677 - `Currency ProjectSpendAlertCurrency`

18678 

18679 The currency for the threshold amount.

18680 

18681 - `const ProjectSpendAlertCurrencyUsd ProjectSpendAlertCurrency = "USD"`

18682 

18683 - `Interval ProjectSpendAlertInterval`

18684 

18685 The time interval for evaluating spend against the threshold.

18686 

18687 - `const ProjectSpendAlertIntervalMonth ProjectSpendAlertInterval = "month"`

18688 

18689 - `NotificationChannel ProjectSpendAlertNotificationChannel`

18690 

18691 Email notification settings for a spend alert.

18692 

18693 - `Recipients []string`

18694 

18695 Email addresses that receive the spend alert notification.

18696 

18697 - `Type Email`

18698 

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

18700 

18701 - `const EmailEmail Email = "email"`

18702 

18703 - `SubjectPrefix string`

18704 

18705 Optional subject prefix for alert emails.

18706 

18707 - `Object ProjectSpendAlert`

18708 

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

18710 

18711 - `const ProjectSpendAlertProjectSpendAlert ProjectSpendAlert = "project.spend_alert"`

18712 

18713 - `ThresholdAmount int64`

18714 

18715 The alert threshold amount, in cents.

18716 

18717### Example

18718 

18719```go

18720package main

18721 

18722import (

18723 "context"

18724 "fmt"

18725 

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

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

18728)

18729 

18730func main() {

18731 client := openai.NewClient(

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

18733 )

18734 projectSpendAlert, err := client.Admin.Organization.Projects.SpendAlerts.Get(

18735 context.TODO(),

18736 "project_id",

18737 "alert_id",

18738 )

18739 if err != nil {

18740 panic(err.Error())

18741 }

18742 fmt.Printf("%+v\n", projectSpendAlert.ID)

18743}

18744```

18745 

18746#### Response

18747 

18748```json

18749{

18750 "id": "id",

18751 "currency": "USD",

18752 "interval": "month",

18753 "notification_channel": {

18754 "recipients": [

18755 "string"

18756 ],

18757 "type": "email",

18758 "subject_prefix": "subject_prefix"

18759 },

18760 "object": "project.spend_alert",

18761 "threshold_amount": 0

18762}

18763```

18764 

18380## Update project spend alert18765## Update project spend alert

18381 18766 

18382`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`18767`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`

Details

152 152 

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

154 154 

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

156 

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

158 

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

156 160 

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


178 182 

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

180 184 

181 Return only events performed on these targets. For example, a project ID updated.185 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>`.

186 

187 - `TenantOnly param.Field[bool]`

188 

189 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.

182 190 

183### Returns191### Returns

184 192 


296 304 

297 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`305 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`

298 306 

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

308 

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

310 

299 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`311 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`

300 312 

301 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`313 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`


916 928 

917 The type of resource the role assignment was scoped to.929 The type of resource the role assignment was scoped to.

918 930 

931 - `RoleBoundToResource AdminOrganizationAuditLogListResponseRoleBoundToResource`

932 

933 The details for events with this `type`.

934 

935 - `ID string`

936 

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

938 

939 - `ConnectorID string`

940 

941 The connector ID for a ChatGPT workspace connector resource.

942 

943 - `ConnectorName string`

944 

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

946 

947 - `Enabled bool`

948 

949 Whether the connector is enabled for the role.

950 

951 - `Permissions []string`

952 

953 The permissions granted to the role for the resource.

954 

955 - `ResourceID string`

956 

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

958 

959 - `ResourceType string`

960 

961 The type of resource the role was bound to.

962 

963 - `RoleID string`

964 

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

966 

967 - `Source string`

968 

969 The connector role mutation path that produced the event.

970 

971 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_toggle"`

972 

973 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_connector_update"`

974 

975 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_delete"`

976 

977 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "workspace_permissions"`

978 

979 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "connector_publish"`

980 

981 - `WorkspaceID string`

982 

983 The workspace ID for a ChatGPT workspace connector resource.

984 

919 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`985 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`

920 986 

921 The details for events with this `type`.987 The details for events with this `type`.


948 1014 

949 The role ID.1015 The role ID.

950 1016 

1017 - `RoleUnboundFromResource AdminOrganizationAuditLogListResponseRoleUnboundFromResource`

1018 

1019 The details for events with this `type`.

1020 

1021 - `ID string`

1022 

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

1024 

1025 - `ConnectorID string`

1026 

1027 The connector ID for a ChatGPT workspace connector resource.

1028 

1029 - `ConnectorName string`

1030 

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

1032 

1033 - `Enabled bool`

1034 

1035 Whether the connector is enabled for the role.

1036 

1037 - `Permissions []string`

1038 

1039 The permissions remaining for the role after the change.

1040 

1041 - `ResourceID string`

1042 

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

1044 

1045 - `ResourceType string`

1046 

1047 The type of resource the role was unbound from.

1048 

1049 - `RoleID string`

1050 

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

1052 

1053 - `Source string`

1054 

1055 The connector role mutation path that produced the event.

1056 

1057 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_toggle"`

1058 

1059 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_connector_update"`

1060 

1061 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_delete"`

1062 

1063 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "workspace_permissions"`

1064 

1065 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "connector_publish"`

1066 

1067 - `WorkspaceID string`

1068 

1069 The workspace ID for a ChatGPT workspace connector resource.

1070 

951 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`1071 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`

952 1072 

953 The details for events with this `type`.1073 The details for events with this `type`.


1431 "resource_id": "resource_id",1551 "resource_id": "resource_id",

1432 "resource_type": "resource_type"1552 "resource_type": "resource_type"

1433 },1553 },

1554 "role.bound_to_resource": {

1555 "id": "id",

1556 "connector_id": "connector_id",

1557 "connector_name": "connector_name",

1558 "enabled": true,

1559 "permissions": [

1560 "string"

1561 ],

1562 "resource_id": "resource_id",

1563 "resource_type": "resource_type",

1564 "role_id": "role_id",

1565 "source": "role_toggle",

1566 "workspace_id": "workspace_id"

1567 },

1434 "role.created": {1568 "role.created": {

1435 "id": "id",1569 "id": "id",

1436 "permissions": [1570 "permissions": [


1443 "role.deleted": {1577 "role.deleted": {

1444 "id": "id"1578 "id": "id"

1445 },1579 },

1580 "role.unbound_from_resource": {

1581 "id": "id",

1582 "connector_id": "connector_id",

1583 "connector_name": "connector_name",

1584 "enabled": true,

1585 "permissions": [

1586 "string"

1587 ],

1588 "resource_id": "resource_id",

1589 "resource_type": "resource_type",

1590 "role_id": "role_id",

1591 "source": "role_toggle",

1592 "workspace_id": "workspace_id"

1593 },

1446 "role.updated": {1594 "role.updated": {

1447 "id": "id",1595 "id": "id",

1448 "changes_requested": {1596 "changes_requested": {


1576 1724 

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

1578 1726 

1727 - `ExpiresAt int64`

1728 

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

1730 

1579 - `Object OrganizationAdminAPIKey`1731 - `Object OrganizationAdminAPIKey`

1580 1732 

1581 The object type, which is always `organization.admin_api_key`1733 The object type, which is always `organization.admin_api_key`


1655 {1807 {

1656 "id": "key_abc",1808 "id": "key_abc",

1657 "created_at": 1711471533,1809 "created_at": 1711471533,

1810 "expires_at": 1714063533,

1658 "object": "organization.admin_api_key",1811 "object": "organization.admin_api_key",

1659 "owner": {1812 "owner": {

1660 "id": "sa_456",1813 "id": "sa_456",


1690 1843 

1691 - `Name param.Field[string]`1844 - `Name param.Field[string]`

1692 1845 

1846 - `ExpiresInSeconds param.Field[int64]`

1847 

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

1849 

1693### Returns1850### Returns

1694 1851 

1695- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`1852- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`


1733{1890{

1734 "id": "key_abc",1891 "id": "key_abc",

1735 "created_at": 1711471533,1892 "created_at": 1711471533,

1893 "expires_at": 1714063533,

1736 "object": "organization.admin_api_key",1894 "object": "organization.admin_api_key",

1737 "owner": {1895 "owner": {

1738 "id": "sa_456",1896 "id": "sa_456",


1777 1935 

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

1779 1937 

1938 - `ExpiresAt int64`

1939 

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

1941 

1780 - `Object OrganizationAdminAPIKey`1942 - `Object OrganizationAdminAPIKey`

1781 1943 

1782 The object type, which is always `organization.admin_api_key`1944 The object type, which is always `organization.admin_api_key`


1852{2014{

1853 "id": "key_abc",2015 "id": "key_abc",

1854 "created_at": 1711471533,2016 "created_at": 1711471533,

2017 "expires_at": 1714063533,

1855 "object": "organization.admin_api_key",2018 "object": "organization.admin_api_key",

1856 "owner": {2019 "owner": {

1857 "id": "sa_456",2020 "id": "sa_456",


1944 2107 

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

1946 2109 

2110 - `ExpiresAt int64`

2111 

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

2113 

1947 - `Object OrganizationAdminAPIKey`2114 - `Object OrganizationAdminAPIKey`

1948 2115 

1949 The object type, which is always `organization.admin_api_key`2116 The object type, which is always `organization.admin_api_key`


11807}11974}

11808```11975```

11809 11976 

11977## Retrieve organization spend alert

11978 

11979`client.Admin.Organization.SpendAlerts.Get(ctx, alertID) (*OrganizationSpendAlert, error)`

11980 

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

11982 

11983Retrieves an organization spend alert.

11984 

11985### Parameters

11986 

11987- `alertID string`

11988 

11989### Returns

11990 

11991- `type OrganizationSpendAlert struct{…}`

11992 

11993 Represents a spend alert configured at the organization level.

11994 

11995 - `ID string`

11996 

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

11998 

11999 - `Currency OrganizationSpendAlertCurrency`

12000 

12001 The currency for the threshold amount.

12002 

12003 - `const OrganizationSpendAlertCurrencyUsd OrganizationSpendAlertCurrency = "USD"`

12004 

12005 - `Interval OrganizationSpendAlertInterval`

12006 

12007 The time interval for evaluating spend against the threshold.

12008 

12009 - `const OrganizationSpendAlertIntervalMonth OrganizationSpendAlertInterval = "month"`

12010 

12011 - `NotificationChannel OrganizationSpendAlertNotificationChannel`

12012 

12013 Email notification settings for a spend alert.

12014 

12015 - `Recipients []string`

12016 

12017 Email addresses that receive the spend alert notification.

12018 

12019 - `Type Email`

12020 

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

12022 

12023 - `const EmailEmail Email = "email"`

12024 

12025 - `SubjectPrefix string`

12026 

12027 Optional subject prefix for alert emails.

12028 

12029 - `Object OrganizationSpendAlert`

12030 

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

12032 

12033 - `const OrganizationSpendAlertOrganizationSpendAlert OrganizationSpendAlert = "organization.spend_alert"`

12034 

12035 - `ThresholdAmount int64`

12036 

12037 The alert threshold amount, in cents.

12038 

12039### Example

12040 

12041```go

12042package main

12043 

12044import (

12045 "context"

12046 "fmt"

12047 

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

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

12050)

12051 

12052func main() {

12053 client := openai.NewClient(

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

12055 )

12056 organizationSpendAlert, err := client.Admin.Organization.SpendAlerts.Get(context.TODO(), "alert_id")

12057 if err != nil {

12058 panic(err.Error())

12059 }

12060 fmt.Printf("%+v\n", organizationSpendAlert.ID)

12061}

12062```

12063 

12064#### Response

12065 

12066```json

12067{

12068 "id": "id",

12069 "currency": "USD",

12070 "interval": "month",

12071 "notification_channel": {

12072 "recipients": [

12073 "string"

12074 ],

12075 "type": "email",

12076 "subject_prefix": "subject_prefix"

12077 },

12078 "object": "organization.spend_alert",

12079 "threshold_amount": 0

12080}

12081```

12082 

11810## Update organization spend alert12083## Update organization spend alert

11811 12084 

11812`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`12085`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`


18375}18648}

18376```18649```

18377 18650 

18651## Retrieve project spend alert

18652 

18653`client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)`

18654 

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

18656 

18657Retrieves a project spend alert.

18658 

18659### Parameters

18660 

18661- `projectID string`

18662 

18663- `alertID string`

18664 

18665### Returns

18666 

18667- `type ProjectSpendAlert struct{…}`

18668 

18669 Represents a spend alert configured at the project level.

18670 

18671 - `ID string`

18672 

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

18674 

18675 - `Currency ProjectSpendAlertCurrency`

18676 

18677 The currency for the threshold amount.

18678 

18679 - `const ProjectSpendAlertCurrencyUsd ProjectSpendAlertCurrency = "USD"`

18680 

18681 - `Interval ProjectSpendAlertInterval`

18682 

18683 The time interval for evaluating spend against the threshold.

18684 

18685 - `const ProjectSpendAlertIntervalMonth ProjectSpendAlertInterval = "month"`

18686 

18687 - `NotificationChannel ProjectSpendAlertNotificationChannel`

18688 

18689 Email notification settings for a spend alert.

18690 

18691 - `Recipients []string`

18692 

18693 Email addresses that receive the spend alert notification.

18694 

18695 - `Type Email`

18696 

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

18698 

18699 - `const EmailEmail Email = "email"`

18700 

18701 - `SubjectPrefix string`

18702 

18703 Optional subject prefix for alert emails.

18704 

18705 - `Object ProjectSpendAlert`

18706 

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

18708 

18709 - `const ProjectSpendAlertProjectSpendAlert ProjectSpendAlert = "project.spend_alert"`

18710 

18711 - `ThresholdAmount int64`

18712 

18713 The alert threshold amount, in cents.

18714 

18715### Example

18716 

18717```go

18718package main

18719 

18720import (

18721 "context"

18722 "fmt"

18723 

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

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

18726)

18727 

18728func main() {

18729 client := openai.NewClient(

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

18731 )

18732 projectSpendAlert, err := client.Admin.Organization.Projects.SpendAlerts.Get(

18733 context.TODO(),

18734 "project_id",

18735 "alert_id",

18736 )

18737 if err != nil {

18738 panic(err.Error())

18739 }

18740 fmt.Printf("%+v\n", projectSpendAlert.ID)

18741}

18742```

18743 

18744#### Response

18745 

18746```json

18747{

18748 "id": "id",

18749 "currency": "USD",

18750 "interval": "month",

18751 "notification_channel": {

18752 "recipients": [

18753 "string"

18754 ],

18755 "type": "email",

18756 "subject_prefix": "subject_prefix"

18757 },

18758 "object": "project.spend_alert",

18759 "threshold_amount": 0

18760}

18761```

18762 

18378## Update project spend alert18763## Update project spend alert

18379 18764 

18380`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`18765`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

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

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `query AdminOrganizationAdminAPIKeyListParams`

14 

15 - `After param.Field[string]`

16 

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

18 

19 - `Limit param.Field[int64]`

20 

21 Maximum number of keys to return.

22 

23 - `Order param.Field[AdminOrganizationAdminAPIKeyListParamsOrder]`

24 

25 Order results by creation time, ascending or descending.

26 

27 - `const AdminOrganizationAdminAPIKeyListParamsOrderAsc AdminOrganizationAdminAPIKeyListParamsOrder = "asc"`

28 

29 - `const AdminOrganizationAdminAPIKeyListParamsOrderDesc AdminOrganizationAdminAPIKeyListParamsOrder = "desc"`

30 

31### Returns

32 

33- `type AdminAPIKey struct{…}`

34 

35 Represents an individual Admin API key in an org.

36 

37 - `ID string`

38 

39 The identifier, which can be referenced in API endpoints

40 

41 - `CreatedAt int64`

42 

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

44 

45 - `ExpiresAt int64`

46 

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

48 

49 - `Object OrganizationAdminAPIKey`

50 

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

52 

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

54 

55 - `Owner AdminAPIKeyOwner`

56 

57 - `ID string`

58 

59 The identifier, which can be referenced in API endpoints

60 

61 - `CreatedAt int64`

62 

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

64 

65 - `Name string`

66 

67 The name of the user

68 

69 - `Object string`

70 

71 The object type, which is always organization.user

72 

73 - `Role string`

74 

75 Always `owner`

76 

77 - `Type string`

78 

79 Always `user`

80 

81 - `RedactedValue string`

82 

83 The redacted value of the API key

84 

85 - `LastUsedAt int64`

86 

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

88 

89 - `Name string`

90 

91 The name of the API key

92 

93### Example

94 

95```go

96package main

97 

98import (

99 "context"

100 "fmt"

101 

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

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

104)

105 

106func main() {

107 client := openai.NewClient(

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

109 )

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

111 

112 })

113 if err != nil {

114 panic(err.Error())

115 }

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

117}

118```

119 

120#### Response

121 

122```json

123{

124 "data": [

125 {

126 "id": "key_abc",

127 "created_at": 1711471533,

128 "expires_at": 1714063533,

129 "object": "organization.admin_api_key",

130 "owner": {

131 "id": "sa_456",

132 "created_at": 1711471533,

133 "name": "My Service Account",

134 "object": "organization.user",

135 "role": "owner",

136 "type": "user"

137 },

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

139 "last_used_at": 1711471534,

140 "name": "Administration Key"

141 }

142 ],

143 "has_more": false,

144 "object": "list",

145 "first_id": "key_abc",

146 "last_id": "key_xyz"

147}

148```

149 

150## Create admin API key

151 

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

153 

154**post** `/organization/admin_api_keys`

155 

156Create an organization admin API key

157 

158### Parameters

159 

160- `body AdminOrganizationAdminAPIKeyNewParams`

161 

162 - `Name param.Field[string]`

163 

164 - `ExpiresInSeconds param.Field[int64]`

165 

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

167 

168### Returns

169 

170- `type AdminOrganizationAdminAPIKeyNewResponse struct{…}`

171 

172 Represents an individual Admin API key in an org.

173 

174 - `Value string`

175 

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

177 

178### Example

179 

180```go

181package main

182 

183import (

184 "context"

185 "fmt"

186 

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

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

189)

190 

191func main() {

192 client := openai.NewClient(

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

194 )

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

196 Name: "New Admin Key",

197 })

198 if err != nil {

199 panic(err.Error())

200 }

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

202}

203```

204 

205#### Response

206 

207```json

208{

209 "id": "key_abc",

210 "created_at": 1711471533,

211 "expires_at": 1714063533,

212 "object": "organization.admin_api_key",

213 "owner": {

214 "id": "sa_456",

215 "created_at": 1711471533,

216 "name": "My Service Account",

217 "object": "organization.user",

218 "role": "owner",

219 "type": "user"

220 },

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

222 "last_used_at": 1711471534,

223 "name": "Administration Key",

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

225}

226```

227 

228## Retrieve admin API key

229 

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

231 

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

233 

234Retrieve a single organization API key

235 

236### Parameters

237 

238- `keyID string`

239 

240 The ID of the API key.

241 

242### Returns

243 

244- `type AdminAPIKey struct{…}`

245 

246 Represents an individual Admin API key in an org.

247 

248 - `ID string`

249 

250 The identifier, which can be referenced in API endpoints

251 

252 - `CreatedAt int64`

253 

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

255 

256 - `ExpiresAt int64`

257 

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

259 

260 - `Object OrganizationAdminAPIKey`

261 

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

263 

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

265 

266 - `Owner AdminAPIKeyOwner`

267 

268 - `ID string`

269 

270 The identifier, which can be referenced in API endpoints

271 

272 - `CreatedAt int64`

273 

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

275 

276 - `Name string`

277 

278 The name of the user

279 

280 - `Object string`

281 

282 The object type, which is always organization.user

283 

284 - `Role string`

285 

286 Always `owner`

287 

288 - `Type string`

289 

290 Always `user`

291 

292 - `RedactedValue string`

293 

294 The redacted value of the API key

295 

296 - `LastUsedAt int64`

297 

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

299 

300 - `Name string`

301 

302 The name of the API key

303 

304### Example

305 

306```go

307package main

308 

309import (

310 "context"

311 "fmt"

312 

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

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

315)

316 

317func main() {

318 client := openai.NewClient(

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

320 )

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

322 if err != nil {

323 panic(err.Error())

324 }

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

326}

327```

328 

329#### Response

330 

331```json

332{

333 "id": "key_abc",

334 "created_at": 1711471533,

335 "expires_at": 1714063533,

336 "object": "organization.admin_api_key",

337 "owner": {

338 "id": "sa_456",

339 "created_at": 1711471533,

340 "name": "My Service Account",

341 "object": "organization.user",

342 "role": "owner",

343 "type": "user"

344 },

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

346 "last_used_at": 1711471534,

347 "name": "Administration Key"

348}

349```

350 

351## Delete admin API key

352 

353`client.Admin.Organization.AdminAPIKeys.Delete(ctx, keyID) (*AdminOrganizationAdminAPIKeyDeleteResponse, error)`

354 

355**delete** `/organization/admin_api_keys/{key_id}`

356 

357Delete an organization admin API key

358 

359### Parameters

360 

361- `keyID string`

362 

363 The ID of the API key to be deleted.

364 

365### Returns

366 

367- `type AdminOrganizationAdminAPIKeyDeleteResponse struct{…}`

368 

369 - `ID string`

370 

371 - `Deleted bool`

372 

373 - `Object OrganizationAdminAPIKeyDeleted`

374 

375 - `const OrganizationAdminAPIKeyDeletedOrganizationAdminAPIKeyDeleted OrganizationAdminAPIKeyDeleted = "organization.admin_api_key.deleted"`

376 

377### Example

378 

379```go

380package main

381 

382import (

383 "context"

384 "fmt"

385 

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

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

388)

389 

390func main() {

391 client := openai.NewClient(

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

393 )

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

395 if err != nil {

396 panic(err.Error())

397 }

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

399}

400```

401 

402#### Response

403 

404```json

405{

406 "id": "key_abc",

407 "deleted": true,

408 "object": "organization.admin_api_key.deleted"

409}

410```

411 

412## Domain Types

413 

414### Admin API Key

415 

416- `type AdminAPIKey struct{…}`

417 

418 Represents an individual Admin API key in an org.

419 

420 - `ID string`

421 

422 The identifier, which can be referenced in API endpoints

423 

424 - `CreatedAt int64`

425 

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

427 

428 - `ExpiresAt int64`

429 

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

431 

432 - `Object OrganizationAdminAPIKey`

433 

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

435 

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

437 

438 - `Owner AdminAPIKeyOwner`

439 

440 - `ID string`

441 

442 The identifier, which can be referenced in API endpoints

443 

444 - `CreatedAt int64`

445 

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

447 

448 - `Name string`

449 

450 The name of the user

451 

452 - `Object string`

453 

454 The object type, which is always organization.user

455 

456 - `Role string`

457 

458 Always `owner`

459 

460 - `Type string`

461 

462 Always `user`

463 

464 - `RedactedValue string`

465 

466 The redacted value of the API key

467 

468 - `LastUsedAt int64`

469 

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

471 

472 - `Name string`

473 

474 The name of the API key

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

150 150 

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

152 152 

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

154 

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

156 

153 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`157 - `const AdminOrganizationAuditLogListParamsEventTypeScimEnabled AdminOrganizationAuditLogListParamsEventType = "scim.enabled"`

154 158 

155 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`159 - `const AdminOrganizationAuditLogListParamsEventTypeScimDisabled AdminOrganizationAuditLogListParamsEventType = "scim.disabled"`


176 180 

177 - `ResourceIDs param.Field[[]string]`181 - `ResourceIDs param.Field[[]string]`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185 - `TenantOnly param.Field[bool]`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 


294 302 

295 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`303 - `const AdminOrganizationAuditLogListResponseTypeRoleAssignmentDeleted AdminOrganizationAuditLogListResponseType = "role.assignment.deleted"`

296 304 

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

306 

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

308 

297 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`309 - `const AdminOrganizationAuditLogListResponseTypeScimEnabled AdminOrganizationAuditLogListResponseType = "scim.enabled"`

298 310 

299 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`311 - `const AdminOrganizationAuditLogListResponseTypeScimDisabled AdminOrganizationAuditLogListResponseType = "scim.disabled"`


914 926 

915 The type of resource the role assignment was scoped to.927 The type of resource the role assignment was scoped to.

916 928 

929 - `RoleBoundToResource AdminOrganizationAuditLogListResponseRoleBoundToResource`

930 

931 The details for events with this `type`.

932 

933 - `ID string`

934 

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

936 

937 - `ConnectorID string`

938 

939 The connector ID for a ChatGPT workspace connector resource.

940 

941 - `ConnectorName string`

942 

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

944 

945 - `Enabled bool`

946 

947 Whether the connector is enabled for the role.

948 

949 - `Permissions []string`

950 

951 The permissions granted to the role for the resource.

952 

953 - `ResourceID string`

954 

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

956 

957 - `ResourceType string`

958 

959 The type of resource the role was bound to.

960 

961 - `RoleID string`

962 

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

964 

965 - `Source string`

966 

967 The connector role mutation path that produced the event.

968 

969 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_toggle"`

970 

971 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_connector_update"`

972 

973 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "role_delete"`

974 

975 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "workspace_permissions"`

976 

977 - `const AdminOrganizationAuditLogListResponseRoleBoundToResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleBoundToResourceSource = "connector_publish"`

978 

979 - `WorkspaceID string`

980 

981 The workspace ID for a ChatGPT workspace connector resource.

982 

917 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`983 - `RoleCreated AdminOrganizationAuditLogListResponseRoleCreated`

918 984 

919 The details for events with this `type`.985 The details for events with this `type`.


946 1012 

947 The role ID.1013 The role ID.

948 1014 

1015 - `RoleUnboundFromResource AdminOrganizationAuditLogListResponseRoleUnboundFromResource`

1016 

1017 The details for events with this `type`.

1018 

1019 - `ID string`

1020 

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

1022 

1023 - `ConnectorID string`

1024 

1025 The connector ID for a ChatGPT workspace connector resource.

1026 

1027 - `ConnectorName string`

1028 

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

1030 

1031 - `Enabled bool`

1032 

1033 Whether the connector is enabled for the role.

1034 

1035 - `Permissions []string`

1036 

1037 The permissions remaining for the role after the change.

1038 

1039 - `ResourceID string`

1040 

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

1042 

1043 - `ResourceType string`

1044 

1045 The type of resource the role was unbound from.

1046 

1047 - `RoleID string`

1048 

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

1050 

1051 - `Source string`

1052 

1053 The connector role mutation path that produced the event.

1054 

1055 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleToggle AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_toggle"`

1056 

1057 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleConnectorUpdate AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_connector_update"`

1058 

1059 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceRoleDelete AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "role_delete"`

1060 

1061 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceWorkspacePermissions AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "workspace_permissions"`

1062 

1063 - `const AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSourceConnectorPublish AdminOrganizationAuditLogListResponseRoleUnboundFromResourceSource = "connector_publish"`

1064 

1065 - `WorkspaceID string`

1066 

1067 The workspace ID for a ChatGPT workspace connector resource.

1068 

949 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`1069 - `RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdated`

950 1070 

951 The details for events with this `type`.1071 The details for events with this `type`.


1429 "resource_id": "resource_id",1549 "resource_id": "resource_id",

1430 "resource_type": "resource_type"1550 "resource_type": "resource_type"

1431 },1551 },

1552 "role.bound_to_resource": {

1553 "id": "id",

1554 "connector_id": "connector_id",

1555 "connector_name": "connector_name",

1556 "enabled": true,

1557 "permissions": [

1558 "string"

1559 ],

1560 "resource_id": "resource_id",

1561 "resource_type": "resource_type",

1562 "role_id": "role_id",

1563 "source": "role_toggle",

1564 "workspace_id": "workspace_id"

1565 },

1432 "role.created": {1566 "role.created": {

1433 "id": "id",1567 "id": "id",

1434 "permissions": [1568 "permissions": [


1441 "role.deleted": {1575 "role.deleted": {

1442 "id": "id"1576 "id": "id"

1443 },1577 },

1578 "role.unbound_from_resource": {

1579 "id": "id",

1580 "connector_id": "connector_id",

1581 "connector_name": "connector_name",

1582 "enabled": true,

1583 "permissions": [

1584 "string"

1585 ],

1586 "resource_id": "resource_id",

1587 "resource_type": "resource_type",

1588 "role_id": "role_id",

1589 "source": "role_toggle",

1590 "workspace_id": "workspace_id"

1591 },

1444 "role.updated": {1592 "role.updated": {

1445 "id": "id",1593 "id": "id",

1446 "changes_requested": {1594 "changes_requested": {

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

5485}5485}

5486```5486```

5487 5487 

5488## Retrieve project spend alert

5489 

5490`client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)`

5491 

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

5493 

5494Retrieves a project spend alert.

5495 

5496### Parameters

5497 

5498- `projectID string`

5499 

5500- `alertID string`

5501 

5502### Returns

5503 

5504- `type ProjectSpendAlert struct{…}`

5505 

5506 Represents a spend alert configured at the project level.

5507 

5508 - `ID string`

5509 

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

5511 

5512 - `Currency ProjectSpendAlertCurrency`

5513 

5514 The currency for the threshold amount.

5515 

5516 - `const ProjectSpendAlertCurrencyUsd ProjectSpendAlertCurrency = "USD"`

5517 

5518 - `Interval ProjectSpendAlertInterval`

5519 

5520 The time interval for evaluating spend against the threshold.

5521 

5522 - `const ProjectSpendAlertIntervalMonth ProjectSpendAlertInterval = "month"`

5523 

5524 - `NotificationChannel ProjectSpendAlertNotificationChannel`

5525 

5526 Email notification settings for a spend alert.

5527 

5528 - `Recipients []string`

5529 

5530 Email addresses that receive the spend alert notification.

5531 

5532 - `Type Email`

5533 

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

5535 

5536 - `const EmailEmail Email = "email"`

5537 

5538 - `SubjectPrefix string`

5539 

5540 Optional subject prefix for alert emails.

5541 

5542 - `Object ProjectSpendAlert`

5543 

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

5545 

5546 - `const ProjectSpendAlertProjectSpendAlert ProjectSpendAlert = "project.spend_alert"`

5547 

5548 - `ThresholdAmount int64`

5549 

5550 The alert threshold amount, in cents.

5551 

5552### Example

5553 

5554```go

5555package main

5556 

5557import (

5558 "context"

5559 "fmt"

5560 

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

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

5563)

5564 

5565func main() {

5566 client := openai.NewClient(

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

5568 )

5569 projectSpendAlert, err := client.Admin.Organization.Projects.SpendAlerts.Get(

5570 context.TODO(),

5571 "project_id",

5572 "alert_id",

5573 )

5574 if err != nil {

5575 panic(err.Error())

5576 }

5577 fmt.Printf("%+v\n", projectSpendAlert.ID)

5578}

5579```

5580 

5581#### Response

5582 

5583```json

5584{

5585 "id": "id",

5586 "currency": "USD",

5587 "interval": "month",

5588 "notification_channel": {

5589 "recipients": [

5590 "string"

5591 ],

5592 "type": "email",

5593 "subject_prefix": "subject_prefix"

5594 },

5595 "object": "project.spend_alert",

5596 "threshold_amount": 0

5597}

5598```

5599 

5488## Update project spend alert5600## Update project spend alert

5489 5601 

5490`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`5602`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`

Details

295}295}

296```296```

297 297 

298## Retrieve project spend alert

299 

300`client.Admin.Organization.Projects.SpendAlerts.Get(ctx, projectID, alertID) (*ProjectSpendAlert, error)`

301 

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

303 

304Retrieves a project spend alert.

305 

306### Parameters

307 

308- `projectID string`

309 

310- `alertID string`

311 

312### Returns

313 

314- `type ProjectSpendAlert struct{…}`

315 

316 Represents a spend alert configured at the project level.

317 

318 - `ID string`

319 

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

321 

322 - `Currency ProjectSpendAlertCurrency`

323 

324 The currency for the threshold amount.

325 

326 - `const ProjectSpendAlertCurrencyUsd ProjectSpendAlertCurrency = "USD"`

327 

328 - `Interval ProjectSpendAlertInterval`

329 

330 The time interval for evaluating spend against the threshold.

331 

332 - `const ProjectSpendAlertIntervalMonth ProjectSpendAlertInterval = "month"`

333 

334 - `NotificationChannel ProjectSpendAlertNotificationChannel`

335 

336 Email notification settings for a spend alert.

337 

338 - `Recipients []string`

339 

340 Email addresses that receive the spend alert notification.

341 

342 - `Type Email`

343 

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

345 

346 - `const EmailEmail Email = "email"`

347 

348 - `SubjectPrefix string`

349 

350 Optional subject prefix for alert emails.

351 

352 - `Object ProjectSpendAlert`

353 

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

355 

356 - `const ProjectSpendAlertProjectSpendAlert ProjectSpendAlert = "project.spend_alert"`

357 

358 - `ThresholdAmount int64`

359 

360 The alert threshold amount, in cents.

361 

362### Example

363 

364```go

365package main

366 

367import (

368 "context"

369 "fmt"

370 

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

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

373)

374 

375func main() {

376 client := openai.NewClient(

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

378 )

379 projectSpendAlert, err := client.Admin.Organization.Projects.SpendAlerts.Get(

380 context.TODO(),

381 "project_id",

382 "alert_id",

383 )

384 if err != nil {

385 panic(err.Error())

386 }

387 fmt.Printf("%+v\n", projectSpendAlert.ID)

388}

389```

390 

391#### Response

392 

393```json

394{

395 "id": "id",

396 "currency": "USD",

397 "interval": "month",

398 "notification_channel": {

399 "recipients": [

400 "string"

401 ],

402 "type": "email",

403 "subject_prefix": "subject_prefix"

404 },

405 "object": "project.spend_alert",

406 "threshold_amount": 0

407}

408```

409 

298## Update project spend alert410## Update project spend alert

299 411 

300`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`412`client.Admin.Organization.Projects.SpendAlerts.Update(ctx, projectID, alertID, body) (*ProjectSpendAlert, error)`

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

283}283}

284```284```

285 285 

286## Retrieve organization spend alert

287 

288`client.Admin.Organization.SpendAlerts.Get(ctx, alertID) (*OrganizationSpendAlert, error)`

289 

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

291 

292Retrieves an organization spend alert.

293 

294### Parameters

295 

296- `alertID string`

297 

298### Returns

299 

300- `type OrganizationSpendAlert struct{…}`

301 

302 Represents a spend alert configured at the organization level.

303 

304 - `ID string`

305 

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

307 

308 - `Currency OrganizationSpendAlertCurrency`

309 

310 The currency for the threshold amount.

311 

312 - `const OrganizationSpendAlertCurrencyUsd OrganizationSpendAlertCurrency = "USD"`

313 

314 - `Interval OrganizationSpendAlertInterval`

315 

316 The time interval for evaluating spend against the threshold.

317 

318 - `const OrganizationSpendAlertIntervalMonth OrganizationSpendAlertInterval = "month"`

319 

320 - `NotificationChannel OrganizationSpendAlertNotificationChannel`

321 

322 Email notification settings for a spend alert.

323 

324 - `Recipients []string`

325 

326 Email addresses that receive the spend alert notification.

327 

328 - `Type Email`

329 

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

331 

332 - `const EmailEmail Email = "email"`

333 

334 - `SubjectPrefix string`

335 

336 Optional subject prefix for alert emails.

337 

338 - `Object OrganizationSpendAlert`

339 

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

341 

342 - `const OrganizationSpendAlertOrganizationSpendAlert OrganizationSpendAlert = "organization.spend_alert"`

343 

344 - `ThresholdAmount int64`

345 

346 The alert threshold amount, in cents.

347 

348### Example

349 

350```go

351package main

352 

353import (

354 "context"

355 "fmt"

356 

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

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

359)

360 

361func main() {

362 client := openai.NewClient(

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

364 )

365 organizationSpendAlert, err := client.Admin.Organization.SpendAlerts.Get(context.TODO(), "alert_id")

366 if err != nil {

367 panic(err.Error())

368 }

369 fmt.Printf("%+v\n", organizationSpendAlert.ID)

370}

371```

372 

373#### Response

374 

375```json

376{

377 "id": "id",

378 "currency": "USD",

379 "interval": "month",

380 "notification_channel": {

381 "recipients": [

382 "string"

383 ],

384 "type": "email",

385 "subject_prefix": "subject_prefix"

386 },

387 "object": "organization.spend_alert",

388 "threshold_amount": 0

389}

390```

391 

286## Update organization spend alert392## Update organization spend alert

287 393 

288`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`394`client.Admin.Organization.SpendAlerts.Update(ctx, alertID, body) (*OrganizationSpendAlert, error)`

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

8332 Configuration options for8332 Configuration options for

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

8334 8334 

8335 - `Context ReasoningContext`

8336 

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

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

8339 used for the response.

8340 

8341 - `const ReasoningContextAuto ReasoningContext = "auto"`

8342 

8343 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

8344 

8345 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

8346 

8335 - `Effort ReasoningEffort`8347 - `Effort ReasoningEffort`

8336 8348 

8337 Constrains effort on reasoning for8349 Constrains effort on reasoning for


8739 "prompt_cache_key": "prompt-cache-key-1234",8751 "prompt_cache_key": "prompt-cache-key-1234",

8740 "prompt_cache_retention": "in_memory",8752 "prompt_cache_retention": "in_memory",

8741 "reasoning": {8753 "reasoning": {

8754 "context": "auto",

8742 "effort": "none",8755 "effort": "none",

8743 "generate_summary": "auto",8756 "generate_summary": "auto",

8744 "summary": "auto"8757 "summary": "auto"


13601 Configuration options for13614 Configuration options for

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

13603 13616 

13617 - `Context ReasoningContext`

13618 

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

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

13621 used for the response.

13622 

13623 - `const ReasoningContextAuto ReasoningContext = "auto"`

13624 

13625 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

13626 

13627 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

13628 

13604 - `Effort ReasoningEffort`13629 - `Effort ReasoningEffort`

13605 13630 

13606 Constrains effort on reasoning for13631 Constrains effort on reasoning for


14012 "prompt_cache_key": "prompt-cache-key-1234",14037 "prompt_cache_key": "prompt-cache-key-1234",

14013 "prompt_cache_retention": "in_memory",14038 "prompt_cache_retention": "in_memory",

14014 "reasoning": {14039 "reasoning": {

14040 "context": "auto",

14015 "effort": "none",14041 "effort": "none",

14016 "generate_summary": "auto",14042 "generate_summary": "auto",

14017 "summary": "auto"14043 "summary": "auto"


18872 Configuration options for18898 Configuration options for

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

18874 18900 

18901 - `Context ReasoningContext`

18902 

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

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

18905 used for the response.

18906 

18907 - `const ReasoningContextAuto ReasoningContext = "auto"`

18908 

18909 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

18910 

18911 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

18912 

18875 - `Effort ReasoningEffort`18913 - `Effort ReasoningEffort`

18876 18914 

18877 Constrains effort on reasoning for18915 Constrains effort on reasoning for


19276 "prompt_cache_key": "prompt-cache-key-1234",19314 "prompt_cache_key": "prompt-cache-key-1234",

19277 "prompt_cache_retention": "in_memory",19315 "prompt_cache_retention": "in_memory",

19278 "reasoning": {19316 "reasoning": {

19317 "context": "auto",

19279 "effort": "none",19318 "effort": "none",

19280 "generate_summary": "auto",19319 "generate_summary": "auto",

19281 "summary": "auto"19320 "summary": "auto"


34735 Configuration options for34774 Configuration options for

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

34737 34776 

34777 - `Context ReasoningContext`

34778 

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

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

34781 used for the response.

34782 

34783 - `const ReasoningContextAuto ReasoningContext = "auto"`

34784 

34785 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

34786 

34787 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

34788 

34738 - `Effort ReasoningEffort`34789 - `Effort ReasoningEffort`

34739 34790 

34740 Constrains effort on reasoning for34791 Constrains effort on reasoning for


40209 Configuration options for40260 Configuration options for

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

40211 40262 

40263 - `Context ReasoningContext`

40264 

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

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

40267 used for the response.

40268 

40269 - `const ReasoningContextAuto ReasoningContext = "auto"`

40270 

40271 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

40272 

40273 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

40274 

40212 - `Effort ReasoningEffort`40275 - `Effort ReasoningEffort`

40213 40276 

40214 Constrains effort on reasoning for40277 Constrains effort on reasoning for


46431 Configuration options for46494 Configuration options for

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

46433 46496 

46497 - `Context ReasoningContext`

46498 

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

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

46501 used for the response.

46502 

46503 - `const ReasoningContextAuto ReasoningContext = "auto"`

46504 

46505 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

46506 

46507 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

46508 

46434 - `Effort ReasoningEffort`46509 - `Effort ReasoningEffort`

46435 46510 

46436 Constrains effort on reasoning for46511 Constrains effort on reasoning for


51803 Configuration options for51878 Configuration options for

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

51805 51880 

51881 - `Context ReasoningContext`

51882 

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

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

51885 used for the response.

51886 

51887 - `const ReasoningContextAuto ReasoningContext = "auto"`

51888 

51889 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

51890 

51891 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

51892 

51806 - `Effort ReasoningEffort`51893 - `Effort ReasoningEffort`

51807 51894 

51808 Constrains effort on reasoning for51895 Constrains effort on reasoning for


57921 Configuration options for58008 Configuration options for

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

57923 58010 

58011 - `Context ReasoningContext`

58012 

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

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

58015 used for the response.

58016 

58017 - `const ReasoningContextAuto ReasoningContext = "auto"`

58018 

58019 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

58020 

58021 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

58022 

57924 - `Effort ReasoningEffort`58023 - `Effort ReasoningEffort`

57925 58024 

57926 Constrains effort on reasoning for58025 Constrains effort on reasoning for


62999 Configuration options for63098 Configuration options for

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

63001 63100 

63101 - `Context ReasoningContext`

63102 

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

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

63105 used for the response.

63106 

63107 - `const ReasoningContextAuto ReasoningContext = "auto"`

63108 

63109 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

63110 

63111 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

63112 

63002 - `Effort ReasoningEffort`63113 - `Effort ReasoningEffort`

63003 63114 

63004 Constrains effort on reasoning for63115 Constrains effort on reasoning for


87002 Configuration options for87113 Configuration options for

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

87004 87115 

87116 - `Context ReasoningContext`

87117 

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

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

87120 used for the response.

87121 

87122 - `const ReasoningContextAuto ReasoningContext = "auto"`

87123 

87124 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

87125 

87126 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

87127 

87005 - `Effort ReasoningEffort`87128 - `Effort ReasoningEffort`

87006 87129 

87007 Constrains effort on reasoning for87130 Constrains effort on reasoning for


92593 Configuration options for92716 Configuration options for

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

92595 92718 

92719 - `Context ReasoningContext`

92720 

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

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

92723 used for the response.

92724 

92725 - `const ReasoningContextAuto ReasoningContext = "auto"`

92726 

92727 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

92728 

92729 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

92730 

92596 - `Effort ReasoningEffort`92731 - `Effort ReasoningEffort`

92597 92732 

92598 Constrains effort on reasoning for92733 Constrains effort on reasoning for


99918 Configuration options for100053 Configuration options for

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

99920 100055 

100056 - `Context ReasoningContext`

100057 

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

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

100060 used for the response.

100061 

100062 - `const ReasoningContextAuto ReasoningContext = "auto"`

100063 

100064 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

100065 

100066 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

100067 

99921 - `Effort ReasoningEffort`100068 - `Effort ReasoningEffort`

99922 100069 

99923 Constrains effort on reasoning for100070 Constrains effort on reasoning for


105374 Configuration options for105521 Configuration options for

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

105376 105523 

105524 - `Context ReasoningContext`

105525 

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

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

105528 used for the response.

105529 

105530 - `const ReasoningContextAuto ReasoningContext = "auto"`

105531 

105532 - `const ReasoningContextCurrentTurn ReasoningContext = "current_turn"`

105533 

105534 - `const ReasoningContextAllTurns ReasoningContext = "all_turns"`

105535 

105377 - `Effort ReasoningEffort`105536 - `Effort ReasoningEffort`

105378 105537 

105379 Constrains effort on reasoning for105538 Constrains effort on reasoning for

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

264 264 

265 - `type VideoEditParamsVideoVideoReferenceInputParam struct{…}`265 - `type VideoEditParamsVideoVideoReferenceInputParam struct{…}`

266 266 

267 Reference to the completed video.267 Reference to the completed video to edit.

268 268 

269 - `ID string`269 - `ID string`

270 270 

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

154 154 

155 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`155 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

156 156 

157 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

158 

159 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

160 

157 - `SCIM_ENABLED("scim.enabled")`161 - `SCIM_ENABLED("scim.enabled")`

158 162 

159 - `SCIM_DISABLED("scim.disabled")`163 - `SCIM_DISABLED("scim.disabled")`


180 184 

181 - `Optional<List<String>> resourceIds`185 - `Optional<List<String>> resourceIds`

182 186 

183 Return only events performed on these targets. For example, a project ID updated.187 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>`.

188 

189 - `Optional<Boolean> tenantOnly`

190 

191 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.

184 192 

185### Returns193### Returns

186 194 


298 306 

299 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`307 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

300 308 

309 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

310 

311 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

312 

301 - `SCIM_ENABLED("scim.enabled")`313 - `SCIM_ENABLED("scim.enabled")`

302 314 

303 - `SCIM_DISABLED("scim.disabled")`315 - `SCIM_DISABLED("scim.disabled")`


918 930 

919 The type of resource the role assignment was scoped to.931 The type of resource the role assignment was scoped to.

920 932 

933 - `Optional<RoleBoundToResource> roleBoundToResource`

934 

935 The details for events with this `type`.

936 

937 - `Optional<String> id`

938 

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

940 

941 - `Optional<String> connectorId`

942 

943 The connector ID for a ChatGPT workspace connector resource.

944 

945 - `Optional<String> connectorName`

946 

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

948 

949 - `Optional<Boolean> enabled`

950 

951 Whether the connector is enabled for the role.

952 

953 - `Optional<List<String>> permissions`

954 

955 The permissions granted to the role for the resource.

956 

957 - `Optional<String> resourceId`

958 

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

960 

961 - `Optional<String> resourceType`

962 

963 The type of resource the role was bound to.

964 

965 - `Optional<String> roleId`

966 

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

968 

969 - `Optional<Source> source`

970 

971 The connector role mutation path that produced the event.

972 

973 - `ROLE_TOGGLE("role_toggle")`

974 

975 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

976 

977 - `ROLE_DELETE("role_delete")`

978 

979 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

980 

981 - `CONNECTOR_PUBLISH("connector_publish")`

982 

983 - `Optional<String> workspaceId`

984 

985 The workspace ID for a ChatGPT workspace connector resource.

986 

921 - `Optional<RoleCreated> roleCreated`987 - `Optional<RoleCreated> roleCreated`

922 988 

923 The details for events with this `type`.989 The details for events with this `type`.


950 1016 

951 The role ID.1017 The role ID.

952 1018 

1019 - `Optional<RoleUnboundFromResource> roleUnboundFromResource`

1020 

1021 The details for events with this `type`.

1022 

1023 - `Optional<String> id`

1024 

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

1026 

1027 - `Optional<String> connectorId`

1028 

1029 The connector ID for a ChatGPT workspace connector resource.

1030 

1031 - `Optional<String> connectorName`

1032 

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

1034 

1035 - `Optional<Boolean> enabled`

1036 

1037 Whether the connector is enabled for the role.

1038 

1039 - `Optional<List<String>> permissions`

1040 

1041 The permissions remaining for the role after the change.

1042 

1043 - `Optional<String> resourceId`

1044 

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

1046 

1047 - `Optional<String> resourceType`

1048 

1049 The type of resource the role was unbound from.

1050 

1051 - `Optional<String> roleId`

1052 

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

1054 

1055 - `Optional<Source> source`

1056 

1057 The connector role mutation path that produced the event.

1058 

1059 - `ROLE_TOGGLE("role_toggle")`

1060 

1061 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

1062 

1063 - `ROLE_DELETE("role_delete")`

1064 

1065 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

1066 

1067 - `CONNECTOR_PUBLISH("connector_publish")`

1068 

1069 - `Optional<String> workspaceId`

1070 

1071 The workspace ID for a ChatGPT workspace connector resource.

1072 

953 - `Optional<RoleUpdated> roleUpdated`1073 - `Optional<RoleUpdated> roleUpdated`

954 1074 

955 The details for events with this `type`.1075 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": {


1572 1720 

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

1574 1722 

1723 - `Optional<Long> expiresAt`

1724 

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

1726 

1575 - `JsonValue; object_ "organization.admin_api_key"constant`1727 - `JsonValue; object_ "organization.admin_api_key"constant`

1576 1728 

1577 The object type, which is always `organization.admin_api_key`1729 The object type, which is always `organization.admin_api_key`


1645 {1797 {

1646 "id": "key_abc",1798 "id": "key_abc",

1647 "created_at": 1711471533,1799 "created_at": 1711471533,

1800 "expires_at": 1714063533,

1648 "object": "organization.admin_api_key",1801 "object": "organization.admin_api_key",

1649 "owner": {1802 "owner": {

1650 "id": "sa_456",1803 "id": "sa_456",


1680 1833 

1681 - `String name`1834 - `String name`

1682 1835 

1836 - `Optional<Long> expiresInSeconds`

1837 

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

1839 

1683### Returns1840### Returns

1684 1841 

1685- `class AdminApiKeyCreateResponse:`1842- `class AdminApiKeyCreateResponse:`


1720{1877{

1721 "id": "key_abc",1878 "id": "key_abc",

1722 "created_at": 1711471533,1879 "created_at": 1711471533,

1880 "expires_at": 1714063533,

1723 "object": "organization.admin_api_key",1881 "object": "organization.admin_api_key",

1724 "owner": {1882 "owner": {

1725 "id": "sa_456",1883 "id": "sa_456",


1766 1924 

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

1768 1926 

1927 - `Optional<Long> expiresAt`

1928 

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

1930 

1769 - `JsonValue; object_ "organization.admin_api_key"constant`1931 - `JsonValue; object_ "organization.admin_api_key"constant`

1770 1932 

1771 The object type, which is always `organization.admin_api_key`1933 The object type, which is always `organization.admin_api_key`


1837{1999{

1838 "id": "key_abc",2000 "id": "key_abc",

1839 "created_at": 1711471533,2001 "created_at": 1711471533,

2002 "expires_at": 1714063533,

1840 "object": "organization.admin_api_key",2003 "object": "organization.admin_api_key",

1841 "owner": {2004 "owner": {

1842 "id": "sa_456",2005 "id": "sa_456",


1927 2090 

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

1929 2092 

2093 - `Optional<Long> expiresAt`

2094 

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

2096 

1930 - `JsonValue; object_ "organization.admin_api_key"constant`2097 - `JsonValue; object_ "organization.admin_api_key"constant`

1931 2098 

1932 The object type, which is always `organization.admin_api_key`2099 The object type, which is always `organization.admin_api_key`


11610}11777}

11611```11778```

11612 11779 

11780## Retrieve organization spend alert

11781 

11782`OrganizationSpendAlert admin().organization().spendAlerts().retrieve(SpendAlertRetrieveParamsparams = SpendAlertRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

11783 

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

11785 

11786Retrieves an organization spend alert.

11787 

11788### Parameters

11789 

11790- `SpendAlertRetrieveParams params`

11791 

11792 - `Optional<String> alertId`

11793 

11794### Returns

11795 

11796- `class OrganizationSpendAlert:`

11797 

11798 Represents a spend alert configured at the organization level.

11799 

11800 - `String id`

11801 

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

11803 

11804 - `Currency currency`

11805 

11806 The currency for the threshold amount.

11807 

11808 - `USD("USD")`

11809 

11810 - `Interval interval`

11811 

11812 The time interval for evaluating spend against the threshold.

11813 

11814 - `MONTH("month")`

11815 

11816 - `NotificationChannel notificationChannel`

11817 

11818 Email notification settings for a spend alert.

11819 

11820 - `List<String> recipients`

11821 

11822 Email addresses that receive the spend alert notification.

11823 

11824 - `JsonValue; type "email"constant`

11825 

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

11827 

11828 - `EMAIL("email")`

11829 

11830 - `Optional<String> subjectPrefix`

11831 

11832 Optional subject prefix for alert emails.

11833 

11834 - `JsonValue; object_ "organization.spend_alert"constant`

11835 

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

11837 

11838 - `ORGANIZATION_SPEND_ALERT("organization.spend_alert")`

11839 

11840 - `long thresholdAmount`

11841 

11842 The alert threshold amount, in cents.

11843 

11844### Example

11845 

11846```java

11847package com.openai.example;

11848 

11849import com.openai.client.OpenAIClient;

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

11851import com.openai.models.admin.organization.spendalerts.OrganizationSpendAlert;

11852import com.openai.models.admin.organization.spendalerts.SpendAlertRetrieveParams;

11853 

11854public final class Main {

11855 private Main() {}

11856 

11857 public static void main(String[] args) {

11858 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

11859 

11860 OrganizationSpendAlert organizationSpendAlert = client.admin().organization().spendAlerts().retrieve("alert_id");

11861 }

11862}

11863```

11864 

11865#### Response

11866 

11867```json

11868{

11869 "id": "id",

11870 "currency": "USD",

11871 "interval": "month",

11872 "notification_channel": {

11873 "recipients": [

11874 "string"

11875 ],

11876 "type": "email",

11877 "subject_prefix": "subject_prefix"

11878 },

11879 "object": "organization.spend_alert",

11880 "threshold_amount": 0

11881}

11882```

11883 

11613## Update organization spend alert11884## Update organization spend alert

11614 11885 

11615`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`11886`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`


17893}18164}

17894```18165```

17895 18166 

18167## Retrieve project spend alert

18168 

18169`ProjectSpendAlert admin().organization().projects().spendAlerts().retrieve(SpendAlertRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

18170 

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

18172 

18173Retrieves a project spend alert.

18174 

18175### Parameters

18176 

18177- `SpendAlertRetrieveParams params`

18178 

18179 - `String projectId`

18180 

18181 - `Optional<String> alertId`

18182 

18183### Returns

18184 

18185- `class ProjectSpendAlert:`

18186 

18187 Represents a spend alert configured at the project level.

18188 

18189 - `String id`

18190 

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

18192 

18193 - `Currency currency`

18194 

18195 The currency for the threshold amount.

18196 

18197 - `USD("USD")`

18198 

18199 - `Interval interval`

18200 

18201 The time interval for evaluating spend against the threshold.

18202 

18203 - `MONTH("month")`

18204 

18205 - `NotificationChannel notificationChannel`

18206 

18207 Email notification settings for a spend alert.

18208 

18209 - `List<String> recipients`

18210 

18211 Email addresses that receive the spend alert notification.

18212 

18213 - `JsonValue; type "email"constant`

18214 

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

18216 

18217 - `EMAIL("email")`

18218 

18219 - `Optional<String> subjectPrefix`

18220 

18221 Optional subject prefix for alert emails.

18222 

18223 - `JsonValue; object_ "project.spend_alert"constant`

18224 

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

18226 

18227 - `PROJECT_SPEND_ALERT("project.spend_alert")`

18228 

18229 - `long thresholdAmount`

18230 

18231 The alert threshold amount, in cents.

18232 

18233### Example

18234 

18235```java

18236package com.openai.example;

18237 

18238import com.openai.client.OpenAIClient;

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

18240import com.openai.models.admin.organization.projects.spendalerts.ProjectSpendAlert;

18241import com.openai.models.admin.organization.projects.spendalerts.SpendAlertRetrieveParams;

18242 

18243public final class Main {

18244 private Main() {}

18245 

18246 public static void main(String[] args) {

18247 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

18248 

18249 SpendAlertRetrieveParams params = SpendAlertRetrieveParams.builder()

18250 .projectId("project_id")

18251 .alertId("alert_id")

18252 .build();

18253 ProjectSpendAlert projectSpendAlert = client.admin().organization().projects().spendAlerts().retrieve(params);

18254 }

18255}

18256```

18257 

18258#### Response

18259 

18260```json

18261{

18262 "id": "id",

18263 "currency": "USD",

18264 "interval": "month",

18265 "notification_channel": {

18266 "recipients": [

18267 "string"

18268 ],

18269 "type": "email",

18270 "subject_prefix": "subject_prefix"

18271 },

18272 "object": "project.spend_alert",

18273 "threshold_amount": 0

18274}

18275```

18276 

17896## Update project spend alert18277## Update project spend alert

17897 18278 

17898`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`18279`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

Details

152 152 

153 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`153 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

154 154 

155 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

156 

157 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

158 

155 - `SCIM_ENABLED("scim.enabled")`159 - `SCIM_ENABLED("scim.enabled")`

156 160 

157 - `SCIM_DISABLED("scim.disabled")`161 - `SCIM_DISABLED("scim.disabled")`


178 182 

179 - `Optional<List<String>> resourceIds`183 - `Optional<List<String>> resourceIds`

180 184 

181 Return only events performed on these targets. For example, a project ID updated.185 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>`.

186 

187 - `Optional<Boolean> tenantOnly`

188 

189 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.

182 190 

183### Returns191### Returns

184 192 


296 304 

297 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`305 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

298 306 

307 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

308 

309 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

310 

299 - `SCIM_ENABLED("scim.enabled")`311 - `SCIM_ENABLED("scim.enabled")`

300 312 

301 - `SCIM_DISABLED("scim.disabled")`313 - `SCIM_DISABLED("scim.disabled")`


916 928 

917 The type of resource the role assignment was scoped to.929 The type of resource the role assignment was scoped to.

918 930 

931 - `Optional<RoleBoundToResource> roleBoundToResource`

932 

933 The details for events with this `type`.

934 

935 - `Optional<String> id`

936 

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

938 

939 - `Optional<String> connectorId`

940 

941 The connector ID for a ChatGPT workspace connector resource.

942 

943 - `Optional<String> connectorName`

944 

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

946 

947 - `Optional<Boolean> enabled`

948 

949 Whether the connector is enabled for the role.

950 

951 - `Optional<List<String>> permissions`

952 

953 The permissions granted to the role for the resource.

954 

955 - `Optional<String> resourceId`

956 

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

958 

959 - `Optional<String> resourceType`

960 

961 The type of resource the role was bound to.

962 

963 - `Optional<String> roleId`

964 

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

966 

967 - `Optional<Source> source`

968 

969 The connector role mutation path that produced the event.

970 

971 - `ROLE_TOGGLE("role_toggle")`

972 

973 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

974 

975 - `ROLE_DELETE("role_delete")`

976 

977 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

978 

979 - `CONNECTOR_PUBLISH("connector_publish")`

980 

981 - `Optional<String> workspaceId`

982 

983 The workspace ID for a ChatGPT workspace connector resource.

984 

919 - `Optional<RoleCreated> roleCreated`985 - `Optional<RoleCreated> roleCreated`

920 986 

921 The details for events with this `type`.987 The details for events with this `type`.


948 1014 

949 The role ID.1015 The role ID.

950 1016 

1017 - `Optional<RoleUnboundFromResource> roleUnboundFromResource`

1018 

1019 The details for events with this `type`.

1020 

1021 - `Optional<String> id`

1022 

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

1024 

1025 - `Optional<String> connectorId`

1026 

1027 The connector ID for a ChatGPT workspace connector resource.

1028 

1029 - `Optional<String> connectorName`

1030 

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

1032 

1033 - `Optional<Boolean> enabled`

1034 

1035 Whether the connector is enabled for the role.

1036 

1037 - `Optional<List<String>> permissions`

1038 

1039 The permissions remaining for the role after the change.

1040 

1041 - `Optional<String> resourceId`

1042 

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

1044 

1045 - `Optional<String> resourceType`

1046 

1047 The type of resource the role was unbound from.

1048 

1049 - `Optional<String> roleId`

1050 

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

1052 

1053 - `Optional<Source> source`

1054 

1055 The connector role mutation path that produced the event.

1056 

1057 - `ROLE_TOGGLE("role_toggle")`

1058 

1059 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

1060 

1061 - `ROLE_DELETE("role_delete")`

1062 

1063 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

1064 

1065 - `CONNECTOR_PUBLISH("connector_publish")`

1066 

1067 - `Optional<String> workspaceId`

1068 

1069 The workspace ID for a ChatGPT workspace connector resource.

1070 

951 - `Optional<RoleUpdated> roleUpdated`1071 - `Optional<RoleUpdated> roleUpdated`

952 1072 

953 The details for events with this `type`.1073 The details for events with this `type`.


1425 "resource_id": "resource_id",1545 "resource_id": "resource_id",

1426 "resource_type": "resource_type"1546 "resource_type": "resource_type"

1427 },1547 },

1548 "role.bound_to_resource": {

1549 "id": "id",

1550 "connector_id": "connector_id",

1551 "connector_name": "connector_name",

1552 "enabled": true,

1553 "permissions": [

1554 "string"

1555 ],

1556 "resource_id": "resource_id",

1557 "resource_type": "resource_type",

1558 "role_id": "role_id",

1559 "source": "role_toggle",

1560 "workspace_id": "workspace_id"

1561 },

1428 "role.created": {1562 "role.created": {

1429 "id": "id",1563 "id": "id",

1430 "permissions": [1564 "permissions": [


1437 "role.deleted": {1571 "role.deleted": {

1438 "id": "id"1572 "id": "id"

1439 },1573 },

1574 "role.unbound_from_resource": {

1575 "id": "id",

1576 "connector_id": "connector_id",

1577 "connector_name": "connector_name",

1578 "enabled": true,

1579 "permissions": [

1580 "string"

1581 ],

1582 "resource_id": "resource_id",

1583 "resource_type": "resource_type",

1584 "role_id": "role_id",

1585 "source": "role_toggle",

1586 "workspace_id": "workspace_id"

1587 },

1440 "role.updated": {1588 "role.updated": {

1441 "id": "id",1589 "id": "id",

1442 "changes_requested": {1590 "changes_requested": {


1570 1718 

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

1572 1720 

1721 - `Optional<Long> expiresAt`

1722 

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

1724 

1573 - `JsonValue; object_ "organization.admin_api_key"constant`1725 - `JsonValue; object_ "organization.admin_api_key"constant`

1574 1726 

1575 The object type, which is always `organization.admin_api_key`1727 The object type, which is always `organization.admin_api_key`


1643 {1795 {

1644 "id": "key_abc",1796 "id": "key_abc",

1645 "created_at": 1711471533,1797 "created_at": 1711471533,

1798 "expires_at": 1714063533,

1646 "object": "organization.admin_api_key",1799 "object": "organization.admin_api_key",

1647 "owner": {1800 "owner": {

1648 "id": "sa_456",1801 "id": "sa_456",


1678 1831 

1679 - `String name`1832 - `String name`

1680 1833 

1834 - `Optional<Long> expiresInSeconds`

1835 

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

1837 

1681### Returns1838### Returns

1682 1839 

1683- `class AdminApiKeyCreateResponse:`1840- `class AdminApiKeyCreateResponse:`


1718{1875{

1719 "id": "key_abc",1876 "id": "key_abc",

1720 "created_at": 1711471533,1877 "created_at": 1711471533,

1878 "expires_at": 1714063533,

1721 "object": "organization.admin_api_key",1879 "object": "organization.admin_api_key",

1722 "owner": {1880 "owner": {

1723 "id": "sa_456",1881 "id": "sa_456",


1764 1922 

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

1766 1924 

1925 - `Optional<Long> expiresAt`

1926 

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

1928 

1767 - `JsonValue; object_ "organization.admin_api_key"constant`1929 - `JsonValue; object_ "organization.admin_api_key"constant`

1768 1930 

1769 The object type, which is always `organization.admin_api_key`1931 The object type, which is always `organization.admin_api_key`


1835{1997{

1836 "id": "key_abc",1998 "id": "key_abc",

1837 "created_at": 1711471533,1999 "created_at": 1711471533,

2000 "expires_at": 1714063533,

1838 "object": "organization.admin_api_key",2001 "object": "organization.admin_api_key",

1839 "owner": {2002 "owner": {

1840 "id": "sa_456",2003 "id": "sa_456",


1925 2088 

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

1927 2090 

2091 - `Optional<Long> expiresAt`

2092 

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

2094 

1928 - `JsonValue; object_ "organization.admin_api_key"constant`2095 - `JsonValue; object_ "organization.admin_api_key"constant`

1929 2096 

1930 The object type, which is always `organization.admin_api_key`2097 The object type, which is always `organization.admin_api_key`


11608}11775}

11609```11776```

11610 11777 

11778## Retrieve organization spend alert

11779 

11780`OrganizationSpendAlert admin().organization().spendAlerts().retrieve(SpendAlertRetrieveParamsparams = SpendAlertRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

11781 

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

11783 

11784Retrieves an organization spend alert.

11785 

11786### Parameters

11787 

11788- `SpendAlertRetrieveParams params`

11789 

11790 - `Optional<String> alertId`

11791 

11792### Returns

11793 

11794- `class OrganizationSpendAlert:`

11795 

11796 Represents a spend alert configured at the organization level.

11797 

11798 - `String id`

11799 

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

11801 

11802 - `Currency currency`

11803 

11804 The currency for the threshold amount.

11805 

11806 - `USD("USD")`

11807 

11808 - `Interval interval`

11809 

11810 The time interval for evaluating spend against the threshold.

11811 

11812 - `MONTH("month")`

11813 

11814 - `NotificationChannel notificationChannel`

11815 

11816 Email notification settings for a spend alert.

11817 

11818 - `List<String> recipients`

11819 

11820 Email addresses that receive the spend alert notification.

11821 

11822 - `JsonValue; type "email"constant`

11823 

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

11825 

11826 - `EMAIL("email")`

11827 

11828 - `Optional<String> subjectPrefix`

11829 

11830 Optional subject prefix for alert emails.

11831 

11832 - `JsonValue; object_ "organization.spend_alert"constant`

11833 

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

11835 

11836 - `ORGANIZATION_SPEND_ALERT("organization.spend_alert")`

11837 

11838 - `long thresholdAmount`

11839 

11840 The alert threshold amount, in cents.

11841 

11842### Example

11843 

11844```java

11845package com.openai.example;

11846 

11847import com.openai.client.OpenAIClient;

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

11849import com.openai.models.admin.organization.spendalerts.OrganizationSpendAlert;

11850import com.openai.models.admin.organization.spendalerts.SpendAlertRetrieveParams;

11851 

11852public final class Main {

11853 private Main() {}

11854 

11855 public static void main(String[] args) {

11856 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

11857 

11858 OrganizationSpendAlert organizationSpendAlert = client.admin().organization().spendAlerts().retrieve("alert_id");

11859 }

11860}

11861```

11862 

11863#### Response

11864 

11865```json

11866{

11867 "id": "id",

11868 "currency": "USD",

11869 "interval": "month",

11870 "notification_channel": {

11871 "recipients": [

11872 "string"

11873 ],

11874 "type": "email",

11875 "subject_prefix": "subject_prefix"

11876 },

11877 "object": "organization.spend_alert",

11878 "threshold_amount": 0

11879}

11880```

11881 

11611## Update organization spend alert11882## Update organization spend alert

11612 11883 

11613`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`11884`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`


17891}18162}

17892```18163```

17893 18164 

18165## Retrieve project spend alert

18166 

18167`ProjectSpendAlert admin().organization().projects().spendAlerts().retrieve(SpendAlertRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

18168 

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

18170 

18171Retrieves a project spend alert.

18172 

18173### Parameters

18174 

18175- `SpendAlertRetrieveParams params`

18176 

18177 - `String projectId`

18178 

18179 - `Optional<String> alertId`

18180 

18181### Returns

18182 

18183- `class ProjectSpendAlert:`

18184 

18185 Represents a spend alert configured at the project level.

18186 

18187 - `String id`

18188 

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

18190 

18191 - `Currency currency`

18192 

18193 The currency for the threshold amount.

18194 

18195 - `USD("USD")`

18196 

18197 - `Interval interval`

18198 

18199 The time interval for evaluating spend against the threshold.

18200 

18201 - `MONTH("month")`

18202 

18203 - `NotificationChannel notificationChannel`

18204 

18205 Email notification settings for a spend alert.

18206 

18207 - `List<String> recipients`

18208 

18209 Email addresses that receive the spend alert notification.

18210 

18211 - `JsonValue; type "email"constant`

18212 

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

18214 

18215 - `EMAIL("email")`

18216 

18217 - `Optional<String> subjectPrefix`

18218 

18219 Optional subject prefix for alert emails.

18220 

18221 - `JsonValue; object_ "project.spend_alert"constant`

18222 

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

18224 

18225 - `PROJECT_SPEND_ALERT("project.spend_alert")`

18226 

18227 - `long thresholdAmount`

18228 

18229 The alert threshold amount, in cents.

18230 

18231### Example

18232 

18233```java

18234package com.openai.example;

18235 

18236import com.openai.client.OpenAIClient;

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

18238import com.openai.models.admin.organization.projects.spendalerts.ProjectSpendAlert;

18239import com.openai.models.admin.organization.projects.spendalerts.SpendAlertRetrieveParams;

18240 

18241public final class Main {

18242 private Main() {}

18243 

18244 public static void main(String[] args) {

18245 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

18246 

18247 SpendAlertRetrieveParams params = SpendAlertRetrieveParams.builder()

18248 .projectId("project_id")

18249 .alertId("alert_id")

18250 .build();

18251 ProjectSpendAlert projectSpendAlert = client.admin().organization().projects().spendAlerts().retrieve(params);

18252 }

18253}

18254```

18255 

18256#### Response

18257 

18258```json

18259{

18260 "id": "id",

18261 "currency": "USD",

18262 "interval": "month",

18263 "notification_channel": {

18264 "recipients": [

18265 "string"

18266 ],

18267 "type": "email",

18268 "subject_prefix": "subject_prefix"

18269 },

18270 "object": "project.spend_alert",

18271 "threshold_amount": 0

18272}

18273```

18274 

17894## Update project spend alert18275## Update project spend alert

17895 18276 

17896`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`18277`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

5`AdminApiKeyListPage admin().organization().adminApiKeys().list(AdminApiKeyListParamsparams = AdminApiKeyListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `AdminApiKeyListParams params`

14 

15 - `Optional<String> after`

16 

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

18 

19 - `Optional<Long> limit`

20 

21 Maximum number of keys to return.

22 

23 - `Optional<Order> order`

24 

25 Order results by creation time, ascending or descending.

26 

27 - `ASC("asc")`

28 

29 - `DESC("desc")`

30 

31### Returns

32 

33- `class AdminApiKey:`

34 

35 Represents an individual Admin API key in an org.

36 

37 - `String id`

38 

39 The identifier, which can be referenced in API endpoints

40 

41 - `long createdAt`

42 

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

44 

45 - `Optional<Long> expiresAt`

46 

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

48 

49 - `JsonValue; object_ "organization.admin_api_key"constant`

50 

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

52 

53 - `ORGANIZATION_ADMIN_API_KEY("organization.admin_api_key")`

54 

55 - `Owner owner`

56 

57 - `Optional<String> id`

58 

59 The identifier, which can be referenced in API endpoints

60 

61 - `Optional<Long> createdAt`

62 

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

64 

65 - `Optional<String> name`

66 

67 The name of the user

68 

69 - `Optional<String> object_`

70 

71 The object type, which is always organization.user

72 

73 - `Optional<String> role`

74 

75 Always `owner`

76 

77 - `Optional<String> type`

78 

79 Always `user`

80 

81 - `String redactedValue`

82 

83 The redacted value of the API key

84 

85 - `Optional<Long> lastUsedAt`

86 

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

88 

89 - `Optional<String> name`

90 

91 The name of the API key

92 

93### Example

94 

95```java

96package com.openai.example;

97 

98import com.openai.client.OpenAIClient;

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

100import com.openai.models.admin.organization.adminapikeys.AdminApiKeyListPage;

101import com.openai.models.admin.organization.adminapikeys.AdminApiKeyListParams;

102 

103public final class Main {

104 private Main() {}

105 

106 public static void main(String[] args) {

107 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

108 

109 AdminApiKeyListPage page = client.admin().organization().adminApiKeys().list();

110 }

111}

112```

113 

114#### Response

115 

116```json

117{

118 "data": [

119 {

120 "id": "key_abc",

121 "created_at": 1711471533,

122 "expires_at": 1714063533,

123 "object": "organization.admin_api_key",

124 "owner": {

125 "id": "sa_456",

126 "created_at": 1711471533,

127 "name": "My Service Account",

128 "object": "organization.user",

129 "role": "owner",

130 "type": "user"

131 },

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

133 "last_used_at": 1711471534,

134 "name": "Administration Key"

135 }

136 ],

137 "has_more": false,

138 "object": "list",

139 "first_id": "key_abc",

140 "last_id": "key_xyz"

141}

142```

143 

144## Create admin API key

145 

146`AdminApiKeyCreateResponse admin().organization().adminApiKeys().create(AdminApiKeyCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

147 

148**post** `/organization/admin_api_keys`

149 

150Create an organization admin API key

151 

152### Parameters

153 

154- `AdminApiKeyCreateParams params`

155 

156 - `String name`

157 

158 - `Optional<Long> expiresInSeconds`

159 

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

161 

162### Returns

163 

164- `class AdminApiKeyCreateResponse:`

165 

166 Represents an individual Admin API key in an org.

167 

168 - `String value`

169 

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

171 

172### Example

173 

174```java

175package com.openai.example;

176 

177import com.openai.client.OpenAIClient;

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

179import com.openai.models.admin.organization.adminapikeys.AdminApiKeyCreateParams;

180import com.openai.models.admin.organization.adminapikeys.AdminApiKeyCreateResponse;

181 

182public final class Main {

183 private Main() {}

184 

185 public static void main(String[] args) {

186 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

187 

188 AdminApiKeyCreateParams params = AdminApiKeyCreateParams.builder()

189 .name("New Admin Key")

190 .build();

191 AdminApiKeyCreateResponse adminApiKey = client.admin().organization().adminApiKeys().create(params);

192 }

193}

194```

195 

196#### Response

197 

198```json

199{

200 "id": "key_abc",

201 "created_at": 1711471533,

202 "expires_at": 1714063533,

203 "object": "organization.admin_api_key",

204 "owner": {

205 "id": "sa_456",

206 "created_at": 1711471533,

207 "name": "My Service Account",

208 "object": "organization.user",

209 "role": "owner",

210 "type": "user"

211 },

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

213 "last_used_at": 1711471534,

214 "name": "Administration Key",

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

216}

217```

218 

219## Retrieve admin API key

220 

221`AdminApiKey admin().organization().adminApiKeys().retrieve(AdminApiKeyRetrieveParamsparams = AdminApiKeyRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

222 

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

224 

225Retrieve a single organization API key

226 

227### Parameters

228 

229- `AdminApiKeyRetrieveParams params`

230 

231 - `Optional<String> keyId`

232 

233 The ID of the API key.

234 

235### Returns

236 

237- `class AdminApiKey:`

238 

239 Represents an individual Admin API key in an org.

240 

241 - `String id`

242 

243 The identifier, which can be referenced in API endpoints

244 

245 - `long createdAt`

246 

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

248 

249 - `Optional<Long> expiresAt`

250 

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

252 

253 - `JsonValue; object_ "organization.admin_api_key"constant`

254 

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

256 

257 - `ORGANIZATION_ADMIN_API_KEY("organization.admin_api_key")`

258 

259 - `Owner owner`

260 

261 - `Optional<String> id`

262 

263 The identifier, which can be referenced in API endpoints

264 

265 - `Optional<Long> createdAt`

266 

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

268 

269 - `Optional<String> name`

270 

271 The name of the user

272 

273 - `Optional<String> object_`

274 

275 The object type, which is always organization.user

276 

277 - `Optional<String> role`

278 

279 Always `owner`

280 

281 - `Optional<String> type`

282 

283 Always `user`

284 

285 - `String redactedValue`

286 

287 The redacted value of the API key

288 

289 - `Optional<Long> lastUsedAt`

290 

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

292 

293 - `Optional<String> name`

294 

295 The name of the API key

296 

297### Example

298 

299```java

300package com.openai.example;

301 

302import com.openai.client.OpenAIClient;

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

304import com.openai.models.admin.organization.adminapikeys.AdminApiKey;

305import com.openai.models.admin.organization.adminapikeys.AdminApiKeyRetrieveParams;

306 

307public final class Main {

308 private Main() {}

309 

310 public static void main(String[] args) {

311 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

312 

313 AdminApiKey adminApiKey = client.admin().organization().adminApiKeys().retrieve("key_id");

314 }

315}

316```

317 

318#### Response

319 

320```json

321{

322 "id": "key_abc",

323 "created_at": 1711471533,

324 "expires_at": 1714063533,

325 "object": "organization.admin_api_key",

326 "owner": {

327 "id": "sa_456",

328 "created_at": 1711471533,

329 "name": "My Service Account",

330 "object": "organization.user",

331 "role": "owner",

332 "type": "user"

333 },

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

335 "last_used_at": 1711471534,

336 "name": "Administration Key"

337}

338```

339 

340## Delete admin API key

341 

342`AdminApiKeyDeleteResponse admin().organization().adminApiKeys().delete(AdminApiKeyDeleteParamsparams = AdminApiKeyDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

343 

344**delete** `/organization/admin_api_keys/{key_id}`

345 

346Delete an organization admin API key

347 

348### Parameters

349 

350- `AdminApiKeyDeleteParams params`

351 

352 - `Optional<String> keyId`

353 

354 The ID of the API key to be deleted.

355 

356### Returns

357 

358- `class AdminApiKeyDeleteResponse:`

359 

360 - `String id`

361 

362 - `boolean deleted`

363 

364 - `JsonValue; object_ "organization.admin_api_key.deleted"constant`

365 

366 - `ORGANIZATION_ADMIN_API_KEY_DELETED("organization.admin_api_key.deleted")`

367 

368### Example

369 

370```java

371package com.openai.example;

372 

373import com.openai.client.OpenAIClient;

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

375import com.openai.models.admin.organization.adminapikeys.AdminApiKeyDeleteParams;

376import com.openai.models.admin.organization.adminapikeys.AdminApiKeyDeleteResponse;

377 

378public final class Main {

379 private Main() {}

380 

381 public static void main(String[] args) {

382 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

383 

384 AdminApiKeyDeleteResponse adminApiKey = client.admin().organization().adminApiKeys().delete("key_id");

385 }

386}

387```

388 

389#### Response

390 

391```json

392{

393 "id": "key_abc",

394 "deleted": true,

395 "object": "organization.admin_api_key.deleted"

396}

397```

398 

399## Domain Types

400 

401### Admin API Key

402 

403- `class AdminApiKey:`

404 

405 Represents an individual Admin API key in an org.

406 

407 - `String id`

408 

409 The identifier, which can be referenced in API endpoints

410 

411 - `long createdAt`

412 

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

414 

415 - `Optional<Long> expiresAt`

416 

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

418 

419 - `JsonValue; object_ "organization.admin_api_key"constant`

420 

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

422 

423 - `ORGANIZATION_ADMIN_API_KEY("organization.admin_api_key")`

424 

425 - `Owner owner`

426 

427 - `Optional<String> id`

428 

429 The identifier, which can be referenced in API endpoints

430 

431 - `Optional<Long> createdAt`

432 

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

434 

435 - `Optional<String> name`

436 

437 The name of the user

438 

439 - `Optional<String> object_`

440 

441 The object type, which is always organization.user

442 

443 - `Optional<String> role`

444 

445 Always `owner`

446 

447 - `Optional<String> type`

448 

449 Always `user`

450 

451 - `String redactedValue`

452 

453 The redacted value of the API key

454 

455 - `Optional<Long> lastUsedAt`

456 

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

458 

459 - `Optional<String> name`

460 

461 The name of the API key

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

150 150 

151 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`151 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

152 152 

153 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

154 

155 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

156 

153 - `SCIM_ENABLED("scim.enabled")`157 - `SCIM_ENABLED("scim.enabled")`

154 158 

155 - `SCIM_DISABLED("scim.disabled")`159 - `SCIM_DISABLED("scim.disabled")`


176 180 

177 - `Optional<List<String>> resourceIds`181 - `Optional<List<String>> resourceIds`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185 - `Optional<Boolean> tenantOnly`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 


294 302 

295 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`303 - `ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")`

296 304 

305 - `ROLE_BOUND_TO_RESOURCE("role.bound_to_resource")`

306 

307 - `ROLE_UNBOUND_FROM_RESOURCE("role.unbound_from_resource")`

308 

297 - `SCIM_ENABLED("scim.enabled")`309 - `SCIM_ENABLED("scim.enabled")`

298 310 

299 - `SCIM_DISABLED("scim.disabled")`311 - `SCIM_DISABLED("scim.disabled")`


914 926 

915 The type of resource the role assignment was scoped to.927 The type of resource the role assignment was scoped to.

916 928 

929 - `Optional<RoleBoundToResource> roleBoundToResource`

930 

931 The details for events with this `type`.

932 

933 - `Optional<String> id`

934 

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

936 

937 - `Optional<String> connectorId`

938 

939 The connector ID for a ChatGPT workspace connector resource.

940 

941 - `Optional<String> connectorName`

942 

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

944 

945 - `Optional<Boolean> enabled`

946 

947 Whether the connector is enabled for the role.

948 

949 - `Optional<List<String>> permissions`

950 

951 The permissions granted to the role for the resource.

952 

953 - `Optional<String> resourceId`

954 

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

956 

957 - `Optional<String> resourceType`

958 

959 The type of resource the role was bound to.

960 

961 - `Optional<String> roleId`

962 

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

964 

965 - `Optional<Source> source`

966 

967 The connector role mutation path that produced the event.

968 

969 - `ROLE_TOGGLE("role_toggle")`

970 

971 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

972 

973 - `ROLE_DELETE("role_delete")`

974 

975 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

976 

977 - `CONNECTOR_PUBLISH("connector_publish")`

978 

979 - `Optional<String> workspaceId`

980 

981 The workspace ID for a ChatGPT workspace connector resource.

982 

917 - `Optional<RoleCreated> roleCreated`983 - `Optional<RoleCreated> roleCreated`

918 984 

919 The details for events with this `type`.985 The details for events with this `type`.


946 1012 

947 The role ID.1013 The role ID.

948 1014 

1015 - `Optional<RoleUnboundFromResource> roleUnboundFromResource`

1016 

1017 The details for events with this `type`.

1018 

1019 - `Optional<String> id`

1020 

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

1022 

1023 - `Optional<String> connectorId`

1024 

1025 The connector ID for a ChatGPT workspace connector resource.

1026 

1027 - `Optional<String> connectorName`

1028 

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

1030 

1031 - `Optional<Boolean> enabled`

1032 

1033 Whether the connector is enabled for the role.

1034 

1035 - `Optional<List<String>> permissions`

1036 

1037 The permissions remaining for the role after the change.

1038 

1039 - `Optional<String> resourceId`

1040 

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

1042 

1043 - `Optional<String> resourceType`

1044 

1045 The type of resource the role was unbound from.

1046 

1047 - `Optional<String> roleId`

1048 

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

1050 

1051 - `Optional<Source> source`

1052 

1053 The connector role mutation path that produced the event.

1054 

1055 - `ROLE_TOGGLE("role_toggle")`

1056 

1057 - `ROLE_CONNECTOR_UPDATE("role_connector_update")`

1058 

1059 - `ROLE_DELETE("role_delete")`

1060 

1061 - `WORKSPACE_PERMISSIONS("workspace_permissions")`

1062 

1063 - `CONNECTOR_PUBLISH("connector_publish")`

1064 

1065 - `Optional<String> workspaceId`

1066 

1067 The workspace ID for a ChatGPT workspace connector resource.

1068 

949 - `Optional<RoleUpdated> roleUpdated`1069 - `Optional<RoleUpdated> roleUpdated`

950 1070 

951 The details for events with this `type`.1071 The details for events with this `type`.


1423 "resource_id": "resource_id",1543 "resource_id": "resource_id",

1424 "resource_type": "resource_type"1544 "resource_type": "resource_type"

1425 },1545 },

1546 "role.bound_to_resource": {

1547 "id": "id",

1548 "connector_id": "connector_id",

1549 "connector_name": "connector_name",

1550 "enabled": true,

1551 "permissions": [

1552 "string"

1553 ],

1554 "resource_id": "resource_id",

1555 "resource_type": "resource_type",

1556 "role_id": "role_id",

1557 "source": "role_toggle",

1558 "workspace_id": "workspace_id"

1559 },

1426 "role.created": {1560 "role.created": {

1427 "id": "id",1561 "id": "id",

1428 "permissions": [1562 "permissions": [


1435 "role.deleted": {1569 "role.deleted": {

1436 "id": "id"1570 "id": "id"

1437 },1571 },

1572 "role.unbound_from_resource": {

1573 "id": "id",

1574 "connector_id": "connector_id",

1575 "connector_name": "connector_name",

1576 "enabled": true,

1577 "permissions": [

1578 "string"

1579 ],

1580 "resource_id": "resource_id",

1581 "resource_type": "resource_type",

1582 "role_id": "role_id",

1583 "source": "role_toggle",

1584 "workspace_id": "workspace_id"

1585 },

1438 "role.updated": {1586 "role.updated": {

1439 "id": "id",1587 "id": "id",

1440 "changes_requested": {1588 "changes_requested": {

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

5245}5245}

5246```5246```

5247 5247 

5248## Retrieve project spend alert

5249 

5250`ProjectSpendAlert admin().organization().projects().spendAlerts().retrieve(SpendAlertRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

5251 

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

5253 

5254Retrieves a project spend alert.

5255 

5256### Parameters

5257 

5258- `SpendAlertRetrieveParams params`

5259 

5260 - `String projectId`

5261 

5262 - `Optional<String> alertId`

5263 

5264### Returns

5265 

5266- `class ProjectSpendAlert:`

5267 

5268 Represents a spend alert configured at the project level.

5269 

5270 - `String id`

5271 

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

5273 

5274 - `Currency currency`

5275 

5276 The currency for the threshold amount.

5277 

5278 - `USD("USD")`

5279 

5280 - `Interval interval`

5281 

5282 The time interval for evaluating spend against the threshold.

5283 

5284 - `MONTH("month")`

5285 

5286 - `NotificationChannel notificationChannel`

5287 

5288 Email notification settings for a spend alert.

5289 

5290 - `List<String> recipients`

5291 

5292 Email addresses that receive the spend alert notification.

5293 

5294 - `JsonValue; type "email"constant`

5295 

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

5297 

5298 - `EMAIL("email")`

5299 

5300 - `Optional<String> subjectPrefix`

5301 

5302 Optional subject prefix for alert emails.

5303 

5304 - `JsonValue; object_ "project.spend_alert"constant`

5305 

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

5307 

5308 - `PROJECT_SPEND_ALERT("project.spend_alert")`

5309 

5310 - `long thresholdAmount`

5311 

5312 The alert threshold amount, in cents.

5313 

5314### Example

5315 

5316```java

5317package com.openai.example;

5318 

5319import com.openai.client.OpenAIClient;

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

5321import com.openai.models.admin.organization.projects.spendalerts.ProjectSpendAlert;

5322import com.openai.models.admin.organization.projects.spendalerts.SpendAlertRetrieveParams;

5323 

5324public final class Main {

5325 private Main() {}

5326 

5327 public static void main(String[] args) {

5328 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

5329 

5330 SpendAlertRetrieveParams params = SpendAlertRetrieveParams.builder()

5331 .projectId("project_id")

5332 .alertId("alert_id")

5333 .build();

5334 ProjectSpendAlert projectSpendAlert = client.admin().organization().projects().spendAlerts().retrieve(params);

5335 }

5336}

5337```

5338 

5339#### Response

5340 

5341```json

5342{

5343 "id": "id",

5344 "currency": "USD",

5345 "interval": "month",

5346 "notification_channel": {

5347 "recipients": [

5348 "string"

5349 ],

5350 "type": "email",

5351 "subject_prefix": "subject_prefix"

5352 },

5353 "object": "project.spend_alert",

5354 "threshold_amount": 0

5355}

5356```

5357 

5248## Update project spend alert5358## Update project spend alert

5249 5359 

5250`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`5360`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

Details

279}279}

280```280```

281 281 

282## Retrieve project spend alert

283 

284`ProjectSpendAlert admin().organization().projects().spendAlerts().retrieve(SpendAlertRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

285 

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

287 

288Retrieves a project spend alert.

289 

290### Parameters

291 

292- `SpendAlertRetrieveParams params`

293 

294 - `String projectId`

295 

296 - `Optional<String> alertId`

297 

298### Returns

299 

300- `class ProjectSpendAlert:`

301 

302 Represents a spend alert configured at the project level.

303 

304 - `String id`

305 

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

307 

308 - `Currency currency`

309 

310 The currency for the threshold amount.

311 

312 - `USD("USD")`

313 

314 - `Interval interval`

315 

316 The time interval for evaluating spend against the threshold.

317 

318 - `MONTH("month")`

319 

320 - `NotificationChannel notificationChannel`

321 

322 Email notification settings for a spend alert.

323 

324 - `List<String> recipients`

325 

326 Email addresses that receive the spend alert notification.

327 

328 - `JsonValue; type "email"constant`

329 

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

331 

332 - `EMAIL("email")`

333 

334 - `Optional<String> subjectPrefix`

335 

336 Optional subject prefix for alert emails.

337 

338 - `JsonValue; object_ "project.spend_alert"constant`

339 

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

341 

342 - `PROJECT_SPEND_ALERT("project.spend_alert")`

343 

344 - `long thresholdAmount`

345 

346 The alert threshold amount, in cents.

347 

348### Example

349 

350```java

351package com.openai.example;

352 

353import com.openai.client.OpenAIClient;

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

355import com.openai.models.admin.organization.projects.spendalerts.ProjectSpendAlert;

356import com.openai.models.admin.organization.projects.spendalerts.SpendAlertRetrieveParams;

357 

358public final class Main {

359 private Main() {}

360 

361 public static void main(String[] args) {

362 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

363 

364 SpendAlertRetrieveParams params = SpendAlertRetrieveParams.builder()

365 .projectId("project_id")

366 .alertId("alert_id")

367 .build();

368 ProjectSpendAlert projectSpendAlert = client.admin().organization().projects().spendAlerts().retrieve(params);

369 }

370}

371```

372 

373#### Response

374 

375```json

376{

377 "id": "id",

378 "currency": "USD",

379 "interval": "month",

380 "notification_channel": {

381 "recipients": [

382 "string"

383 ],

384 "type": "email",

385 "subject_prefix": "subject_prefix"

386 },

387 "object": "project.spend_alert",

388 "threshold_amount": 0

389}

390```

391 

282## Update project spend alert392## Update project spend alert

283 393 

284`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`394`ProjectSpendAlert admin().organization().projects().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

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

274}274}

275```275```

276 276 

277## Retrieve organization spend alert

278 

279`OrganizationSpendAlert admin().organization().spendAlerts().retrieve(SpendAlertRetrieveParamsparams = SpendAlertRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

280 

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

282 

283Retrieves an organization spend alert.

284 

285### Parameters

286 

287- `SpendAlertRetrieveParams params`

288 

289 - `Optional<String> alertId`

290 

291### Returns

292 

293- `class OrganizationSpendAlert:`

294 

295 Represents a spend alert configured at the organization level.

296 

297 - `String id`

298 

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

300 

301 - `Currency currency`

302 

303 The currency for the threshold amount.

304 

305 - `USD("USD")`

306 

307 - `Interval interval`

308 

309 The time interval for evaluating spend against the threshold.

310 

311 - `MONTH("month")`

312 

313 - `NotificationChannel notificationChannel`

314 

315 Email notification settings for a spend alert.

316 

317 - `List<String> recipients`

318 

319 Email addresses that receive the spend alert notification.

320 

321 - `JsonValue; type "email"constant`

322 

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

324 

325 - `EMAIL("email")`

326 

327 - `Optional<String> subjectPrefix`

328 

329 Optional subject prefix for alert emails.

330 

331 - `JsonValue; object_ "organization.spend_alert"constant`

332 

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

334 

335 - `ORGANIZATION_SPEND_ALERT("organization.spend_alert")`

336 

337 - `long thresholdAmount`

338 

339 The alert threshold amount, in cents.

340 

341### Example

342 

343```java

344package com.openai.example;

345 

346import com.openai.client.OpenAIClient;

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

348import com.openai.models.admin.organization.spendalerts.OrganizationSpendAlert;

349import com.openai.models.admin.organization.spendalerts.SpendAlertRetrieveParams;

350 

351public final class Main {

352 private Main() {}

353 

354 public static void main(String[] args) {

355 OpenAIClient client = OpenAIOkHttpClient.fromEnv();

356 

357 OrganizationSpendAlert organizationSpendAlert = client.admin().organization().spendAlerts().retrieve("alert_id");

358 }

359}

360```

361 

362#### Response

363 

364```json

365{

366 "id": "id",

367 "currency": "USD",

368 "interval": "month",

369 "notification_channel": {

370 "recipients": [

371 "string"

372 ],

373 "type": "email",

374 "subject_prefix": "subject_prefix"

375 },

376 "object": "organization.spend_alert",

377 "threshold_amount": 0

378}

379```

380 

277## Update organization spend alert381## Update organization spend alert

278 382 

279`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`383`OrganizationSpendAlert admin().organization().spendAlerts().update(SpendAlertUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

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

8104 Configuration options for8104 Configuration options for

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

8106 8106 

8107 - `Optional<Context> context`

8108 

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

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

8111 used for the response.

8112 

8113 - `AUTO("auto")`

8114 

8115 - `CURRENT_TURN("current_turn")`

8116 

8117 - `ALL_TURNS("all_turns")`

8118 

8107 - `Optional<ReasoningEffort> effort`8119 - `Optional<ReasoningEffort> effort`

8108 8120 

8109 Constrains effort on reasoning for8121 Constrains effort on reasoning for


8504 "prompt_cache_key": "prompt-cache-key-1234",8516 "prompt_cache_key": "prompt-cache-key-1234",

8505 "prompt_cache_retention": "in_memory",8517 "prompt_cache_retention": "in_memory",

8506 "reasoning": {8518 "reasoning": {

8519 "context": "auto",

8507 "effort": "none",8520 "effort": "none",

8508 "generate_summary": "auto",8521 "generate_summary": "auto",

8509 "summary": "auto"8522 "summary": "auto"


13233 Configuration options for13246 Configuration options for

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

13235 13248 

13249 - `Optional<Context> context`

13250 

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

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

13253 used for the response.

13254 

13255 - `AUTO("auto")`

13256 

13257 - `CURRENT_TURN("current_turn")`

13258 

13259 - `ALL_TURNS("all_turns")`

13260 

13236 - `Optional<ReasoningEffort> effort`13261 - `Optional<ReasoningEffort> effort`

13237 13262 

13238 Constrains effort on reasoning for13263 Constrains effort on reasoning for


13633 "prompt_cache_key": "prompt-cache-key-1234",13658 "prompt_cache_key": "prompt-cache-key-1234",

13634 "prompt_cache_retention": "in_memory",13659 "prompt_cache_retention": "in_memory",

13635 "reasoning": {13660 "reasoning": {

13661 "context": "auto",

13636 "effort": "none",13662 "effort": "none",

13637 "generate_summary": "auto",13663 "generate_summary": "auto",

13638 "summary": "auto"13664 "summary": "auto"


18363 Configuration options for18389 Configuration options for

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

18365 18391 

18392 - `Optional<Context> context`

18393 

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

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

18396 used for the response.

18397 

18398 - `AUTO("auto")`

18399 

18400 - `CURRENT_TURN("current_turn")`

18401 

18402 - `ALL_TURNS("all_turns")`

18403 

18366 - `Optional<ReasoningEffort> effort`18404 - `Optional<ReasoningEffort> effort`

18367 18405 

18368 Constrains effort on reasoning for18406 Constrains effort on reasoning for


18763 "prompt_cache_key": "prompt-cache-key-1234",18801 "prompt_cache_key": "prompt-cache-key-1234",

18764 "prompt_cache_retention": "in_memory",18802 "prompt_cache_retention": "in_memory",

18765 "reasoning": {18803 "reasoning": {

18804 "context": "auto",

18766 "effort": "none",18805 "effort": "none",

18767 "generate_summary": "auto",18806 "generate_summary": "auto",

18768 "summary": "auto"18807 "summary": "auto"


33631 Configuration options for33670 Configuration options for

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

33633 33672 

33673 - `Optional<Context> context`

33674 

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

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

33677 used for the response.

33678 

33679 - `AUTO("auto")`

33680 

33681 - `CURRENT_TURN("current_turn")`

33682 

33683 - `ALL_TURNS("all_turns")`

33684 

33634 - `Optional<ReasoningEffort> effort`33685 - `Optional<ReasoningEffort> effort`

33635 33686 

33636 Constrains effort on reasoning for33687 Constrains effort on reasoning for


38974 Configuration options for39025 Configuration options for

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

38976 39027 

39028 - `Optional<Context> context`

39029 

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

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

39032 used for the response.

39033 

39034 - `AUTO("auto")`

39035 

39036 - `CURRENT_TURN("current_turn")`

39037 

39038 - `ALL_TURNS("all_turns")`

39039 

38977 - `Optional<ReasoningEffort> effort`39040 - `Optional<ReasoningEffort> effort`

38978 39041 

38979 Constrains effort on reasoning for39042 Constrains effort on reasoning for


45043 Configuration options for45106 Configuration options for

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

45045 45108 

45109 - `Optional<Context> context`

45110 

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

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

45113 used for the response.

45114 

45115 - `AUTO("auto")`

45116 

45117 - `CURRENT_TURN("current_turn")`

45118 

45119 - `ALL_TURNS("all_turns")`

45120 

45046 - `Optional<ReasoningEffort> effort`45121 - `Optional<ReasoningEffort> effort`

45047 45122 

45048 Constrains effort on reasoning for45123 Constrains effort on reasoning for


50282 Configuration options for50357 Configuration options for

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

50284 50359 

50360 - `Optional<Context> context`

50361 

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

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

50364 used for the response.

50365 

50366 - `AUTO("auto")`

50367 

50368 - `CURRENT_TURN("current_turn")`

50369 

50370 - `ALL_TURNS("all_turns")`

50371 

50285 - `Optional<ReasoningEffort> effort`50372 - `Optional<ReasoningEffort> effort`

50286 50373 

50287 Constrains effort on reasoning for50374 Constrains effort on reasoning for


56179 Configuration options for56266 Configuration options for

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

56181 56268 

56269 - `Optional<Context> context`

56270 

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

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

56273 used for the response.

56274 

56275 - `AUTO("auto")`

56276 

56277 - `CURRENT_TURN("current_turn")`

56278 

56279 - `ALL_TURNS("all_turns")`

56280 

56182 - `Optional<ReasoningEffort> effort`56281 - `Optional<ReasoningEffort> effort`

56183 56282 

56184 Constrains effort on reasoning for56283 Constrains effort on reasoning for


61126 Configuration options for61225 Configuration options for

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

61128 61227 

61228 - `Optional<Context> context`

61229 

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

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

61232 used for the response.

61233 

61234 - `AUTO("auto")`

61235 

61236 - `CURRENT_TURN("current_turn")`

61237 

61238 - `ALL_TURNS("all_turns")`

61239 

61129 - `Optional<ReasoningEffort> effort`61240 - `Optional<ReasoningEffort> effort`

61130 61241 

61131 Constrains effort on reasoning for61242 Constrains effort on reasoning for


81509 Configuration options for81620 Configuration options for

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

81511 81622 

81623 - `Optional<Context> context`

81624 

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

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

81627 used for the response.

81628 

81629 - `AUTO("auto")`

81630 

81631 - `CURRENT_TURN("current_turn")`

81632 

81633 - `ALL_TURNS("all_turns")`

81634 

81512 - `Optional<ReasoningEffort> effort`81635 - `Optional<ReasoningEffort> effort`

81513 81636 

81514 Constrains effort on reasoning for81637 Constrains effort on reasoning for


86969 Configuration options for87092 Configuration options for

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

86971 87094 

87095 - `Optional<Context> context`

87096 

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

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

87099 used for the response.

87100 

87101 - `AUTO("auto")`

87102 

87103 - `CURRENT_TURN("current_turn")`

87104 

87105 - `ALL_TURNS("all_turns")`

87106 

86972 - `Optional<ReasoningEffort> effort`87107 - `Optional<ReasoningEffort> effort`

86973 87108 

86974 Constrains effort on reasoning for87109 Constrains effort on reasoning for


94152 Configuration options for94287 Configuration options for

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

94154 94289 

94290 - `Optional<Context> context`

94291 

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

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

94294 used for the response.

94295 

94296 - `AUTO("auto")`

94297 

94298 - `CURRENT_TURN("current_turn")`

94299 

94300 - `ALL_TURNS("all_turns")`

94301 

94155 - `Optional<ReasoningEffort> effort`94302 - `Optional<ReasoningEffort> effort`

94156 94303 

94157 Constrains effort on reasoning for94304 Constrains effort on reasoning for


99468 Configuration options for99615 Configuration options for

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

99470 99617 

99618 - `Optional<Context> context`

99619 

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

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

99622 used for the response.

99623 

99624 - `AUTO("auto")`

99625 

99626 - `CURRENT_TURN("current_turn")`

99627 

99628 - `ALL_TURNS("all_turns")`

99629 

99471 - `Optional<ReasoningEffort> effort`99630 - `Optional<ReasoningEffort> effort`

99472 99631 

99473 Constrains effort on reasoning for99632 Constrains effort on reasoning for

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

253 253 

254 - `class VideoReferenceInputParam:`254 - `class VideoReferenceInputParam:`

255 255 

256 Reference to the completed video.256 Reference to the completed video to edit.

257 257 

258 - `String id`258 - `String id`

259 259 

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

50 50 

51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

52 52 

53- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]]]`53- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]]]`

54 54 

55 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).55 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).

56 56 


152 152 

153 - `"role.assignment.deleted"`153 - `"role.assignment.deleted"`

154 154 

155 - `"role.bound_to_resource"`

156 

157 - `"role.unbound_from_resource"`

158 

155 - `"scim.enabled"`159 - `"scim.enabled"`

156 160 

157 - `"scim.disabled"`161 - `"scim.disabled"`


178 182 

179- `resource_ids: Optional[Sequence[str]]`183- `resource_ids: Optional[Sequence[str]]`

180 184 

181 Return only events performed on these targets. For example, a project ID updated.185 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>`.

186 

187- `tenant_only: Optional[bool]`

188 

189 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.

182 190 

183### Returns191### Returns

184 192 


194 202 

195 The Unix timestamp (in seconds) of the event.203 The Unix timestamp (in seconds) of the event.

196 204 

197 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`205 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

198 206 

199 The event type.207 The event type.

200 208 


296 304 

297 - `"role.assignment.deleted"`305 - `"role.assignment.deleted"`

298 306 

307 - `"role.bound_to_resource"`

308 

309 - `"role.unbound_from_resource"`

310 

299 - `"scim.enabled"`311 - `"scim.enabled"`

300 312 

301 - `"scim.disabled"`313 - `"scim.disabled"`


916 928 

917 The type of resource the role assignment was scoped to.929 The type of resource the role assignment was scoped to.

918 930 

931 - `role_bound_to_resource: Optional[RoleBoundToResource]`

932 

933 The details for events with this `type`.

934 

935 - `id: Optional[str]`

936 

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

938 

939 - `connector_id: Optional[str]`

940 

941 The connector ID for a ChatGPT workspace connector resource.

942 

943 - `connector_name: Optional[str]`

944 

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

946 

947 - `enabled: Optional[bool]`

948 

949 Whether the connector is enabled for the role.

950 

951 - `permissions: Optional[List[str]]`

952 

953 The permissions granted to the role for the resource.

954 

955 - `resource_id: Optional[str]`

956 

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

958 

959 - `resource_type: Optional[str]`

960 

961 The type of resource the role was bound to.

962 

963 - `role_id: Optional[str]`

964 

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

966 

967 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

968 

969 The connector role mutation path that produced the event.

970 

971 - `"role_toggle"`

972 

973 - `"role_connector_update"`

974 

975 - `"role_delete"`

976 

977 - `"workspace_permissions"`

978 

979 - `"connector_publish"`

980 

981 - `workspace_id: Optional[str]`

982 

983 The workspace ID for a ChatGPT workspace connector resource.

984 

919 - `role_created: Optional[RoleCreated]`985 - `role_created: Optional[RoleCreated]`

920 986 

921 The details for events with this `type`.987 The details for events with this `type`.


948 1014 

949 The role ID.1015 The role ID.

950 1016 

1017 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

1018 

1019 The details for events with this `type`.

1020 

1021 - `id: Optional[str]`

1022 

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

1024 

1025 - `connector_id: Optional[str]`

1026 

1027 The connector ID for a ChatGPT workspace connector resource.

1028 

1029 - `connector_name: Optional[str]`

1030 

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

1032 

1033 - `enabled: Optional[bool]`

1034 

1035 Whether the connector is enabled for the role.

1036 

1037 - `permissions: Optional[List[str]]`

1038 

1039 The permissions remaining for the role after the change.

1040 

1041 - `resource_id: Optional[str]`

1042 

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

1044 

1045 - `resource_type: Optional[str]`

1046 

1047 The type of resource the role was unbound from.

1048 

1049 - `role_id: Optional[str]`

1050 

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

1052 

1053 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

1054 

1055 The connector role mutation path that produced the event.

1056 

1057 - `"role_toggle"`

1058 

1059 - `"role_connector_update"`

1060 

1061 - `"role_delete"`

1062 

1063 - `"workspace_permissions"`

1064 

1065 - `"connector_publish"`

1066 

1067 - `workspace_id: Optional[str]`

1068 

1069 The workspace ID for a ChatGPT workspace connector resource.

1070 

951 - `role_updated: Optional[RoleUpdated]`1071 - `role_updated: Optional[RoleUpdated]`

952 1072 

953 The details for events with this `type`.1073 The details for events with this `type`.


1418 "resource_id": "resource_id",1538 "resource_id": "resource_id",

1419 "resource_type": "resource_type"1539 "resource_type": "resource_type"

1420 },1540 },

1541 "role.bound_to_resource": {

1542 "id": "id",

1543 "connector_id": "connector_id",

1544 "connector_name": "connector_name",

1545 "enabled": true,

1546 "permissions": [

1547 "string"

1548 ],

1549 "resource_id": "resource_id",

1550 "resource_type": "resource_type",

1551 "role_id": "role_id",

1552 "source": "role_toggle",

1553 "workspace_id": "workspace_id"

1554 },

1421 "role.created": {1555 "role.created": {

1422 "id": "id",1556 "id": "id",

1423 "permissions": [1557 "permissions": [


1430 "role.deleted": {1564 "role.deleted": {

1431 "id": "id"1565 "id": "id"

1432 },1566 },

1567 "role.unbound_from_resource": {

1568 "id": "id",

1569 "connector_id": "connector_id",

1570 "connector_name": "connector_name",

1571 "enabled": true,

1572 "permissions": [

1573 "string"

1574 ],

1575 "resource_id": "resource_id",

1576 "resource_type": "resource_type",

1577 "role_id": "role_id",

1578 "source": "role_toggle",

1579 "workspace_id": "workspace_id"

1580 },

1433 "role.updated": {1581 "role.updated": {

1434 "id": "id",1582 "id": "id",

1435 "changes_requested": {1583 "changes_requested": {


1535 1683 

1536 The Unix timestamp (in seconds) of the event.1684 The Unix timestamp (in seconds) of the event.

1537 1685 

1538 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`1686 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

1539 1687 

1540 The event type.1688 The event type.

1541 1689 


1637 1785 

1638 - `"role.assignment.deleted"`1786 - `"role.assignment.deleted"`

1639 1787 

1788 - `"role.bound_to_resource"`

1789 

1790 - `"role.unbound_from_resource"`

1791 

1640 - `"scim.enabled"`1792 - `"scim.enabled"`

1641 1793 

1642 - `"scim.disabled"`1794 - `"scim.disabled"`


2257 2409 

2258 The type of resource the role assignment was scoped to.2410 The type of resource the role assignment was scoped to.

2259 2411 

2412 - `role_bound_to_resource: Optional[RoleBoundToResource]`

2413 

2414 The details for events with this `type`.

2415 

2416 - `id: Optional[str]`

2417 

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

2419 

2420 - `connector_id: Optional[str]`

2421 

2422 The connector ID for a ChatGPT workspace connector resource.

2423 

2424 - `connector_name: Optional[str]`

2425 

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

2427 

2428 - `enabled: Optional[bool]`

2429 

2430 Whether the connector is enabled for the role.

2431 

2432 - `permissions: Optional[List[str]]`

2433 

2434 The permissions granted to the role for the resource.

2435 

2436 - `resource_id: Optional[str]`

2437 

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

2439 

2440 - `resource_type: Optional[str]`

2441 

2442 The type of resource the role was bound to.

2443 

2444 - `role_id: Optional[str]`

2445 

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

2447 

2448 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2449 

2450 The connector role mutation path that produced the event.

2451 

2452 - `"role_toggle"`

2453 

2454 - `"role_connector_update"`

2455 

2456 - `"role_delete"`

2457 

2458 - `"workspace_permissions"`

2459 

2460 - `"connector_publish"`

2461 

2462 - `workspace_id: Optional[str]`

2463 

2464 The workspace ID for a ChatGPT workspace connector resource.

2465 

2260 - `role_created: Optional[RoleCreated]`2466 - `role_created: Optional[RoleCreated]`

2261 2467 

2262 The details for events with this `type`.2468 The details for events with this `type`.


2289 2495 

2290 The role ID.2496 The role ID.

2291 2497 

2498 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

2499 

2500 The details for events with this `type`.

2501 

2502 - `id: Optional[str]`

2503 

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

2505 

2506 - `connector_id: Optional[str]`

2507 

2508 The connector ID for a ChatGPT workspace connector resource.

2509 

2510 - `connector_name: Optional[str]`

2511 

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

2513 

2514 - `enabled: Optional[bool]`

2515 

2516 Whether the connector is enabled for the role.

2517 

2518 - `permissions: Optional[List[str]]`

2519 

2520 The permissions remaining for the role after the change.

2521 

2522 - `resource_id: Optional[str]`

2523 

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

2525 

2526 - `resource_type: Optional[str]`

2527 

2528 The type of resource the role was unbound from.

2529 

2530 - `role_id: Optional[str]`

2531 

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

2533 

2534 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2535 

2536 The connector role mutation path that produced the event.

2537 

2538 - `"role_toggle"`

2539 

2540 - `"role_connector_update"`

2541 

2542 - `"role_delete"`

2543 

2544 - `"workspace_permissions"`

2545 

2546 - `"connector_publish"`

2547 

2548 - `workspace_id: Optional[str]`

2549 

2550 The workspace ID for a ChatGPT workspace connector resource.

2551 

2292 - `role_updated: Optional[RoleUpdated]`2552 - `role_updated: Optional[RoleUpdated]`

2293 2553 

2294 The details for events with this `type`.2554 The details for events with this `type`.


2555 2815 

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

2557 2817 

2818 - `expires_at: Optional[int]`

2819 

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

2821 

2558 - `object: Literal["organization.admin_api_key"]`2822 - `object: Literal["organization.admin_api_key"]`

2559 2823 

2560 The object type, which is always `organization.admin_api_key`2824 The object type, which is always `organization.admin_api_key`


2621 {2885 {

2622 "id": "key_abc",2886 "id": "key_abc",

2623 "created_at": 1711471533,2887 "created_at": 1711471533,

2888 "expires_at": 1714063533,

2624 "object": "organization.admin_api_key",2889 "object": "organization.admin_api_key",

2625 "owner": {2890 "owner": {

2626 "id": "sa_456",2891 "id": "sa_456",


2654 2919 

2655- `name: str`2920- `name: str`

2656 2921 

2922- `expires_in_seconds: Optional[int]`

2923 

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

2925 

2657### Returns2926### Returns

2658 2927 

2659- `class AdminAPIKeyCreateResponse: …`2928- `class AdminAPIKeyCreateResponse: …`


2685{2954{

2686 "id": "key_abc",2955 "id": "key_abc",

2687 "created_at": 1711471533,2956 "created_at": 1711471533,

2957 "expires_at": 1714063533,

2688 "object": "organization.admin_api_key",2958 "object": "organization.admin_api_key",

2689 "owner": {2959 "owner": {

2690 "id": "sa_456",2960 "id": "sa_456",


2729 2999 

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

2731 3001 

3002 - `expires_at: Optional[int]`

3003 

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

3005 

2732 - `object: Literal["organization.admin_api_key"]`3006 - `object: Literal["organization.admin_api_key"]`

2733 3007 

2734 The object type, which is always `organization.admin_api_key`3008 The object type, which is always `organization.admin_api_key`


2794{3068{

2795 "id": "key_abc",3069 "id": "key_abc",

2796 "created_at": 1711471533,3070 "created_at": 1711471533,

3071 "expires_at": 1714063533,

2797 "object": "organization.admin_api_key",3072 "object": "organization.admin_api_key",

2798 "owner": {3073 "owner": {

2799 "id": "sa_456",3074 "id": "sa_456",


2876 3151 

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

2878 3153 

3154 - `expires_at: Optional[int]`

3155 

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

3157 

2879 - `object: Literal["organization.admin_api_key"]`3158 - `object: Literal["organization.admin_api_key"]`

2880 3159 

2881 The object type, which is always `organization.admin_api_key`3160 The object type, which is always `organization.admin_api_key`


16960}17239}

16961```17240```

16962 17241 

17242## Retrieve organization spend alert

17243 

17244`admin.organization.spend_alerts.retrieve(stralert_id) -> OrganizationSpendAlert`

17245 

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

17247 

17248Retrieves an organization spend alert.

17249 

17250### Parameters

17251 

17252- `alert_id: str`

17253 

17254### Returns

17255 

17256- `class OrganizationSpendAlert: …`

17257 

17258 Represents a spend alert configured at the organization level.

17259 

17260 - `id: str`

17261 

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

17263 

17264 - `currency: Literal["USD"]`

17265 

17266 The currency for the threshold amount.

17267 

17268 - `"USD"`

17269 

17270 - `interval: Literal["month"]`

17271 

17272 The time interval for evaluating spend against the threshold.

17273 

17274 - `"month"`

17275 

17276 - `notification_channel: NotificationChannel`

17277 

17278 Email notification settings for a spend alert.

17279 

17280 - `recipients: List[str]`

17281 

17282 Email addresses that receive the spend alert notification.

17283 

17284 - `type: Literal["email"]`

17285 

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

17287 

17288 - `"email"`

17289 

17290 - `subject_prefix: Optional[str]`

17291 

17292 Optional subject prefix for alert emails.

17293 

17294 - `object: Literal["organization.spend_alert"]`

17295 

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

17297 

17298 - `"organization.spend_alert"`

17299 

17300 - `threshold_amount: int`

17301 

17302 The alert threshold amount, in cents.

17303 

17304### Example

17305 

17306```python

17307import os

17308from openai import OpenAI

17309 

17310client = OpenAI(

17311 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

17312)

17313organization_spend_alert = client.admin.organization.spend_alerts.retrieve(

17314 "alert_id",

17315)

17316print(organization_spend_alert.id)

17317```

17318 

17319#### Response

17320 

17321```json

17322{

17323 "id": "id",

17324 "currency": "USD",

17325 "interval": "month",

17326 "notification_channel": {

17327 "recipients": [

17328 "string"

17329 ],

17330 "type": "email",

17331 "subject_prefix": "subject_prefix"

17332 },

17333 "object": "organization.spend_alert",

17334 "threshold_amount": 0

17335}

17336```

17337 

16963## Update organization spend alert17338## Update organization spend alert

16964 17339 

16965`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`17340`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`


23432}23807}

23433```23808```

23434 23809 

23810## Retrieve project spend alert

23811 

23812`admin.organization.projects.spend_alerts.retrieve(stralert_id, SpendAlertRetrieveParams**kwargs) -> ProjectSpendAlert`

23813 

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

23815 

23816Retrieves a project spend alert.

23817 

23818### Parameters

23819 

23820- `project_id: str`

23821 

23822- `alert_id: str`

23823 

23824### Returns

23825 

23826- `class ProjectSpendAlert: …`

23827 

23828 Represents a spend alert configured at the project level.

23829 

23830 - `id: str`

23831 

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

23833 

23834 - `currency: Literal["USD"]`

23835 

23836 The currency for the threshold amount.

23837 

23838 - `"USD"`

23839 

23840 - `interval: Literal["month"]`

23841 

23842 The time interval for evaluating spend against the threshold.

23843 

23844 - `"month"`

23845 

23846 - `notification_channel: NotificationChannel`

23847 

23848 Email notification settings for a spend alert.

23849 

23850 - `recipients: List[str]`

23851 

23852 Email addresses that receive the spend alert notification.

23853 

23854 - `type: Literal["email"]`

23855 

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

23857 

23858 - `"email"`

23859 

23860 - `subject_prefix: Optional[str]`

23861 

23862 Optional subject prefix for alert emails.

23863 

23864 - `object: Literal["project.spend_alert"]`

23865 

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

23867 

23868 - `"project.spend_alert"`

23869 

23870 - `threshold_amount: int`

23871 

23872 The alert threshold amount, in cents.

23873 

23874### Example

23875 

23876```python

23877import os

23878from openai import OpenAI

23879 

23880client = OpenAI(

23881 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

23882)

23883project_spend_alert = client.admin.organization.projects.spend_alerts.retrieve(

23884 alert_id="alert_id",

23885 project_id="project_id",

23886)

23887print(project_spend_alert.id)

23888```

23889 

23890#### Response

23891 

23892```json

23893{

23894 "id": "id",

23895 "currency": "USD",

23896 "interval": "month",

23897 "notification_channel": {

23898 "recipients": [

23899 "string"

23900 ],

23901 "type": "email",

23902 "subject_prefix": "subject_prefix"

23903 },

23904 "object": "project.spend_alert",

23905 "threshold_amount": 0

23906}

23907```

23908 

23435## Update project spend alert23909## Update project spend alert

23436 23910 

23437`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`23911`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`

Details

48 48 

49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

50 50 

51- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]]]`51- `event_types: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]]]`

52 52 

53 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).53 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).

54 54 


150 150 

151 - `"role.assignment.deleted"`151 - `"role.assignment.deleted"`

152 152 

153 - `"role.bound_to_resource"`

154 

155 - `"role.unbound_from_resource"`

156 

153 - `"scim.enabled"`157 - `"scim.enabled"`

154 158 

155 - `"scim.disabled"`159 - `"scim.disabled"`


176 180 

177- `resource_ids: Optional[Sequence[str]]`181- `resource_ids: Optional[Sequence[str]]`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185- `tenant_only: Optional[bool]`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 


192 200 

193 The Unix timestamp (in seconds) of the event.201 The Unix timestamp (in seconds) of the event.

194 202 

195 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`203 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

196 204 

197 The event type.205 The event type.

198 206 


294 302 

295 - `"role.assignment.deleted"`303 - `"role.assignment.deleted"`

296 304 

305 - `"role.bound_to_resource"`

306 

307 - `"role.unbound_from_resource"`

308 

297 - `"scim.enabled"`309 - `"scim.enabled"`

298 310 

299 - `"scim.disabled"`311 - `"scim.disabled"`


914 926 

915 The type of resource the role assignment was scoped to.927 The type of resource the role assignment was scoped to.

916 928 

929 - `role_bound_to_resource: Optional[RoleBoundToResource]`

930 

931 The details for events with this `type`.

932 

933 - `id: Optional[str]`

934 

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

936 

937 - `connector_id: Optional[str]`

938 

939 The connector ID for a ChatGPT workspace connector resource.

940 

941 - `connector_name: Optional[str]`

942 

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

944 

945 - `enabled: Optional[bool]`

946 

947 Whether the connector is enabled for the role.

948 

949 - `permissions: Optional[List[str]]`

950 

951 The permissions granted to the role for the resource.

952 

953 - `resource_id: Optional[str]`

954 

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

956 

957 - `resource_type: Optional[str]`

958 

959 The type of resource the role was bound to.

960 

961 - `role_id: Optional[str]`

962 

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

964 

965 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

966 

967 The connector role mutation path that produced the event.

968 

969 - `"role_toggle"`

970 

971 - `"role_connector_update"`

972 

973 - `"role_delete"`

974 

975 - `"workspace_permissions"`

976 

977 - `"connector_publish"`

978 

979 - `workspace_id: Optional[str]`

980 

981 The workspace ID for a ChatGPT workspace connector resource.

982 

917 - `role_created: Optional[RoleCreated]`983 - `role_created: Optional[RoleCreated]`

918 984 

919 The details for events with this `type`.985 The details for events with this `type`.


946 1012 

947 The role ID.1013 The role ID.

948 1014 

1015 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

1016 

1017 The details for events with this `type`.

1018 

1019 - `id: Optional[str]`

1020 

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

1022 

1023 - `connector_id: Optional[str]`

1024 

1025 The connector ID for a ChatGPT workspace connector resource.

1026 

1027 - `connector_name: Optional[str]`

1028 

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

1030 

1031 - `enabled: Optional[bool]`

1032 

1033 Whether the connector is enabled for the role.

1034 

1035 - `permissions: Optional[List[str]]`

1036 

1037 The permissions remaining for the role after the change.

1038 

1039 - `resource_id: Optional[str]`

1040 

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

1042 

1043 - `resource_type: Optional[str]`

1044 

1045 The type of resource the role was unbound from.

1046 

1047 - `role_id: Optional[str]`

1048 

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

1050 

1051 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

1052 

1053 The connector role mutation path that produced the event.

1054 

1055 - `"role_toggle"`

1056 

1057 - `"role_connector_update"`

1058 

1059 - `"role_delete"`

1060 

1061 - `"workspace_permissions"`

1062 

1063 - `"connector_publish"`

1064 

1065 - `workspace_id: Optional[str]`

1066 

1067 The workspace ID for a ChatGPT workspace connector resource.

1068 

949 - `role_updated: Optional[RoleUpdated]`1069 - `role_updated: Optional[RoleUpdated]`

950 1070 

951 The details for events with this `type`.1071 The details for events with this `type`.


1416 "resource_id": "resource_id",1536 "resource_id": "resource_id",

1417 "resource_type": "resource_type"1537 "resource_type": "resource_type"

1418 },1538 },

1539 "role.bound_to_resource": {

1540 "id": "id",

1541 "connector_id": "connector_id",

1542 "connector_name": "connector_name",

1543 "enabled": true,

1544 "permissions": [

1545 "string"

1546 ],

1547 "resource_id": "resource_id",

1548 "resource_type": "resource_type",

1549 "role_id": "role_id",

1550 "source": "role_toggle",

1551 "workspace_id": "workspace_id"

1552 },

1419 "role.created": {1553 "role.created": {

1420 "id": "id",1554 "id": "id",

1421 "permissions": [1555 "permissions": [


1428 "role.deleted": {1562 "role.deleted": {

1429 "id": "id"1563 "id": "id"

1430 },1564 },

1565 "role.unbound_from_resource": {

1566 "id": "id",

1567 "connector_id": "connector_id",

1568 "connector_name": "connector_name",

1569 "enabled": true,

1570 "permissions": [

1571 "string"

1572 ],

1573 "resource_id": "resource_id",

1574 "resource_type": "resource_type",

1575 "role_id": "role_id",

1576 "source": "role_toggle",

1577 "workspace_id": "workspace_id"

1578 },

1431 "role.updated": {1579 "role.updated": {

1432 "id": "id",1580 "id": "id",

1433 "changes_requested": {1581 "changes_requested": {


1533 1681 

1534 The Unix timestamp (in seconds) of the event.1682 The Unix timestamp (in seconds) of the event.

1535 1683 

1536 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`1684 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

1537 1685 

1538 The event type.1686 The event type.

1539 1687 


1635 1783 

1636 - `"role.assignment.deleted"`1784 - `"role.assignment.deleted"`

1637 1785 

1786 - `"role.bound_to_resource"`

1787 

1788 - `"role.unbound_from_resource"`

1789 

1638 - `"scim.enabled"`1790 - `"scim.enabled"`

1639 1791 

1640 - `"scim.disabled"`1792 - `"scim.disabled"`


2255 2407 

2256 The type of resource the role assignment was scoped to.2408 The type of resource the role assignment was scoped to.

2257 2409 

2410 - `role_bound_to_resource: Optional[RoleBoundToResource]`

2411 

2412 The details for events with this `type`.

2413 

2414 - `id: Optional[str]`

2415 

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

2417 

2418 - `connector_id: Optional[str]`

2419 

2420 The connector ID for a ChatGPT workspace connector resource.

2421 

2422 - `connector_name: Optional[str]`

2423 

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

2425 

2426 - `enabled: Optional[bool]`

2427 

2428 Whether the connector is enabled for the role.

2429 

2430 - `permissions: Optional[List[str]]`

2431 

2432 The permissions granted to the role for the resource.

2433 

2434 - `resource_id: Optional[str]`

2435 

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

2437 

2438 - `resource_type: Optional[str]`

2439 

2440 The type of resource the role was bound to.

2441 

2442 - `role_id: Optional[str]`

2443 

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

2445 

2446 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2447 

2448 The connector role mutation path that produced the event.

2449 

2450 - `"role_toggle"`

2451 

2452 - `"role_connector_update"`

2453 

2454 - `"role_delete"`

2455 

2456 - `"workspace_permissions"`

2457 

2458 - `"connector_publish"`

2459 

2460 - `workspace_id: Optional[str]`

2461 

2462 The workspace ID for a ChatGPT workspace connector resource.

2463 

2258 - `role_created: Optional[RoleCreated]`2464 - `role_created: Optional[RoleCreated]`

2259 2465 

2260 The details for events with this `type`.2466 The details for events with this `type`.


2287 2493 

2288 The role ID.2494 The role ID.

2289 2495 

2496 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

2497 

2498 The details for events with this `type`.

2499 

2500 - `id: Optional[str]`

2501 

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

2503 

2504 - `connector_id: Optional[str]`

2505 

2506 The connector ID for a ChatGPT workspace connector resource.

2507 

2508 - `connector_name: Optional[str]`

2509 

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

2511 

2512 - `enabled: Optional[bool]`

2513 

2514 Whether the connector is enabled for the role.

2515 

2516 - `permissions: Optional[List[str]]`

2517 

2518 The permissions remaining for the role after the change.

2519 

2520 - `resource_id: Optional[str]`

2521 

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

2523 

2524 - `resource_type: Optional[str]`

2525 

2526 The type of resource the role was unbound from.

2527 

2528 - `role_id: Optional[str]`

2529 

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

2531 

2532 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2533 

2534 The connector role mutation path that produced the event.

2535 

2536 - `"role_toggle"`

2537 

2538 - `"role_connector_update"`

2539 

2540 - `"role_delete"`

2541 

2542 - `"workspace_permissions"`

2543 

2544 - `"connector_publish"`

2545 

2546 - `workspace_id: Optional[str]`

2547 

2548 The workspace ID for a ChatGPT workspace connector resource.

2549 

2290 - `role_updated: Optional[RoleUpdated]`2550 - `role_updated: Optional[RoleUpdated]`

2291 2551 

2292 The details for events with this `type`.2552 The details for events with this `type`.


2553 2813 

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

2555 2815 

2816 - `expires_at: Optional[int]`

2817 

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

2819 

2556 - `object: Literal["organization.admin_api_key"]`2820 - `object: Literal["organization.admin_api_key"]`

2557 2821 

2558 The object type, which is always `organization.admin_api_key`2822 The object type, which is always `organization.admin_api_key`


2619 {2883 {

2620 "id": "key_abc",2884 "id": "key_abc",

2621 "created_at": 1711471533,2885 "created_at": 1711471533,

2886 "expires_at": 1714063533,

2622 "object": "organization.admin_api_key",2887 "object": "organization.admin_api_key",

2623 "owner": {2888 "owner": {

2624 "id": "sa_456",2889 "id": "sa_456",


2652 2917 

2653- `name: str`2918- `name: str`

2654 2919 

2920- `expires_in_seconds: Optional[int]`

2921 

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

2923 

2655### Returns2924### Returns

2656 2925 

2657- `class AdminAPIKeyCreateResponse: …`2926- `class AdminAPIKeyCreateResponse: …`


2683{2952{

2684 "id": "key_abc",2953 "id": "key_abc",

2685 "created_at": 1711471533,2954 "created_at": 1711471533,

2955 "expires_at": 1714063533,

2686 "object": "organization.admin_api_key",2956 "object": "organization.admin_api_key",

2687 "owner": {2957 "owner": {

2688 "id": "sa_456",2958 "id": "sa_456",


2727 2997 

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

2729 2999 

3000 - `expires_at: Optional[int]`

3001 

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

3003 

2730 - `object: Literal["organization.admin_api_key"]`3004 - `object: Literal["organization.admin_api_key"]`

2731 3005 

2732 The object type, which is always `organization.admin_api_key`3006 The object type, which is always `organization.admin_api_key`


2792{3066{

2793 "id": "key_abc",3067 "id": "key_abc",

2794 "created_at": 1711471533,3068 "created_at": 1711471533,

3069 "expires_at": 1714063533,

2795 "object": "organization.admin_api_key",3070 "object": "organization.admin_api_key",

2796 "owner": {3071 "owner": {

2797 "id": "sa_456",3072 "id": "sa_456",


2874 3149 

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

2876 3151 

3152 - `expires_at: Optional[int]`

3153 

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

3155 

2877 - `object: Literal["organization.admin_api_key"]`3156 - `object: Literal["organization.admin_api_key"]`

2878 3157 

2879 The object type, which is always `organization.admin_api_key`3158 The object type, which is always `organization.admin_api_key`


16958}17237}

16959```17238```

16960 17239 

17240## Retrieve organization spend alert

17241 

17242`admin.organization.spend_alerts.retrieve(stralert_id) -> OrganizationSpendAlert`

17243 

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

17245 

17246Retrieves an organization spend alert.

17247 

17248### Parameters

17249 

17250- `alert_id: str`

17251 

17252### Returns

17253 

17254- `class OrganizationSpendAlert: …`

17255 

17256 Represents a spend alert configured at the organization level.

17257 

17258 - `id: str`

17259 

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

17261 

17262 - `currency: Literal["USD"]`

17263 

17264 The currency for the threshold amount.

17265 

17266 - `"USD"`

17267 

17268 - `interval: Literal["month"]`

17269 

17270 The time interval for evaluating spend against the threshold.

17271 

17272 - `"month"`

17273 

17274 - `notification_channel: NotificationChannel`

17275 

17276 Email notification settings for a spend alert.

17277 

17278 - `recipients: List[str]`

17279 

17280 Email addresses that receive the spend alert notification.

17281 

17282 - `type: Literal["email"]`

17283 

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

17285 

17286 - `"email"`

17287 

17288 - `subject_prefix: Optional[str]`

17289 

17290 Optional subject prefix for alert emails.

17291 

17292 - `object: Literal["organization.spend_alert"]`

17293 

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

17295 

17296 - `"organization.spend_alert"`

17297 

17298 - `threshold_amount: int`

17299 

17300 The alert threshold amount, in cents.

17301 

17302### Example

17303 

17304```python

17305import os

17306from openai import OpenAI

17307 

17308client = OpenAI(

17309 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

17310)

17311organization_spend_alert = client.admin.organization.spend_alerts.retrieve(

17312 "alert_id",

17313)

17314print(organization_spend_alert.id)

17315```

17316 

17317#### Response

17318 

17319```json

17320{

17321 "id": "id",

17322 "currency": "USD",

17323 "interval": "month",

17324 "notification_channel": {

17325 "recipients": [

17326 "string"

17327 ],

17328 "type": "email",

17329 "subject_prefix": "subject_prefix"

17330 },

17331 "object": "organization.spend_alert",

17332 "threshold_amount": 0

17333}

17334```

17335 

16961## Update organization spend alert17336## Update organization spend alert

16962 17337 

16963`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`17338`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`


23430}23805}

23431```23806```

23432 23807 

23808## Retrieve project spend alert

23809 

23810`admin.organization.projects.spend_alerts.retrieve(stralert_id, SpendAlertRetrieveParams**kwargs) -> ProjectSpendAlert`

23811 

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

23813 

23814Retrieves a project spend alert.

23815 

23816### Parameters

23817 

23818- `project_id: str`

23819 

23820- `alert_id: str`

23821 

23822### Returns

23823 

23824- `class ProjectSpendAlert: …`

23825 

23826 Represents a spend alert configured at the project level.

23827 

23828 - `id: str`

23829 

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

23831 

23832 - `currency: Literal["USD"]`

23833 

23834 The currency for the threshold amount.

23835 

23836 - `"USD"`

23837 

23838 - `interval: Literal["month"]`

23839 

23840 The time interval for evaluating spend against the threshold.

23841 

23842 - `"month"`

23843 

23844 - `notification_channel: NotificationChannel`

23845 

23846 Email notification settings for a spend alert.

23847 

23848 - `recipients: List[str]`

23849 

23850 Email addresses that receive the spend alert notification.

23851 

23852 - `type: Literal["email"]`

23853 

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

23855 

23856 - `"email"`

23857 

23858 - `subject_prefix: Optional[str]`

23859 

23860 Optional subject prefix for alert emails.

23861 

23862 - `object: Literal["project.spend_alert"]`

23863 

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

23865 

23866 - `"project.spend_alert"`

23867 

23868 - `threshold_amount: int`

23869 

23870 The alert threshold amount, in cents.

23871 

23872### Example

23873 

23874```python

23875import os

23876from openai import OpenAI

23877 

23878client = OpenAI(

23879 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

23880)

23881project_spend_alert = client.admin.organization.projects.spend_alerts.retrieve(

23882 alert_id="alert_id",

23883 project_id="project_id",

23884)

23885print(project_spend_alert.id)

23886```

23887 

23888#### Response

23889 

23890```json

23891{

23892 "id": "id",

23893 "currency": "USD",

23894 "interval": "month",

23895 "notification_channel": {

23896 "recipients": [

23897 "string"

23898 ],

23899 "type": "email",

23900 "subject_prefix": "subject_prefix"

23901 },

23902 "object": "project.spend_alert",

23903 "threshold_amount": 0

23904}

23905```

23906 

23433## Update project spend alert23907## Update project spend alert

23434 23908 

23435`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`23909`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

5`admin.organization.admin_api_keys.list(AdminAPIKeyListParams**kwargs) -> SyncCursorPage[AdminAPIKey]`

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `after: Optional[str]`

14 

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

16 

17- `limit: Optional[int]`

18 

19 Maximum number of keys to return.

20 

21- `order: Optional[Literal["asc", "desc"]]`

22 

23 Order results by creation time, ascending or descending.

24 

25 - `"asc"`

26 

27 - `"desc"`

28 

29### Returns

30 

31- `class AdminAPIKey: …`

32 

33 Represents an individual Admin API key in an org.

34 

35 - `id: str`

36 

37 The identifier, which can be referenced in API endpoints

38 

39 - `created_at: int`

40 

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

42 

43 - `expires_at: Optional[int]`

44 

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

46 

47 - `object: Literal["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: Optional[str]`

56 

57 The identifier, which can be referenced in API endpoints

58 

59 - `created_at: Optional[int]`

60 

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

62 

63 - `name: Optional[str]`

64 

65 The name of the user

66 

67 - `object: Optional[str]`

68 

69 The object type, which is always organization.user

70 

71 - `role: Optional[str]`

72 

73 Always `owner`

74 

75 - `type: Optional[str]`

76 

77 Always `user`

78 

79 - `redacted_value: str`

80 

81 The redacted value of the API key

82 

83 - `last_used_at: Optional[int]`

84 

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

86 

87 - `name: Optional[str]`

88 

89 The name of the API key

90 

91### Example

92 

93```python

94import os

95from openai import OpenAI

96 

97client = OpenAI(

98 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

99)

100page = client.admin.organization.admin_api_keys.list()

101page = page.data[0]

102print(page.id)

103```

104 

105#### Response

106 

107```json

108{

109 "data": [

110 {

111 "id": "key_abc",

112 "created_at": 1711471533,

113 "expires_at": 1714063533,

114 "object": "organization.admin_api_key",

115 "owner": {

116 "id": "sa_456",

117 "created_at": 1711471533,

118 "name": "My Service Account",

119 "object": "organization.user",

120 "role": "owner",

121 "type": "user"

122 },

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

124 "last_used_at": 1711471534,

125 "name": "Administration Key"

126 }

127 ],

128 "has_more": false,

129 "object": "list",

130 "first_id": "key_abc",

131 "last_id": "key_xyz"

132}

133```

134 

135## Create admin API key

136 

137`admin.organization.admin_api_keys.create(AdminAPIKeyCreateParams**kwargs) -> AdminAPIKeyCreateResponse`

138 

139**post** `/organization/admin_api_keys`

140 

141Create an organization admin API key

142 

143### Parameters

144 

145- `name: str`

146 

147- `expires_in_seconds: Optional[int]`

148 

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

150 

151### Returns

152 

153- `class AdminAPIKeyCreateResponse: …`

154 

155 Represents an individual Admin API key in an org.

156 

157 - `value: str`

158 

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

160 

161### Example

162 

163```python

164import os

165from openai import OpenAI

166 

167client = OpenAI(

168 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

169)

170admin_api_key = client.admin.organization.admin_api_keys.create(

171 name="New Admin Key",

172)

173print(admin_api_key)

174```

175 

176#### Response

177 

178```json

179{

180 "id": "key_abc",

181 "created_at": 1711471533,

182 "expires_at": 1714063533,

183 "object": "organization.admin_api_key",

184 "owner": {

185 "id": "sa_456",

186 "created_at": 1711471533,

187 "name": "My Service Account",

188 "object": "organization.user",

189 "role": "owner",

190 "type": "user"

191 },

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

193 "last_used_at": 1711471534,

194 "name": "Administration Key",

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

196}

197```

198 

199## Retrieve admin API key

200 

201`admin.organization.admin_api_keys.retrieve(strkey_id) -> AdminAPIKey`

202 

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

204 

205Retrieve a single organization API key

206 

207### Parameters

208 

209- `key_id: str`

210 

211 The ID of the API key.

212 

213### Returns

214 

215- `class AdminAPIKey: …`

216 

217 Represents an individual Admin API key in an org.

218 

219 - `id: str`

220 

221 The identifier, which can be referenced in API endpoints

222 

223 - `created_at: int`

224 

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

226 

227 - `expires_at: Optional[int]`

228 

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

230 

231 - `object: Literal["organization.admin_api_key"]`

232 

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

234 

235 - `"organization.admin_api_key"`

236 

237 - `owner: Owner`

238 

239 - `id: Optional[str]`

240 

241 The identifier, which can be referenced in API endpoints

242 

243 - `created_at: Optional[int]`

244 

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

246 

247 - `name: Optional[str]`

248 

249 The name of the user

250 

251 - `object: Optional[str]`

252 

253 The object type, which is always organization.user

254 

255 - `role: Optional[str]`

256 

257 Always `owner`

258 

259 - `type: Optional[str]`

260 

261 Always `user`

262 

263 - `redacted_value: str`

264 

265 The redacted value of the API key

266 

267 - `last_used_at: Optional[int]`

268 

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

270 

271 - `name: Optional[str]`

272 

273 The name of the API key

274 

275### Example

276 

277```python

278import os

279from openai import OpenAI

280 

281client = OpenAI(

282 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

283)

284admin_api_key = client.admin.organization.admin_api_keys.retrieve(

285 "key_id",

286)

287print(admin_api_key.id)

288```

289 

290#### Response

291 

292```json

293{

294 "id": "key_abc",

295 "created_at": 1711471533,

296 "expires_at": 1714063533,

297 "object": "organization.admin_api_key",

298 "owner": {

299 "id": "sa_456",

300 "created_at": 1711471533,

301 "name": "My Service Account",

302 "object": "organization.user",

303 "role": "owner",

304 "type": "user"

305 },

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

307 "last_used_at": 1711471534,

308 "name": "Administration Key"

309}

310```

311 

312## Delete admin API key

313 

314`admin.organization.admin_api_keys.delete(strkey_id) -> AdminAPIKeyDeleteResponse`

315 

316**delete** `/organization/admin_api_keys/{key_id}`

317 

318Delete an organization admin API key

319 

320### Parameters

321 

322- `key_id: str`

323 

324 The ID of the API key to be deleted.

325 

326### Returns

327 

328- `class AdminAPIKeyDeleteResponse: …`

329 

330 - `id: str`

331 

332 - `deleted: bool`

333 

334 - `object: Literal["organization.admin_api_key.deleted"]`

335 

336 - `"organization.admin_api_key.deleted"`

337 

338### Example

339 

340```python

341import os

342from openai import OpenAI

343 

344client = OpenAI(

345 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

346)

347admin_api_key = client.admin.organization.admin_api_keys.delete(

348 "key_id",

349)

350print(admin_api_key.id)

351```

352 

353#### Response

354 

355```json

356{

357 "id": "key_abc",

358 "deleted": true,

359 "object": "organization.admin_api_key.deleted"

360}

361```

362 

363## Domain Types

364 

365### Admin API Key

366 

367- `class AdminAPIKey: …`

368 

369 Represents an individual Admin API key in an org.

370 

371 - `id: str`

372 

373 The identifier, which can be referenced in API endpoints

374 

375 - `created_at: int`

376 

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

378 

379 - `expires_at: Optional[int]`

380 

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

382 

383 - `object: Literal["organization.admin_api_key"]`

384 

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

386 

387 - `"organization.admin_api_key"`

388 

389 - `owner: Owner`

390 

391 - `id: Optional[str]`

392 

393 The identifier, which can be referenced in API endpoints

394 

395 - `created_at: Optional[int]`

396 

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

398 

399 - `name: Optional[str]`

400 

401 The name of the user

402 

403 - `object: Optional[str]`

404 

405 The object type, which is always organization.user

406 

407 - `role: Optional[str]`

408 

409 Always `owner`

410 

411 - `type: Optional[str]`

412 

413 Always `user`

414 

415 - `redacted_value: str`

416 

417 The redacted value of the API key

418 

419 - `last_used_at: Optional[int]`

420 

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

422 

423 - `name: Optional[str]`

424 

425 The name of the API key

426 

427### Admin API Key Create Response

428 

429- `class AdminAPIKeyCreateResponse: …`

430 

431 Represents an individual Admin API key in an org.

432 

433 - `value: str`

434 

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

436 

437### Admin API Key Delete Response

438 

439- `class AdminAPIKeyDeleteResponse: …`

440 

441 - `id: str`

442 

443 - `deleted: bool`

444 

445 - `object: Literal["organization.admin_api_key.deleted"]`

446 

447 - `"organization.admin_api_key.deleted"`

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

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: Optional[List[Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]]]`49- `event_types: Optional[List[Literal["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: Optional[Sequence[str]]`179- `resource_ids: Optional[Sequence[str]]`

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: Optional[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 


190 198 

191 The Unix timestamp (in seconds) of the event.199 The Unix timestamp (in seconds) of the event.

192 200 

193 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`201 - `type: Literal["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: Optional[RoleBoundToResource]`

928 

929 The details for events with this `type`.

930 

931 - `id: Optional[str]`

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: Optional[str]`

936 

937 The connector ID for a ChatGPT workspace connector resource.

938 

939 - `connector_name: Optional[str]`

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: Optional[bool]`

944 

945 Whether the connector is enabled for the role.

946 

947 - `permissions: Optional[List[str]]`

948 

949 The permissions granted to the role for the resource.

950 

951 - `resource_id: Optional[str]`

952 

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

954 

955 - `resource_type: Optional[str]`

956 

957 The type of resource the role was bound to.

958 

959 - `role_id: Optional[str]`

960 

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

962 

963 - `source: Optional[Literal["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: Optional[str]`

978 

979 The workspace ID for a ChatGPT workspace connector resource.

980 

915 - `role_created: Optional[RoleCreated]`981 - `role_created: Optional[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: Optional[RoleUnboundFromResource]`

1014 

1015 The details for events with this `type`.

1016 

1017 - `id: Optional[str]`

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: Optional[str]`

1022 

1023 The connector ID for a ChatGPT workspace connector resource.

1024 

1025 - `connector_name: Optional[str]`

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: Optional[bool]`

1030 

1031 Whether the connector is enabled for the role.

1032 

1033 - `permissions: Optional[List[str]]`

1034 

1035 The permissions remaining for the role after the change.

1036 

1037 - `resource_id: Optional[str]`

1038 

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

1040 

1041 - `resource_type: Optional[str]`

1042 

1043 The type of resource the role was unbound from.

1044 

1045 - `role_id: Optional[str]`

1046 

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

1048 

1049 - `source: Optional[Literal["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: Optional[str]`

1064 

1065 The workspace ID for a ChatGPT workspace connector resource.

1066 

947 - `role_updated: Optional[RoleUpdated]`1067 - `role_updated: Optional[RoleUpdated]`

948 1068 

949 The details for events with this `type`.1069 The details for events with this `type`.


1414 "resource_id": "resource_id",1534 "resource_id": "resource_id",

1415 "resource_type": "resource_type"1535 "resource_type": "resource_type"

1416 },1536 },

1537 "role.bound_to_resource": {

1538 "id": "id",

1539 "connector_id": "connector_id",

1540 "connector_name": "connector_name",

1541 "enabled": true,

1542 "permissions": [

1543 "string"

1544 ],

1545 "resource_id": "resource_id",

1546 "resource_type": "resource_type",

1547 "role_id": "role_id",

1548 "source": "role_toggle",

1549 "workspace_id": "workspace_id"

1550 },

1417 "role.created": {1551 "role.created": {

1418 "id": "id",1552 "id": "id",

1419 "permissions": [1553 "permissions": [


1426 "role.deleted": {1560 "role.deleted": {

1427 "id": "id"1561 "id": "id"

1428 },1562 },

1563 "role.unbound_from_resource": {

1564 "id": "id",

1565 "connector_id": "connector_id",

1566 "connector_name": "connector_name",

1567 "enabled": true,

1568 "permissions": [

1569 "string"

1570 ],

1571 "resource_id": "resource_id",

1572 "resource_type": "resource_type",

1573 "role_id": "role_id",

1574 "source": "role_toggle",

1575 "workspace_id": "workspace_id"

1576 },

1429 "role.updated": {1577 "role.updated": {

1430 "id": "id",1578 "id": "id",

1431 "changes_requested": {1579 "changes_requested": {


1531 1679 

1532 The Unix timestamp (in seconds) of the event.1680 The Unix timestamp (in seconds) of the event.

1533 1681 

1534 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 54 more]`1682 - `type: Literal["api_key.created", "api_key.updated", "api_key.deleted", 56 more]`

1535 1683 

1536 The event type.1684 The event type.

1537 1685 


1633 1781 

1634 - `"role.assignment.deleted"`1782 - `"role.assignment.deleted"`

1635 1783 

1784 - `"role.bound_to_resource"`

1785 

1786 - `"role.unbound_from_resource"`

1787 

1636 - `"scim.enabled"`1788 - `"scim.enabled"`

1637 1789 

1638 - `"scim.disabled"`1790 - `"scim.disabled"`


2253 2405 

2254 The type of resource the role assignment was scoped to.2406 The type of resource the role assignment was scoped to.

2255 2407 

2408 - `role_bound_to_resource: Optional[RoleBoundToResource]`

2409 

2410 The details for events with this `type`.

2411 

2412 - `id: Optional[str]`

2413 

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

2415 

2416 - `connector_id: Optional[str]`

2417 

2418 The connector ID for a ChatGPT workspace connector resource.

2419 

2420 - `connector_name: Optional[str]`

2421 

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

2423 

2424 - `enabled: Optional[bool]`

2425 

2426 Whether the connector is enabled for the role.

2427 

2428 - `permissions: Optional[List[str]]`

2429 

2430 The permissions granted to the role for the resource.

2431 

2432 - `resource_id: Optional[str]`

2433 

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

2435 

2436 - `resource_type: Optional[str]`

2437 

2438 The type of resource the role was bound to.

2439 

2440 - `role_id: Optional[str]`

2441 

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

2443 

2444 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2445 

2446 The connector role mutation path that produced the event.

2447 

2448 - `"role_toggle"`

2449 

2450 - `"role_connector_update"`

2451 

2452 - `"role_delete"`

2453 

2454 - `"workspace_permissions"`

2455 

2456 - `"connector_publish"`

2457 

2458 - `workspace_id: Optional[str]`

2459 

2460 The workspace ID for a ChatGPT workspace connector resource.

2461 

2256 - `role_created: Optional[RoleCreated]`2462 - `role_created: Optional[RoleCreated]`

2257 2463 

2258 The details for events with this `type`.2464 The details for events with this `type`.


2285 2491 

2286 The role ID.2492 The role ID.

2287 2493 

2494 - `role_unbound_from_resource: Optional[RoleUnboundFromResource]`

2495 

2496 The details for events with this `type`.

2497 

2498 - `id: Optional[str]`

2499 

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

2501 

2502 - `connector_id: Optional[str]`

2503 

2504 The connector ID for a ChatGPT workspace connector resource.

2505 

2506 - `connector_name: Optional[str]`

2507 

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

2509 

2510 - `enabled: Optional[bool]`

2511 

2512 Whether the connector is enabled for the role.

2513 

2514 - `permissions: Optional[List[str]]`

2515 

2516 The permissions remaining for the role after the change.

2517 

2518 - `resource_id: Optional[str]`

2519 

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

2521 

2522 - `resource_type: Optional[str]`

2523 

2524 The type of resource the role was unbound from.

2525 

2526 - `role_id: Optional[str]`

2527 

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

2529 

2530 - `source: Optional[Literal["role_toggle", "role_connector_update", "role_delete", 2 more]]`

2531 

2532 The connector role mutation path that produced the event.

2533 

2534 - `"role_toggle"`

2535 

2536 - `"role_connector_update"`

2537 

2538 - `"role_delete"`

2539 

2540 - `"workspace_permissions"`

2541 

2542 - `"connector_publish"`

2543 

2544 - `workspace_id: Optional[str]`

2545 

2546 The workspace ID for a ChatGPT workspace connector resource.

2547 

2288 - `role_updated: Optional[RoleUpdated]`2548 - `role_updated: Optional[RoleUpdated]`

2289 2549 

2290 The details for events with this `type`.2550 The details for events with this `type`.

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

5388}5388}

5389```5389```

5390 5390 

5391## Retrieve project spend alert

5392 

5393`admin.organization.projects.spend_alerts.retrieve(stralert_id, SpendAlertRetrieveParams**kwargs) -> ProjectSpendAlert`

5394 

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

5396 

5397Retrieves a project spend alert.

5398 

5399### Parameters

5400 

5401- `project_id: str`

5402 

5403- `alert_id: str`

5404 

5405### Returns

5406 

5407- `class ProjectSpendAlert: …`

5408 

5409 Represents a spend alert configured at the project level.

5410 

5411 - `id: str`

5412 

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

5414 

5415 - `currency: Literal["USD"]`

5416 

5417 The currency for the threshold amount.

5418 

5419 - `"USD"`

5420 

5421 - `interval: Literal["month"]`

5422 

5423 The time interval for evaluating spend against the threshold.

5424 

5425 - `"month"`

5426 

5427 - `notification_channel: NotificationChannel`

5428 

5429 Email notification settings for a spend alert.

5430 

5431 - `recipients: List[str]`

5432 

5433 Email addresses that receive the spend alert notification.

5434 

5435 - `type: Literal["email"]`

5436 

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

5438 

5439 - `"email"`

5440 

5441 - `subject_prefix: Optional[str]`

5442 

5443 Optional subject prefix for alert emails.

5444 

5445 - `object: Literal["project.spend_alert"]`

5446 

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

5448 

5449 - `"project.spend_alert"`

5450 

5451 - `threshold_amount: int`

5452 

5453 The alert threshold amount, in cents.

5454 

5455### Example

5456 

5457```python

5458import os

5459from openai import OpenAI

5460 

5461client = OpenAI(

5462 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

5463)

5464project_spend_alert = client.admin.organization.projects.spend_alerts.retrieve(

5465 alert_id="alert_id",

5466 project_id="project_id",

5467)

5468print(project_spend_alert.id)

5469```

5470 

5471#### Response

5472 

5473```json

5474{

5475 "id": "id",

5476 "currency": "USD",

5477 "interval": "month",

5478 "notification_channel": {

5479 "recipients": [

5480 "string"

5481 ],

5482 "type": "email",

5483 "subject_prefix": "subject_prefix"

5484 },

5485 "object": "project.spend_alert",

5486 "threshold_amount": 0

5487}

5488```

5489 

5391## Update project spend alert5490## Update project spend alert

5392 5491 

5393`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`5492`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`

Details

262}262}

263```263```

264 264 

265## Retrieve project spend alert

266 

267`admin.organization.projects.spend_alerts.retrieve(stralert_id, SpendAlertRetrieveParams**kwargs) -> ProjectSpendAlert`

268 

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

270 

271Retrieves a project spend alert.

272 

273### Parameters

274 

275- `project_id: str`

276 

277- `alert_id: str`

278 

279### Returns

280 

281- `class ProjectSpendAlert: …`

282 

283 Represents a spend alert configured at the project level.

284 

285 - `id: str`

286 

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

288 

289 - `currency: Literal["USD"]`

290 

291 The currency for the threshold amount.

292 

293 - `"USD"`

294 

295 - `interval: Literal["month"]`

296 

297 The time interval for evaluating spend against the threshold.

298 

299 - `"month"`

300 

301 - `notification_channel: NotificationChannel`

302 

303 Email notification settings for a spend alert.

304 

305 - `recipients: List[str]`

306 

307 Email addresses that receive the spend alert notification.

308 

309 - `type: Literal["email"]`

310 

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

312 

313 - `"email"`

314 

315 - `subject_prefix: Optional[str]`

316 

317 Optional subject prefix for alert emails.

318 

319 - `object: Literal["project.spend_alert"]`

320 

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

322 

323 - `"project.spend_alert"`

324 

325 - `threshold_amount: int`

326 

327 The alert threshold amount, in cents.

328 

329### Example

330 

331```python

332import os

333from openai import OpenAI

334 

335client = OpenAI(

336 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

337)

338project_spend_alert = client.admin.organization.projects.spend_alerts.retrieve(

339 alert_id="alert_id",

340 project_id="project_id",

341)

342print(project_spend_alert.id)

343```

344 

345#### Response

346 

347```json

348{

349 "id": "id",

350 "currency": "USD",

351 "interval": "month",

352 "notification_channel": {

353 "recipients": [

354 "string"

355 ],

356 "type": "email",

357 "subject_prefix": "subject_prefix"

358 },

359 "object": "project.spend_alert",

360 "threshold_amount": 0

361}

362```

363 

265## Update project spend alert364## Update project spend alert

266 365 

267`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`366`admin.organization.projects.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> ProjectSpendAlert`

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

255}255}

256```256```

257 257 

258## Retrieve organization spend alert

259 

260`admin.organization.spend_alerts.retrieve(stralert_id) -> OrganizationSpendAlert`

261 

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

263 

264Retrieves an organization spend alert.

265 

266### Parameters

267 

268- `alert_id: str`

269 

270### Returns

271 

272- `class OrganizationSpendAlert: …`

273 

274 Represents a spend alert configured at the organization level.

275 

276 - `id: str`

277 

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

279 

280 - `currency: Literal["USD"]`

281 

282 The currency for the threshold amount.

283 

284 - `"USD"`

285 

286 - `interval: Literal["month"]`

287 

288 The time interval for evaluating spend against the threshold.

289 

290 - `"month"`

291 

292 - `notification_channel: NotificationChannel`

293 

294 Email notification settings for a spend alert.

295 

296 - `recipients: List[str]`

297 

298 Email addresses that receive the spend alert notification.

299 

300 - `type: Literal["email"]`

301 

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

303 

304 - `"email"`

305 

306 - `subject_prefix: Optional[str]`

307 

308 Optional subject prefix for alert emails.

309 

310 - `object: Literal["organization.spend_alert"]`

311 

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

313 

314 - `"organization.spend_alert"`

315 

316 - `threshold_amount: int`

317 

318 The alert threshold amount, in cents.

319 

320### Example

321 

322```python

323import os

324from openai import OpenAI

325 

326client = OpenAI(

327 admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"), # This is the default and can be omitted

328)

329organization_spend_alert = client.admin.organization.spend_alerts.retrieve(

330 "alert_id",

331)

332print(organization_spend_alert.id)

333```

334 

335#### Response

336 

337```json

338{

339 "id": "id",

340 "currency": "USD",

341 "interval": "month",

342 "notification_channel": {

343 "recipients": [

344 "string"

345 ],

346 "type": "email",

347 "subject_prefix": "subject_prefix"

348 },

349 "object": "organization.spend_alert",

350 "threshold_amount": 0

351}

352```

353 

258## Update organization spend alert354## Update organization spend alert

259 355 

260`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`356`admin.organization.spend_alerts.update(stralert_id, SpendAlertUpdateParams**kwargs) -> OrganizationSpendAlert`

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

3470 Configuration options for3470 Configuration options for

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

3472 3472 

3473 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

3474 

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

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

3477 used for the response.

3478 

3479 - `"auto"`

3480 

3481 - `"current_turn"`

3482 

3483 - `"all_turns"`

3484 

3473 - `effort: Optional[ReasoningEffort]`3485 - `effort: Optional[ReasoningEffort]`

3474 3486 

3475 Constrains effort on reasoning for3487 Constrains effort on reasoning for


8744 Configuration options for8756 Configuration options for

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

8746 8758 

8759 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

8760 

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

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

8763 used for the response.

8764 

8765 - `"auto"`

8766 

8767 - `"current_turn"`

8768 

8769 - `"all_turns"`

8770 

8747 - `effort: Optional[ReasoningEffort]`8771 - `effort: Optional[ReasoningEffort]`

8748 8772 

8749 Constrains effort on reasoning for8773 Constrains effort on reasoning for


9136 "prompt_cache_key": "prompt-cache-key-1234",9160 "prompt_cache_key": "prompt-cache-key-1234",

9137 "prompt_cache_retention": "in_memory",9161 "prompt_cache_retention": "in_memory",

9138 "reasoning": {9162 "reasoning": {

9163 "context": "auto",

9139 "effort": "none",9164 "effort": "none",

9140 "generate_summary": "auto",9165 "generate_summary": "auto",

9141 "summary": "auto"9166 "summary": "auto"


14796 Configuration options for14821 Configuration options for

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

14798 14823 

14824 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

14825 

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

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

14828 used for the response.

14829 

14830 - `"auto"`

14831 

14832 - `"current_turn"`

14833 

14834 - `"all_turns"`

14835 

14799 - `effort: Optional[ReasoningEffort]`14836 - `effort: Optional[ReasoningEffort]`

14800 14837 

14801 Constrains effort on reasoning for14838 Constrains effort on reasoning for


15190 "prompt_cache_key": "prompt-cache-key-1234",15227 "prompt_cache_key": "prompt-cache-key-1234",

15191 "prompt_cache_retention": "in_memory",15228 "prompt_cache_retention": "in_memory",

15192 "reasoning": {15229 "reasoning": {

15230 "context": "auto",

15193 "effort": "none",15231 "effort": "none",

15194 "generate_summary": "auto",15232 "generate_summary": "auto",

15195 "summary": "auto"15233 "summary": "auto"


20150 Configuration options for20188 Configuration options for

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

20152 20190 

20191 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

20192 

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

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

20195 used for the response.

20196 

20197 - `"auto"`

20198 

20199 - `"current_turn"`

20200 

20201 - `"all_turns"`

20202 

20153 - `effort: Optional[ReasoningEffort]`20203 - `effort: Optional[ReasoningEffort]`

20154 20204 

20155 Constrains effort on reasoning for20205 Constrains effort on reasoning for


20544 "prompt_cache_key": "prompt-cache-key-1234",20594 "prompt_cache_key": "prompt-cache-key-1234",

20545 "prompt_cache_retention": "in_memory",20595 "prompt_cache_retention": "in_memory",

20546 "reasoning": {20596 "reasoning": {

20597 "context": "auto",

20547 "effort": "none",20598 "effort": "none",

20548 "generate_summary": "auto",20599 "generate_summary": "auto",

20549 "summary": "auto"20600 "summary": "auto"


36187 Configuration options for36238 Configuration options for

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

36189 36240 

36241 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

36242 

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

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

36245 used for the response.

36246 

36247 - `"auto"`

36248 

36249 - `"current_turn"`

36250 

36251 - `"all_turns"`

36252 

36190 - `effort: Optional[ReasoningEffort]`36253 - `effort: Optional[ReasoningEffort]`

36191 36254 

36192 Constrains effort on reasoning for36255 Constrains effort on reasoning for


41678 Configuration options for41741 Configuration options for

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

41680 41743 

41744 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

41745 

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

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

41748 used for the response.

41749 

41750 - `"auto"`

41751 

41752 - `"current_turn"`

41753 

41754 - `"all_turns"`

41755 

41681 - `effort: Optional[ReasoningEffort]`41756 - `effort: Optional[ReasoningEffort]`

41682 41757 

41683 Constrains effort on reasoning for41758 Constrains effort on reasoning for


47919 Configuration options for47994 Configuration options for

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

47921 47996 

47997 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

47998 

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

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

48001 used for the response.

48002 

48003 - `"auto"`

48004 

48005 - `"current_turn"`

48006 

48007 - `"all_turns"`

48008 

47922 - `effort: Optional[ReasoningEffort]`48009 - `effort: Optional[ReasoningEffort]`

47923 48010 

47924 Constrains effort on reasoning for48011 Constrains effort on reasoning for


53310 Configuration options for53397 Configuration options for

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

53312 53399 

53400 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

53401 

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

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

53404 used for the response.

53405 

53406 - `"auto"`

53407 

53408 - `"current_turn"`

53409 

53410 - `"all_turns"`

53411 

53313 - `effort: Optional[ReasoningEffort]`53412 - `effort: Optional[ReasoningEffort]`

53314 53413 

53315 Constrains effort on reasoning for53414 Constrains effort on reasoning for


59447 Configuration options for59546 Configuration options for

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

59449 59548 

59549 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

59550 

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

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

59553 used for the response.

59554 

59555 - `"auto"`

59556 

59557 - `"current_turn"`

59558 

59559 - `"all_turns"`

59560 

59450 - `effort: Optional[ReasoningEffort]`59561 - `effort: Optional[ReasoningEffort]`

59451 59562 

59452 Constrains effort on reasoning for59563 Constrains effort on reasoning for


64542 Configuration options for64653 Configuration options for

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

64544 64655 

64656 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

64657 

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

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

64660 used for the response.

64661 

64662 - `"auto"`

64663 

64664 - `"current_turn"`

64665 

64666 - `"all_turns"`

64667 

64545 - `effort: Optional[ReasoningEffort]`64668 - `effort: Optional[ReasoningEffort]`

64546 64669 

64547 Constrains effort on reasoning for64670 Constrains effort on reasoning for


88644 Configuration options for88767 Configuration options for

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

88646 88769 

88770 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

88771 

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

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

88774 used for the response.

88775 

88776 - `"auto"`

88777 

88778 - `"current_turn"`

88779 

88780 - `"all_turns"`

88781 

88647 - `effort: Optional[ReasoningEffort]`88782 - `effort: Optional[ReasoningEffort]`

88648 88783 

88649 Constrains effort on reasoning for88784 Constrains effort on reasoning for


94252 Configuration options for94387 Configuration options for

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

94254 94389 

94390 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

94391 

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

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

94394 used for the response.

94395 

94396 - `"auto"`

94397 

94398 - `"current_turn"`

94399 

94400 - `"all_turns"`

94401 

94255 - `effort: Optional[ReasoningEffort]`94402 - `effort: Optional[ReasoningEffort]`

94256 94403 

94257 Constrains effort on reasoning for94404 Constrains effort on reasoning for


101616 Configuration options for101763 Configuration options for

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

101618 101765 

101766 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

101767 

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

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

101770 used for the response.

101771 

101772 - `"auto"`

101773 

101774 - `"current_turn"`

101775 

101776 - `"all_turns"`

101777 

101619 - `effort: Optional[ReasoningEffort]`101778 - `effort: Optional[ReasoningEffort]`

101620 101779 

101621 Constrains effort on reasoning for101780 Constrains effort on reasoning for


107080 Configuration options for107239 Configuration options for

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

107082 107241 

107242 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

107243 

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

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

107246 used for the response.

107247 

107248 - `"auto"`

107249 

107250 - `"current_turn"`

107251 

107252 - `"all_turns"`

107253 

107083 - `effort: Optional[ReasoningEffort]`107254 - `effort: Optional[ReasoningEffort]`

107084 107255 

107085 Constrains effort on reasoning for107256 Constrains effort on reasoning for


119100 119271 

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

119102 119273 

119274 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

119275 

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

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

119278 used for the response.

119279 

119280 - `"auto"`

119281 

119282 - `"current_turn"`

119283 

119284 - `"all_turns"`

119285 

119103 - `effort: Optional[ReasoningEffort]`119286 - `effort: Optional[ReasoningEffort]`

119104 119287 

119105 Constrains effort on reasoning for119288 Constrains effort on reasoning for

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

3131 3131 

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

3133 3133 

3134 - `context: Optional[Literal["auto", "current_turn", "all_turns"]]`

3135 

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

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

3138 used for the response.

3139 

3140 - `"auto"`

3141 

3142 - `"current_turn"`

3143 

3144 - `"all_turns"`

3145 

3134 - `effort: Optional[ReasoningEffort]`3146 - `effort: Optional[ReasoningEffort]`

3135 3147 

3136 Constrains effort on reasoning for3148 Constrains effort on reasoning for

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

268 268 

269 - `class VideoVideoReferenceInputParam: …`269 - `class VideoVideoReferenceInputParam: …`

270 270 

271 Reference to the completed video.271 Reference to the completed video to edit.

272 272 

273 - `id: str`273 - `id: str`

274 274 

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

48 48 

49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

50 50 

51- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`51- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

52 52 

53 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).53 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).

54 54 


150 150 

151 - `"role.assignment.deleted"`151 - `"role.assignment.deleted"`

152 152 

153 - `"role.bound_to_resource"`

154 

155 - `"role.unbound_from_resource"`

156 

153 - `"scim.enabled"`157 - `"scim.enabled"`

154 158 

155 - `"scim.disabled"`159 - `"scim.disabled"`


176 180 

177- `resource_ids: optional array of string`181- `resource_ids: optional array of string`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185- `tenant_only: optional boolean`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 

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

184 192 

185 - `id: string`193 - `id: string`

186 194 


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" or "api_key.updated" or "api_key.deleted" or 54 more`201 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 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": optional object { id, connector_id, connector_name, 7 more }`

928 

929 The details for events with this `type`.

930 

931 - `id: optional 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: optional string`

936 

937 The connector ID for a ChatGPT workspace connector resource.

938 

939 - `connector_name: optional 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: optional boolean`

944 

945 Whether the connector is enabled for the role.

946 

947 - `permissions: optional array of string`

948 

949 The permissions granted to the role for the resource.

950 

951 - `resource_id: optional string`

952 

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

954 

955 - `resource_type: optional string`

956 

957 The type of resource the role was bound to.

958 

959 - `role_id: optional string`

960 

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

962 

963 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 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: optional string`

978 

979 The workspace ID for a ChatGPT workspace connector resource.

980 

915 - `"role.created": optional object { id, permissions, resource_id, 2 more }`981 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

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": optional object { id, connector_id, connector_name, 7 more }`

1014 

1015 The details for events with this `type`.

1016 

1017 - `id: optional 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: optional string`

1022 

1023 The connector ID for a ChatGPT workspace connector resource.

1024 

1025 - `connector_name: optional 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: optional boolean`

1030 

1031 Whether the connector is enabled for the role.

1032 

1033 - `permissions: optional array of string`

1034 

1035 The permissions remaining for the role after the change.

1036 

1037 - `resource_id: optional string`

1038 

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

1040 

1041 - `resource_type: optional string`

1042 

1043 The type of resource the role was unbound from.

1044 

1045 - `role_id: optional string`

1046 

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

1048 

1049 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 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: optional string`

1064 

1065 The workspace ID for a ChatGPT workspace connector resource.

1066 

947 - `"role.updated": optional object { id, changes_requested }`1067 - `"role.updated": optional object { id, changes_requested }`

948 1068 

949 The details for events with this `type`.1069 The details for events with this `type`.


1417 "resource_id": "resource_id",1537 "resource_id": "resource_id",

1418 "resource_type": "resource_type"1538 "resource_type": "resource_type"

1419 },1539 },

1540 "role.bound_to_resource": {

1541 "id": "id",

1542 "connector_id": "connector_id",

1543 "connector_name": "connector_name",

1544 "enabled": true,

1545 "permissions": [

1546 "string"

1547 ],

1548 "resource_id": "resource_id",

1549 "resource_type": "resource_type",

1550 "role_id": "role_id",

1551 "source": "role_toggle",

1552 "workspace_id": "workspace_id"

1553 },

1420 "role.created": {1554 "role.created": {

1421 "id": "id",1555 "id": "id",

1422 "permissions": [1556 "permissions": [


1429 "role.deleted": {1563 "role.deleted": {

1430 "id": "id"1564 "id": "id"

1431 },1565 },

1566 "role.unbound_from_resource": {

1567 "id": "id",

1568 "connector_id": "connector_id",

1569 "connector_name": "connector_name",

1570 "enabled": true,

1571 "permissions": [

1572 "string"

1573 ],

1574 "resource_id": "resource_id",

1575 "resource_type": "resource_type",

1576 "role_id": "role_id",

1577 "source": "role_toggle",

1578 "workspace_id": "workspace_id"

1579 },

1432 "role.updated": {1580 "role.updated": {

1433 "id": "id",1581 "id": "id",

1434 "changes_requested": {1582 "changes_requested": {


1594 1742 

1595### Audit Log List Response1743### Audit Log List Response

1596 1744 

1597- `AuditLogListResponse object { id, effective_at, type, 55 more }`1745- `AuditLogListResponse object { id, effective_at, type, 57 more }`

1598 1746 

1599 A log of a user action or configuration change within this organization.1747 A log of a user action or configuration change within this organization.

1600 1748 


1606 1754 

1607 The Unix timestamp (in seconds) of the event.1755 The Unix timestamp (in seconds) of the event.

1608 1756 

1609 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`1757 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

1610 1758 

1611 The event type.1759 The event type.

1612 1760 


1708 1856 

1709 - `"role.assignment.deleted"`1857 - `"role.assignment.deleted"`

1710 1858 

1859 - `"role.bound_to_resource"`

1860 

1861 - `"role.unbound_from_resource"`

1862 

1711 - `"scim.enabled"`1863 - `"scim.enabled"`

1712 1864 

1713 - `"scim.disabled"`1865 - `"scim.disabled"`


2328 2480 

2329 The type of resource the role assignment was scoped to.2481 The type of resource the role assignment was scoped to.

2330 2482 

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

2484 

2485 The details for events with this `type`.

2486 

2487 - `id: optional string`

2488 

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

2490 

2491 - `connector_id: optional string`

2492 

2493 The connector ID for a ChatGPT workspace connector resource.

2494 

2495 - `connector_name: optional string`

2496 

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

2498 

2499 - `enabled: optional boolean`

2500 

2501 Whether the connector is enabled for the role.

2502 

2503 - `permissions: optional array of string`

2504 

2505 The permissions granted to the role for the resource.

2506 

2507 - `resource_id: optional string`

2508 

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

2510 

2511 - `resource_type: optional string`

2512 

2513 The type of resource the role was bound to.

2514 

2515 - `role_id: optional string`

2516 

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

2518 

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

2520 

2521 The connector role mutation path that produced the event.

2522 

2523 - `"role_toggle"`

2524 

2525 - `"role_connector_update"`

2526 

2527 - `"role_delete"`

2528 

2529 - `"workspace_permissions"`

2530 

2531 - `"connector_publish"`

2532 

2533 - `workspace_id: optional string`

2534 

2535 The workspace ID for a ChatGPT workspace connector resource.

2536 

2331 - `"role.created": optional object { id, permissions, resource_id, 2 more }`2537 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

2332 2538 

2333 The details for events with this `type`.2539 The details for events with this `type`.


2360 2566 

2361 The role ID.2567 The role ID.

2362 2568 

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

2570 

2571 The details for events with this `type`.

2572 

2573 - `id: optional string`

2574 

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

2576 

2577 - `connector_id: optional string`

2578 

2579 The connector ID for a ChatGPT workspace connector resource.

2580 

2581 - `connector_name: optional string`

2582 

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

2584 

2585 - `enabled: optional boolean`

2586 

2587 Whether the connector is enabled for the role.

2588 

2589 - `permissions: optional array of string`

2590 

2591 The permissions remaining for the role after the change.

2592 

2593 - `resource_id: optional string`

2594 

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

2596 

2597 - `resource_type: optional string`

2598 

2599 The type of resource the role was unbound from.

2600 

2601 - `role_id: optional string`

2602 

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

2604 

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

2606 

2607 The connector role mutation path that produced the event.

2608 

2609 - `"role_toggle"`

2610 

2611 - `"role_connector_update"`

2612 

2613 - `"role_delete"`

2614 

2615 - `"workspace_permissions"`

2616 

2617 - `"connector_publish"`

2618 

2619 - `workspace_id: optional string`

2620 

2621 The workspace ID for a ChatGPT workspace connector resource.

2622 

2363 - `"role.updated": optional object { id, changes_requested }`2623 - `"role.updated": optional object { id, changes_requested }`

2364 2624 

2365 The details for events with this `type`.2625 The details for events with this `type`.


2622 2882 

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

2624 2884 

2885 - `expires_at: number`

2886 

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

2888 

2625 - `object: "organization.admin_api_key"`2889 - `object: "organization.admin_api_key"`

2626 2890 

2627 The object type, which is always `organization.admin_api_key`2891 The object type, which is always `organization.admin_api_key`


2691 {2955 {

2692 "id": "key_abc",2956 "id": "key_abc",

2693 "created_at": 1711471533,2957 "created_at": 1711471533,

2958 "expires_at": 1714063533,

2694 "object": "organization.admin_api_key",2959 "object": "organization.admin_api_key",

2695 "owner": {2960 "owner": {

2696 "id": "sa_456",2961 "id": "sa_456",


2732 "name": "Main Admin Key",2997 "name": "Main Admin Key",

2733 "redacted_value": "sk-admin...def",2998 "redacted_value": "sk-admin...def",

2734 "created_at": 1711471533,2999 "created_at": 1711471533,

3000 "expires_at": 1714063533,

2735 "last_used_at": 1711471534,3001 "last_used_at": 1711471534,

2736 "owner": {3002 "owner": {

2737 "type": "service_account",3003 "type": "service_account",


2759 3025 

2760- `name: string`3026- `name: string`

2761 3027 

3028- `expires_in_seconds: optional number`

3029 

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

3031 

2762### Returns3032### Returns

2763 3033 

2764- `value: string`3034- `value: string`


2772 -H 'Content-Type: application/json' \3042 -H 'Content-Type: application/json' \

2773 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \3043 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2774 -d '{3044 -d '{

2775 "name": "New Admin Key"3045 "name": "New Admin Key",

3046 "expires_in_seconds": 2592000

2776 }'3047 }'

2777```3048```

2778 3049 


2782{3053{

2783 "id": "key_abc",3054 "id": "key_abc",

2784 "created_at": 1711471533,3055 "created_at": 1711471533,

3056 "expires_at": 1714063533,

2785 "object": "organization.admin_api_key",3057 "object": "organization.admin_api_key",

2786 "owner": {3058 "owner": {

2787 "id": "sa_456",3059 "id": "sa_456",


2805 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \3077 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2806 -H "Content-Type: application/json" \3078 -H "Content-Type: application/json" \

2807 -d '{3079 -d '{

2808 "name": "New Admin Key"3080 "name": "New Admin Key",

3081 "expires_in_seconds": 2592000

2809 }'3082 }'

2810```3083```

2811 3084 


2818 "name": "New Admin Key",3091 "name": "New Admin Key",

2819 "redacted_value": "sk-admin...xyz",3092 "redacted_value": "sk-admin...xyz",

2820 "created_at": 1711471533,3093 "created_at": 1711471533,

3094 "expires_at": 1714063533,

2821 "last_used_at": 1711471534,3095 "last_used_at": 1711471534,

2822 "owner": {3096 "owner": {

2823 "type": "user",3097 "type": "user",


2845 3119 

2846### Returns3120### Returns

2847 3121 

2848- `AdminAPIKey object { id, created_at, object, 4 more }`3122- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

2849 3123 

2850 Represents an individual Admin API key in an org.3124 Represents an individual Admin API key in an org.

2851 3125 


2857 3131 

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

2859 3133 

3134 - `expires_at: number`

3135 

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

3137 

2860 - `object: "organization.admin_api_key"`3138 - `object: "organization.admin_api_key"`

2861 3139 

2862 The object type, which is always `organization.admin_api_key`3140 The object type, which is always `organization.admin_api_key`


2914{3192{

2915 "id": "key_abc",3193 "id": "key_abc",

2916 "created_at": 1711471533,3194 "created_at": 1711471533,

3195 "expires_at": 1714063533,

2917 "object": "organization.admin_api_key",3196 "object": "organization.admin_api_key",

2918 "owner": {3197 "owner": {

2919 "id": "sa_456",3198 "id": "sa_456",


3020 3299 

3021### Admin API Key3300### Admin API Key

3022 3301 

3023- `AdminAPIKey object { id, created_at, object, 4 more }`3302- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

3024 3303 

3025 Represents an individual Admin API key in an org.3304 Represents an individual Admin API key in an org.

3026 3305 


3032 3311 

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

3034 3313 

3314 - `expires_at: number`

3315 

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

3317 

3035 - `object: "organization.admin_api_key"`3318 - `object: "organization.admin_api_key"`

3036 3319 

3037 The object type, which is always `organization.admin_api_key`3320 The object type, which is always `organization.admin_api_key`


18067}18350}

18068```18351```

18069 18352 

18353## Retrieve organization spend alert

18354 

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

18356 

18357Retrieves an organization spend alert.

18358 

18359### Path Parameters

18360 

18361- `alert_id: string`

18362 

18363### Returns

18364 

18365- `OrganizationSpendAlert object { id, currency, interval, 3 more }`

18366 

18367 Represents a spend alert configured at the organization level.

18368 

18369 - `id: string`

18370 

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

18372 

18373 - `currency: "USD"`

18374 

18375 The currency for the threshold amount.

18376 

18377 - `"USD"`

18378 

18379 - `interval: "month"`

18380 

18381 The time interval for evaluating spend against the threshold.

18382 

18383 - `"month"`

18384 

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

18386 

18387 Email notification settings for a spend alert.

18388 

18389 - `recipients: array of string`

18390 

18391 Email addresses that receive the spend alert notification.

18392 

18393 - `type: "email"`

18394 

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

18396 

18397 - `"email"`

18398 

18399 - `subject_prefix: optional string`

18400 

18401 Optional subject prefix for alert emails.

18402 

18403 - `object: "organization.spend_alert"`

18404 

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

18406 

18407 - `"organization.spend_alert"`

18408 

18409 - `threshold_amount: number`

18410 

18411 The alert threshold amount, in cents.

18412 

18413### Example

18414 

18415```http

18416curl https://api.openai.com/v1/organization/spend_alerts/$ALERT_ID \

18417 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

18418```

18419 

18420#### Response

18421 

18422```json

18423{

18424 "id": "id",

18425 "currency": "USD",

18426 "interval": "month",

18427 "notification_channel": {

18428 "recipients": [

18429 "string"

18430 ],

18431 "type": "email",

18432 "subject_prefix": "subject_prefix"

18433 },

18434 "object": "organization.spend_alert",

18435 "threshold_amount": 0

18436}

18437```

18438 

18439### Example

18440 

18441```http

18442curl https://api.openai.com/v1/organization/spend_alerts/alert_abc123 \

18443 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

18444 -H "Content-Type: application/json"

18445```

18446 

18447#### Response

18448 

18449```json

18450{

18451 "id": "alert_abc123",

18452 "object": "organization.spend_alert",

18453 "threshold_amount": 150000,

18454 "currency": "USD",

18455 "interval": "month",

18456 "notification_channel": {

18457 "type": "email",

18458 "recipients": ["finance@example.com"],

18459 "subject_prefix": "OpenAI spend alert"

18460 }

18461}

18462```

18463 

18070## Update organization spend alert18464## Update organization spend alert

18071 18465 

18072**post** `/organization/spend_alerts/{alert_id}`18466**post** `/organization/spend_alerts/{alert_id}`


25642}26036}

25643```26037```

25644 26038 

26039## Retrieve project spend alert

26040 

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

26042 

26043Retrieves a project spend alert.

26044 

26045### Path Parameters

26046 

26047- `project_id: string`

26048 

26049- `alert_id: string`

26050 

26051### Returns

26052 

26053- `ProjectSpendAlert object { id, currency, interval, 3 more }`

26054 

26055 Represents a spend alert configured at the project level.

26056 

26057 - `id: string`

26058 

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

26060 

26061 - `currency: "USD"`

26062 

26063 The currency for the threshold amount.

26064 

26065 - `"USD"`

26066 

26067 - `interval: "month"`

26068 

26069 The time interval for evaluating spend against the threshold.

26070 

26071 - `"month"`

26072 

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

26074 

26075 Email notification settings for a spend alert.

26076 

26077 - `recipients: array of string`

26078 

26079 Email addresses that receive the spend alert notification.

26080 

26081 - `type: "email"`

26082 

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

26084 

26085 - `"email"`

26086 

26087 - `subject_prefix: optional string`

26088 

26089 Optional subject prefix for alert emails.

26090 

26091 - `object: "project.spend_alert"`

26092 

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

26094 

26095 - `"project.spend_alert"`

26096 

26097 - `threshold_amount: number`

26098 

26099 The alert threshold amount, in cents.

26100 

26101### Example

26102 

26103```http

26104curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

26105 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

26106```

26107 

26108#### Response

26109 

26110```json

26111{

26112 "id": "id",

26113 "currency": "USD",

26114 "interval": "month",

26115 "notification_channel": {

26116 "recipients": [

26117 "string"

26118 ],

26119 "type": "email",

26120 "subject_prefix": "subject_prefix"

26121 },

26122 "object": "project.spend_alert",

26123 "threshold_amount": 0

26124}

26125```

26126 

26127### Example

26128 

26129```http

26130curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

26131 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

26132 -H "Content-Type: application/json"

26133```

26134 

26135#### Response

26136 

26137```json

26138{

26139 "id": "alert_abc123",

26140 "object": "project.spend_alert",

26141 "threshold_amount": 150000,

26142 "currency": "USD",

26143 "interval": "month",

26144 "notification_channel": {

26145 "type": "email",

26146 "recipients": ["finance@example.com"],

26147 "subject_prefix": "OpenAI spend alert"

26148 }

26149}

26150```

26151 

25645## Update project spend alert26152## Update project spend alert

25646 26153 

25647**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`26154**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

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: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`49- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 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](/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](/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: optional array of string`179- `resource_ids: optional array of 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: optional 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 

181- `data: array of object { id, effective_at, type, 55 more }`189- `data: array of object { id, effective_at, type, 57 more }`

182 190 

183 - `id: string`191 - `id: string`

184 192 


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" or "api_key.updated" or "api_key.deleted" or 54 more`199 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 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 object { id, connector_id, connector_name, 7 more }`

926 

927 The details for events with this `type`.

928 

929 - `id: optional 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: optional string`

934 

935 The connector ID for a ChatGPT workspace connector resource.

936 

937 - `connector_name: optional 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: optional boolean`

942 

943 Whether the connector is enabled for the role.

944 

945 - `permissions: optional array of string`

946 

947 The permissions granted to the role for the resource.

948 

949 - `resource_id: optional string`

950 

951 The ID of the resource the role was bound to.

952 

953 - `resource_type: optional string`

954 

955 The type of resource the role was bound to.

956 

957 - `role_id: optional string`

958 

959 The ID of the role that was bound to the resource.

960 

961 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 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 string`

976 

977 The workspace ID for a ChatGPT workspace connector resource.

978 

913 - `"role.created": optional object { id, permissions, resource_id, 2 more }`979 - `"role.created": optional object { 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": optional object { id, connector_id, connector_name, 7 more }`

1012 

1013 The details for events with this `type`.

1014 

1015 - `id: optional 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: optional string`

1020 

1021 The connector ID for a ChatGPT workspace connector resource.

1022 

1023 - `connector_name: optional 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: optional boolean`

1028 

1029 Whether the connector is enabled for the role.

1030 

1031 - `permissions: optional array of string`

1032 

1033 The permissions remaining for the role after the change.

1034 

1035 - `resource_id: optional string`

1036 

1037 The ID of the resource the role was unbound from.

1038 

1039 - `resource_type: optional string`

1040 

1041 The type of resource the role was unbound from.

1042 

1043 - `role_id: optional string`

1044 

1045 The ID of the role that was unbound from the resource.

1046 

1047 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 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 string`

1062 

1063 The workspace ID for a ChatGPT workspace connector resource.

1064 

945 - `"role.updated": optional object { id, changes_requested }`1065 - `"role.updated": optional object { id, changes_requested }`

946 1066 

947 The details for events with this `type`.1067 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": {


1592 1740 

1593### Audit Log List Response1741### Audit Log List Response

1594 1742 

1595- `AuditLogListResponse object { id, effective_at, type, 55 more }`1743- `AuditLogListResponse object { id, effective_at, type, 57 more }`

1596 1744 

1597 A log of a user action or configuration change within this organization.1745 A log of a user action or configuration change within this organization.

1598 1746 


1604 1752 

1605 The Unix timestamp (in seconds) of the event.1753 The Unix timestamp (in seconds) of the event.

1606 1754 

1607 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`1755 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

1608 1756 

1609 The event type.1757 The event type.

1610 1758 


1706 1854 

1707 - `"role.assignment.deleted"`1855 - `"role.assignment.deleted"`

1708 1856 

1857 - `"role.bound_to_resource"`

1858 

1859 - `"role.unbound_from_resource"`

1860 

1709 - `"scim.enabled"`1861 - `"scim.enabled"`

1710 1862 

1711 - `"scim.disabled"`1863 - `"scim.disabled"`


2326 2478 

2327 The type of resource the role assignment was scoped to.2479 The type of resource the role assignment was scoped to.

2328 2480 

2481 - `"role.bound_to_resource": optional object { id, connector_id, connector_name, 7 more }`

2482 

2483 The details for events with this `type`.

2484 

2485 - `id: optional string`

2486 

2487 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2488 

2489 - `connector_id: optional string`

2490 

2491 The connector ID for a ChatGPT workspace connector resource.

2492 

2493 - `connector_name: optional string`

2494 

2495 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2496 

2497 - `enabled: optional boolean`

2498 

2499 Whether the connector is enabled for the role.

2500 

2501 - `permissions: optional array of string`

2502 

2503 The permissions granted to the role for the resource.

2504 

2505 - `resource_id: optional string`

2506 

2507 The ID of the resource the role was bound to.

2508 

2509 - `resource_type: optional string`

2510 

2511 The type of resource the role was bound to.

2512 

2513 - `role_id: optional string`

2514 

2515 The ID of the role that was bound to the resource.

2516 

2517 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

2518 

2519 The connector role mutation path that produced the event.

2520 

2521 - `"role_toggle"`

2522 

2523 - `"role_connector_update"`

2524 

2525 - `"role_delete"`

2526 

2527 - `"workspace_permissions"`

2528 

2529 - `"connector_publish"`

2530 

2531 - `workspace_id: optional string`

2532 

2533 The workspace ID for a ChatGPT workspace connector resource.

2534 

2329 - `"role.created": optional object { id, permissions, resource_id, 2 more }`2535 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

2330 2536 

2331 The details for events with this `type`.2537 The details for events with this `type`.


2358 2564 

2359 The role ID.2565 The role ID.

2360 2566 

2567 - `"role.unbound_from_resource": optional object { id, connector_id, connector_name, 7 more }`

2568 

2569 The details for events with this `type`.

2570 

2571 - `id: optional string`

2572 

2573 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2574 

2575 - `connector_id: optional string`

2576 

2577 The connector ID for a ChatGPT workspace connector resource.

2578 

2579 - `connector_name: optional string`

2580 

2581 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2582 

2583 - `enabled: optional boolean`

2584 

2585 Whether the connector is enabled for the role.

2586 

2587 - `permissions: optional array of string`

2588 

2589 The permissions remaining for the role after the change.

2590 

2591 - `resource_id: optional string`

2592 

2593 The ID of the resource the role was unbound from.

2594 

2595 - `resource_type: optional string`

2596 

2597 The type of resource the role was unbound from.

2598 

2599 - `role_id: optional string`

2600 

2601 The ID of the role that was unbound from the resource.

2602 

2603 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

2604 

2605 The connector role mutation path that produced the event.

2606 

2607 - `"role_toggle"`

2608 

2609 - `"role_connector_update"`

2610 

2611 - `"role_delete"`

2612 

2613 - `"workspace_permissions"`

2614 

2615 - `"connector_publish"`

2616 

2617 - `workspace_id: optional string`

2618 

2619 The workspace ID for a ChatGPT workspace connector resource.

2620 

2361 - `"role.updated": optional object { id, changes_requested }`2621 - `"role.updated": optional object { id, changes_requested }`

2362 2622 

2363 The details for events with this `type`.2623 The details for events with this `type`.


2620 2880 

2621 The Unix timestamp (in seconds) of when the API key was created2881 The Unix timestamp (in seconds) of when the API key was created

2622 2882 

2883 - `expires_at: number`

2884 

2885 The Unix timestamp (in seconds) of when the API key expires

2886 

2623 - `object: "organization.admin_api_key"`2887 - `object: "organization.admin_api_key"`

2624 2888 

2625 The object type, which is always `organization.admin_api_key`2889 The object type, which is always `organization.admin_api_key`


2689 {2953 {

2690 "id": "key_abc",2954 "id": "key_abc",

2691 "created_at": 1711471533,2955 "created_at": 1711471533,

2956 "expires_at": 1714063533,

2692 "object": "organization.admin_api_key",2957 "object": "organization.admin_api_key",

2693 "owner": {2958 "owner": {

2694 "id": "sa_456",2959 "id": "sa_456",


2730 "name": "Main Admin Key",2995 "name": "Main Admin Key",

2731 "redacted_value": "sk-admin...def",2996 "redacted_value": "sk-admin...def",

2732 "created_at": 1711471533,2997 "created_at": 1711471533,

2998 "expires_at": 1714063533,

2733 "last_used_at": 1711471534,2999 "last_used_at": 1711471534,

2734 "owner": {3000 "owner": {

2735 "type": "service_account",3001 "type": "service_account",


2757 3023 

2758- `name: string`3024- `name: string`

2759 3025 

3026- `expires_in_seconds: optional number`

3027 

3028 The number of seconds until the API key expires. Omit this field for a key that does not expire.

3029 

2760### Returns3030### Returns

2761 3031 

2762- `value: string`3032- `value: string`


2770 -H 'Content-Type: application/json' \3040 -H 'Content-Type: application/json' \

2771 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \3041 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2772 -d '{3042 -d '{

2773 "name": "New Admin Key"3043 "name": "New Admin Key",

3044 "expires_in_seconds": 2592000

2774 }'3045 }'

2775```3046```

2776 3047 


2780{3051{

2781 "id": "key_abc",3052 "id": "key_abc",

2782 "created_at": 1711471533,3053 "created_at": 1711471533,

3054 "expires_at": 1714063533,

2783 "object": "organization.admin_api_key",3055 "object": "organization.admin_api_key",

2784 "owner": {3056 "owner": {

2785 "id": "sa_456",3057 "id": "sa_456",


2803 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \3075 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

2804 -H "Content-Type: application/json" \3076 -H "Content-Type: application/json" \

2805 -d '{3077 -d '{

2806 "name": "New Admin Key"3078 "name": "New Admin Key",

3079 "expires_in_seconds": 2592000

2807 }'3080 }'

2808```3081```

2809 3082 


2816 "name": "New Admin Key",3089 "name": "New Admin Key",

2817 "redacted_value": "sk-admin...xyz",3090 "redacted_value": "sk-admin...xyz",

2818 "created_at": 1711471533,3091 "created_at": 1711471533,

3092 "expires_at": 1714063533,

2819 "last_used_at": 1711471534,3093 "last_used_at": 1711471534,

2820 "owner": {3094 "owner": {

2821 "type": "user",3095 "type": "user",


2843 3117 

2844### Returns3118### Returns

2845 3119 

2846- `AdminAPIKey object { id, created_at, object, 4 more }`3120- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

2847 3121 

2848 Represents an individual Admin API key in an org.3122 Represents an individual Admin API key in an org.

2849 3123 


2855 3129 

2856 The Unix timestamp (in seconds) of when the API key was created3130 The Unix timestamp (in seconds) of when the API key was created

2857 3131 

3132 - `expires_at: number`

3133 

3134 The Unix timestamp (in seconds) of when the API key expires

3135 

2858 - `object: "organization.admin_api_key"`3136 - `object: "organization.admin_api_key"`

2859 3137 

2860 The object type, which is always `organization.admin_api_key`3138 The object type, which is always `organization.admin_api_key`


2912{3190{

2913 "id": "key_abc",3191 "id": "key_abc",

2914 "created_at": 1711471533,3192 "created_at": 1711471533,

3193 "expires_at": 1714063533,

2915 "object": "organization.admin_api_key",3194 "object": "organization.admin_api_key",

2916 "owner": {3195 "owner": {

2917 "id": "sa_456",3196 "id": "sa_456",


3018 3297 

3019### Admin API Key3298### Admin API Key

3020 3299 

3021- `AdminAPIKey object { id, created_at, object, 4 more }`3300- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

3022 3301 

3023 Represents an individual Admin API key in an org.3302 Represents an individual Admin API key in an org.

3024 3303 


3030 3309 

3031 The Unix timestamp (in seconds) of when the API key was created3310 The Unix timestamp (in seconds) of when the API key was created

3032 3311 

3312 - `expires_at: number`

3313 

3314 The Unix timestamp (in seconds) of when the API key expires

3315 

3033 - `object: "organization.admin_api_key"`3316 - `object: "organization.admin_api_key"`

3034 3317 

3035 The object type, which is always `organization.admin_api_key`3318 The object type, which is always `organization.admin_api_key`


18065}18348}

18066```18349```

18067 18350 

18351## Retrieve organization spend alert

18352 

18353**get** `/organization/spend_alerts/{alert_id}`

18354 

18355Retrieves an organization spend alert.

18356 

18357### Path Parameters

18358 

18359- `alert_id: string`

18360 

18361### Returns

18362 

18363- `OrganizationSpendAlert object { id, currency, interval, 3 more }`

18364 

18365 Represents a spend alert configured at the organization level.

18366 

18367 - `id: string`

18368 

18369 The identifier, which can be referenced in API endpoints.

18370 

18371 - `currency: "USD"`

18372 

18373 The currency for the threshold amount.

18374 

18375 - `"USD"`

18376 

18377 - `interval: "month"`

18378 

18379 The time interval for evaluating spend against the threshold.

18380 

18381 - `"month"`

18382 

18383 - `notification_channel: object { recipients, type, subject_prefix }`

18384 

18385 Email notification settings for a spend alert.

18386 

18387 - `recipients: array of string`

18388 

18389 Email addresses that receive the spend alert notification.

18390 

18391 - `type: "email"`

18392 

18393 The notification channel type. Currently only `email` is supported.

18394 

18395 - `"email"`

18396 

18397 - `subject_prefix: optional string`

18398 

18399 Optional subject prefix for alert emails.

18400 

18401 - `object: "organization.spend_alert"`

18402 

18403 The object type, which is always `organization.spend_alert`.

18404 

18405 - `"organization.spend_alert"`

18406 

18407 - `threshold_amount: number`

18408 

18409 The alert threshold amount, in cents.

18410 

18411### Example

18412 

18413```http

18414curl https://api.openai.com/v1/organization/spend_alerts/$ALERT_ID \

18415 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

18416```

18417 

18418#### Response

18419 

18420```json

18421{

18422 "id": "id",

18423 "currency": "USD",

18424 "interval": "month",

18425 "notification_channel": {

18426 "recipients": [

18427 "string"

18428 ],

18429 "type": "email",

18430 "subject_prefix": "subject_prefix"

18431 },

18432 "object": "organization.spend_alert",

18433 "threshold_amount": 0

18434}

18435```

18436 

18437### Example

18438 

18439```http

18440curl https://api.openai.com/v1/organization/spend_alerts/alert_abc123 \

18441 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

18442 -H "Content-Type: application/json"

18443```

18444 

18445#### Response

18446 

18447```json

18448{

18449 "id": "alert_abc123",

18450 "object": "organization.spend_alert",

18451 "threshold_amount": 150000,

18452 "currency": "USD",

18453 "interval": "month",

18454 "notification_channel": {

18455 "type": "email",

18456 "recipients": ["finance@example.com"],

18457 "subject_prefix": "OpenAI spend alert"

18458 }

18459}

18460```

18461 

18068## Update organization spend alert18462## Update organization spend alert

18069 18463 

18070**post** `/organization/spend_alerts/{alert_id}`18464**post** `/organization/spend_alerts/{alert_id}`


25640}26034}

25641```26035```

25642 26036 

26037## Retrieve project spend alert

26038 

26039**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

26040 

26041Retrieves a project spend alert.

26042 

26043### Path Parameters

26044 

26045- `project_id: string`

26046 

26047- `alert_id: string`

26048 

26049### Returns

26050 

26051- `ProjectSpendAlert object { id, currency, interval, 3 more }`

26052 

26053 Represents a spend alert configured at the project level.

26054 

26055 - `id: string`

26056 

26057 The identifier, which can be referenced in API endpoints.

26058 

26059 - `currency: "USD"`

26060 

26061 The currency for the threshold amount.

26062 

26063 - `"USD"`

26064 

26065 - `interval: "month"`

26066 

26067 The time interval for evaluating spend against the threshold.

26068 

26069 - `"month"`

26070 

26071 - `notification_channel: object { recipients, type, subject_prefix }`

26072 

26073 Email notification settings for a spend alert.

26074 

26075 - `recipients: array of string`

26076 

26077 Email addresses that receive the spend alert notification.

26078 

26079 - `type: "email"`

26080 

26081 The notification channel type. Currently only `email` is supported.

26082 

26083 - `"email"`

26084 

26085 - `subject_prefix: optional string`

26086 

26087 Optional subject prefix for alert emails.

26088 

26089 - `object: "project.spend_alert"`

26090 

26091 The object type, which is always `project.spend_alert`.

26092 

26093 - `"project.spend_alert"`

26094 

26095 - `threshold_amount: number`

26096 

26097 The alert threshold amount, in cents.

26098 

26099### Example

26100 

26101```http

26102curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

26103 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

26104```

26105 

26106#### Response

26107 

26108```json

26109{

26110 "id": "id",

26111 "currency": "USD",

26112 "interval": "month",

26113 "notification_channel": {

26114 "recipients": [

26115 "string"

26116 ],

26117 "type": "email",

26118 "subject_prefix": "subject_prefix"

26119 },

26120 "object": "project.spend_alert",

26121 "threshold_amount": 0

26122}

26123```

26124 

26125### Example

26126 

26127```http

26128curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

26129 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

26130 -H "Content-Type: application/json"

26131```

26132 

26133#### Response

26134 

26135```json

26136{

26137 "id": "alert_abc123",

26138 "object": "project.spend_alert",

26139 "threshold_amount": 150000,

26140 "currency": "USD",

26141 "interval": "month",

26142 "notification_channel": {

26143 "type": "email",

26144 "recipients": ["finance@example.com"],

26145 "subject_prefix": "OpenAI spend alert"

26146 }

26147}

26148```

26149 

25643## Update project spend alert26150## Update project spend alert

25644 26151 

25645**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`26152**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

Details

36 36 

37 The Unix timestamp (in seconds) of when the API key was created37 The Unix timestamp (in seconds) of when the API key was created

38 38 

39 - `expires_at: number`

40 

41 The Unix timestamp (in seconds) of when the API key expires

42 

39 - `object: "organization.admin_api_key"`43 - `object: "organization.admin_api_key"`

40 44 

41 The object type, which is always `organization.admin_api_key`45 The object type, which is always `organization.admin_api_key`


105 {109 {

106 "id": "key_abc",110 "id": "key_abc",

107 "created_at": 1711471533,111 "created_at": 1711471533,

112 "expires_at": 1714063533,

108 "object": "organization.admin_api_key",113 "object": "organization.admin_api_key",

109 "owner": {114 "owner": {

110 "id": "sa_456",115 "id": "sa_456",


146 "name": "Main Admin Key",151 "name": "Main Admin Key",

147 "redacted_value": "sk-admin...def",152 "redacted_value": "sk-admin...def",

148 "created_at": 1711471533,153 "created_at": 1711471533,

154 "expires_at": 1714063533,

149 "last_used_at": 1711471534,155 "last_used_at": 1711471534,

150 "owner": {156 "owner": {

151 "type": "service_account",157 "type": "service_account",


173 179 

174- `name: string`180- `name: string`

175 181 

182- `expires_in_seconds: optional number`

183 

184 The number of seconds until the API key expires. Omit this field for a key that does not expire.

185 

176### Returns186### Returns

177 187 

178- `value: string`188- `value: string`


186 -H 'Content-Type: application/json' \196 -H 'Content-Type: application/json' \

187 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \197 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

188 -d '{198 -d '{

189 "name": "New Admin Key"199 "name": "New Admin Key",

200 "expires_in_seconds": 2592000

190 }'201 }'

191```202```

192 203 


196{207{

197 "id": "key_abc",208 "id": "key_abc",

198 "created_at": 1711471533,209 "created_at": 1711471533,

210 "expires_at": 1714063533,

199 "object": "organization.admin_api_key",211 "object": "organization.admin_api_key",

200 "owner": {212 "owner": {

201 "id": "sa_456",213 "id": "sa_456",


219 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \231 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

220 -H "Content-Type: application/json" \232 -H "Content-Type: application/json" \

221 -d '{233 -d '{

222 "name": "New Admin Key"234 "name": "New Admin Key",

235 "expires_in_seconds": 2592000

223 }'236 }'

224```237```

225 238 


232 "name": "New Admin Key",245 "name": "New Admin Key",

233 "redacted_value": "sk-admin...xyz",246 "redacted_value": "sk-admin...xyz",

234 "created_at": 1711471533,247 "created_at": 1711471533,

248 "expires_at": 1714063533,

235 "last_used_at": 1711471534,249 "last_used_at": 1711471534,

236 "owner": {250 "owner": {

237 "type": "user",251 "type": "user",


259 273 

260### Returns274### Returns

261 275 

262- `AdminAPIKey object { id, created_at, object, 4 more }`276- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

263 277 

264 Represents an individual Admin API key in an org.278 Represents an individual Admin API key in an org.

265 279 


271 285 

272 The Unix timestamp (in seconds) of when the API key was created286 The Unix timestamp (in seconds) of when the API key was created

273 287 

288 - `expires_at: number`

289 

290 The Unix timestamp (in seconds) of when the API key expires

291 

274 - `object: "organization.admin_api_key"`292 - `object: "organization.admin_api_key"`

275 293 

276 The object type, which is always `organization.admin_api_key`294 The object type, which is always `organization.admin_api_key`


328{346{

329 "id": "key_abc",347 "id": "key_abc",

330 "created_at": 1711471533,348 "created_at": 1711471533,

349 "expires_at": 1714063533,

331 "object": "organization.admin_api_key",350 "object": "organization.admin_api_key",

332 "owner": {351 "owner": {

333 "id": "sa_456",352 "id": "sa_456",


434 453 

435### Admin API Key454### Admin API Key

436 455 

437- `AdminAPIKey object { id, created_at, object, 4 more }`456- `AdminAPIKey object { id, created_at, expires_at, 5 more }`

438 457 

439 Represents an individual Admin API key in an org.458 Represents an individual Admin API key in an org.

440 459 


446 465 

447 The Unix timestamp (in seconds) of when the API key was created466 The Unix timestamp (in seconds) of when the API key was created

448 467 

468 - `expires_at: number`

469 

470 The Unix timestamp (in seconds) of when the API key expires

471 

449 - `object: "organization.admin_api_key"`472 - `object: "organization.admin_api_key"`

450 473 

451 The object type, which is always `organization.admin_api_key`474 The object type, which is always `organization.admin_api_key`

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

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 array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`47- `event_types: optional array of "api_key.created" or "api_key.updated" or "api_key.deleted" or 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](/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](/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 array of string`177- `resource_ids: optional array of 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: optional boolean`

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 

179- `data: array of object { id, effective_at, type, 55 more }`187- `data: array of object { id, effective_at, type, 57 more }`

180 188 

181 - `id: string`189 - `id: string`

182 190 


186 194 

187 The Unix timestamp (in seconds) of the event.195 The Unix timestamp (in seconds) of the event.

188 196 

189 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`197 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

190 198 

191 The event type.199 The event type.

192 200 


288 296 

289 - `"role.assignment.deleted"`297 - `"role.assignment.deleted"`

290 298 

299 - `"role.bound_to_resource"`

300 

301 - `"role.unbound_from_resource"`

302 

291 - `"scim.enabled"`303 - `"scim.enabled"`

292 304 

293 - `"scim.disabled"`305 - `"scim.disabled"`


908 920 

909 The type of resource the role assignment was scoped to.921 The type of resource the role assignment was scoped to.

910 922 

923 - `"role.bound_to_resource": optional object { id, connector_id, connector_name, 7 more }`

924 

925 The details for events with this `type`.

926 

927 - `id: optional string`

928 

929 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

930 

931 - `connector_id: optional string`

932 

933 The connector ID for a ChatGPT workspace connector resource.

934 

935 - `connector_name: optional string`

936 

937 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

938 

939 - `enabled: optional boolean`

940 

941 Whether the connector is enabled for the role.

942 

943 - `permissions: optional array of string`

944 

945 The permissions granted to the role for the resource.

946 

947 - `resource_id: optional string`

948 

949 The ID of the resource the role was bound to.

950 

951 - `resource_type: optional string`

952 

953 The type of resource the role was bound to.

954 

955 - `role_id: optional string`

956 

957 The ID of the role that was bound to the resource.

958 

959 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

960 

961 The connector role mutation path that produced the event.

962 

963 - `"role_toggle"`

964 

965 - `"role_connector_update"`

966 

967 - `"role_delete"`

968 

969 - `"workspace_permissions"`

970 

971 - `"connector_publish"`

972 

973 - `workspace_id: optional string`

974 

975 The workspace ID for a ChatGPT workspace connector resource.

976 

911 - `"role.created": optional object { id, permissions, resource_id, 2 more }`977 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

912 978 

913 The details for events with this `type`.979 The details for events with this `type`.


940 1006 

941 The role ID.1007 The role ID.

942 1008 

1009 - `"role.unbound_from_resource": optional object { id, connector_id, connector_name, 7 more }`

1010 

1011 The details for events with this `type`.

1012 

1013 - `id: optional string`

1014 

1015 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1016 

1017 - `connector_id: optional string`

1018 

1019 The connector ID for a ChatGPT workspace connector resource.

1020 

1021 - `connector_name: optional string`

1022 

1023 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1024 

1025 - `enabled: optional boolean`

1026 

1027 Whether the connector is enabled for the role.

1028 

1029 - `permissions: optional array of string`

1030 

1031 The permissions remaining for the role after the change.

1032 

1033 - `resource_id: optional string`

1034 

1035 The ID of the resource the role was unbound from.

1036 

1037 - `resource_type: optional string`

1038 

1039 The type of resource the role was unbound from.

1040 

1041 - `role_id: optional string`

1042 

1043 The ID of the role that was unbound from the resource.

1044 

1045 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

1046 

1047 The connector role mutation path that produced the event.

1048 

1049 - `"role_toggle"`

1050 

1051 - `"role_connector_update"`

1052 

1053 - `"role_delete"`

1054 

1055 - `"workspace_permissions"`

1056 

1057 - `"connector_publish"`

1058 

1059 - `workspace_id: optional string`

1060 

1061 The workspace ID for a ChatGPT workspace connector resource.

1062 

943 - `"role.updated": optional object { id, changes_requested }`1063 - `"role.updated": optional object { id, changes_requested }`

944 1064 

945 The details for events with this `type`.1065 The details for events with this `type`.


1413 "resource_id": "resource_id",1533 "resource_id": "resource_id",

1414 "resource_type": "resource_type"1534 "resource_type": "resource_type"

1415 },1535 },

1536 "role.bound_to_resource": {

1537 "id": "id",

1538 "connector_id": "connector_id",

1539 "connector_name": "connector_name",

1540 "enabled": true,

1541 "permissions": [

1542 "string"

1543 ],

1544 "resource_id": "resource_id",

1545 "resource_type": "resource_type",

1546 "role_id": "role_id",

1547 "source": "role_toggle",

1548 "workspace_id": "workspace_id"

1549 },

1416 "role.created": {1550 "role.created": {

1417 "id": "id",1551 "id": "id",

1418 "permissions": [1552 "permissions": [


1425 "role.deleted": {1559 "role.deleted": {

1426 "id": "id"1560 "id": "id"

1427 },1561 },

1562 "role.unbound_from_resource": {

1563 "id": "id",

1564 "connector_id": "connector_id",

1565 "connector_name": "connector_name",

1566 "enabled": true,

1567 "permissions": [

1568 "string"

1569 ],

1570 "resource_id": "resource_id",

1571 "resource_type": "resource_type",

1572 "role_id": "role_id",

1573 "source": "role_toggle",

1574 "workspace_id": "workspace_id"

1575 },

1428 "role.updated": {1576 "role.updated": {

1429 "id": "id",1577 "id": "id",

1430 "changes_requested": {1578 "changes_requested": {


1590 1738 

1591### Audit Log List Response1739### Audit Log List Response

1592 1740 

1593- `AuditLogListResponse object { id, effective_at, type, 55 more }`1741- `AuditLogListResponse object { id, effective_at, type, 57 more }`

1594 1742 

1595 A log of a user action or configuration change within this organization.1743 A log of a user action or configuration change within this organization.

1596 1744 


1602 1750 

1603 The Unix timestamp (in seconds) of the event.1751 The Unix timestamp (in seconds) of the event.

1604 1752 

1605 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 54 more`1753 - `type: "api_key.created" or "api_key.updated" or "api_key.deleted" or 56 more`

1606 1754 

1607 The event type.1755 The event type.

1608 1756 


1704 1852 

1705 - `"role.assignment.deleted"`1853 - `"role.assignment.deleted"`

1706 1854 

1855 - `"role.bound_to_resource"`

1856 

1857 - `"role.unbound_from_resource"`

1858 

1707 - `"scim.enabled"`1859 - `"scim.enabled"`

1708 1860 

1709 - `"scim.disabled"`1861 - `"scim.disabled"`


2324 2476 

2325 The type of resource the role assignment was scoped to.2477 The type of resource the role assignment was scoped to.

2326 2478 

2479 - `"role.bound_to_resource": optional object { id, connector_id, connector_name, 7 more }`

2480 

2481 The details for events with this `type`.

2482 

2483 - `id: optional string`

2484 

2485 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2486 

2487 - `connector_id: optional string`

2488 

2489 The connector ID for a ChatGPT workspace connector resource.

2490 

2491 - `connector_name: optional string`

2492 

2493 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2494 

2495 - `enabled: optional boolean`

2496 

2497 Whether the connector is enabled for the role.

2498 

2499 - `permissions: optional array of string`

2500 

2501 The permissions granted to the role for the resource.

2502 

2503 - `resource_id: optional string`

2504 

2505 The ID of the resource the role was bound to.

2506 

2507 - `resource_type: optional string`

2508 

2509 The type of resource the role was bound to.

2510 

2511 - `role_id: optional string`

2512 

2513 The ID of the role that was bound to the resource.

2514 

2515 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

2516 

2517 The connector role mutation path that produced the event.

2518 

2519 - `"role_toggle"`

2520 

2521 - `"role_connector_update"`

2522 

2523 - `"role_delete"`

2524 

2525 - `"workspace_permissions"`

2526 

2527 - `"connector_publish"`

2528 

2529 - `workspace_id: optional string`

2530 

2531 The workspace ID for a ChatGPT workspace connector resource.

2532 

2327 - `"role.created": optional object { id, permissions, resource_id, 2 more }`2533 - `"role.created": optional object { id, permissions, resource_id, 2 more }`

2328 2534 

2329 The details for events with this `type`.2535 The details for events with this `type`.


2356 2562 

2357 The role ID.2563 The role ID.

2358 2564 

2565 - `"role.unbound_from_resource": optional object { id, connector_id, connector_name, 7 more }`

2566 

2567 The details for events with this `type`.

2568 

2569 - `id: optional string`

2570 

2571 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2572 

2573 - `connector_id: optional string`

2574 

2575 The connector ID for a ChatGPT workspace connector resource.

2576 

2577 - `connector_name: optional string`

2578 

2579 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2580 

2581 - `enabled: optional boolean`

2582 

2583 Whether the connector is enabled for the role.

2584 

2585 - `permissions: optional array of string`

2586 

2587 The permissions remaining for the role after the change.

2588 

2589 - `resource_id: optional string`

2590 

2591 The ID of the resource the role was unbound from.

2592 

2593 - `resource_type: optional string`

2594 

2595 The type of resource the role was unbound from.

2596 

2597 - `role_id: optional string`

2598 

2599 The ID of the role that was unbound from the resource.

2600 

2601 - `source: optional "role_toggle" or "role_connector_update" or "role_delete" or 2 more`

2602 

2603 The connector role mutation path that produced the event.

2604 

2605 - `"role_toggle"`

2606 

2607 - `"role_connector_update"`

2608 

2609 - `"role_delete"`

2610 

2611 - `"workspace_permissions"`

2612 

2613 - `"connector_publish"`

2614 

2615 - `workspace_id: optional string`

2616 

2617 The workspace ID for a ChatGPT workspace connector resource.

2618 

2359 - `"role.updated": optional object { id, changes_requested }`2619 - `"role.updated": optional object { id, changes_requested }`

2360 2620 

2361 The details for events with this `type`.2621 The details for events with this `type`.

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

6275}6275}

6276```6276```

6277 6277 

6278## Retrieve project spend alert

6279 

6280**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

6281 

6282Retrieves a project spend alert.

6283 

6284### Path Parameters

6285 

6286- `project_id: string`

6287 

6288- `alert_id: string`

6289 

6290### Returns

6291 

6292- `ProjectSpendAlert object { id, currency, interval, 3 more }`

6293 

6294 Represents a spend alert configured at the project level.

6295 

6296 - `id: string`

6297 

6298 The identifier, which can be referenced in API endpoints.

6299 

6300 - `currency: "USD"`

6301 

6302 The currency for the threshold amount.

6303 

6304 - `"USD"`

6305 

6306 - `interval: "month"`

6307 

6308 The time interval for evaluating spend against the threshold.

6309 

6310 - `"month"`

6311 

6312 - `notification_channel: object { recipients, type, subject_prefix }`

6313 

6314 Email notification settings for a spend alert.

6315 

6316 - `recipients: array of string`

6317 

6318 Email addresses that receive the spend alert notification.

6319 

6320 - `type: "email"`

6321 

6322 The notification channel type. Currently only `email` is supported.

6323 

6324 - `"email"`

6325 

6326 - `subject_prefix: optional string`

6327 

6328 Optional subject prefix for alert emails.

6329 

6330 - `object: "project.spend_alert"`

6331 

6332 The object type, which is always `project.spend_alert`.

6333 

6334 - `"project.spend_alert"`

6335 

6336 - `threshold_amount: number`

6337 

6338 The alert threshold amount, in cents.

6339 

6340### Example

6341 

6342```http

6343curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

6344 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

6345```

6346 

6347#### Response

6348 

6349```json

6350{

6351 "id": "id",

6352 "currency": "USD",

6353 "interval": "month",

6354 "notification_channel": {

6355 "recipients": [

6356 "string"

6357 ],

6358 "type": "email",

6359 "subject_prefix": "subject_prefix"

6360 },

6361 "object": "project.spend_alert",

6362 "threshold_amount": 0

6363}

6364```

6365 

6366### Example

6367 

6368```http

6369curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

6370 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

6371 -H "Content-Type: application/json"

6372```

6373 

6374#### Response

6375 

6376```json

6377{

6378 "id": "alert_abc123",

6379 "object": "project.spend_alert",

6380 "threshold_amount": 150000,

6381 "currency": "USD",

6382 "interval": "month",

6383 "notification_channel": {

6384 "type": "email",

6385 "recipients": ["finance@example.com"],

6386 "subject_prefix": "OpenAI spend alert"

6387 }

6388}

6389```

6390 

6278## Update project spend alert6391## Update project spend alert

6279 6392 

6280**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`6393**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

Details

336}336}

337```337```

338 338 

339## Retrieve project spend alert

340 

341**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

342 

343Retrieves a project spend alert.

344 

345### Path Parameters

346 

347- `project_id: string`

348 

349- `alert_id: string`

350 

351### Returns

352 

353- `ProjectSpendAlert object { id, currency, interval, 3 more }`

354 

355 Represents a spend alert configured at the project level.

356 

357 - `id: string`

358 

359 The identifier, which can be referenced in API endpoints.

360 

361 - `currency: "USD"`

362 

363 The currency for the threshold amount.

364 

365 - `"USD"`

366 

367 - `interval: "month"`

368 

369 The time interval for evaluating spend against the threshold.

370 

371 - `"month"`

372 

373 - `notification_channel: object { recipients, type, subject_prefix }`

374 

375 Email notification settings for a spend alert.

376 

377 - `recipients: array of string`

378 

379 Email addresses that receive the spend alert notification.

380 

381 - `type: "email"`

382 

383 The notification channel type. Currently only `email` is supported.

384 

385 - `"email"`

386 

387 - `subject_prefix: optional string`

388 

389 Optional subject prefix for alert emails.

390 

391 - `object: "project.spend_alert"`

392 

393 The object type, which is always `project.spend_alert`.

394 

395 - `"project.spend_alert"`

396 

397 - `threshold_amount: number`

398 

399 The alert threshold amount, in cents.

400 

401### Example

402 

403```http

404curl https://api.openai.com/v1/organization/projects/$PROJECT_ID/spend_alerts/$ALERT_ID \

405 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

406```

407 

408#### Response

409 

410```json

411{

412 "id": "id",

413 "currency": "USD",

414 "interval": "month",

415 "notification_channel": {

416 "recipients": [

417 "string"

418 ],

419 "type": "email",

420 "subject_prefix": "subject_prefix"

421 },

422 "object": "project.spend_alert",

423 "threshold_amount": 0

424}

425```

426 

427### Example

428 

429```http

430curl https://api.openai.com/v1/organization/projects/proj_abc/spend_alerts/alert_abc123 \

431 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

432 -H "Content-Type: application/json"

433```

434 

435#### Response

436 

437```json

438{

439 "id": "alert_abc123",

440 "object": "project.spend_alert",

441 "threshold_amount": 150000,

442 "currency": "USD",

443 "interval": "month",

444 "notification_channel": {

445 "type": "email",

446 "recipients": ["finance@example.com"],

447 "subject_prefix": "OpenAI spend alert"

448 }

449}

450```

451 

339## Update project spend alert452## Update project spend alert

340 453 

341**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`454**post** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

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

328}328}

329```329```

330 330 

331## Retrieve organization spend alert

332 

333**get** `/organization/spend_alerts/{alert_id}`

334 

335Retrieves an organization spend alert.

336 

337### Path Parameters

338 

339- `alert_id: string`

340 

341### Returns

342 

343- `OrganizationSpendAlert object { id, currency, interval, 3 more }`

344 

345 Represents a spend alert configured at the organization level.

346 

347 - `id: string`

348 

349 The identifier, which can be referenced in API endpoints.

350 

351 - `currency: "USD"`

352 

353 The currency for the threshold amount.

354 

355 - `"USD"`

356 

357 - `interval: "month"`

358 

359 The time interval for evaluating spend against the threshold.

360 

361 - `"month"`

362 

363 - `notification_channel: object { recipients, type, subject_prefix }`

364 

365 Email notification settings for a spend alert.

366 

367 - `recipients: array of string`

368 

369 Email addresses that receive the spend alert notification.

370 

371 - `type: "email"`

372 

373 The notification channel type. Currently only `email` is supported.

374 

375 - `"email"`

376 

377 - `subject_prefix: optional string`

378 

379 Optional subject prefix for alert emails.

380 

381 - `object: "organization.spend_alert"`

382 

383 The object type, which is always `organization.spend_alert`.

384 

385 - `"organization.spend_alert"`

386 

387 - `threshold_amount: number`

388 

389 The alert threshold amount, in cents.

390 

391### Example

392 

393```http

394curl https://api.openai.com/v1/organization/spend_alerts/$ALERT_ID \

395 -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

396```

397 

398#### Response

399 

400```json

401{

402 "id": "id",

403 "currency": "USD",

404 "interval": "month",

405 "notification_channel": {

406 "recipients": [

407 "string"

408 ],

409 "type": "email",

410 "subject_prefix": "subject_prefix"

411 },

412 "object": "organization.spend_alert",

413 "threshold_amount": 0

414}

415```

416 

417### Example

418 

419```http

420curl https://api.openai.com/v1/organization/spend_alerts/alert_abc123 \

421 -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \

422 -H "Content-Type: application/json"

423```

424 

425#### Response

426 

427```json

428{

429 "id": "alert_abc123",

430 "object": "organization.spend_alert",

431 "threshold_amount": 150000,

432 "currency": "USD",

433 "interval": "month",

434 "notification_channel": {

435 "type": "email",

436 "recipients": ["finance@example.com"],

437 "subject_prefix": "OpenAI spend alert"

438 }

439}

440```

441 

331## Update organization spend alert442## Update organization spend alert

332 443 

333**post** `/organization/spend_alerts/{alert_id}`444**post** `/organization/spend_alerts/{alert_id}`

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

3954 Configuration options for3954 Configuration options for

3955 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3955 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3956 3956 

3957 - `context: optional "auto" or "current_turn" or "all_turns"`

3958 

3959 Controls which reasoning items are rendered back to the model on later turns.

3960 When returned on a response, this is the effective reasoning context mode

3961 used for the response.

3962 

3963 - `"auto"`

3964 

3965 - `"current_turn"`

3966 

3967 - `"all_turns"`

3968 

3957 - `effort: optional ReasoningEffort`3969 - `effort: optional ReasoningEffort`

3958 3970 

3959 Constrains effort on reasoning for3971 Constrains effort on reasoning for


12810 Configuration options for12822 Configuration options for

12811 [reasoning models](https://platform.openai.com/docs/guides/reasoning).12823 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

12812 12824 

12825 - `context: optional "auto" or "current_turn" or "all_turns"`

12826 

12827 Controls which reasoning items are rendered back to the model on later turns.

12828 When returned on a response, this is the effective reasoning context mode

12829 used for the response.

12830 

12831 - `"auto"`

12832 

12833 - `"current_turn"`

12834 

12835 - `"all_turns"`

12836 

12813 - `effort: optional ReasoningEffort`12837 - `effort: optional ReasoningEffort`

12814 12838 

12815 Constrains effort on reasoning for12839 Constrains effort on reasoning for


13205 "prompt_cache_key": "prompt-cache-key-1234",13229 "prompt_cache_key": "prompt-cache-key-1234",

13206 "prompt_cache_retention": "in_memory",13230 "prompt_cache_retention": "in_memory",

13207 "reasoning": {13231 "reasoning": {

13232 "context": "auto",

13208 "effort": "none",13233 "effort": "none",

13209 "generate_summary": "auto",13234 "generate_summary": "auto",

13210 "summary": "auto"13235 "summary": "auto"


21757 Configuration options for21782 Configuration options for

21758 [reasoning models](https://platform.openai.com/docs/guides/reasoning).21783 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

21759 21784 

21785 - `context: optional "auto" or "current_turn" or "all_turns"`

21786 

21787 Controls which reasoning items are rendered back to the model on later turns.

21788 When returned on a response, this is the effective reasoning context mode

21789 used for the response.

21790 

21791 - `"auto"`

21792 

21793 - `"current_turn"`

21794 

21795 - `"all_turns"`

21796 

21760 - `effort: optional ReasoningEffort`21797 - `effort: optional ReasoningEffort`

21761 21798 

21762 Constrains effort on reasoning for21799 Constrains effort on reasoning for


22143 "prompt_cache_key": "prompt-cache-key-1234",22180 "prompt_cache_key": "prompt-cache-key-1234",

22144 "prompt_cache_retention": "in_memory",22181 "prompt_cache_retention": "in_memory",

22145 "reasoning": {22182 "reasoning": {

22183 "context": "auto",

22146 "effort": "none",22184 "effort": "none",

22147 "generate_summary": "auto",22185 "generate_summary": "auto",

22148 "summary": "auto"22186 "summary": "auto"


30004 Configuration options for30042 Configuration options for

30005 [reasoning models](https://platform.openai.com/docs/guides/reasoning).30043 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

30006 30044 

30045 - `context: optional "auto" or "current_turn" or "all_turns"`

30046 

30047 Controls which reasoning items are rendered back to the model on later turns.

30048 When returned on a response, this is the effective reasoning context mode

30049 used for the response.

30050 

30051 - `"auto"`

30052 

30053 - `"current_turn"`

30054 

30055 - `"all_turns"`

30056 

30007 - `effort: optional ReasoningEffort`30057 - `effort: optional ReasoningEffort`

30008 30058 

30009 Constrains effort on reasoning for30059 Constrains effort on reasoning for


30391 "prompt_cache_key": "prompt-cache-key-1234",30441 "prompt_cache_key": "prompt-cache-key-1234",

30392 "prompt_cache_retention": "in_memory",30442 "prompt_cache_retention": "in_memory",

30393 "reasoning": {30443 "reasoning": {

30444 "context": "auto",

30394 "effort": "none",30445 "effort": "none",

30395 "generate_summary": "auto",30446 "generate_summary": "auto",

30396 "summary": "auto"30447 "summary": "auto"


50107 Configuration options for50158 Configuration options for

50108 [reasoning models](https://platform.openai.com/docs/guides/reasoning).50159 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

50109 50160 

50161 - `context: optional "auto" or "current_turn" or "all_turns"`

50162 

50163 Controls which reasoning items are rendered back to the model on later turns.

50164 When returned on a response, this is the effective reasoning context mode

50165 used for the response.

50166 

50167 - `"auto"`

50168 

50169 - `"current_turn"`

50170 

50171 - `"all_turns"`

50172 

50110 - `effort: optional ReasoningEffort`50173 - `effort: optional ReasoningEffort`

50111 50174 

50112 Constrains effort on reasoning for50175 Constrains effort on reasoning for


58276 Configuration options for58339 Configuration options for

58277 [reasoning models](https://platform.openai.com/docs/guides/reasoning).58340 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

58278 58341 

58342 - `context: optional "auto" or "current_turn" or "all_turns"`

58343 

58344 Controls which reasoning items are rendered back to the model on later turns.

58345 When returned on a response, this is the effective reasoning context mode

58346 used for the response.

58347 

58348 - `"auto"`

58349 

58350 - `"current_turn"`

58351 

58352 - `"all_turns"`

58353 

58279 - `effort: optional ReasoningEffort`58354 - `effort: optional ReasoningEffort`

58280 58355 

58281 Constrains effort on reasoning for58356 Constrains effort on reasoning for


66922 Configuration options for66997 Configuration options for

66923 [reasoning models](https://platform.openai.com/docs/guides/reasoning).66998 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

66924 66999 

67000 - `context: optional "auto" or "current_turn" or "all_turns"`

67001 

67002 Controls which reasoning items are rendered back to the model on later turns.

67003 When returned on a response, this is the effective reasoning context mode

67004 used for the response.

67005 

67006 - `"auto"`

67007 

67008 - `"current_turn"`

67009 

67010 - `"all_turns"`

67011 

66925 - `effort: optional ReasoningEffort`67012 - `effort: optional ReasoningEffort`

66926 67013 

66927 Constrains effort on reasoning for67014 Constrains effort on reasoning for


75035 Configuration options for75122 Configuration options for

75036 [reasoning models](https://platform.openai.com/docs/guides/reasoning).75123 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

75037 75124 

75125 - `context: optional "auto" or "current_turn" or "all_turns"`

75126 

75127 Controls which reasoning items are rendered back to the model on later turns.

75128 When returned on a response, this is the effective reasoning context mode

75129 used for the response.

75130 

75131 - `"auto"`

75132 

75133 - `"current_turn"`

75134 

75135 - `"all_turns"`

75136 

75038 - `effort: optional ReasoningEffort`75137 - `effort: optional ReasoningEffort`

75039 75138 

75040 Constrains effort on reasoning for75139 Constrains effort on reasoning for


83401 Configuration options for83500 Configuration options for

83402 [reasoning models](https://platform.openai.com/docs/guides/reasoning).83501 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

83403 83502 

83503 - `context: optional "auto" or "current_turn" or "all_turns"`

83504 

83505 Controls which reasoning items are rendered back to the model on later turns.

83506 When returned on a response, this is the effective reasoning context mode

83507 used for the response.

83508 

83509 - `"auto"`

83510 

83511 - `"current_turn"`

83512 

83513 - `"all_turns"`

83514 

83404 - `effort: optional ReasoningEffort`83515 - `effort: optional ReasoningEffort`

83405 83516 

83406 Constrains effort on reasoning for83517 Constrains effort on reasoning for


91411 Configuration options for91522 Configuration options for

91412 [reasoning models](https://platform.openai.com/docs/guides/reasoning).91523 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

91413 91524 

91525 - `context: optional "auto" or "current_turn" or "all_turns"`

91526 

91527 Controls which reasoning items are rendered back to the model on later turns.

91528 When returned on a response, this is the effective reasoning context mode

91529 used for the response.

91530 

91531 - `"auto"`

91532 

91533 - `"current_turn"`

91534 

91535 - `"all_turns"`

91536 

91414 - `effort: optional ReasoningEffort`91537 - `effort: optional ReasoningEffort`

91415 91538 

91416 Constrains effort on reasoning for91539 Constrains effort on reasoning for


110990 Configuration options for111113 Configuration options for

110991 [reasoning models](https://platform.openai.com/docs/guides/reasoning).111114 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

110992 111115 

111116 - `context: optional "auto" or "current_turn" or "all_turns"`

111117 

111118 Controls which reasoning items are rendered back to the model on later turns.

111119 When returned on a response, this is the effective reasoning context mode

111120 used for the response.

111121 

111122 - `"auto"`

111123 

111124 - `"current_turn"`

111125 

111126 - `"all_turns"`

111127 

110993 - `effort: optional ReasoningEffort`111128 - `effort: optional ReasoningEffort`

110994 111129 

110995 Constrains effort on reasoning for111130 Constrains effort on reasoning for


119450 Configuration options for119585 Configuration options for

119451 [reasoning models](https://platform.openai.com/docs/guides/reasoning).119586 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

119452 119587 

119588 - `context: optional "auto" or "current_turn" or "all_turns"`

119589 

119590 Controls which reasoning items are rendered back to the model on later turns.

119591 When returned on a response, this is the effective reasoning context mode

119592 used for the response.

119593 

119594 - `"auto"`

119595 

119596 - `"current_turn"`

119597 

119598 - `"all_turns"`

119599 

119453 - `effort: optional ReasoningEffort`119600 - `effort: optional ReasoningEffort`

119454 119601 

119455 Constrains effort on reasoning for119602 Constrains effort on reasoning for


125258 Configuration options for125405 Configuration options for

125259 [reasoning models](https://platform.openai.com/docs/guides/reasoning).125406 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

125260 125407 

125408 - `context: optional "auto" or "current_turn" or "all_turns"`

125409 

125410 Controls which reasoning items are rendered back to the model on later turns.

125411 When returned on a response, this is the effective reasoning context mode

125412 used for the response.

125413 

125414 - `"auto"`

125415 

125416 - `"current_turn"`

125417 

125418 - `"all_turns"`

125419 

125261 - `effort: optional ReasoningEffort`125420 - `effort: optional ReasoningEffort`

125262 125421 

125263 Constrains effort on reasoning for125422 Constrains effort on reasoning for


134306 Configuration options for134465 Configuration options for

134307 [reasoning models](https://platform.openai.com/docs/guides/reasoning).134466 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

134308 134467 

134468 - `context: optional "auto" or "current_turn" or "all_turns"`

134469 

134470 Controls which reasoning items are rendered back to the model on later turns.

134471 When returned on a response, this is the effective reasoning context mode

134472 used for the response.

134473 

134474 - `"auto"`

134475 

134476 - `"current_turn"`

134477 

134478 - `"all_turns"`

134479 

134309 - `effort: optional ReasoningEffort`134480 - `effort: optional ReasoningEffort`

134310 134481 

134311 Constrains effort on reasoning for134482 Constrains effort on reasoning for


146882 147053 

146883 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).147054 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

146884 147055 

147056 - `context: optional "auto" or "current_turn" or "all_turns"`

147057 

147058 Controls which reasoning items are rendered back to the model on later turns.

147059 When returned on a response, this is the effective reasoning context mode

147060 used for the response.

147061 

147062 - `"auto"`

147063 

147064 - `"current_turn"`

147065 

147066 - `"all_turns"`

147067 

146885 - `effort: optional ReasoningEffort`147068 - `effort: optional ReasoningEffort`

146886 147069 

146887 Constrains effort on reasoning for147070 Constrains effort on reasoning for

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

3632 3632 

3633 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3633 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3634 3634 

3635 - `context: optional "auto" or "current_turn" or "all_turns"`

3636 

3637 Controls which reasoning items are rendered back to the model on later turns.

3638 When returned on a response, this is the effective reasoning context mode

3639 used for the response.

3640 

3641 - `"auto"`

3642 

3643 - `"current_turn"`

3644 

3645 - `"all_turns"`

3646 

3635 - `effort: optional ReasoningEffort`3647 - `effort: optional ReasoningEffort`

3636 3648 

3637 Constrains effort on reasoning for3649 Constrains effort on reasoning for

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

50 50 

51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

52 52 

53- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more]`53- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more]`

54 54 

55 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).55 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).

56 56 


152 152 

153 - `:"role.assignment.deleted"`153 - `:"role.assignment.deleted"`

154 154 

155 - `:"role.bound_to_resource"`

156 

157 - `:"role.unbound_from_resource"`

158 

155 - `:"scim.enabled"`159 - `:"scim.enabled"`

156 160 

157 - `:"scim.disabled"`161 - `:"scim.disabled"`


178 182 

179- `resource_ids: Array[String]`183- `resource_ids: Array[String]`

180 184 

181 Return only events performed on these targets. For example, a project ID updated.185 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>`.

186 

187- `tenant_only: bool`

188 

189 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.

182 190 

183### Returns191### Returns

184 192 


194 202 

195 The Unix timestamp (in seconds) of the event.203 The Unix timestamp (in seconds) of the event.

196 204 

197 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`205 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

198 206 

199 The event type.207 The event type.

200 208 


296 304 

297 - `:"role.assignment.deleted"`305 - `:"role.assignment.deleted"`

298 306 

307 - `:"role.bound_to_resource"`

308 

309 - `:"role.unbound_from_resource"`

310 

299 - `:"scim.enabled"`311 - `:"scim.enabled"`

300 312 

301 - `:"scim.disabled"`313 - `:"scim.disabled"`


916 928 

917 The type of resource the role assignment was scoped to.929 The type of resource the role assignment was scoped to.

918 930 

931 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

932 

933 The details for events with this `type`.

934 

935 - `id: String`

936 

937 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

938 

939 - `connector_id: String`

940 

941 The connector ID for a ChatGPT workspace connector resource.

942 

943 - `connector_name: String`

944 

945 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

946 

947 - `enabled: bool`

948 

949 Whether the connector is enabled for the role.

950 

951 - `permissions: Array[String]`

952 

953 The permissions granted to the role for the resource.

954 

955 - `resource_id: String`

956 

957 The ID of the resource the role was bound to.

958 

959 - `resource_type: String`

960 

961 The type of resource the role was bound to.

962 

963 - `role_id: String`

964 

965 The ID of the role that was bound to the resource.

966 

967 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

968 

969 The connector role mutation path that produced the event.

970 

971 - `:role_toggle`

972 

973 - `:role_connector_update`

974 

975 - `:role_delete`

976 

977 - `:workspace_permissions`

978 

979 - `:connector_publish`

980 

981 - `workspace_id: String`

982 

983 The workspace ID for a ChatGPT workspace connector resource.

984 

919 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`985 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

920 986 

921 The details for events with this `type`.987 The details for events with this `type`.


948 1014 

949 The role ID.1015 The role ID.

950 1016 

1017 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

1018 

1019 The details for events with this `type`.

1020 

1021 - `id: String`

1022 

1023 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1024 

1025 - `connector_id: String`

1026 

1027 The connector ID for a ChatGPT workspace connector resource.

1028 

1029 - `connector_name: String`

1030 

1031 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1032 

1033 - `enabled: bool`

1034 

1035 Whether the connector is enabled for the role.

1036 

1037 - `permissions: Array[String]`

1038 

1039 The permissions remaining for the role after the change.

1040 

1041 - `resource_id: String`

1042 

1043 The ID of the resource the role was unbound from.

1044 

1045 - `resource_type: String`

1046 

1047 The type of resource the role was unbound from.

1048 

1049 - `role_id: String`

1050 

1051 The ID of the role that was unbound from the resource.

1052 

1053 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

1054 

1055 The connector role mutation path that produced the event.

1056 

1057 - `:role_toggle`

1058 

1059 - `:role_connector_update`

1060 

1061 - `:role_delete`

1062 

1063 - `:workspace_permissions`

1064 

1065 - `:connector_publish`

1066 

1067 - `workspace_id: String`

1068 

1069 The workspace ID for a ChatGPT workspace connector resource.

1070 

951 - `role_updated: RoleUpdated{ id, changes_requested}`1071 - `role_updated: RoleUpdated{ id, changes_requested}`

952 1072 

953 The details for events with this `type`.1073 The details for events with this `type`.


1416 "resource_id": "resource_id",1536 "resource_id": "resource_id",

1417 "resource_type": "resource_type"1537 "resource_type": "resource_type"

1418 },1538 },

1539 "role.bound_to_resource": {

1540 "id": "id",

1541 "connector_id": "connector_id",

1542 "connector_name": "connector_name",

1543 "enabled": true,

1544 "permissions": [

1545 "string"

1546 ],

1547 "resource_id": "resource_id",

1548 "resource_type": "resource_type",

1549 "role_id": "role_id",

1550 "source": "role_toggle",

1551 "workspace_id": "workspace_id"

1552 },

1419 "role.created": {1553 "role.created": {

1420 "id": "id",1554 "id": "id",

1421 "permissions": [1555 "permissions": [


1428 "role.deleted": {1562 "role.deleted": {

1429 "id": "id"1563 "id": "id"

1430 },1564 },

1565 "role.unbound_from_resource": {

1566 "id": "id",

1567 "connector_id": "connector_id",

1568 "connector_name": "connector_name",

1569 "enabled": true,

1570 "permissions": [

1571 "string"

1572 ],

1573 "resource_id": "resource_id",

1574 "resource_type": "resource_type",

1575 "role_id": "role_id",

1576 "source": "role_toggle",

1577 "workspace_id": "workspace_id"

1578 },

1431 "role.updated": {1579 "role.updated": {

1432 "id": "id",1580 "id": "id",

1433 "changes_requested": {1581 "changes_requested": {


1533 1681 

1534 The Unix timestamp (in seconds) of the event.1682 The Unix timestamp (in seconds) of the event.

1535 1683 

1536 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`1684 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

1537 1685 

1538 The event type.1686 The event type.

1539 1687 


1635 1783 

1636 - `:"role.assignment.deleted"`1784 - `:"role.assignment.deleted"`

1637 1785 

1786 - `:"role.bound_to_resource"`

1787 

1788 - `:"role.unbound_from_resource"`

1789 

1638 - `:"scim.enabled"`1790 - `:"scim.enabled"`

1639 1791 

1640 - `:"scim.disabled"`1792 - `:"scim.disabled"`


2255 2407 

2256 The type of resource the role assignment was scoped to.2408 The type of resource the role assignment was scoped to.

2257 2409 

2410 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

2411 

2412 The details for events with this `type`.

2413 

2414 - `id: String`

2415 

2416 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2417 

2418 - `connector_id: String`

2419 

2420 The connector ID for a ChatGPT workspace connector resource.

2421 

2422 - `connector_name: String`

2423 

2424 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2425 

2426 - `enabled: bool`

2427 

2428 Whether the connector is enabled for the role.

2429 

2430 - `permissions: Array[String]`

2431 

2432 The permissions granted to the role for the resource.

2433 

2434 - `resource_id: String`

2435 

2436 The ID of the resource the role was bound to.

2437 

2438 - `resource_type: String`

2439 

2440 The type of resource the role was bound to.

2441 

2442 - `role_id: String`

2443 

2444 The ID of the role that was bound to the resource.

2445 

2446 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2447 

2448 The connector role mutation path that produced the event.

2449 

2450 - `:role_toggle`

2451 

2452 - `:role_connector_update`

2453 

2454 - `:role_delete`

2455 

2456 - `:workspace_permissions`

2457 

2458 - `:connector_publish`

2459 

2460 - `workspace_id: String`

2461 

2462 The workspace ID for a ChatGPT workspace connector resource.

2463 

2258 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`2464 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

2259 2465 

2260 The details for events with this `type`.2466 The details for events with this `type`.


2287 2493 

2288 The role ID.2494 The role ID.

2289 2495 

2496 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

2497 

2498 The details for events with this `type`.

2499 

2500 - `id: String`

2501 

2502 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2503 

2504 - `connector_id: String`

2505 

2506 The connector ID for a ChatGPT workspace connector resource.

2507 

2508 - `connector_name: String`

2509 

2510 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2511 

2512 - `enabled: bool`

2513 

2514 Whether the connector is enabled for the role.

2515 

2516 - `permissions: Array[String]`

2517 

2518 The permissions remaining for the role after the change.

2519 

2520 - `resource_id: String`

2521 

2522 The ID of the resource the role was unbound from.

2523 

2524 - `resource_type: String`

2525 

2526 The type of resource the role was unbound from.

2527 

2528 - `role_id: String`

2529 

2530 The ID of the role that was unbound from the resource.

2531 

2532 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2533 

2534 The connector role mutation path that produced the event.

2535 

2536 - `:role_toggle`

2537 

2538 - `:role_connector_update`

2539 

2540 - `:role_delete`

2541 

2542 - `:workspace_permissions`

2543 

2544 - `:connector_publish`

2545 

2546 - `workspace_id: String`

2547 

2548 The workspace ID for a ChatGPT workspace connector resource.

2549 

2290 - `role_updated: RoleUpdated{ id, changes_requested}`2550 - `role_updated: RoleUpdated{ id, changes_requested}`

2291 2551 

2292 The details for events with this `type`.2552 The details for events with this `type`.


2553 2813 

2554 The Unix timestamp (in seconds) of when the API key was created2814 The Unix timestamp (in seconds) of when the API key was created

2555 2815 

2816 - `expires_at: Integer`

2817 

2818 The Unix timestamp (in seconds) of when the API key expires

2819 

2556 - `object: :"organization.admin_api_key"`2820 - `object: :"organization.admin_api_key"`

2557 2821 

2558 The object type, which is always `organization.admin_api_key`2822 The object type, which is always `organization.admin_api_key`


2617 {2881 {

2618 "id": "key_abc",2882 "id": "key_abc",

2619 "created_at": 1711471533,2883 "created_at": 1711471533,

2884 "expires_at": 1714063533,

2620 "object": "organization.admin_api_key",2885 "object": "organization.admin_api_key",

2621 "owner": {2886 "owner": {

2622 "id": "sa_456",2887 "id": "sa_456",


2650 2915 

2651- `name: String`2916- `name: String`

2652 2917 

2918- `expires_in_seconds: Integer`

2919 

2920 The number of seconds until the API key expires. Omit this field for a key that does not expire.

2921 

2653### Returns2922### Returns

2654 2923 

2655- `class AdminAPIKeyCreateResponse`2924- `class AdminAPIKeyCreateResponse`


2678{2947{

2679 "id": "key_abc",2948 "id": "key_abc",

2680 "created_at": 1711471533,2949 "created_at": 1711471533,

2950 "expires_at": 1714063533,

2681 "object": "organization.admin_api_key",2951 "object": "organization.admin_api_key",

2682 "owner": {2952 "owner": {

2683 "id": "sa_456",2953 "id": "sa_456",


2722 2992 

2723 The Unix timestamp (in seconds) of when the API key was created2993 The Unix timestamp (in seconds) of when the API key was created

2724 2994 

2995 - `expires_at: Integer`

2996 

2997 The Unix timestamp (in seconds) of when the API key expires

2998 

2725 - `object: :"organization.admin_api_key"`2999 - `object: :"organization.admin_api_key"`

2726 3000 

2727 The object type, which is always `organization.admin_api_key`3001 The object type, which is always `organization.admin_api_key`


2784{3058{

2785 "id": "key_abc",3059 "id": "key_abc",

2786 "created_at": 1711471533,3060 "created_at": 1711471533,

3061 "expires_at": 1714063533,

2787 "object": "organization.admin_api_key",3062 "object": "organization.admin_api_key",

2788 "owner": {3063 "owner": {

2789 "id": "sa_456",3064 "id": "sa_456",


2863 3138 

2864 The Unix timestamp (in seconds) of when the API key was created3139 The Unix timestamp (in seconds) of when the API key was created

2865 3140 

3141 - `expires_at: Integer`

3142 

3143 The Unix timestamp (in seconds) of when the API key expires

3144 

2866 - `object: :"organization.admin_api_key"`3145 - `object: :"organization.admin_api_key"`

2867 3146 

2868 The object type, which is always `organization.admin_api_key`3147 The object type, which is always `organization.admin_api_key`


16803}17082}

16804```17083```

16805 17084 

17085## Retrieve organization spend alert

17086 

17087`admin.organization.spend_alerts.retrieve(alert_id) -> OrganizationSpendAlert`

17088 

17089**get** `/organization/spend_alerts/{alert_id}`

17090 

17091Retrieves an organization spend alert.

17092 

17093### Parameters

17094 

17095- `alert_id: String`

17096 

17097### Returns

17098 

17099- `class OrganizationSpendAlert`

17100 

17101 Represents a spend alert configured at the organization level.

17102 

17103 - `id: String`

17104 

17105 The identifier, which can be referenced in API endpoints.

17106 

17107 - `currency: :USD`

17108 

17109 The currency for the threshold amount.

17110 

17111 - `:USD`

17112 

17113 - `interval: :month`

17114 

17115 The time interval for evaluating spend against the threshold.

17116 

17117 - `:month`

17118 

17119 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

17120 

17121 Email notification settings for a spend alert.

17122 

17123 - `recipients: Array[String]`

17124 

17125 Email addresses that receive the spend alert notification.

17126 

17127 - `type: :email`

17128 

17129 The notification channel type. Currently only `email` is supported.

17130 

17131 - `:email`

17132 

17133 - `subject_prefix: String`

17134 

17135 Optional subject prefix for alert emails.

17136 

17137 - `object: :"organization.spend_alert"`

17138 

17139 The object type, which is always `organization.spend_alert`.

17140 

17141 - `:"organization.spend_alert"`

17142 

17143 - `threshold_amount: Integer`

17144 

17145 The alert threshold amount, in cents.

17146 

17147### Example

17148 

17149```ruby

17150require "openai"

17151 

17152openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

17153 

17154organization_spend_alert = openai.admin.organization.spend_alerts.retrieve("alert_id")

17155 

17156puts(organization_spend_alert)

17157```

17158 

17159#### Response

17160 

17161```json

17162{

17163 "id": "id",

17164 "currency": "USD",

17165 "interval": "month",

17166 "notification_channel": {

17167 "recipients": [

17168 "string"

17169 ],

17170 "type": "email",

17171 "subject_prefix": "subject_prefix"

17172 },

17173 "object": "organization.spend_alert",

17174 "threshold_amount": 0

17175}

17176```

17177 

16806## Update organization spend alert17178## Update organization spend alert

16807 17179 

16808`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`17180`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`


23103}23475}

23104```23476```

23105 23477 

23478## Retrieve project spend alert

23479 

23480`admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert`

23481 

23482**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

23483 

23484Retrieves a project spend alert.

23485 

23486### Parameters

23487 

23488- `project_id: String`

23489 

23490- `alert_id: String`

23491 

23492### Returns

23493 

23494- `class ProjectSpendAlert`

23495 

23496 Represents a spend alert configured at the project level.

23497 

23498 - `id: String`

23499 

23500 The identifier, which can be referenced in API endpoints.

23501 

23502 - `currency: :USD`

23503 

23504 The currency for the threshold amount.

23505 

23506 - `:USD`

23507 

23508 - `interval: :month`

23509 

23510 The time interval for evaluating spend against the threshold.

23511 

23512 - `:month`

23513 

23514 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

23515 

23516 Email notification settings for a spend alert.

23517 

23518 - `recipients: Array[String]`

23519 

23520 Email addresses that receive the spend alert notification.

23521 

23522 - `type: :email`

23523 

23524 The notification channel type. Currently only `email` is supported.

23525 

23526 - `:email`

23527 

23528 - `subject_prefix: String`

23529 

23530 Optional subject prefix for alert emails.

23531 

23532 - `object: :"project.spend_alert"`

23533 

23534 The object type, which is always `project.spend_alert`.

23535 

23536 - `:"project.spend_alert"`

23537 

23538 - `threshold_amount: Integer`

23539 

23540 The alert threshold amount, in cents.

23541 

23542### Example

23543 

23544```ruby

23545require "openai"

23546 

23547openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

23548 

23549project_spend_alert = openai.admin.organization.projects.spend_alerts.retrieve("alert_id", project_id: "project_id")

23550 

23551puts(project_spend_alert)

23552```

23553 

23554#### Response

23555 

23556```json

23557{

23558 "id": "id",

23559 "currency": "USD",

23560 "interval": "month",

23561 "notification_channel": {

23562 "recipients": [

23563 "string"

23564 ],

23565 "type": "email",

23566 "subject_prefix": "subject_prefix"

23567 },

23568 "object": "project.spend_alert",

23569 "threshold_amount": 0

23570}

23571```

23572 

23106## Update project spend alert23573## Update project spend alert

23107 23574 

23108`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`23575`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`

Details

48 48 

49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

50 50 

51- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more]`51- `event_types: Array[:"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more]`

52 52 

53 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).53 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).

54 54 


150 150 

151 - `:"role.assignment.deleted"`151 - `:"role.assignment.deleted"`

152 152 

153 - `:"role.bound_to_resource"`

154 

155 - `:"role.unbound_from_resource"`

156 

153 - `:"scim.enabled"`157 - `:"scim.enabled"`

154 158 

155 - `:"scim.disabled"`159 - `:"scim.disabled"`


176 180 

177- `resource_ids: Array[String]`181- `resource_ids: Array[String]`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185- `tenant_only: bool`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 


192 200 

193 The Unix timestamp (in seconds) of the event.201 The Unix timestamp (in seconds) of the event.

194 202 

195 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`203 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

196 204 

197 The event type.205 The event type.

198 206 


294 302 

295 - `:"role.assignment.deleted"`303 - `:"role.assignment.deleted"`

296 304 

305 - `:"role.bound_to_resource"`

306 

307 - `:"role.unbound_from_resource"`

308 

297 - `:"scim.enabled"`309 - `:"scim.enabled"`

298 310 

299 - `:"scim.disabled"`311 - `:"scim.disabled"`


914 926 

915 The type of resource the role assignment was scoped to.927 The type of resource the role assignment was scoped to.

916 928 

929 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

930 

931 The details for events with this `type`.

932 

933 - `id: String`

934 

935 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

936 

937 - `connector_id: String`

938 

939 The connector ID for a ChatGPT workspace connector resource.

940 

941 - `connector_name: String`

942 

943 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

944 

945 - `enabled: bool`

946 

947 Whether the connector is enabled for the role.

948 

949 - `permissions: Array[String]`

950 

951 The permissions granted to the role for the resource.

952 

953 - `resource_id: String`

954 

955 The ID of the resource the role was bound to.

956 

957 - `resource_type: String`

958 

959 The type of resource the role was bound to.

960 

961 - `role_id: String`

962 

963 The ID of the role that was bound to the resource.

964 

965 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

966 

967 The connector role mutation path that produced the event.

968 

969 - `:role_toggle`

970 

971 - `:role_connector_update`

972 

973 - `:role_delete`

974 

975 - `:workspace_permissions`

976 

977 - `:connector_publish`

978 

979 - `workspace_id: String`

980 

981 The workspace ID for a ChatGPT workspace connector resource.

982 

917 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`983 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

918 984 

919 The details for events with this `type`.985 The details for events with this `type`.


946 1012 

947 The role ID.1013 The role ID.

948 1014 

1015 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

1016 

1017 The details for events with this `type`.

1018 

1019 - `id: String`

1020 

1021 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1022 

1023 - `connector_id: String`

1024 

1025 The connector ID for a ChatGPT workspace connector resource.

1026 

1027 - `connector_name: String`

1028 

1029 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1030 

1031 - `enabled: bool`

1032 

1033 Whether the connector is enabled for the role.

1034 

1035 - `permissions: Array[String]`

1036 

1037 The permissions remaining for the role after the change.

1038 

1039 - `resource_id: String`

1040 

1041 The ID of the resource the role was unbound from.

1042 

1043 - `resource_type: String`

1044 

1045 The type of resource the role was unbound from.

1046 

1047 - `role_id: String`

1048 

1049 The ID of the role that was unbound from the resource.

1050 

1051 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

1052 

1053 The connector role mutation path that produced the event.

1054 

1055 - `:role_toggle`

1056 

1057 - `:role_connector_update`

1058 

1059 - `:role_delete`

1060 

1061 - `:workspace_permissions`

1062 

1063 - `:connector_publish`

1064 

1065 - `workspace_id: String`

1066 

1067 The workspace ID for a ChatGPT workspace connector resource.

1068 

949 - `role_updated: RoleUpdated{ id, changes_requested}`1069 - `role_updated: RoleUpdated{ id, changes_requested}`

950 1070 

951 The details for events with this `type`.1071 The details for events with this `type`.


1414 "resource_id": "resource_id",1534 "resource_id": "resource_id",

1415 "resource_type": "resource_type"1535 "resource_type": "resource_type"

1416 },1536 },

1537 "role.bound_to_resource": {

1538 "id": "id",

1539 "connector_id": "connector_id",

1540 "connector_name": "connector_name",

1541 "enabled": true,

1542 "permissions": [

1543 "string"

1544 ],

1545 "resource_id": "resource_id",

1546 "resource_type": "resource_type",

1547 "role_id": "role_id",

1548 "source": "role_toggle",

1549 "workspace_id": "workspace_id"

1550 },

1417 "role.created": {1551 "role.created": {

1418 "id": "id",1552 "id": "id",

1419 "permissions": [1553 "permissions": [


1426 "role.deleted": {1560 "role.deleted": {

1427 "id": "id"1561 "id": "id"

1428 },1562 },

1563 "role.unbound_from_resource": {

1564 "id": "id",

1565 "connector_id": "connector_id",

1566 "connector_name": "connector_name",

1567 "enabled": true,

1568 "permissions": [

1569 "string"

1570 ],

1571 "resource_id": "resource_id",

1572 "resource_type": "resource_type",

1573 "role_id": "role_id",

1574 "source": "role_toggle",

1575 "workspace_id": "workspace_id"

1576 },

1429 "role.updated": {1577 "role.updated": {

1430 "id": "id",1578 "id": "id",

1431 "changes_requested": {1579 "changes_requested": {


1531 1679 

1532 The Unix timestamp (in seconds) of the event.1680 The Unix timestamp (in seconds) of the event.

1533 1681 

1534 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`1682 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

1535 1683 

1536 The event type.1684 The event type.

1537 1685 


1633 1781 

1634 - `:"role.assignment.deleted"`1782 - `:"role.assignment.deleted"`

1635 1783 

1784 - `:"role.bound_to_resource"`

1785 

1786 - `:"role.unbound_from_resource"`

1787 

1636 - `:"scim.enabled"`1788 - `:"scim.enabled"`

1637 1789 

1638 - `:"scim.disabled"`1790 - `:"scim.disabled"`


2253 2405 

2254 The type of resource the role assignment was scoped to.2406 The type of resource the role assignment was scoped to.

2255 2407 

2408 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

2409 

2410 The details for events with this `type`.

2411 

2412 - `id: String`

2413 

2414 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2415 

2416 - `connector_id: String`

2417 

2418 The connector ID for a ChatGPT workspace connector resource.

2419 

2420 - `connector_name: String`

2421 

2422 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2423 

2424 - `enabled: bool`

2425 

2426 Whether the connector is enabled for the role.

2427 

2428 - `permissions: Array[String]`

2429 

2430 The permissions granted to the role for the resource.

2431 

2432 - `resource_id: String`

2433 

2434 The ID of the resource the role was bound to.

2435 

2436 - `resource_type: String`

2437 

2438 The type of resource the role was bound to.

2439 

2440 - `role_id: String`

2441 

2442 The ID of the role that was bound to the resource.

2443 

2444 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2445 

2446 The connector role mutation path that produced the event.

2447 

2448 - `:role_toggle`

2449 

2450 - `:role_connector_update`

2451 

2452 - `:role_delete`

2453 

2454 - `:workspace_permissions`

2455 

2456 - `:connector_publish`

2457 

2458 - `workspace_id: String`

2459 

2460 The workspace ID for a ChatGPT workspace connector resource.

2461 

2256 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`2462 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

2257 2463 

2258 The details for events with this `type`.2464 The details for events with this `type`.


2285 2491 

2286 The role ID.2492 The role ID.

2287 2493 

2494 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

2495 

2496 The details for events with this `type`.

2497 

2498 - `id: String`

2499 

2500 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2501 

2502 - `connector_id: String`

2503 

2504 The connector ID for a ChatGPT workspace connector resource.

2505 

2506 - `connector_name: String`

2507 

2508 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2509 

2510 - `enabled: bool`

2511 

2512 Whether the connector is enabled for the role.

2513 

2514 - `permissions: Array[String]`

2515 

2516 The permissions remaining for the role after the change.

2517 

2518 - `resource_id: String`

2519 

2520 The ID of the resource the role was unbound from.

2521 

2522 - `resource_type: String`

2523 

2524 The type of resource the role was unbound from.

2525 

2526 - `role_id: String`

2527 

2528 The ID of the role that was unbound from the resource.

2529 

2530 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2531 

2532 The connector role mutation path that produced the event.

2533 

2534 - `:role_toggle`

2535 

2536 - `:role_connector_update`

2537 

2538 - `:role_delete`

2539 

2540 - `:workspace_permissions`

2541 

2542 - `:connector_publish`

2543 

2544 - `workspace_id: String`

2545 

2546 The workspace ID for a ChatGPT workspace connector resource.

2547 

2288 - `role_updated: RoleUpdated{ id, changes_requested}`2548 - `role_updated: RoleUpdated{ id, changes_requested}`

2289 2549 

2290 The details for events with this `type`.2550 The details for events with this `type`.


2551 2811 

2552 The Unix timestamp (in seconds) of when the API key was created2812 The Unix timestamp (in seconds) of when the API key was created

2553 2813 

2814 - `expires_at: Integer`

2815 

2816 The Unix timestamp (in seconds) of when the API key expires

2817 

2554 - `object: :"organization.admin_api_key"`2818 - `object: :"organization.admin_api_key"`

2555 2819 

2556 The object type, which is always `organization.admin_api_key`2820 The object type, which is always `organization.admin_api_key`


2615 {2879 {

2616 "id": "key_abc",2880 "id": "key_abc",

2617 "created_at": 1711471533,2881 "created_at": 1711471533,

2882 "expires_at": 1714063533,

2618 "object": "organization.admin_api_key",2883 "object": "organization.admin_api_key",

2619 "owner": {2884 "owner": {

2620 "id": "sa_456",2885 "id": "sa_456",


2648 2913 

2649- `name: String`2914- `name: String`

2650 2915 

2916- `expires_in_seconds: Integer`

2917 

2918 The number of seconds until the API key expires. Omit this field for a key that does not expire.

2919 

2651### Returns2920### Returns

2652 2921 

2653- `class AdminAPIKeyCreateResponse`2922- `class AdminAPIKeyCreateResponse`


2676{2945{

2677 "id": "key_abc",2946 "id": "key_abc",

2678 "created_at": 1711471533,2947 "created_at": 1711471533,

2948 "expires_at": 1714063533,

2679 "object": "organization.admin_api_key",2949 "object": "organization.admin_api_key",

2680 "owner": {2950 "owner": {

2681 "id": "sa_456",2951 "id": "sa_456",


2720 2990 

2721 The Unix timestamp (in seconds) of when the API key was created2991 The Unix timestamp (in seconds) of when the API key was created

2722 2992 

2993 - `expires_at: Integer`

2994 

2995 The Unix timestamp (in seconds) of when the API key expires

2996 

2723 - `object: :"organization.admin_api_key"`2997 - `object: :"organization.admin_api_key"`

2724 2998 

2725 The object type, which is always `organization.admin_api_key`2999 The object type, which is always `organization.admin_api_key`


2782{3056{

2783 "id": "key_abc",3057 "id": "key_abc",

2784 "created_at": 1711471533,3058 "created_at": 1711471533,

3059 "expires_at": 1714063533,

2785 "object": "organization.admin_api_key",3060 "object": "organization.admin_api_key",

2786 "owner": {3061 "owner": {

2787 "id": "sa_456",3062 "id": "sa_456",


2861 3136 

2862 The Unix timestamp (in seconds) of when the API key was created3137 The Unix timestamp (in seconds) of when the API key was created

2863 3138 

3139 - `expires_at: Integer`

3140 

3141 The Unix timestamp (in seconds) of when the API key expires

3142 

2864 - `object: :"organization.admin_api_key"`3143 - `object: :"organization.admin_api_key"`

2865 3144 

2866 The object type, which is always `organization.admin_api_key`3145 The object type, which is always `organization.admin_api_key`


16801}17080}

16802```17081```

16803 17082 

17083## Retrieve organization spend alert

17084 

17085`admin.organization.spend_alerts.retrieve(alert_id) -> OrganizationSpendAlert`

17086 

17087**get** `/organization/spend_alerts/{alert_id}`

17088 

17089Retrieves an organization spend alert.

17090 

17091### Parameters

17092 

17093- `alert_id: String`

17094 

17095### Returns

17096 

17097- `class OrganizationSpendAlert`

17098 

17099 Represents a spend alert configured at the organization level.

17100 

17101 - `id: String`

17102 

17103 The identifier, which can be referenced in API endpoints.

17104 

17105 - `currency: :USD`

17106 

17107 The currency for the threshold amount.

17108 

17109 - `:USD`

17110 

17111 - `interval: :month`

17112 

17113 The time interval for evaluating spend against the threshold.

17114 

17115 - `:month`

17116 

17117 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

17118 

17119 Email notification settings for a spend alert.

17120 

17121 - `recipients: Array[String]`

17122 

17123 Email addresses that receive the spend alert notification.

17124 

17125 - `type: :email`

17126 

17127 The notification channel type. Currently only `email` is supported.

17128 

17129 - `:email`

17130 

17131 - `subject_prefix: String`

17132 

17133 Optional subject prefix for alert emails.

17134 

17135 - `object: :"organization.spend_alert"`

17136 

17137 The object type, which is always `organization.spend_alert`.

17138 

17139 - `:"organization.spend_alert"`

17140 

17141 - `threshold_amount: Integer`

17142 

17143 The alert threshold amount, in cents.

17144 

17145### Example

17146 

17147```ruby

17148require "openai"

17149 

17150openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

17151 

17152organization_spend_alert = openai.admin.organization.spend_alerts.retrieve("alert_id")

17153 

17154puts(organization_spend_alert)

17155```

17156 

17157#### Response

17158 

17159```json

17160{

17161 "id": "id",

17162 "currency": "USD",

17163 "interval": "month",

17164 "notification_channel": {

17165 "recipients": [

17166 "string"

17167 ],

17168 "type": "email",

17169 "subject_prefix": "subject_prefix"

17170 },

17171 "object": "organization.spend_alert",

17172 "threshold_amount": 0

17173}

17174```

17175 

16804## Update organization spend alert17176## Update organization spend alert

16805 17177 

16806`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`17178`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`


23101}23473}

23102```23474```

23103 23475 

23476## Retrieve project spend alert

23477 

23478`admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert`

23479 

23480**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

23481 

23482Retrieves a project spend alert.

23483 

23484### Parameters

23485 

23486- `project_id: String`

23487 

23488- `alert_id: String`

23489 

23490### Returns

23491 

23492- `class ProjectSpendAlert`

23493 

23494 Represents a spend alert configured at the project level.

23495 

23496 - `id: String`

23497 

23498 The identifier, which can be referenced in API endpoints.

23499 

23500 - `currency: :USD`

23501 

23502 The currency for the threshold amount.

23503 

23504 - `:USD`

23505 

23506 - `interval: :month`

23507 

23508 The time interval for evaluating spend against the threshold.

23509 

23510 - `:month`

23511 

23512 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

23513 

23514 Email notification settings for a spend alert.

23515 

23516 - `recipients: Array[String]`

23517 

23518 Email addresses that receive the spend alert notification.

23519 

23520 - `type: :email`

23521 

23522 The notification channel type. Currently only `email` is supported.

23523 

23524 - `:email`

23525 

23526 - `subject_prefix: String`

23527 

23528 Optional subject prefix for alert emails.

23529 

23530 - `object: :"project.spend_alert"`

23531 

23532 The object type, which is always `project.spend_alert`.

23533 

23534 - `:"project.spend_alert"`

23535 

23536 - `threshold_amount: Integer`

23537 

23538 The alert threshold amount, in cents.

23539 

23540### Example

23541 

23542```ruby

23543require "openai"

23544 

23545openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

23546 

23547project_spend_alert = openai.admin.organization.projects.spend_alerts.retrieve("alert_id", project_id: "project_id")

23548 

23549puts(project_spend_alert)

23550```

23551 

23552#### Response

23553 

23554```json

23555{

23556 "id": "id",

23557 "currency": "USD",

23558 "interval": "month",

23559 "notification_channel": {

23560 "recipients": [

23561 "string"

23562 ],

23563 "type": "email",

23564 "subject_prefix": "subject_prefix"

23565 },

23566 "object": "project.spend_alert",

23567 "threshold_amount": 0

23568}

23569```

23570 

23104## Update project spend alert23571## Update project spend alert

23105 23572 

23106`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`23573`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

5`admin.organization.admin_api_keys.list(**kwargs) -> CursorPage<AdminAPIKey>`

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `after: String`

14 

15 Return keys with IDs that come after this ID in the pagination order.

16 

17- `limit: Integer`

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- `class 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: Integer`

40 

41 The Unix timestamp (in seconds) of when the API key was created

42 

43 - `expires_at: Integer`

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{ id, created_at, name, 3 more}`

54 

55 - `id: String`

56 

57 The identifier, which can be referenced in API endpoints

58 

59 - `created_at: Integer`

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: Integer`

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```ruby

94require "openai"

95 

96openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

97 

98page = openai.admin.organization.admin_api_keys.list

99 

100puts(page)

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```

132 

133## Create admin API key

134 

135`admin.organization.admin_api_keys.create(**kwargs) -> AdminAPIKeyCreateResponse`

136 

137**post** `/organization/admin_api_keys`

138 

139Create an organization admin API key

140 

141### Parameters

142 

143- `name: String`

144 

145- `expires_in_seconds: Integer`

146 

147 The number of seconds until the API key expires. Omit this field for a key that does not expire.

148 

149### Returns

150 

151- `class AdminAPIKeyCreateResponse`

152 

153 Represents an individual Admin API key in an org.

154 

155 - `value: String`

156 

157 The value of the API key. Only shown on create.

158 

159### Example

160 

161```ruby

162require "openai"

163 

164openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

165 

166admin_api_key = openai.admin.organization.admin_api_keys.create(name: "New Admin Key")

167 

168puts(admin_api_key)

169```

170 

171#### Response

172 

173```json

174{

175 "id": "key_abc",

176 "created_at": 1711471533,

177 "expires_at": 1714063533,

178 "object": "organization.admin_api_key",

179 "owner": {

180 "id": "sa_456",

181 "created_at": 1711471533,

182 "name": "My Service Account",

183 "object": "organization.user",

184 "role": "owner",

185 "type": "user"

186 },

187 "redacted_value": "sk-admin...def",

188 "last_used_at": 1711471534,

189 "name": "Administration Key",

190 "value": "sk-admin-1234abcd"

191}

192```

193 

194## Retrieve admin API key

195 

196`admin.organization.admin_api_keys.retrieve(key_id) -> AdminAPIKey`

197 

198**get** `/organization/admin_api_keys/{key_id}`

199 

200Retrieve a single organization API key

201 

202### Parameters

203 

204- `key_id: String`

205 

206 The ID of the API key.

207 

208### Returns

209 

210- `class AdminAPIKey`

211 

212 Represents an individual Admin API key in an org.

213 

214 - `id: String`

215 

216 The identifier, which can be referenced in API endpoints

217 

218 - `created_at: Integer`

219 

220 The Unix timestamp (in seconds) of when the API key was created

221 

222 - `expires_at: Integer`

223 

224 The Unix timestamp (in seconds) of when the API key expires

225 

226 - `object: :"organization.admin_api_key"`

227 

228 The object type, which is always `organization.admin_api_key`

229 

230 - `:"organization.admin_api_key"`

231 

232 - `owner: Owner{ id, created_at, name, 3 more}`

233 

234 - `id: String`

235 

236 The identifier, which can be referenced in API endpoints

237 

238 - `created_at: Integer`

239 

240 The Unix timestamp (in seconds) of when the user was created

241 

242 - `name: String`

243 

244 The name of the user

245 

246 - `object: String`

247 

248 The object type, which is always organization.user

249 

250 - `role: String`

251 

252 Always `owner`

253 

254 - `type: String`

255 

256 Always `user`

257 

258 - `redacted_value: String`

259 

260 The redacted value of the API key

261 

262 - `last_used_at: Integer`

263 

264 The Unix timestamp (in seconds) of when the API key was last used

265 

266 - `name: String`

267 

268 The name of the API key

269 

270### Example

271 

272```ruby

273require "openai"

274 

275openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

276 

277admin_api_key = openai.admin.organization.admin_api_keys.retrieve("key_id")

278 

279puts(admin_api_key)

280```

281 

282#### Response

283 

284```json

285{

286 "id": "key_abc",

287 "created_at": 1711471533,

288 "expires_at": 1714063533,

289 "object": "organization.admin_api_key",

290 "owner": {

291 "id": "sa_456",

292 "created_at": 1711471533,

293 "name": "My Service Account",

294 "object": "organization.user",

295 "role": "owner",

296 "type": "user"

297 },

298 "redacted_value": "sk-admin...def",

299 "last_used_at": 1711471534,

300 "name": "Administration Key"

301}

302```

303 

304## Delete admin API key

305 

306`admin.organization.admin_api_keys.delete(key_id) -> AdminAPIKeyDeleteResponse`

307 

308**delete** `/organization/admin_api_keys/{key_id}`

309 

310Delete an organization admin API key

311 

312### Parameters

313 

314- `key_id: String`

315 

316 The ID of the API key to be deleted.

317 

318### Returns

319 

320- `class AdminAPIKeyDeleteResponse`

321 

322 - `id: String`

323 

324 - `deleted: bool`

325 

326 - `object: :"organization.admin_api_key.deleted"`

327 

328 - `:"organization.admin_api_key.deleted"`

329 

330### Example

331 

332```ruby

333require "openai"

334 

335openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

336 

337admin_api_key = openai.admin.organization.admin_api_keys.delete("key_id")

338 

339puts(admin_api_key)

340```

341 

342#### Response

343 

344```json

345{

346 "id": "key_abc",

347 "deleted": true,

348 "object": "organization.admin_api_key.deleted"

349}

350```

351 

352## Domain Types

353 

354### Admin API Key

355 

356- `class AdminAPIKey`

357 

358 Represents an individual Admin API key in an org.

359 

360 - `id: String`

361 

362 The identifier, which can be referenced in API endpoints

363 

364 - `created_at: Integer`

365 

366 The Unix timestamp (in seconds) of when the API key was created

367 

368 - `expires_at: Integer`

369 

370 The Unix timestamp (in seconds) of when the API key expires

371 

372 - `object: :"organization.admin_api_key"`

373 

374 The object type, which is always `organization.admin_api_key`

375 

376 - `:"organization.admin_api_key"`

377 

378 - `owner: Owner{ id, created_at, name, 3 more}`

379 

380 - `id: String`

381 

382 The identifier, which can be referenced in API endpoints

383 

384 - `created_at: Integer`

385 

386 The Unix timestamp (in seconds) of when the user was created

387 

388 - `name: String`

389 

390 The name of the user

391 

392 - `object: String`

393 

394 The object type, which is always organization.user

395 

396 - `role: String`

397 

398 Always `owner`

399 

400 - `type: String`

401 

402 Always `user`

403 

404 - `redacted_value: String`

405 

406 The redacted value of the API key

407 

408 - `last_used_at: Integer`

409 

410 The Unix timestamp (in seconds) of when the API key was last used

411 

412 - `name: String`

413 

414 The name of the API key

415 

416### Admin API Key Create Response

417 

418- `class AdminAPIKeyCreateResponse`

419 

420 Represents an individual Admin API key in an org.

421 

422 - `value: String`

423 

424 The value of the API key. Only shown on create.

425 

426### Admin API Key Delete Response

427 

428- `class AdminAPIKeyDeleteResponse`

429 

430 - `id: String`

431 

432 - `deleted: bool`

433 

434 - `object: :"organization.admin_api_key.deleted"`

435 

436 - `:"organization.admin_api_key.deleted"`

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

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: 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 


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{ id, connector_id, connector_name, 7 more}`

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: bool`

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{ id, permissions, resource_id, 2 more}`981 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

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{ id, connector_id, connector_name, 7 more}`

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: bool`

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{ id, changes_requested}`1067 - `role_updated: RoleUpdated{ id, changes_requested}`

948 1068 

949 The details for events with this `type`.1069 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": {


1529 1677 

1530 The Unix timestamp (in seconds) of the event.1678 The Unix timestamp (in seconds) of the event.

1531 1679 

1532 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 54 more`1680 - `type: :"api_key.created" | :"api_key.updated" | :"api_key.deleted" | 56 more`

1533 1681 

1534 The event type.1682 The event type.

1535 1683 


1631 1779 

1632 - `:"role.assignment.deleted"`1780 - `:"role.assignment.deleted"`

1633 1781 

1782 - `:"role.bound_to_resource"`

1783 

1784 - `:"role.unbound_from_resource"`

1785 

1634 - `:"scim.enabled"`1786 - `:"scim.enabled"`

1635 1787 

1636 - `:"scim.disabled"`1788 - `:"scim.disabled"`


2251 2403 

2252 The type of resource the role assignment was scoped to.2404 The type of resource the role assignment was scoped to.

2253 2405 

2406 - `role_bound_to_resource: RoleBoundToResource{ id, connector_id, connector_name, 7 more}`

2407 

2408 The details for events with this `type`.

2409 

2410 - `id: String`

2411 

2412 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2413 

2414 - `connector_id: String`

2415 

2416 The connector ID for a ChatGPT workspace connector resource.

2417 

2418 - `connector_name: String`

2419 

2420 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2421 

2422 - `enabled: bool`

2423 

2424 Whether the connector is enabled for the role.

2425 

2426 - `permissions: Array[String]`

2427 

2428 The permissions granted to the role for the resource.

2429 

2430 - `resource_id: String`

2431 

2432 The ID of the resource the role was bound to.

2433 

2434 - `resource_type: String`

2435 

2436 The type of resource the role was bound to.

2437 

2438 - `role_id: String`

2439 

2440 The ID of the role that was bound to the resource.

2441 

2442 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2443 

2444 The connector role mutation path that produced the event.

2445 

2446 - `:role_toggle`

2447 

2448 - `:role_connector_update`

2449 

2450 - `:role_delete`

2451 

2452 - `:workspace_permissions`

2453 

2454 - `:connector_publish`

2455 

2456 - `workspace_id: String`

2457 

2458 The workspace ID for a ChatGPT workspace connector resource.

2459 

2254 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`2460 - `role_created: RoleCreated{ id, permissions, resource_id, 2 more}`

2255 2461 

2256 The details for events with this `type`.2462 The details for events with this `type`.


2283 2489 

2284 The role ID.2490 The role ID.

2285 2491 

2492 - `role_unbound_from_resource: RoleUnboundFromResource{ id, connector_id, connector_name, 7 more}`

2493 

2494 The details for events with this `type`.

2495 

2496 - `id: String`

2497 

2498 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2499 

2500 - `connector_id: String`

2501 

2502 The connector ID for a ChatGPT workspace connector resource.

2503 

2504 - `connector_name: String`

2505 

2506 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2507 

2508 - `enabled: bool`

2509 

2510 Whether the connector is enabled for the role.

2511 

2512 - `permissions: Array[String]`

2513 

2514 The permissions remaining for the role after the change.

2515 

2516 - `resource_id: String`

2517 

2518 The ID of the resource the role was unbound from.

2519 

2520 - `resource_type: String`

2521 

2522 The type of resource the role was unbound from.

2523 

2524 - `role_id: String`

2525 

2526 The ID of the role that was unbound from the resource.

2527 

2528 - `source: :role_toggle | :role_connector_update | :role_delete | 2 more`

2529 

2530 The connector role mutation path that produced the event.

2531 

2532 - `:role_toggle`

2533 

2534 - `:role_connector_update`

2535 

2536 - `:role_delete`

2537 

2538 - `:workspace_permissions`

2539 

2540 - `:connector_publish`

2541 

2542 - `workspace_id: String`

2543 

2544 The workspace ID for a ChatGPT workspace connector resource.

2545 

2286 - `role_updated: RoleUpdated{ id, changes_requested}`2546 - `role_updated: RoleUpdated{ id, changes_requested}`

2287 2547 

2288 The details for events with this `type`.2548 The details for events with this `type`.

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

5245}5245}

5246```5246```

5247 5247 

5248## Retrieve project spend alert

5249 

5250`admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert`

5251 

5252**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

5253 

5254Retrieves a project spend alert.

5255 

5256### Parameters

5257 

5258- `project_id: String`

5259 

5260- `alert_id: String`

5261 

5262### Returns

5263 

5264- `class ProjectSpendAlert`

5265 

5266 Represents a spend alert configured at the project level.

5267 

5268 - `id: String`

5269 

5270 The identifier, which can be referenced in API endpoints.

5271 

5272 - `currency: :USD`

5273 

5274 The currency for the threshold amount.

5275 

5276 - `:USD`

5277 

5278 - `interval: :month`

5279 

5280 The time interval for evaluating spend against the threshold.

5281 

5282 - `:month`

5283 

5284 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

5285 

5286 Email notification settings for a spend alert.

5287 

5288 - `recipients: Array[String]`

5289 

5290 Email addresses that receive the spend alert notification.

5291 

5292 - `type: :email`

5293 

5294 The notification channel type. Currently only `email` is supported.

5295 

5296 - `:email`

5297 

5298 - `subject_prefix: String`

5299 

5300 Optional subject prefix for alert emails.

5301 

5302 - `object: :"project.spend_alert"`

5303 

5304 The object type, which is always `project.spend_alert`.

5305 

5306 - `:"project.spend_alert"`

5307 

5308 - `threshold_amount: Integer`

5309 

5310 The alert threshold amount, in cents.

5311 

5312### Example

5313 

5314```ruby

5315require "openai"

5316 

5317openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

5318 

5319project_spend_alert = openai.admin.organization.projects.spend_alerts.retrieve("alert_id", project_id: "project_id")

5320 

5321puts(project_spend_alert)

5322```

5323 

5324#### Response

5325 

5326```json

5327{

5328 "id": "id",

5329 "currency": "USD",

5330 "interval": "month",

5331 "notification_channel": {

5332 "recipients": [

5333 "string"

5334 ],

5335 "type": "email",

5336 "subject_prefix": "subject_prefix"

5337 },

5338 "object": "project.spend_alert",

5339 "threshold_amount": 0

5340}

5341```

5342 

5248## Update project spend alert5343## Update project spend alert

5249 5344 

5250`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`5345`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`

Details

254}254}

255```255```

256 256 

257## Retrieve project spend alert

258 

259`admin.organization.projects.spend_alerts.retrieve(alert_id, **kwargs) -> ProjectSpendAlert`

260 

261**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

262 

263Retrieves a project spend alert.

264 

265### Parameters

266 

267- `project_id: String`

268 

269- `alert_id: String`

270 

271### Returns

272 

273- `class ProjectSpendAlert`

274 

275 Represents a spend alert configured at the project level.

276 

277 - `id: String`

278 

279 The identifier, which can be referenced in API endpoints.

280 

281 - `currency: :USD`

282 

283 The currency for the threshold amount.

284 

285 - `:USD`

286 

287 - `interval: :month`

288 

289 The time interval for evaluating spend against the threshold.

290 

291 - `:month`

292 

293 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

294 

295 Email notification settings for a spend alert.

296 

297 - `recipients: Array[String]`

298 

299 Email addresses that receive the spend alert notification.

300 

301 - `type: :email`

302 

303 The notification channel type. Currently only `email` is supported.

304 

305 - `:email`

306 

307 - `subject_prefix: String`

308 

309 Optional subject prefix for alert emails.

310 

311 - `object: :"project.spend_alert"`

312 

313 The object type, which is always `project.spend_alert`.

314 

315 - `:"project.spend_alert"`

316 

317 - `threshold_amount: Integer`

318 

319 The alert threshold amount, in cents.

320 

321### Example

322 

323```ruby

324require "openai"

325 

326openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

327 

328project_spend_alert = openai.admin.organization.projects.spend_alerts.retrieve("alert_id", project_id: "project_id")

329 

330puts(project_spend_alert)

331```

332 

333#### Response

334 

335```json

336{

337 "id": "id",

338 "currency": "USD",

339 "interval": "month",

340 "notification_channel": {

341 "recipients": [

342 "string"

343 ],

344 "type": "email",

345 "subject_prefix": "subject_prefix"

346 },

347 "object": "project.spend_alert",

348 "threshold_amount": 0

349}

350```

351 

257## Update project spend alert352## Update project spend alert

258 353 

259`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`354`admin.organization.projects.spend_alerts.update(alert_id, **kwargs) -> ProjectSpendAlert`

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

249}249}

250```250```

251 251 

252## Retrieve organization spend alert

253 

254`admin.organization.spend_alerts.retrieve(alert_id) -> OrganizationSpendAlert`

255 

256**get** `/organization/spend_alerts/{alert_id}`

257 

258Retrieves an organization spend alert.

259 

260### Parameters

261 

262- `alert_id: String`

263 

264### Returns

265 

266- `class OrganizationSpendAlert`

267 

268 Represents a spend alert configured at the organization level.

269 

270 - `id: String`

271 

272 The identifier, which can be referenced in API endpoints.

273 

274 - `currency: :USD`

275 

276 The currency for the threshold amount.

277 

278 - `:USD`

279 

280 - `interval: :month`

281 

282 The time interval for evaluating spend against the threshold.

283 

284 - `:month`

285 

286 - `notification_channel: NotificationChannel{ recipients, type, subject_prefix}`

287 

288 Email notification settings for a spend alert.

289 

290 - `recipients: Array[String]`

291 

292 Email addresses that receive the spend alert notification.

293 

294 - `type: :email`

295 

296 The notification channel type. Currently only `email` is supported.

297 

298 - `:email`

299 

300 - `subject_prefix: String`

301 

302 Optional subject prefix for alert emails.

303 

304 - `object: :"organization.spend_alert"`

305 

306 The object type, which is always `organization.spend_alert`.

307 

308 - `:"organization.spend_alert"`

309 

310 - `threshold_amount: Integer`

311 

312 The alert threshold amount, in cents.

313 

314### Example

315 

316```ruby

317require "openai"

318 

319openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

320 

321organization_spend_alert = openai.admin.organization.spend_alerts.retrieve("alert_id")

322 

323puts(organization_spend_alert)

324```

325 

326#### Response

327 

328```json

329{

330 "id": "id",

331 "currency": "USD",

332 "interval": "month",

333 "notification_channel": {

334 "recipients": [

335 "string"

336 ],

337 "type": "email",

338 "subject_prefix": "subject_prefix"

339 },

340 "object": "organization.spend_alert",

341 "threshold_amount": 0

342}

343```

344 

252## Update organization spend alert345## Update organization spend alert

253 346 

254`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`347`admin.organization.spend_alerts.update(alert_id, **kwargs) -> OrganizationSpendAlert`

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

3446 Configuration options for3446 Configuration options for

3447 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3447 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3448 3448 

3449 - `context: :auto | :current_turn | :all_turns`

3450 

3451 Controls which reasoning items are rendered back to the model on later turns.

3452 When returned on a response, this is the effective reasoning context mode

3453 used for the response.

3454 

3455 - `:auto`

3456 

3457 - `:current_turn`

3458 

3459 - `:all_turns`

3460 

3449 - `effort: ReasoningEffort`3461 - `effort: ReasoningEffort`

3450 3462 

3451 Constrains effort on reasoning for3463 Constrains effort on reasoning for


8729 Configuration options for8741 Configuration options for

8730 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8742 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8731 8743 

8744 - `context: :auto | :current_turn | :all_turns`

8745 

8746 Controls which reasoning items are rendered back to the model on later turns.

8747 When returned on a response, this is the effective reasoning context mode

8748 used for the response.

8749 

8750 - `:auto`

8751 

8752 - `:current_turn`

8753 

8754 - `:all_turns`

8755 

8732 - `effort: ReasoningEffort`8756 - `effort: ReasoningEffort`

8733 8757 

8734 Constrains effort on reasoning for8758 Constrains effort on reasoning for


9120 "prompt_cache_key": "prompt-cache-key-1234",9144 "prompt_cache_key": "prompt-cache-key-1234",

9121 "prompt_cache_retention": "in_memory",9145 "prompt_cache_retention": "in_memory",

9122 "reasoning": {9146 "reasoning": {

9147 "context": "auto",

9123 "effort": "none",9148 "effort": "none",

9124 "generate_summary": "auto",9149 "generate_summary": "auto",

9125 "summary": "auto"9150 "summary": "auto"


14004 Configuration options for14029 Configuration options for

14005 [reasoning models](https://platform.openai.com/docs/guides/reasoning).14030 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

14006 14031 

14032 - `context: :auto | :current_turn | :all_turns`

14033 

14034 Controls which reasoning items are rendered back to the model on later turns.

14035 When returned on a response, this is the effective reasoning context mode

14036 used for the response.

14037 

14038 - `:auto`

14039 

14040 - `:current_turn`

14041 

14042 - `:all_turns`

14043 

14007 - `effort: ReasoningEffort`14044 - `effort: ReasoningEffort`

14008 14045 

14009 Constrains effort on reasoning for14046 Constrains effort on reasoning for


14395 "prompt_cache_key": "prompt-cache-key-1234",14432 "prompt_cache_key": "prompt-cache-key-1234",

14396 "prompt_cache_retention": "in_memory",14433 "prompt_cache_retention": "in_memory",

14397 "reasoning": {14434 "reasoning": {

14435 "context": "auto",

14398 "effort": "none",14436 "effort": "none",

14399 "generate_summary": "auto",14437 "generate_summary": "auto",

14400 "summary": "auto"14438 "summary": "auto"


19263 Configuration options for19301 Configuration options for

19264 [reasoning models](https://platform.openai.com/docs/guides/reasoning).19302 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

19265 19303 

19304 - `context: :auto | :current_turn | :all_turns`

19305 

19306 Controls which reasoning items are rendered back to the model on later turns.

19307 When returned on a response, this is the effective reasoning context mode

19308 used for the response.

19309 

19310 - `:auto`

19311 

19312 - `:current_turn`

19313 

19314 - `:all_turns`

19315 

19266 - `effort: ReasoningEffort`19316 - `effort: ReasoningEffort`

19267 19317 

19268 Constrains effort on reasoning for19318 Constrains effort on reasoning for


19654 "prompt_cache_key": "prompt-cache-key-1234",19704 "prompt_cache_key": "prompt-cache-key-1234",

19655 "prompt_cache_retention": "in_memory",19705 "prompt_cache_retention": "in_memory",

19656 "reasoning": {19706 "reasoning": {

19707 "context": "auto",

19657 "effort": "none",19708 "effort": "none",

19658 "generate_summary": "auto",19709 "generate_summary": "auto",

19659 "summary": "auto"19710 "summary": "auto"


35154 Configuration options for35205 Configuration options for

35155 [reasoning models](https://platform.openai.com/docs/guides/reasoning).35206 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

35156 35207 

35208 - `context: :auto | :current_turn | :all_turns`

35209 

35210 Controls which reasoning items are rendered back to the model on later turns.

35211 When returned on a response, this is the effective reasoning context mode

35212 used for the response.

35213 

35214 - `:auto`

35215 

35216 - `:current_turn`

35217 

35218 - `:all_turns`

35219 

35157 - `effort: ReasoningEffort`35220 - `effort: ReasoningEffort`

35158 35221 

35159 Constrains effort on reasoning for35222 Constrains effort on reasoning for


40647 Configuration options for40710 Configuration options for

40648 [reasoning models](https://platform.openai.com/docs/guides/reasoning).40711 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

40649 40712 

40713 - `context: :auto | :current_turn | :all_turns`

40714 

40715 Controls which reasoning items are rendered back to the model on later turns.

40716 When returned on a response, this is the effective reasoning context mode

40717 used for the response.

40718 

40719 - `:auto`

40720 

40721 - `:current_turn`

40722 

40723 - `:all_turns`

40724 

40650 - `effort: ReasoningEffort`40725 - `effort: ReasoningEffort`

40651 40726 

40652 Constrains effort on reasoning for40727 Constrains effort on reasoning for


46890 Configuration options for46965 Configuration options for

46891 [reasoning models](https://platform.openai.com/docs/guides/reasoning).46966 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

46892 46967 

46968 - `context: :auto | :current_turn | :all_turns`

46969 

46970 Controls which reasoning items are rendered back to the model on later turns.

46971 When returned on a response, this is the effective reasoning context mode

46972 used for the response.

46973 

46974 - `:auto`

46975 

46976 - `:current_turn`

46977 

46978 - `:all_turns`

46979 

46893 - `effort: ReasoningEffort`46980 - `effort: ReasoningEffort`

46894 46981 

46895 Constrains effort on reasoning for46982 Constrains effort on reasoning for


52283 Configuration options for52370 Configuration options for

52284 [reasoning models](https://platform.openai.com/docs/guides/reasoning).52371 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

52285 52372 

52373 - `context: :auto | :current_turn | :all_turns`

52374 

52375 Controls which reasoning items are rendered back to the model on later turns.

52376 When returned on a response, this is the effective reasoning context mode

52377 used for the response.

52378 

52379 - `:auto`

52380 

52381 - `:current_turn`

52382 

52383 - `:all_turns`

52384 

52286 - `effort: ReasoningEffort`52385 - `effort: ReasoningEffort`

52287 52386 

52288 Constrains effort on reasoning for52387 Constrains effort on reasoning for


58422 Configuration options for58521 Configuration options for

58423 [reasoning models](https://platform.openai.com/docs/guides/reasoning).58522 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

58424 58523 

58524 - `context: :auto | :current_turn | :all_turns`

58525 

58526 Controls which reasoning items are rendered back to the model on later turns.

58527 When returned on a response, this is the effective reasoning context mode

58528 used for the response.

58529 

58530 - `:auto`

58531 

58532 - `:current_turn`

58533 

58534 - `:all_turns`

58535 

58425 - `effort: ReasoningEffort`58536 - `effort: ReasoningEffort`

58426 58537 

58427 Constrains effort on reasoning for58538 Constrains effort on reasoning for


63519 Configuration options for63630 Configuration options for

63520 [reasoning models](https://platform.openai.com/docs/guides/reasoning).63631 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

63521 63632 

63633 - `context: :auto | :current_turn | :all_turns`

63634 

63635 Controls which reasoning items are rendered back to the model on later turns.

63636 When returned on a response, this is the effective reasoning context mode

63637 used for the response.

63638 

63639 - `:auto`

63640 

63641 - `:current_turn`

63642 

63643 - `:all_turns`

63644 

63522 - `effort: ReasoningEffort`63645 - `effort: ReasoningEffort`

63523 63646 

63524 Constrains effort on reasoning for63647 Constrains effort on reasoning for


87609 Configuration options for87732 Configuration options for

87610 [reasoning models](https://platform.openai.com/docs/guides/reasoning).87733 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

87611 87734 

87735 - `context: :auto | :current_turn | :all_turns`

87736 

87737 Controls which reasoning items are rendered back to the model on later turns.

87738 When returned on a response, this is the effective reasoning context mode

87739 used for the response.

87740 

87741 - `:auto`

87742 

87743 - `:current_turn`

87744 

87745 - `:all_turns`

87746 

87612 - `effort: ReasoningEffort`87747 - `effort: ReasoningEffort`

87613 87748 

87614 Constrains effort on reasoning for87749 Constrains effort on reasoning for


93219 Configuration options for93354 Configuration options for

93220 [reasoning models](https://platform.openai.com/docs/guides/reasoning).93355 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

93221 93356 

93357 - `context: :auto | :current_turn | :all_turns`

93358 

93359 Controls which reasoning items are rendered back to the model on later turns.

93360 When returned on a response, this is the effective reasoning context mode

93361 used for the response.

93362 

93363 - `:auto`

93364 

93365 - `:current_turn`

93366 

93367 - `:all_turns`

93368 

93222 - `effort: ReasoningEffort`93369 - `effort: ReasoningEffort`

93223 93370 

93224 Constrains effort on reasoning for93371 Constrains effort on reasoning for


100579 Configuration options for100726 Configuration options for

100580 [reasoning models](https://platform.openai.com/docs/guides/reasoning).100727 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

100581 100728 

100729 - `context: :auto | :current_turn | :all_turns`

100730 

100731 Controls which reasoning items are rendered back to the model on later turns.

100732 When returned on a response, this is the effective reasoning context mode

100733 used for the response.

100734 

100735 - `:auto`

100736 

100737 - `:current_turn`

100738 

100739 - `:all_turns`

100740 

100582 - `effort: ReasoningEffort`100741 - `effort: ReasoningEffort`

100583 100742 

100584 Constrains effort on reasoning for100743 Constrains effort on reasoning for


106054 Configuration options for106213 Configuration options for

106055 [reasoning models](https://platform.openai.com/docs/guides/reasoning).106214 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

106056 106215 

106216 - `context: :auto | :current_turn | :all_turns`

106217 

106218 Controls which reasoning items are rendered back to the model on later turns.

106219 When returned on a response, this is the effective reasoning context mode

106220 used for the response.

106221 

106222 - `:auto`

106223 

106224 - `:current_turn`

106225 

106226 - `:all_turns`

106227 

106057 - `effort: ReasoningEffort`106228 - `effort: ReasoningEffort`

106058 106229 

106059 Constrains effort on reasoning for106230 Constrains effort on reasoning for


118029 118200 

118030 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).118201 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

118031 118202 

118203 - `context: :auto | :current_turn | :all_turns`

118204 

118205 Controls which reasoning items are rendered back to the model on later turns.

118206 When returned on a response, this is the effective reasoning context mode

118207 used for the response.

118208 

118209 - `:auto`

118210 

118211 - `:current_turn`

118212 

118213 - `:all_turns`

118214 

118032 - `effort: ReasoningEffort`118215 - `effort: ReasoningEffort`

118033 118216 

118034 Constrains effort on reasoning for118217 Constrains effort on reasoning for

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

3124 3124 

3125 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3125 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3126 3126 

3127 - `context: :auto | :current_turn | :all_turns`

3128 

3129 Controls which reasoning items are rendered back to the model on later turns.

3130 When returned on a response, this is the effective reasoning context mode

3131 used for the response.

3132 

3133 - `:auto`

3134 

3135 - `:current_turn`

3136 

3137 - `:all_turns`

3138 

3127 - `effort: ReasoningEffort`3139 - `effort: ReasoningEffort`

3128 3140 

3129 Constrains effort on reasoning for3141 Constrains effort on reasoning for

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

265 265 

266 - `class VideoReferenceInputParam`266 - `class VideoReferenceInputParam`

267 267 

268 Reference to the completed video.268 Reference to the completed video to edit.

269 269 

270 - `id: String`270 - `id: String`

271 271 

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

52 52 

53 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.53 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

54 54 

55 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more>`55 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more>`

56 56 

57 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).57 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).

58 58 


154 154 

155 - `"role.assignment.deleted"`155 - `"role.assignment.deleted"`

156 156 

157 - `"role.bound_to_resource"`

158 

159 - `"role.unbound_from_resource"`

160 

157 - `"scim.enabled"`161 - `"scim.enabled"`

158 162 

159 - `"scim.disabled"`163 - `"scim.disabled"`


180 184 

181 - `resource_ids?: Array<string>`185 - `resource_ids?: Array<string>`

182 186 

183 Return only events performed on these targets. For example, a project ID updated.187 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>`.

188 

189 - `tenant_only?: boolean`

190 

191 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.

184 192 

185### Returns193### Returns

186 194 


196 204 

197 The Unix timestamp (in seconds) of the event.205 The Unix timestamp (in seconds) of the event.

198 206 

199 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`207 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

200 208 

201 The event type.209 The event type.

202 210 


298 306 

299 - `"role.assignment.deleted"`307 - `"role.assignment.deleted"`

300 308 

309 - `"role.bound_to_resource"`

310 

311 - `"role.unbound_from_resource"`

312 

301 - `"scim.enabled"`313 - `"scim.enabled"`

302 314 

303 - `"scim.disabled"`315 - `"scim.disabled"`


918 930 

919 The type of resource the role assignment was scoped to.931 The type of resource the role assignment was scoped to.

920 932 

933 - `"role.bound_to_resource"?: RoleBoundToResource`

934 

935 The details for events with this `type`.

936 

937 - `id?: string`

938 

939 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

940 

941 - `connector_id?: string`

942 

943 The connector ID for a ChatGPT workspace connector resource.

944 

945 - `connector_name?: string`

946 

947 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

948 

949 - `enabled?: boolean`

950 

951 Whether the connector is enabled for the role.

952 

953 - `permissions?: Array<string>`

954 

955 The permissions granted to the role for the resource.

956 

957 - `resource_id?: string`

958 

959 The ID of the resource the role was bound to.

960 

961 - `resource_type?: string`

962 

963 The type of resource the role was bound to.

964 

965 - `role_id?: string`

966 

967 The ID of the role that was bound to the resource.

968 

969 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

970 

971 The connector role mutation path that produced the event.

972 

973 - `"role_toggle"`

974 

975 - `"role_connector_update"`

976 

977 - `"role_delete"`

978 

979 - `"workspace_permissions"`

980 

981 - `"connector_publish"`

982 

983 - `workspace_id?: string`

984 

985 The workspace ID for a ChatGPT workspace connector resource.

986 

921 - `"role.created"?: RoleCreated`987 - `"role.created"?: RoleCreated`

922 988 

923 The details for events with this `type`.989 The details for events with this `type`.


950 1016 

951 The role ID.1017 The role ID.

952 1018 

1019 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

1020 

1021 The details for events with this `type`.

1022 

1023 - `id?: string`

1024 

1025 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1026 

1027 - `connector_id?: string`

1028 

1029 The connector ID for a ChatGPT workspace connector resource.

1030 

1031 - `connector_name?: string`

1032 

1033 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1034 

1035 - `enabled?: boolean`

1036 

1037 Whether the connector is enabled for the role.

1038 

1039 - `permissions?: Array<string>`

1040 

1041 The permissions remaining for the role after the change.

1042 

1043 - `resource_id?: string`

1044 

1045 The ID of the resource the role was unbound from.

1046 

1047 - `resource_type?: string`

1048 

1049 The type of resource the role was unbound from.

1050 

1051 - `role_id?: string`

1052 

1053 The ID of the role that was unbound from the resource.

1054 

1055 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

1056 

1057 The connector role mutation path that produced the event.

1058 

1059 - `"role_toggle"`

1060 

1061 - `"role_connector_update"`

1062 

1063 - `"role_delete"`

1064 

1065 - `"workspace_permissions"`

1066 

1067 - `"connector_publish"`

1068 

1069 - `workspace_id?: string`

1070 

1071 The workspace ID for a ChatGPT workspace connector resource.

1072 

953 - `"role.updated"?: RoleUpdated`1073 - `"role.updated"?: RoleUpdated`

954 1074 

955 The details for events with this `type`.1075 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": {


1538 1686 

1539 The Unix timestamp (in seconds) of the event.1687 The Unix timestamp (in seconds) of the event.

1540 1688 

1541 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`1689 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

1542 1690 

1543 The event type.1691 The event type.

1544 1692 


1640 1788 

1641 - `"role.assignment.deleted"`1789 - `"role.assignment.deleted"`

1642 1790 

1791 - `"role.bound_to_resource"`

1792 

1793 - `"role.unbound_from_resource"`

1794 

1643 - `"scim.enabled"`1795 - `"scim.enabled"`

1644 1796 

1645 - `"scim.disabled"`1797 - `"scim.disabled"`


2260 2412 

2261 The type of resource the role assignment was scoped to.2413 The type of resource the role assignment was scoped to.

2262 2414 

2415 - `"role.bound_to_resource"?: RoleBoundToResource`

2416 

2417 The details for events with this `type`.

2418 

2419 - `id?: string`

2420 

2421 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2422 

2423 - `connector_id?: string`

2424 

2425 The connector ID for a ChatGPT workspace connector resource.

2426 

2427 - `connector_name?: string`

2428 

2429 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2430 

2431 - `enabled?: boolean`

2432 

2433 Whether the connector is enabled for the role.

2434 

2435 - `permissions?: Array<string>`

2436 

2437 The permissions granted to the role for the resource.

2438 

2439 - `resource_id?: string`

2440 

2441 The ID of the resource the role was bound to.

2442 

2443 - `resource_type?: string`

2444 

2445 The type of resource the role was bound to.

2446 

2447 - `role_id?: string`

2448 

2449 The ID of the role that was bound to the resource.

2450 

2451 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2452 

2453 The connector role mutation path that produced the event.

2454 

2455 - `"role_toggle"`

2456 

2457 - `"role_connector_update"`

2458 

2459 - `"role_delete"`

2460 

2461 - `"workspace_permissions"`

2462 

2463 - `"connector_publish"`

2464 

2465 - `workspace_id?: string`

2466 

2467 The workspace ID for a ChatGPT workspace connector resource.

2468 

2263 - `"role.created"?: RoleCreated`2469 - `"role.created"?: RoleCreated`

2264 2470 

2265 The details for events with this `type`.2471 The details for events with this `type`.


2292 2498 

2293 The role ID.2499 The role ID.

2294 2500 

2501 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

2502 

2503 The details for events with this `type`.

2504 

2505 - `id?: string`

2506 

2507 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2508 

2509 - `connector_id?: string`

2510 

2511 The connector ID for a ChatGPT workspace connector resource.

2512 

2513 - `connector_name?: string`

2514 

2515 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2516 

2517 - `enabled?: boolean`

2518 

2519 Whether the connector is enabled for the role.

2520 

2521 - `permissions?: Array<string>`

2522 

2523 The permissions remaining for the role after the change.

2524 

2525 - `resource_id?: string`

2526 

2527 The ID of the resource the role was unbound from.

2528 

2529 - `resource_type?: string`

2530 

2531 The type of resource the role was unbound from.

2532 

2533 - `role_id?: string`

2534 

2535 The ID of the role that was unbound from the resource.

2536 

2537 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2538 

2539 The connector role mutation path that produced the event.

2540 

2541 - `"role_toggle"`

2542 

2543 - `"role_connector_update"`

2544 

2545 - `"role_delete"`

2546 

2547 - `"workspace_permissions"`

2548 

2549 - `"connector_publish"`

2550 

2551 - `workspace_id?: string`

2552 

2553 The workspace ID for a ChatGPT workspace connector resource.

2554 

2295 - `"role.updated"?: RoleUpdated`2555 - `"role.updated"?: RoleUpdated`

2296 2556 

2297 The details for events with this `type`.2557 The details for events with this `type`.


2560 2820 

2561 The Unix timestamp (in seconds) of when the API key was created2821 The Unix timestamp (in seconds) of when the API key was created

2562 2822 

2823 - `expires_at: number | null`

2824 

2825 The Unix timestamp (in seconds) of when the API key expires

2826 

2563 - `object: "organization.admin_api_key"`2827 - `object: "organization.admin_api_key"`

2564 2828 

2565 The object type, which is always `organization.admin_api_key`2829 The object type, which is always `organization.admin_api_key`


2627 {2891 {

2628 "id": "key_abc",2892 "id": "key_abc",

2629 "created_at": 1711471533,2893 "created_at": 1711471533,

2894 "expires_at": 1714063533,

2630 "object": "organization.admin_api_key",2895 "object": "organization.admin_api_key",

2631 "owner": {2896 "owner": {

2632 "id": "sa_456",2897 "id": "sa_456",


2662 2927 

2663 - `name: string`2928 - `name: string`

2664 2929 

2930 - `expires_in_seconds?: number`

2931 

2932 The number of seconds until the API key expires. Omit this field for a key that does not expire.

2933 

2665### Returns2934### Returns

2666 2935 

2667- `AdminAPIKeyCreateResponse extends AdminAPIKey`2936- `AdminAPIKeyCreateResponse extends AdminAPIKey`


2692{2961{

2693 "id": "key_abc",2962 "id": "key_abc",

2694 "created_at": 1711471533,2963 "created_at": 1711471533,

2964 "expires_at": 1714063533,

2695 "object": "organization.admin_api_key",2965 "object": "organization.admin_api_key",

2696 "owner": {2966 "owner": {

2697 "id": "sa_456",2967 "id": "sa_456",


2736 3006 

2737 The Unix timestamp (in seconds) of when the API key was created3007 The Unix timestamp (in seconds) of when the API key was created

2738 3008 

3009 - `expires_at: number | null`

3010 

3011 The Unix timestamp (in seconds) of when the API key expires

3012 

2739 - `object: "organization.admin_api_key"`3013 - `object: "organization.admin_api_key"`

2740 3014 

2741 The object type, which is always `organization.admin_api_key`3015 The object type, which is always `organization.admin_api_key`


2800{3074{

2801 "id": "key_abc",3075 "id": "key_abc",

2802 "created_at": 1711471533,3076 "created_at": 1711471533,

3077 "expires_at": 1714063533,

2803 "object": "organization.admin_api_key",3078 "object": "organization.admin_api_key",

2804 "owner": {3079 "owner": {

2805 "id": "sa_456",3080 "id": "sa_456",


2881 3156 

2882 The Unix timestamp (in seconds) of when the API key was created3157 The Unix timestamp (in seconds) of when the API key was created

2883 3158 

3159 - `expires_at: number | null`

3160 

3161 The Unix timestamp (in seconds) of when the API key expires

3162 

2884 - `object: "organization.admin_api_key"`3163 - `object: "organization.admin_api_key"`

2885 3164 

2886 The object type, which is always `organization.admin_api_key`3165 The object type, which is always `organization.admin_api_key`


17022}17301}

17023```17302```

17024 17303 

17304## Retrieve organization spend alert

17305 

17306`client.admin.organization.spendAlerts.retrieve(stringalertID, RequestOptionsoptions?): OrganizationSpendAlert`

17307 

17308**get** `/organization/spend_alerts/{alert_id}`

17309 

17310Retrieves an organization spend alert.

17311 

17312### Parameters

17313 

17314- `alertID: string`

17315 

17316### Returns

17317 

17318- `OrganizationSpendAlert`

17319 

17320 Represents a spend alert configured at the organization level.

17321 

17322 - `id: string`

17323 

17324 The identifier, which can be referenced in API endpoints.

17325 

17326 - `currency: "USD"`

17327 

17328 The currency for the threshold amount.

17329 

17330 - `"USD"`

17331 

17332 - `interval: "month"`

17333 

17334 The time interval for evaluating spend against the threshold.

17335 

17336 - `"month"`

17337 

17338 - `notification_channel: NotificationChannel`

17339 

17340 Email notification settings for a spend alert.

17341 

17342 - `recipients: Array<string>`

17343 

17344 Email addresses that receive the spend alert notification.

17345 

17346 - `type: "email"`

17347 

17348 The notification channel type. Currently only `email` is supported.

17349 

17350 - `"email"`

17351 

17352 - `subject_prefix?: string | null`

17353 

17354 Optional subject prefix for alert emails.

17355 

17356 - `object: "organization.spend_alert"`

17357 

17358 The object type, which is always `organization.spend_alert`.

17359 

17360 - `"organization.spend_alert"`

17361 

17362 - `threshold_amount: number`

17363 

17364 The alert threshold amount, in cents.

17365 

17366### Example

17367 

17368```typescript

17369import OpenAI from 'openai';

17370 

17371const client = new OpenAI({

17372 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

17373});

17374 

17375const organizationSpendAlert = await client.admin.organization.spendAlerts.retrieve('alert_id');

17376 

17377console.log(organizationSpendAlert.id);

17378```

17379 

17380#### Response

17381 

17382```json

17383{

17384 "id": "id",

17385 "currency": "USD",

17386 "interval": "month",

17387 "notification_channel": {

17388 "recipients": [

17389 "string"

17390 ],

17391 "type": "email",

17392 "subject_prefix": "subject_prefix"

17393 },

17394 "object": "organization.spend_alert",

17395 "threshold_amount": 0

17396}

17397```

17398 

17025## Update organization spend alert17399## Update organization spend alert

17026 17400 

17027`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`17401`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`


23645}24019}

23646```24020```

23647 24021 

24022## Retrieve project spend alert

24023 

24024`client.admin.organization.projects.spendAlerts.retrieve(stringalertID, SpendAlertRetrieveParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

24025 

24026**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

24027 

24028Retrieves a project spend alert.

24029 

24030### Parameters

24031 

24032- `alertID: string`

24033 

24034- `params: SpendAlertRetrieveParams`

24035 

24036 - `project_id: string`

24037 

24038 The ID of the project.

24039 

24040### Returns

24041 

24042- `ProjectSpendAlert`

24043 

24044 Represents a spend alert configured at the project level.

24045 

24046 - `id: string`

24047 

24048 The identifier, which can be referenced in API endpoints.

24049 

24050 - `currency: "USD"`

24051 

24052 The currency for the threshold amount.

24053 

24054 - `"USD"`

24055 

24056 - `interval: "month"`

24057 

24058 The time interval for evaluating spend against the threshold.

24059 

24060 - `"month"`

24061 

24062 - `notification_channel: NotificationChannel`

24063 

24064 Email notification settings for a spend alert.

24065 

24066 - `recipients: Array<string>`

24067 

24068 Email addresses that receive the spend alert notification.

24069 

24070 - `type: "email"`

24071 

24072 The notification channel type. Currently only `email` is supported.

24073 

24074 - `"email"`

24075 

24076 - `subject_prefix?: string | null`

24077 

24078 Optional subject prefix for alert emails.

24079 

24080 - `object: "project.spend_alert"`

24081 

24082 The object type, which is always `project.spend_alert`.

24083 

24084 - `"project.spend_alert"`

24085 

24086 - `threshold_amount: number`

24087 

24088 The alert threshold amount, in cents.

24089 

24090### Example

24091 

24092```typescript

24093import OpenAI from 'openai';

24094 

24095const client = new OpenAI({

24096 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

24097});

24098 

24099const projectSpendAlert = await client.admin.organization.projects.spendAlerts.retrieve(

24100 'alert_id',

24101 { project_id: 'project_id' },

24102);

24103 

24104console.log(projectSpendAlert.id);

24105```

24106 

24107#### Response

24108 

24109```json

24110{

24111 "id": "id",

24112 "currency": "USD",

24113 "interval": "month",

24114 "notification_channel": {

24115 "recipients": [

24116 "string"

24117 ],

24118 "type": "email",

24119 "subject_prefix": "subject_prefix"

24120 },

24121 "object": "project.spend_alert",

24122 "threshold_amount": 0

24123}

24124```

24125 

23648## Update project spend alert24126## Update project spend alert

23649 24127 

23650`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`24128`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

Details

50 50 

51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.51 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

52 52 

53 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more>`53 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more>`

54 54 

55 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).55 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).

56 56 


152 152 

153 - `"role.assignment.deleted"`153 - `"role.assignment.deleted"`

154 154 

155 - `"role.bound_to_resource"`

156 

157 - `"role.unbound_from_resource"`

158 

155 - `"scim.enabled"`159 - `"scim.enabled"`

156 160 

157 - `"scim.disabled"`161 - `"scim.disabled"`


178 182 

179 - `resource_ids?: Array<string>`183 - `resource_ids?: Array<string>`

180 184 

181 Return only events performed on these targets. For example, a project ID updated.185 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>`.

186 

187 - `tenant_only?: boolean`

188 

189 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.

182 190 

183### Returns191### Returns

184 192 


194 202 

195 The Unix timestamp (in seconds) of the event.203 The Unix timestamp (in seconds) of the event.

196 204 

197 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`205 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

198 206 

199 The event type.207 The event type.

200 208 


296 304 

297 - `"role.assignment.deleted"`305 - `"role.assignment.deleted"`

298 306 

307 - `"role.bound_to_resource"`

308 

309 - `"role.unbound_from_resource"`

310 

299 - `"scim.enabled"`311 - `"scim.enabled"`

300 312 

301 - `"scim.disabled"`313 - `"scim.disabled"`


916 928 

917 The type of resource the role assignment was scoped to.929 The type of resource the role assignment was scoped to.

918 930 

931 - `"role.bound_to_resource"?: RoleBoundToResource`

932 

933 The details for events with this `type`.

934 

935 - `id?: string`

936 

937 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

938 

939 - `connector_id?: string`

940 

941 The connector ID for a ChatGPT workspace connector resource.

942 

943 - `connector_name?: string`

944 

945 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

946 

947 - `enabled?: boolean`

948 

949 Whether the connector is enabled for the role.

950 

951 - `permissions?: Array<string>`

952 

953 The permissions granted to the role for the resource.

954 

955 - `resource_id?: string`

956 

957 The ID of the resource the role was bound to.

958 

959 - `resource_type?: string`

960 

961 The type of resource the role was bound to.

962 

963 - `role_id?: string`

964 

965 The ID of the role that was bound to the resource.

966 

967 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

968 

969 The connector role mutation path that produced the event.

970 

971 - `"role_toggle"`

972 

973 - `"role_connector_update"`

974 

975 - `"role_delete"`

976 

977 - `"workspace_permissions"`

978 

979 - `"connector_publish"`

980 

981 - `workspace_id?: string`

982 

983 The workspace ID for a ChatGPT workspace connector resource.

984 

919 - `"role.created"?: RoleCreated`985 - `"role.created"?: RoleCreated`

920 986 

921 The details for events with this `type`.987 The details for events with this `type`.


948 1014 

949 The role ID.1015 The role ID.

950 1016 

1017 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

1018 

1019 The details for events with this `type`.

1020 

1021 - `id?: string`

1022 

1023 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1024 

1025 - `connector_id?: string`

1026 

1027 The connector ID for a ChatGPT workspace connector resource.

1028 

1029 - `connector_name?: string`

1030 

1031 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1032 

1033 - `enabled?: boolean`

1034 

1035 Whether the connector is enabled for the role.

1036 

1037 - `permissions?: Array<string>`

1038 

1039 The permissions remaining for the role after the change.

1040 

1041 - `resource_id?: string`

1042 

1043 The ID of the resource the role was unbound from.

1044 

1045 - `resource_type?: string`

1046 

1047 The type of resource the role was unbound from.

1048 

1049 - `role_id?: string`

1050 

1051 The ID of the role that was unbound from the resource.

1052 

1053 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

1054 

1055 The connector role mutation path that produced the event.

1056 

1057 - `"role_toggle"`

1058 

1059 - `"role_connector_update"`

1060 

1061 - `"role_delete"`

1062 

1063 - `"workspace_permissions"`

1064 

1065 - `"connector_publish"`

1066 

1067 - `workspace_id?: string`

1068 

1069 The workspace ID for a ChatGPT workspace connector resource.

1070 

951 - `"role.updated"?: RoleUpdated`1071 - `"role.updated"?: RoleUpdated`

952 1072 

953 The details for events with this `type`.1073 The details for events with this `type`.


1419 "resource_id": "resource_id",1539 "resource_id": "resource_id",

1420 "resource_type": "resource_type"1540 "resource_type": "resource_type"

1421 },1541 },

1542 "role.bound_to_resource": {

1543 "id": "id",

1544 "connector_id": "connector_id",

1545 "connector_name": "connector_name",

1546 "enabled": true,

1547 "permissions": [

1548 "string"

1549 ],

1550 "resource_id": "resource_id",

1551 "resource_type": "resource_type",

1552 "role_id": "role_id",

1553 "source": "role_toggle",

1554 "workspace_id": "workspace_id"

1555 },

1422 "role.created": {1556 "role.created": {

1423 "id": "id",1557 "id": "id",

1424 "permissions": [1558 "permissions": [


1431 "role.deleted": {1565 "role.deleted": {

1432 "id": "id"1566 "id": "id"

1433 },1567 },

1568 "role.unbound_from_resource": {

1569 "id": "id",

1570 "connector_id": "connector_id",

1571 "connector_name": "connector_name",

1572 "enabled": true,

1573 "permissions": [

1574 "string"

1575 ],

1576 "resource_id": "resource_id",

1577 "resource_type": "resource_type",

1578 "role_id": "role_id",

1579 "source": "role_toggle",

1580 "workspace_id": "workspace_id"

1581 },

1434 "role.updated": {1582 "role.updated": {

1435 "id": "id",1583 "id": "id",

1436 "changes_requested": {1584 "changes_requested": {


1536 1684 

1537 The Unix timestamp (in seconds) of the event.1685 The Unix timestamp (in seconds) of the event.

1538 1686 

1539 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`1687 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

1540 1688 

1541 The event type.1689 The event type.

1542 1690 


1638 1786 

1639 - `"role.assignment.deleted"`1787 - `"role.assignment.deleted"`

1640 1788 

1789 - `"role.bound_to_resource"`

1790 

1791 - `"role.unbound_from_resource"`

1792 

1641 - `"scim.enabled"`1793 - `"scim.enabled"`

1642 1794 

1643 - `"scim.disabled"`1795 - `"scim.disabled"`


2258 2410 

2259 The type of resource the role assignment was scoped to.2411 The type of resource the role assignment was scoped to.

2260 2412 

2413 - `"role.bound_to_resource"?: RoleBoundToResource`

2414 

2415 The details for events with this `type`.

2416 

2417 - `id?: string`

2418 

2419 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2420 

2421 - `connector_id?: string`

2422 

2423 The connector ID for a ChatGPT workspace connector resource.

2424 

2425 - `connector_name?: string`

2426 

2427 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2428 

2429 - `enabled?: boolean`

2430 

2431 Whether the connector is enabled for the role.

2432 

2433 - `permissions?: Array<string>`

2434 

2435 The permissions granted to the role for the resource.

2436 

2437 - `resource_id?: string`

2438 

2439 The ID of the resource the role was bound to.

2440 

2441 - `resource_type?: string`

2442 

2443 The type of resource the role was bound to.

2444 

2445 - `role_id?: string`

2446 

2447 The ID of the role that was bound to the resource.

2448 

2449 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2450 

2451 The connector role mutation path that produced the event.

2452 

2453 - `"role_toggle"`

2454 

2455 - `"role_connector_update"`

2456 

2457 - `"role_delete"`

2458 

2459 - `"workspace_permissions"`

2460 

2461 - `"connector_publish"`

2462 

2463 - `workspace_id?: string`

2464 

2465 The workspace ID for a ChatGPT workspace connector resource.

2466 

2261 - `"role.created"?: RoleCreated`2467 - `"role.created"?: RoleCreated`

2262 2468 

2263 The details for events with this `type`.2469 The details for events with this `type`.


2290 2496 

2291 The role ID.2497 The role ID.

2292 2498 

2499 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

2500 

2501 The details for events with this `type`.

2502 

2503 - `id?: string`

2504 

2505 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2506 

2507 - `connector_id?: string`

2508 

2509 The connector ID for a ChatGPT workspace connector resource.

2510 

2511 - `connector_name?: string`

2512 

2513 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2514 

2515 - `enabled?: boolean`

2516 

2517 Whether the connector is enabled for the role.

2518 

2519 - `permissions?: Array<string>`

2520 

2521 The permissions remaining for the role after the change.

2522 

2523 - `resource_id?: string`

2524 

2525 The ID of the resource the role was unbound from.

2526 

2527 - `resource_type?: string`

2528 

2529 The type of resource the role was unbound from.

2530 

2531 - `role_id?: string`

2532 

2533 The ID of the role that was unbound from the resource.

2534 

2535 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2536 

2537 The connector role mutation path that produced the event.

2538 

2539 - `"role_toggle"`

2540 

2541 - `"role_connector_update"`

2542 

2543 - `"role_delete"`

2544 

2545 - `"workspace_permissions"`

2546 

2547 - `"connector_publish"`

2548 

2549 - `workspace_id?: string`

2550 

2551 The workspace ID for a ChatGPT workspace connector resource.

2552 

2293 - `"role.updated"?: RoleUpdated`2553 - `"role.updated"?: RoleUpdated`

2294 2554 

2295 The details for events with this `type`.2555 The details for events with this `type`.


2558 2818 

2559 The Unix timestamp (in seconds) of when the API key was created2819 The Unix timestamp (in seconds) of when the API key was created

2560 2820 

2821 - `expires_at: number | null`

2822 

2823 The Unix timestamp (in seconds) of when the API key expires

2824 

2561 - `object: "organization.admin_api_key"`2825 - `object: "organization.admin_api_key"`

2562 2826 

2563 The object type, which is always `organization.admin_api_key`2827 The object type, which is always `organization.admin_api_key`


2625 {2889 {

2626 "id": "key_abc",2890 "id": "key_abc",

2627 "created_at": 1711471533,2891 "created_at": 1711471533,

2892 "expires_at": 1714063533,

2628 "object": "organization.admin_api_key",2893 "object": "organization.admin_api_key",

2629 "owner": {2894 "owner": {

2630 "id": "sa_456",2895 "id": "sa_456",


2660 2925 

2661 - `name: string`2926 - `name: string`

2662 2927 

2928 - `expires_in_seconds?: number`

2929 

2930 The number of seconds until the API key expires. Omit this field for a key that does not expire.

2931 

2663### Returns2932### Returns

2664 2933 

2665- `AdminAPIKeyCreateResponse extends AdminAPIKey`2934- `AdminAPIKeyCreateResponse extends AdminAPIKey`


2690{2959{

2691 "id": "key_abc",2960 "id": "key_abc",

2692 "created_at": 1711471533,2961 "created_at": 1711471533,

2962 "expires_at": 1714063533,

2693 "object": "organization.admin_api_key",2963 "object": "organization.admin_api_key",

2694 "owner": {2964 "owner": {

2695 "id": "sa_456",2965 "id": "sa_456",


2734 3004 

2735 The Unix timestamp (in seconds) of when the API key was created3005 The Unix timestamp (in seconds) of when the API key was created

2736 3006 

3007 - `expires_at: number | null`

3008 

3009 The Unix timestamp (in seconds) of when the API key expires

3010 

2737 - `object: "organization.admin_api_key"`3011 - `object: "organization.admin_api_key"`

2738 3012 

2739 The object type, which is always `organization.admin_api_key`3013 The object type, which is always `organization.admin_api_key`


2798{3072{

2799 "id": "key_abc",3073 "id": "key_abc",

2800 "created_at": 1711471533,3074 "created_at": 1711471533,

3075 "expires_at": 1714063533,

2801 "object": "organization.admin_api_key",3076 "object": "organization.admin_api_key",

2802 "owner": {3077 "owner": {

2803 "id": "sa_456",3078 "id": "sa_456",


2879 3154 

2880 The Unix timestamp (in seconds) of when the API key was created3155 The Unix timestamp (in seconds) of when the API key was created

2881 3156 

3157 - `expires_at: number | null`

3158 

3159 The Unix timestamp (in seconds) of when the API key expires

3160 

2882 - `object: "organization.admin_api_key"`3161 - `object: "organization.admin_api_key"`

2883 3162 

2884 The object type, which is always `organization.admin_api_key`3163 The object type, which is always `organization.admin_api_key`


17020}17299}

17021```17300```

17022 17301 

17302## Retrieve organization spend alert

17303 

17304`client.admin.organization.spendAlerts.retrieve(stringalertID, RequestOptionsoptions?): OrganizationSpendAlert`

17305 

17306**get** `/organization/spend_alerts/{alert_id}`

17307 

17308Retrieves an organization spend alert.

17309 

17310### Parameters

17311 

17312- `alertID: string`

17313 

17314### Returns

17315 

17316- `OrganizationSpendAlert`

17317 

17318 Represents a spend alert configured at the organization level.

17319 

17320 - `id: string`

17321 

17322 The identifier, which can be referenced in API endpoints.

17323 

17324 - `currency: "USD"`

17325 

17326 The currency for the threshold amount.

17327 

17328 - `"USD"`

17329 

17330 - `interval: "month"`

17331 

17332 The time interval for evaluating spend against the threshold.

17333 

17334 - `"month"`

17335 

17336 - `notification_channel: NotificationChannel`

17337 

17338 Email notification settings for a spend alert.

17339 

17340 - `recipients: Array<string>`

17341 

17342 Email addresses that receive the spend alert notification.

17343 

17344 - `type: "email"`

17345 

17346 The notification channel type. Currently only `email` is supported.

17347 

17348 - `"email"`

17349 

17350 - `subject_prefix?: string | null`

17351 

17352 Optional subject prefix for alert emails.

17353 

17354 - `object: "organization.spend_alert"`

17355 

17356 The object type, which is always `organization.spend_alert`.

17357 

17358 - `"organization.spend_alert"`

17359 

17360 - `threshold_amount: number`

17361 

17362 The alert threshold amount, in cents.

17363 

17364### Example

17365 

17366```typescript

17367import OpenAI from 'openai';

17368 

17369const client = new OpenAI({

17370 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

17371});

17372 

17373const organizationSpendAlert = await client.admin.organization.spendAlerts.retrieve('alert_id');

17374 

17375console.log(organizationSpendAlert.id);

17376```

17377 

17378#### Response

17379 

17380```json

17381{

17382 "id": "id",

17383 "currency": "USD",

17384 "interval": "month",

17385 "notification_channel": {

17386 "recipients": [

17387 "string"

17388 ],

17389 "type": "email",

17390 "subject_prefix": "subject_prefix"

17391 },

17392 "object": "organization.spend_alert",

17393 "threshold_amount": 0

17394}

17395```

17396 

17023## Update organization spend alert17397## Update organization spend alert

17024 17398 

17025`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`17399`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`


23643}24017}

23644```24018```

23645 24019 

24020## Retrieve project spend alert

24021 

24022`client.admin.organization.projects.spendAlerts.retrieve(stringalertID, SpendAlertRetrieveParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

24023 

24024**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

24025 

24026Retrieves a project spend alert.

24027 

24028### Parameters

24029 

24030- `alertID: string`

24031 

24032- `params: SpendAlertRetrieveParams`

24033 

24034 - `project_id: string`

24035 

24036 The ID of the project.

24037 

24038### Returns

24039 

24040- `ProjectSpendAlert`

24041 

24042 Represents a spend alert configured at the project level.

24043 

24044 - `id: string`

24045 

24046 The identifier, which can be referenced in API endpoints.

24047 

24048 - `currency: "USD"`

24049 

24050 The currency for the threshold amount.

24051 

24052 - `"USD"`

24053 

24054 - `interval: "month"`

24055 

24056 The time interval for evaluating spend against the threshold.

24057 

24058 - `"month"`

24059 

24060 - `notification_channel: NotificationChannel`

24061 

24062 Email notification settings for a spend alert.

24063 

24064 - `recipients: Array<string>`

24065 

24066 Email addresses that receive the spend alert notification.

24067 

24068 - `type: "email"`

24069 

24070 The notification channel type. Currently only `email` is supported.

24071 

24072 - `"email"`

24073 

24074 - `subject_prefix?: string | null`

24075 

24076 Optional subject prefix for alert emails.

24077 

24078 - `object: "project.spend_alert"`

24079 

24080 The object type, which is always `project.spend_alert`.

24081 

24082 - `"project.spend_alert"`

24083 

24084 - `threshold_amount: number`

24085 

24086 The alert threshold amount, in cents.

24087 

24088### Example

24089 

24090```typescript

24091import OpenAI from 'openai';

24092 

24093const client = new OpenAI({

24094 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

24095});

24096 

24097const projectSpendAlert = await client.admin.organization.projects.spendAlerts.retrieve(

24098 'alert_id',

24099 { project_id: 'project_id' },

24100);

24101 

24102console.log(projectSpendAlert.id);

24103```

24104 

24105#### Response

24106 

24107```json

24108{

24109 "id": "id",

24110 "currency": "USD",

24111 "interval": "month",

24112 "notification_channel": {

24113 "recipients": [

24114 "string"

24115 ],

24116 "type": "email",

24117 "subject_prefix": "subject_prefix"

24118 },

24119 "object": "project.spend_alert",

24120 "threshold_amount": 0

24121}

24122```

24123 

23646## Update project spend alert24124## Update project spend alert

23647 24125 

23648`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`24126`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

Details

1# Admin API Keys

2 

3## List all organization and project API keys.

4 

5`client.admin.organization.adminAPIKeys.list(AdminAPIKeyListParamsquery?, RequestOptionsoptions?): CursorPage<AdminAPIKey>`

6 

7**get** `/organization/admin_api_keys`

8 

9List organization API keys

10 

11### Parameters

12 

13- `query: AdminAPIKeyListParams`

14 

15 - `after?: string | null`

16 

17 Return keys with IDs that come after this ID in the pagination order.

18 

19 - `limit?: number`

20 

21 Maximum number of keys to return.

22 

23 - `order?: "asc" | "desc"`

24 

25 Order results by creation time, ascending or descending.

26 

27 - `"asc"`

28 

29 - `"desc"`

30 

31### Returns

32 

33- `AdminAPIKey`

34 

35 Represents an individual Admin API key in an org.

36 

37 - `id: string`

38 

39 The identifier, which can be referenced in API endpoints

40 

41 - `created_at: number`

42 

43 The Unix timestamp (in seconds) of when the API key was created

44 

45 - `expires_at: number | null`

46 

47 The Unix timestamp (in seconds) of when the API key expires

48 

49 - `object: "organization.admin_api_key"`

50 

51 The object type, which is always `organization.admin_api_key`

52 

53 - `"organization.admin_api_key"`

54 

55 - `owner: Owner`

56 

57 - `id?: string`

58 

59 The identifier, which can be referenced in API endpoints

60 

61 - `created_at?: number`

62 

63 The Unix timestamp (in seconds) of when the user was created

64 

65 - `name?: string`

66 

67 The name of the user

68 

69 - `object?: string`

70 

71 The object type, which is always organization.user

72 

73 - `role?: string`

74 

75 Always `owner`

76 

77 - `type?: string`

78 

79 Always `user`

80 

81 - `redacted_value: string`

82 

83 The redacted value of the API key

84 

85 - `last_used_at?: number | null`

86 

87 The Unix timestamp (in seconds) of when the API key was last used

88 

89 - `name?: string | null`

90 

91 The name of the API key

92 

93### Example

94 

95```typescript

96import OpenAI from 'openai';

97 

98const client = new OpenAI({

99 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

100});

101 

102// Automatically fetches more pages as needed.

103for await (const adminAPIKey of client.admin.organization.adminAPIKeys.list()) {

104 console.log(adminAPIKey.id);

105}

106```

107 

108#### Response

109 

110```json

111{

112 "data": [

113 {

114 "id": "key_abc",

115 "created_at": 1711471533,

116 "expires_at": 1714063533,

117 "object": "organization.admin_api_key",

118 "owner": {

119 "id": "sa_456",

120 "created_at": 1711471533,

121 "name": "My Service Account",

122 "object": "organization.user",

123 "role": "owner",

124 "type": "user"

125 },

126 "redacted_value": "sk-admin...def",

127 "last_used_at": 1711471534,

128 "name": "Administration Key"

129 }

130 ],

131 "has_more": false,

132 "object": "list",

133 "first_id": "key_abc",

134 "last_id": "key_xyz"

135}

136```

137 

138## Create admin API key

139 

140`client.admin.organization.adminAPIKeys.create(AdminAPIKeyCreateParamsbody, RequestOptionsoptions?): AdminAPIKeyCreateResponse`

141 

142**post** `/organization/admin_api_keys`

143 

144Create an organization admin API key

145 

146### Parameters

147 

148- `body: AdminAPIKeyCreateParams`

149 

150 - `name: string`

151 

152 - `expires_in_seconds?: number`

153 

154 The number of seconds until the API key expires. Omit this field for a key that does not expire.

155 

156### Returns

157 

158- `AdminAPIKeyCreateResponse extends AdminAPIKey`

159 

160 Represents an individual Admin API key in an org.

161 

162 - `value: string`

163 

164 The value of the API key. Only shown on create.

165 

166### Example

167 

168```typescript

169import OpenAI from 'openai';

170 

171const client = new OpenAI({

172 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

173});

174 

175const adminAPIKey = await client.admin.organization.adminAPIKeys.create({ name: 'New Admin Key' });

176 

177console.log(adminAPIKey);

178```

179 

180#### Response

181 

182```json

183{

184 "id": "key_abc",

185 "created_at": 1711471533,

186 "expires_at": 1714063533,

187 "object": "organization.admin_api_key",

188 "owner": {

189 "id": "sa_456",

190 "created_at": 1711471533,

191 "name": "My Service Account",

192 "object": "organization.user",

193 "role": "owner",

194 "type": "user"

195 },

196 "redacted_value": "sk-admin...def",

197 "last_used_at": 1711471534,

198 "name": "Administration Key",

199 "value": "sk-admin-1234abcd"

200}

201```

202 

203## Retrieve admin API key

204 

205`client.admin.organization.adminAPIKeys.retrieve(stringkeyID, RequestOptionsoptions?): AdminAPIKey`

206 

207**get** `/organization/admin_api_keys/{key_id}`

208 

209Retrieve a single organization API key

210 

211### Parameters

212 

213- `keyID: string`

214 

215 The ID of the API key.

216 

217### Returns

218 

219- `AdminAPIKey`

220 

221 Represents an individual Admin API key in an org.

222 

223 - `id: string`

224 

225 The identifier, which can be referenced in API endpoints

226 

227 - `created_at: number`

228 

229 The Unix timestamp (in seconds) of when the API key was created

230 

231 - `expires_at: number | null`

232 

233 The Unix timestamp (in seconds) of when the API key expires

234 

235 - `object: "organization.admin_api_key"`

236 

237 The object type, which is always `organization.admin_api_key`

238 

239 - `"organization.admin_api_key"`

240 

241 - `owner: Owner`

242 

243 - `id?: string`

244 

245 The identifier, which can be referenced in API endpoints

246 

247 - `created_at?: number`

248 

249 The Unix timestamp (in seconds) of when the user was created

250 

251 - `name?: string`

252 

253 The name of the user

254 

255 - `object?: string`

256 

257 The object type, which is always organization.user

258 

259 - `role?: string`

260 

261 Always `owner`

262 

263 - `type?: string`

264 

265 Always `user`

266 

267 - `redacted_value: string`

268 

269 The redacted value of the API key

270 

271 - `last_used_at?: number | null`

272 

273 The Unix timestamp (in seconds) of when the API key was last used

274 

275 - `name?: string | null`

276 

277 The name of the API key

278 

279### Example

280 

281```typescript

282import OpenAI from 'openai';

283 

284const client = new OpenAI({

285 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

286});

287 

288const adminAPIKey = await client.admin.organization.adminAPIKeys.retrieve('key_id');

289 

290console.log(adminAPIKey.id);

291```

292 

293#### Response

294 

295```json

296{

297 "id": "key_abc",

298 "created_at": 1711471533,

299 "expires_at": 1714063533,

300 "object": "organization.admin_api_key",

301 "owner": {

302 "id": "sa_456",

303 "created_at": 1711471533,

304 "name": "My Service Account",

305 "object": "organization.user",

306 "role": "owner",

307 "type": "user"

308 },

309 "redacted_value": "sk-admin...def",

310 "last_used_at": 1711471534,

311 "name": "Administration Key"

312}

313```

314 

315## Delete admin API key

316 

317`client.admin.organization.adminAPIKeys.delete(stringkeyID, RequestOptionsoptions?): AdminAPIKeyDeleteResponse`

318 

319**delete** `/organization/admin_api_keys/{key_id}`

320 

321Delete an organization admin API key

322 

323### Parameters

324 

325- `keyID: string`

326 

327 The ID of the API key to be deleted.

328 

329### Returns

330 

331- `AdminAPIKeyDeleteResponse`

332 

333 - `id: string`

334 

335 - `deleted: boolean`

336 

337 - `object: "organization.admin_api_key.deleted"`

338 

339 - `"organization.admin_api_key.deleted"`

340 

341### Example

342 

343```typescript

344import OpenAI from 'openai';

345 

346const client = new OpenAI({

347 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

348});

349 

350const adminAPIKey = await client.admin.organization.adminAPIKeys.delete('key_id');

351 

352console.log(adminAPIKey.id);

353```

354 

355#### Response

356 

357```json

358{

359 "id": "key_abc",

360 "deleted": true,

361 "object": "organization.admin_api_key.deleted"

362}

363```

364 

365## Domain Types

366 

367### Admin API Key

368 

369- `AdminAPIKey`

370 

371 Represents an individual Admin API key in an org.

372 

373 - `id: string`

374 

375 The identifier, which can be referenced in API endpoints

376 

377 - `created_at: number`

378 

379 The Unix timestamp (in seconds) of when the API key was created

380 

381 - `expires_at: number | null`

382 

383 The Unix timestamp (in seconds) of when the API key expires

384 

385 - `object: "organization.admin_api_key"`

386 

387 The object type, which is always `organization.admin_api_key`

388 

389 - `"organization.admin_api_key"`

390 

391 - `owner: Owner`

392 

393 - `id?: string`

394 

395 The identifier, which can be referenced in API endpoints

396 

397 - `created_at?: number`

398 

399 The Unix timestamp (in seconds) of when the user was created

400 

401 - `name?: string`

402 

403 The name of the user

404 

405 - `object?: string`

406 

407 The object type, which is always organization.user

408 

409 - `role?: string`

410 

411 Always `owner`

412 

413 - `type?: string`

414 

415 Always `user`

416 

417 - `redacted_value: string`

418 

419 The redacted value of the API key

420 

421 - `last_used_at?: number | null`

422 

423 The Unix timestamp (in seconds) of when the API key was last used

424 

425 - `name?: string | null`

426 

427 The name of the API key

428 

429### Admin API Key Create Response

430 

431- `AdminAPIKeyCreateResponse extends AdminAPIKey`

432 

433 Represents an individual Admin API key in an org.

434 

435 - `value: string`

436 

437 The value of the API key. Only shown on create.

438 

439### Admin API Key Delete Response

440 

441- `AdminAPIKeyDeleteResponse`

442 

443 - `id: string`

444 

445 - `deleted: boolean`

446 

447 - `object: "organization.admin_api_key.deleted"`

448 

449 - `"organization.admin_api_key.deleted"`

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

48 48 

49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.49 Return only events whose `effective_at` (Unix seconds) is less than or equal to this value.

50 50 

51 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more>`51 - `event_types?: Array<"api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more>`

52 52 

53 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).53 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).

54 54 


150 150 

151 - `"role.assignment.deleted"`151 - `"role.assignment.deleted"`

152 152 

153 - `"role.bound_to_resource"`

154 

155 - `"role.unbound_from_resource"`

156 

153 - `"scim.enabled"`157 - `"scim.enabled"`

154 158 

155 - `"scim.disabled"`159 - `"scim.disabled"`


176 180 

177 - `resource_ids?: Array<string>`181 - `resource_ids?: Array<string>`

178 182 

179 Return only events performed on these targets. For example, a project ID updated.183 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>`.

184 

185 - `tenant_only?: boolean`

186 

187 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.

180 188 

181### Returns189### Returns

182 190 


192 200 

193 The Unix timestamp (in seconds) of the event.201 The Unix timestamp (in seconds) of the event.

194 202 

195 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`203 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

196 204 

197 The event type.205 The event type.

198 206 


294 302 

295 - `"role.assignment.deleted"`303 - `"role.assignment.deleted"`

296 304 

305 - `"role.bound_to_resource"`

306 

307 - `"role.unbound_from_resource"`

308 

297 - `"scim.enabled"`309 - `"scim.enabled"`

298 310 

299 - `"scim.disabled"`311 - `"scim.disabled"`


914 926 

915 The type of resource the role assignment was scoped to.927 The type of resource the role assignment was scoped to.

916 928 

929 - `"role.bound_to_resource"?: RoleBoundToResource`

930 

931 The details for events with this `type`.

932 

933 - `id?: string`

934 

935 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

936 

937 - `connector_id?: string`

938 

939 The connector ID for a ChatGPT workspace connector resource.

940 

941 - `connector_name?: string`

942 

943 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

944 

945 - `enabled?: boolean`

946 

947 Whether the connector is enabled for the role.

948 

949 - `permissions?: Array<string>`

950 

951 The permissions granted to the role for the resource.

952 

953 - `resource_id?: string`

954 

955 The ID of the resource the role was bound to.

956 

957 - `resource_type?: string`

958 

959 The type of resource the role was bound to.

960 

961 - `role_id?: string`

962 

963 The ID of the role that was bound to the resource.

964 

965 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

966 

967 The connector role mutation path that produced the event.

968 

969 - `"role_toggle"`

970 

971 - `"role_connector_update"`

972 

973 - `"role_delete"`

974 

975 - `"workspace_permissions"`

976 

977 - `"connector_publish"`

978 

979 - `workspace_id?: string`

980 

981 The workspace ID for a ChatGPT workspace connector resource.

982 

917 - `"role.created"?: RoleCreated`983 - `"role.created"?: RoleCreated`

918 984 

919 The details for events with this `type`.985 The details for events with this `type`.


946 1012 

947 The role ID.1013 The role ID.

948 1014 

1015 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

1016 

1017 The details for events with this `type`.

1018 

1019 - `id?: string`

1020 

1021 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

1022 

1023 - `connector_id?: string`

1024 

1025 The connector ID for a ChatGPT workspace connector resource.

1026 

1027 - `connector_name?: string`

1028 

1029 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

1030 

1031 - `enabled?: boolean`

1032 

1033 Whether the connector is enabled for the role.

1034 

1035 - `permissions?: Array<string>`

1036 

1037 The permissions remaining for the role after the change.

1038 

1039 - `resource_id?: string`

1040 

1041 The ID of the resource the role was unbound from.

1042 

1043 - `resource_type?: string`

1044 

1045 The type of resource the role was unbound from.

1046 

1047 - `role_id?: string`

1048 

1049 The ID of the role that was unbound from the resource.

1050 

1051 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

1052 

1053 The connector role mutation path that produced the event.

1054 

1055 - `"role_toggle"`

1056 

1057 - `"role_connector_update"`

1058 

1059 - `"role_delete"`

1060 

1061 - `"workspace_permissions"`

1062 

1063 - `"connector_publish"`

1064 

1065 - `workspace_id?: string`

1066 

1067 The workspace ID for a ChatGPT workspace connector resource.

1068 

949 - `"role.updated"?: RoleUpdated`1069 - `"role.updated"?: RoleUpdated`

950 1070 

951 The details for events with this `type`.1071 The details for events with this `type`.


1417 "resource_id": "resource_id",1537 "resource_id": "resource_id",

1418 "resource_type": "resource_type"1538 "resource_type": "resource_type"

1419 },1539 },

1540 "role.bound_to_resource": {

1541 "id": "id",

1542 "connector_id": "connector_id",

1543 "connector_name": "connector_name",

1544 "enabled": true,

1545 "permissions": [

1546 "string"

1547 ],

1548 "resource_id": "resource_id",

1549 "resource_type": "resource_type",

1550 "role_id": "role_id",

1551 "source": "role_toggle",

1552 "workspace_id": "workspace_id"

1553 },

1420 "role.created": {1554 "role.created": {

1421 "id": "id",1555 "id": "id",

1422 "permissions": [1556 "permissions": [


1429 "role.deleted": {1563 "role.deleted": {

1430 "id": "id"1564 "id": "id"

1431 },1565 },

1566 "role.unbound_from_resource": {

1567 "id": "id",

1568 "connector_id": "connector_id",

1569 "connector_name": "connector_name",

1570 "enabled": true,

1571 "permissions": [

1572 "string"

1573 ],

1574 "resource_id": "resource_id",

1575 "resource_type": "resource_type",

1576 "role_id": "role_id",

1577 "source": "role_toggle",

1578 "workspace_id": "workspace_id"

1579 },

1432 "role.updated": {1580 "role.updated": {

1433 "id": "id",1581 "id": "id",

1434 "changes_requested": {1582 "changes_requested": {


1534 1682 

1535 The Unix timestamp (in seconds) of the event.1683 The Unix timestamp (in seconds) of the event.

1536 1684 

1537 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 54 more`1685 - `type: "api_key.created" | "api_key.updated" | "api_key.deleted" | 56 more`

1538 1686 

1539 The event type.1687 The event type.

1540 1688 


1636 1784 

1637 - `"role.assignment.deleted"`1785 - `"role.assignment.deleted"`

1638 1786 

1787 - `"role.bound_to_resource"`

1788 

1789 - `"role.unbound_from_resource"`

1790 

1639 - `"scim.enabled"`1791 - `"scim.enabled"`

1640 1792 

1641 - `"scim.disabled"`1793 - `"scim.disabled"`


2256 2408 

2257 The type of resource the role assignment was scoped to.2409 The type of resource the role assignment was scoped to.

2258 2410 

2411 - `"role.bound_to_resource"?: RoleBoundToResource`

2412 

2413 The details for events with this `type`.

2414 

2415 - `id?: string`

2416 

2417 The ID of the resource the role was bound to. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2418 

2419 - `connector_id?: string`

2420 

2421 The connector ID for a ChatGPT workspace connector resource.

2422 

2423 - `connector_name?: string`

2424 

2425 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2426 

2427 - `enabled?: boolean`

2428 

2429 Whether the connector is enabled for the role.

2430 

2431 - `permissions?: Array<string>`

2432 

2433 The permissions granted to the role for the resource.

2434 

2435 - `resource_id?: string`

2436 

2437 The ID of the resource the role was bound to.

2438 

2439 - `resource_type?: string`

2440 

2441 The type of resource the role was bound to.

2442 

2443 - `role_id?: string`

2444 

2445 The ID of the role that was bound to the resource.

2446 

2447 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2448 

2449 The connector role mutation path that produced the event.

2450 

2451 - `"role_toggle"`

2452 

2453 - `"role_connector_update"`

2454 

2455 - `"role_delete"`

2456 

2457 - `"workspace_permissions"`

2458 

2459 - `"connector_publish"`

2460 

2461 - `workspace_id?: string`

2462 

2463 The workspace ID for a ChatGPT workspace connector resource.

2464 

2259 - `"role.created"?: RoleCreated`2465 - `"role.created"?: RoleCreated`

2260 2466 

2261 The details for events with this `type`.2467 The details for events with this `type`.


2288 2494 

2289 The role ID.2495 The role ID.

2290 2496 

2497 - `"role.unbound_from_resource"?: RoleUnboundFromResource`

2498 

2499 The details for events with this `type`.

2500 

2501 - `id?: string`

2502 

2503 The ID of the resource the role was unbound from. ChatGPT workspace connector resources use `<workspace_id>__<connector_id>`.

2504 

2505 - `connector_id?: string`

2506 

2507 The connector ID for a ChatGPT workspace connector resource.

2508 

2509 - `connector_name?: string`

2510 

2511 The connector display name for a ChatGPT workspace connector resource, or the connector ID when the display name could not be resolved.

2512 

2513 - `enabled?: boolean`

2514 

2515 Whether the connector is enabled for the role.

2516 

2517 - `permissions?: Array<string>`

2518 

2519 The permissions remaining for the role after the change.

2520 

2521 - `resource_id?: string`

2522 

2523 The ID of the resource the role was unbound from.

2524 

2525 - `resource_type?: string`

2526 

2527 The type of resource the role was unbound from.

2528 

2529 - `role_id?: string`

2530 

2531 The ID of the role that was unbound from the resource.

2532 

2533 - `source?: "role_toggle" | "role_connector_update" | "role_delete" | 2 more`

2534 

2535 The connector role mutation path that produced the event.

2536 

2537 - `"role_toggle"`

2538 

2539 - `"role_connector_update"`

2540 

2541 - `"role_delete"`

2542 

2543 - `"workspace_permissions"`

2544 

2545 - `"connector_publish"`

2546 

2547 - `workspace_id?: string`

2548 

2549 The workspace ID for a ChatGPT workspace connector resource.

2550 

2291 - `"role.updated"?: RoleUpdated`2551 - `"role.updated"?: RoleUpdated`

2292 2552 

2293 The details for events with this `type`.2553 The details for events with this `type`.

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

5526}5526}

5527```5527```

5528 5528 

5529## Retrieve project spend alert

5530 

5531`client.admin.organization.projects.spendAlerts.retrieve(stringalertID, SpendAlertRetrieveParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

5532 

5533**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

5534 

5535Retrieves a project spend alert.

5536 

5537### Parameters

5538 

5539- `alertID: string`

5540 

5541- `params: SpendAlertRetrieveParams`

5542 

5543 - `project_id: string`

5544 

5545 The ID of the project.

5546 

5547### Returns

5548 

5549- `ProjectSpendAlert`

5550 

5551 Represents a spend alert configured at the project level.

5552 

5553 - `id: string`

5554 

5555 The identifier, which can be referenced in API endpoints.

5556 

5557 - `currency: "USD"`

5558 

5559 The currency for the threshold amount.

5560 

5561 - `"USD"`

5562 

5563 - `interval: "month"`

5564 

5565 The time interval for evaluating spend against the threshold.

5566 

5567 - `"month"`

5568 

5569 - `notification_channel: NotificationChannel`

5570 

5571 Email notification settings for a spend alert.

5572 

5573 - `recipients: Array<string>`

5574 

5575 Email addresses that receive the spend alert notification.

5576 

5577 - `type: "email"`

5578 

5579 The notification channel type. Currently only `email` is supported.

5580 

5581 - `"email"`

5582 

5583 - `subject_prefix?: string | null`

5584 

5585 Optional subject prefix for alert emails.

5586 

5587 - `object: "project.spend_alert"`

5588 

5589 The object type, which is always `project.spend_alert`.

5590 

5591 - `"project.spend_alert"`

5592 

5593 - `threshold_amount: number`

5594 

5595 The alert threshold amount, in cents.

5596 

5597### Example

5598 

5599```typescript

5600import OpenAI from 'openai';

5601 

5602const client = new OpenAI({

5603 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

5604});

5605 

5606const projectSpendAlert = await client.admin.organization.projects.spendAlerts.retrieve(

5607 'alert_id',

5608 { project_id: 'project_id' },

5609);

5610 

5611console.log(projectSpendAlert.id);

5612```

5613 

5614#### Response

5615 

5616```json

5617{

5618 "id": "id",

5619 "currency": "USD",

5620 "interval": "month",

5621 "notification_channel": {

5622 "recipients": [

5623 "string"

5624 ],

5625 "type": "email",

5626 "subject_prefix": "subject_prefix"

5627 },

5628 "object": "project.spend_alert",

5629 "threshold_amount": 0

5630}

5631```

5632 

5529## Update project spend alert5633## Update project spend alert

5530 5634 

5531`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`5635`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

Details

267}267}

268```268```

269 269 

270## Retrieve project spend alert

271 

272`client.admin.organization.projects.spendAlerts.retrieve(stringalertID, SpendAlertRetrieveParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

273 

274**get** `/organization/projects/{project_id}/spend_alerts/{alert_id}`

275 

276Retrieves a project spend alert.

277 

278### Parameters

279 

280- `alertID: string`

281 

282- `params: SpendAlertRetrieveParams`

283 

284 - `project_id: string`

285 

286 The ID of the project.

287 

288### Returns

289 

290- `ProjectSpendAlert`

291 

292 Represents a spend alert configured at the project level.

293 

294 - `id: string`

295 

296 The identifier, which can be referenced in API endpoints.

297 

298 - `currency: "USD"`

299 

300 The currency for the threshold amount.

301 

302 - `"USD"`

303 

304 - `interval: "month"`

305 

306 The time interval for evaluating spend against the threshold.

307 

308 - `"month"`

309 

310 - `notification_channel: NotificationChannel`

311 

312 Email notification settings for a spend alert.

313 

314 - `recipients: Array<string>`

315 

316 Email addresses that receive the spend alert notification.

317 

318 - `type: "email"`

319 

320 The notification channel type. Currently only `email` is supported.

321 

322 - `"email"`

323 

324 - `subject_prefix?: string | null`

325 

326 Optional subject prefix for alert emails.

327 

328 - `object: "project.spend_alert"`

329 

330 The object type, which is always `project.spend_alert`.

331 

332 - `"project.spend_alert"`

333 

334 - `threshold_amount: number`

335 

336 The alert threshold amount, in cents.

337 

338### Example

339 

340```typescript

341import OpenAI from 'openai';

342 

343const client = new OpenAI({

344 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

345});

346 

347const projectSpendAlert = await client.admin.organization.projects.spendAlerts.retrieve(

348 'alert_id',

349 { project_id: 'project_id' },

350);

351 

352console.log(projectSpendAlert.id);

353```

354 

355#### Response

356 

357```json

358{

359 "id": "id",

360 "currency": "USD",

361 "interval": "month",

362 "notification_channel": {

363 "recipients": [

364 "string"

365 ],

366 "type": "email",

367 "subject_prefix": "subject_prefix"

368 },

369 "object": "project.spend_alert",

370 "threshold_amount": 0

371}

372```

373 

270## Update project spend alert374## Update project spend alert

271 375 

272`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`376`client.admin.organization.projects.spendAlerts.update(stringalertID, SpendAlertUpdateParamsparams, RequestOptionsoptions?): ProjectSpendAlert`

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

258}258}

259```259```

260 260 

261## Retrieve organization spend alert

262 

263`client.admin.organization.spendAlerts.retrieve(stringalertID, RequestOptionsoptions?): OrganizationSpendAlert`

264 

265**get** `/organization/spend_alerts/{alert_id}`

266 

267Retrieves an organization spend alert.

268 

269### Parameters

270 

271- `alertID: string`

272 

273### Returns

274 

275- `OrganizationSpendAlert`

276 

277 Represents a spend alert configured at the organization level.

278 

279 - `id: string`

280 

281 The identifier, which can be referenced in API endpoints.

282 

283 - `currency: "USD"`

284 

285 The currency for the threshold amount.

286 

287 - `"USD"`

288 

289 - `interval: "month"`

290 

291 The time interval for evaluating spend against the threshold.

292 

293 - `"month"`

294 

295 - `notification_channel: NotificationChannel`

296 

297 Email notification settings for a spend alert.

298 

299 - `recipients: Array<string>`

300 

301 Email addresses that receive the spend alert notification.

302 

303 - `type: "email"`

304 

305 The notification channel type. Currently only `email` is supported.

306 

307 - `"email"`

308 

309 - `subject_prefix?: string | null`

310 

311 Optional subject prefix for alert emails.

312 

313 - `object: "organization.spend_alert"`

314 

315 The object type, which is always `organization.spend_alert`.

316 

317 - `"organization.spend_alert"`

318 

319 - `threshold_amount: number`

320 

321 The alert threshold amount, in cents.

322 

323### Example

324 

325```typescript

326import OpenAI from 'openai';

327 

328const client = new OpenAI({

329 adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted

330});

331 

332const organizationSpendAlert = await client.admin.organization.spendAlerts.retrieve('alert_id');

333 

334console.log(organizationSpendAlert.id);

335```

336 

337#### Response

338 

339```json

340{

341 "id": "id",

342 "currency": "USD",

343 "interval": "month",

344 "notification_channel": {

345 "recipients": [

346 "string"

347 ],

348 "type": "email",

349 "subject_prefix": "subject_prefix"

350 },

351 "object": "organization.spend_alert",

352 "threshold_amount": 0

353}

354```

355 

261## Update organization spend alert356## Update organization spend alert

262 357 

263`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`358`client.admin.organization.spendAlerts.update(stringalertID, SpendAlertUpdateParamsbody, RequestOptionsoptions?): OrganizationSpendAlert`

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

3445 Configuration options for3445 Configuration options for

3446 [reasoning models](https://platform.openai.com/docs/guides/reasoning).3446 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3447 3447 

3448 - `context?: "auto" | "current_turn" | "all_turns" | null`

3449 

3450 Controls which reasoning items are rendered back to the model on later turns.

3451 When returned on a response, this is the effective reasoning context mode

3452 used for the response.

3453 

3454 - `"auto"`

3455 

3456 - `"current_turn"`

3457 

3458 - `"all_turns"`

3459 

3448 - `effort?: ReasoningEffort | null`3460 - `effort?: ReasoningEffort | null`

3449 3461 

3450 Constrains effort on reasoning for3462 Constrains effort on reasoning for


8720 Configuration options for8732 Configuration options for

8721 [reasoning models](https://platform.openai.com/docs/guides/reasoning).8733 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

8722 8734 

8735 - `context?: "auto" | "current_turn" | "all_turns" | null`

8736 

8737 Controls which reasoning items are rendered back to the model on later turns.

8738 When returned on a response, this is the effective reasoning context mode

8739 used for the response.

8740 

8741 - `"auto"`

8742 

8743 - `"current_turn"`

8744 

8745 - `"all_turns"`

8746 

8723 - `effort?: ReasoningEffort | null`8747 - `effort?: ReasoningEffort | null`

8724 8748 

8725 Constrains effort on reasoning for8749 Constrains effort on reasoning for


9113 "prompt_cache_key": "prompt-cache-key-1234",9137 "prompt_cache_key": "prompt-cache-key-1234",

9114 "prompt_cache_retention": "in_memory",9138 "prompt_cache_retention": "in_memory",

9115 "reasoning": {9139 "reasoning": {

9140 "context": "auto",

9116 "effort": "none",9141 "effort": "none",

9117 "generate_summary": "auto",9142 "generate_summary": "auto",

9118 "summary": "auto"9143 "summary": "auto"


14771 Configuration options for14796 Configuration options for

14772 [reasoning models](https://platform.openai.com/docs/guides/reasoning).14797 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

14773 14798 

14799 - `context?: "auto" | "current_turn" | "all_turns" | null`

14800 

14801 Controls which reasoning items are rendered back to the model on later turns.

14802 When returned on a response, this is the effective reasoning context mode

14803 used for the response.

14804 

14805 - `"auto"`

14806 

14807 - `"current_turn"`

14808 

14809 - `"all_turns"`

14810 

14774 - `effort?: ReasoningEffort | null`14811 - `effort?: ReasoningEffort | null`

14775 14812 

14776 Constrains effort on reasoning for14813 Constrains effort on reasoning for


15164 "prompt_cache_key": "prompt-cache-key-1234",15201 "prompt_cache_key": "prompt-cache-key-1234",

15165 "prompt_cache_retention": "in_memory",15202 "prompt_cache_retention": "in_memory",

15166 "reasoning": {15203 "reasoning": {

15204 "context": "auto",

15167 "effort": "none",15205 "effort": "none",

15168 "generate_summary": "auto",15206 "generate_summary": "auto",

15169 "summary": "auto"15207 "summary": "auto"


20094 Configuration options for20132 Configuration options for

20095 [reasoning models](https://platform.openai.com/docs/guides/reasoning).20133 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

20096 20134 

20135 - `context?: "auto" | "current_turn" | "all_turns" | null`

20136 

20137 Controls which reasoning items are rendered back to the model on later turns.

20138 When returned on a response, this is the effective reasoning context mode

20139 used for the response.

20140 

20141 - `"auto"`

20142 

20143 - `"current_turn"`

20144 

20145 - `"all_turns"`

20146 

20097 - `effort?: ReasoningEffort | null`20147 - `effort?: ReasoningEffort | null`

20098 20148 

20099 Constrains effort on reasoning for20149 Constrains effort on reasoning for


20487 "prompt_cache_key": "prompt-cache-key-1234",20537 "prompt_cache_key": "prompt-cache-key-1234",

20488 "prompt_cache_retention": "in_memory",20538 "prompt_cache_retention": "in_memory",

20489 "reasoning": {20539 "reasoning": {

20540 "context": "auto",

20490 "effort": "none",20541 "effort": "none",

20491 "generate_summary": "auto",20542 "generate_summary": "auto",

20492 "summary": "auto"20543 "summary": "auto"


36041 Configuration options for36092 Configuration options for

36042 [reasoning models](https://platform.openai.com/docs/guides/reasoning).36093 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

36043 36094 

36095 - `context?: "auto" | "current_turn" | "all_turns" | null`

36096 

36097 Controls which reasoning items are rendered back to the model on later turns.

36098 When returned on a response, this is the effective reasoning context mode

36099 used for the response.

36100 

36101 - `"auto"`

36102 

36103 - `"current_turn"`

36104 

36105 - `"all_turns"`

36106 

36044 - `effort?: ReasoningEffort | null`36107 - `effort?: ReasoningEffort | null`

36045 36108 

36046 Constrains effort on reasoning for36109 Constrains effort on reasoning for


41504 Configuration options for41567 Configuration options for

41505 [reasoning models](https://platform.openai.com/docs/guides/reasoning).41568 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

41506 41569 

41570 - `context?: "auto" | "current_turn" | "all_turns" | null`

41571 

41572 Controls which reasoning items are rendered back to the model on later turns.

41573 When returned on a response, this is the effective reasoning context mode

41574 used for the response.

41575 

41576 - `"auto"`

41577 

41578 - `"current_turn"`

41579 

41580 - `"all_turns"`

41581 

41507 - `effort?: ReasoningEffort | null`41582 - `effort?: ReasoningEffort | null`

41508 41583 

41509 Constrains effort on reasoning for41584 Constrains effort on reasoning for


47717 Configuration options for47792 Configuration options for

47718 [reasoning models](https://platform.openai.com/docs/guides/reasoning).47793 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

47719 47794 

47795 - `context?: "auto" | "current_turn" | "all_turns" | null`

47796 

47797 Controls which reasoning items are rendered back to the model on later turns.

47798 When returned on a response, this is the effective reasoning context mode

47799 used for the response.

47800 

47801 - `"auto"`

47802 

47803 - `"current_turn"`

47804 

47805 - `"all_turns"`

47806 

47720 - `effort?: ReasoningEffort | null`47807 - `effort?: ReasoningEffort | null`

47721 47808 

47722 Constrains effort on reasoning for47809 Constrains effort on reasoning for


53076 Configuration options for53163 Configuration options for

53077 [reasoning models](https://platform.openai.com/docs/guides/reasoning).53164 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

53078 53165 

53166 - `context?: "auto" | "current_turn" | "all_turns" | null`

53167 

53168 Controls which reasoning items are rendered back to the model on later turns.

53169 When returned on a response, this is the effective reasoning context mode

53170 used for the response.

53171 

53172 - `"auto"`

53173 

53174 - `"current_turn"`

53175 

53176 - `"all_turns"`

53177 

53079 - `effort?: ReasoningEffort | null`53178 - `effort?: ReasoningEffort | null`

53080 53179 

53081 Constrains effort on reasoning for53180 Constrains effort on reasoning for


59181 Configuration options for59280 Configuration options for

59182 [reasoning models](https://platform.openai.com/docs/guides/reasoning).59281 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

59183 59282 

59283 - `context?: "auto" | "current_turn" | "all_turns" | null`

59284 

59285 Controls which reasoning items are rendered back to the model on later turns.

59286 When returned on a response, this is the effective reasoning context mode

59287 used for the response.

59288 

59289 - `"auto"`

59290 

59291 - `"current_turn"`

59292 

59293 - `"all_turns"`

59294 

59184 - `effort?: ReasoningEffort | null`59295 - `effort?: ReasoningEffort | null`

59185 59296 

59186 Constrains effort on reasoning for59297 Constrains effort on reasoning for


64248 Configuration options for64359 Configuration options for

64249 [reasoning models](https://platform.openai.com/docs/guides/reasoning).64360 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

64250 64361 

64362 - `context?: "auto" | "current_turn" | "all_turns" | null`

64363 

64364 Controls which reasoning items are rendered back to the model on later turns.

64365 When returned on a response, this is the effective reasoning context mode

64366 used for the response.

64367 

64368 - `"auto"`

64369 

64370 - `"current_turn"`

64371 

64372 - `"all_turns"`

64373 

64251 - `effort?: ReasoningEffort | null`64374 - `effort?: ReasoningEffort | null`

64252 64375 

64253 Constrains effort on reasoning for64376 Constrains effort on reasoning for


88204 Configuration options for88327 Configuration options for

88205 [reasoning models](https://platform.openai.com/docs/guides/reasoning).88328 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

88206 88329 

88330 - `context?: "auto" | "current_turn" | "all_turns" | null`

88331 

88332 Controls which reasoning items are rendered back to the model on later turns.

88333 When returned on a response, this is the effective reasoning context mode

88334 used for the response.

88335 

88336 - `"auto"`

88337 

88338 - `"current_turn"`

88339 

88340 - `"all_turns"`

88341 

88207 - `effort?: ReasoningEffort | null`88342 - `effort?: ReasoningEffort | null`

88208 88343 

88209 Constrains effort on reasoning for88344 Constrains effort on reasoning for


93784 Configuration options for93919 Configuration options for

93785 [reasoning models](https://platform.openai.com/docs/guides/reasoning).93920 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

93786 93921 

93922 - `context?: "auto" | "current_turn" | "all_turns" | null`

93923 

93924 Controls which reasoning items are rendered back to the model on later turns.

93925 When returned on a response, this is the effective reasoning context mode

93926 used for the response.

93927 

93928 - `"auto"`

93929 

93930 - `"current_turn"`

93931 

93932 - `"all_turns"`

93933 

93787 - `effort?: ReasoningEffort | null`93934 - `effort?: ReasoningEffort | null`

93788 93935 

93789 Constrains effort on reasoning for93936 Constrains effort on reasoning for


101095 Configuration options for101242 Configuration options for

101096 [reasoning models](https://platform.openai.com/docs/guides/reasoning).101243 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

101097 101244 

101245 - `context?: "auto" | "current_turn" | "all_turns" | null`

101246 

101247 Controls which reasoning items are rendered back to the model on later turns.

101248 When returned on a response, this is the effective reasoning context mode

101249 used for the response.

101250 

101251 - `"auto"`

101252 

101253 - `"current_turn"`

101254 

101255 - `"all_turns"`

101256 

101098 - `effort?: ReasoningEffort | null`101257 - `effort?: ReasoningEffort | null`

101099 101258 

101100 Constrains effort on reasoning for101259 Constrains effort on reasoning for


106540 Configuration options for106699 Configuration options for

106541 [reasoning models](https://platform.openai.com/docs/guides/reasoning).106700 [reasoning models](https://platform.openai.com/docs/guides/reasoning).

106542 106701 

106702 - `context?: "auto" | "current_turn" | "all_turns" | null`

106703 

106704 Controls which reasoning items are rendered back to the model on later turns.

106705 When returned on a response, this is the effective reasoning context mode

106706 used for the response.

106707 

106708 - `"auto"`

106709 

106710 - `"current_turn"`

106711 

106712 - `"all_turns"`

106713 

106543 - `effort?: ReasoningEffort | null`106714 - `effort?: ReasoningEffort | null`

106544 106715 

106545 Constrains effort on reasoning for106716 Constrains effort on reasoning for


118484 118655 

118485 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).118656 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

118486 118657 

118658 - `context?: "auto" | "current_turn" | "all_turns" | null`

118659 

118660 Controls which reasoning items are rendered back to the model on later turns.

118661 When returned on a response, this is the effective reasoning context mode

118662 used for the response.

118663 

118664 - `"auto"`

118665 

118666 - `"current_turn"`

118667 

118668 - `"all_turns"`

118669 

118487 - `effort?: ReasoningEffort | null`118670 - `effort?: ReasoningEffort | null`

118488 118671 

118489 Constrains effort on reasoning for118672 Constrains effort on reasoning for

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

3098 3098 

3099 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).3099 **gpt-5 and o-series models only** Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning).

3100 3100 

3101 - `context?: "auto" | "current_turn" | "all_turns" | null`

3102 

3103 Controls which reasoning items are rendered back to the model on later turns.

3104 When returned on a response, this is the effective reasoning context mode

3105 used for the response.

3106 

3107 - `"auto"`

3108 

3109 - `"current_turn"`

3110 

3111 - `"all_turns"`

3112 

3101 - `effort?: ReasoningEffort | null`3113 - `effort?: ReasoningEffort | null`

3102 3114 

3103 Constrains effort on reasoning for3115 Constrains effort on reasoning for

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

Details

267 267 

268 - `VideoReferenceInputParam`268 - `VideoReferenceInputParam`

269 269 

270 Reference to the completed video.270 Reference to the completed video to edit.

271 271 

272 - `id: string`272 - `id: string`

273 273