Skip to content

feat(api): add GPT Image 2.5 models and image options - #3824

Merged
marcuswood-oai merged 1 commit into
mainfrom
castiron/promotions/pr-79
Sep 8, 2026
Merged

feat(api): add GPT Image 2.5 models and image options#3824
marcuswood-oai merged 1 commit into
mainfrom
castiron/promotions/pr-79

Conversation

@marcuswood-oai

Copy link
Copy Markdown
Contributor

Adds GPT Image 2.5 Sunburst/Flare aliases and September 8 snapshots, xhigh/max quality, and custom image dimensions.

  • Exposes optional, nullable quality and size on Responses image calls, including quality: "auto".
  • Clarifies Live and Realtime webhook call IDs.
  • Preserves WebSocket reconnect retry accounting when raw events are received.

Castiron-Internal-PR: openai/openai-python-internal#79
Castiron-Source-SHA: a536ddf31b2137752c45947b05ec4ad152d995ea
Castiron-Public-Base-SHA: f1cd7f0
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

36 mixed files remain; 0 existing customizations changed; 5 generated baselines changed.

Compared f1cd7f02021093058483e110. Generated baselines verified.

File Result Current custom patch
src/openai/resources/beta/responses/responses.py Generated baseline changed +12 / −11
src/openai/resources/realtime/realtime.py Generated baseline changed +65 / −32
src/openai/resources/responses/responses.py Generated baseline changed +851 / −18
src/openai/types/responses/tool.py Generated baseline changed +5 / −0
src/openai/types/responses/tool_param.py Generated baseline changed +9 / −0
31 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/openai/init.py
  • src/openai/_client.py
  • src/openai/resources/audio/transcriptions.py
  • src/openai/resources/audio/translations.py
  • src/openai/resources/beta/beta.py
  • src/openai/resources/beta/threads/runs/runs.py
  • src/openai/resources/beta/threads/threads.py
  • src/openai/resources/chat/completions/completions.py
  • src/openai/resources/embeddings.py
  • src/openai/resources/files.py
  • src/openai/resources/uploads/uploads.py
  • src/openai/resources/vector_stores/file_batches.py
  • src/openai/resources/vector_stores/files.py
  • src/openai/resources/videos.py
  • src/openai/resources/webhooks/init.py
  • src/openai/resources/webhooks/webhooks.py
  • src/openai/types/chat/init.py
  • src/openai/types/chat/chat_completion_message_tool_call.py
  • src/openai/types/fine_tuning/fine_tuning_job_integration.py
  • src/openai/types/responses/init.py
  • src/openai/types/responses/response.py
  • src/openai/types/responses/response_function_web_search.py
  • src/openai/types/responses/response_function_web_search_param.py
  • src/openai/types/responses/responses_client_event.py
  • src/openai/types/responses/responses_client_event_param.py
  • src/openai/types/webhooks/init.py
  • tests/api_resources/test_videos.py

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 34287760208 --repo openai/openai-python \
  --name castiron-custom-code-34287760208-1 --dir /tmp/castiron-custom-code-34287760208-1
git apply --stat /tmp/castiron-custom-code-34287760208-1/custom-code.patch
cat /tmp/castiron-custom-code-34287760208-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin f1cd7f020210ec3fc71699fc46d90320ddbb411c 93058483e1105703cc7e43bfc8b072bc4b987928
python3 scripts/castiron/custom_code_report.py report \
  --base f1cd7f020210ec3fc71699fc46d90320ddbb411c \
  --head 93058483e1105703cc7e43bfc8b072bc4b987928 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-93058483e110
cat /tmp/castiron-custom-code-93058483e110/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@marcuswood-oai
marcuswood-oai marked this pull request as ready for review September 8, 2026 22:48
@marcuswood-oai
marcuswood-oai requested a review from a team as a code owner September 8, 2026 22:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T22:52:32.483643Z 9305848 Draft marked ready
🔒 Security Review Completed 2026-09-08T22:53:16.601115Z 9305848 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openai-sdks

openai-sdks Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

236/236 SDK tests passed in 11.492s for Python SDK PR #3824.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 187ms
tests/chat-completions-create.test.ts ✅ Passed 229ms
tests/chat-completions-stream.test.ts ✅ Passed 195ms
tests/files-content-binary.test.ts ✅ Passed 213ms
tests/files-create-multipart.test.ts ✅ Passed 204ms
tests/files-list-pagination.test.ts ✅ Passed 171ms
tests/initialize-config.test.ts ✅ Passed 191ms
tests/instance-isolation.test.ts ✅ Passed 183ms
tests/models-list.test.ts ✅ Passed 240ms
tests/responses-background-lifecycle.test.ts ✅ Passed 287ms
tests/responses-body-method-errors.test.ts ✅ Passed 331ms
tests/responses-cancel-timeout.test.ts ✅ Passed 196ms
tests/responses-cancel.test.ts ✅ Passed 285ms
tests/responses-compact-retries.test.ts ✅ Passed 277ms
tests/responses-compact.test.ts ✅ Passed 249ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 136ms
tests/responses-create-advanced.test.ts ✅ Passed 167ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.184s
tests/responses-create-errors.test.ts ✅ Passed 213ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 472ms
tests/responses-create-retries.test.ts ✅ Passed 253ms
tests/responses-create-stream-failures.test.ts ✅ Passed 194ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 210ms
tests/responses-create-stream-wire.test.ts ✅ Passed 3.803s
tests/responses-create-stream.test.ts ✅ Passed 97ms
tests/responses-create-terminal-states.test.ts ✅ Passed 255ms
tests/responses-create-timeout.test.ts ✅ Passed 217ms
tests/responses-create.test.ts ✅ Passed 227ms
tests/responses-delete.test.ts ✅ Passed 190ms
tests/responses-input-items-errors.test.ts ✅ Passed 569ms
tests/responses-input-items-list.test.ts ✅ Passed 430ms
tests/responses-input-items-options.test.ts ✅ Passed 311ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 235ms
tests/responses-input-tokens-count.test.ts ✅ Passed 226ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.88s
tests/responses-not-found-errors.test.ts ✅ Passed 251ms
tests/responses-parse.test.ts ✅ Passed 587ms
tests/responses-retrieve-retries.test.ts ✅ Passed 351ms
tests/responses-retrieve.test.ts ✅ Passed 217ms
tests/responses-stored-method-errors.test.ts ✅ Passed 650ms
tests/retry-behavior.test.ts ✅ Passed 3.016s
tests/sdk-error-shape.test.ts ✅ Passed 286ms

View OkTest run #34287736180

SDK merge (f874e4e24367) · head (93058483e110) · base (f1cd7f020210) · OkTest (08ec4299e769)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93058483e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if self._reconnect_attempt:
# Account for raw application progress without changing frame delivery.
try:
event_data: object = json.loads(message)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve raw delivery without parsing the entire event

When recv_bytes() receives the first non-error event after a reconnect, this now materializes the complete JSON object solely to update retry accounting; callers using the raw API to process very large image, audio, or Responses events therefore incur an unexpected full parse and allocation before receiving the bytes, and .recv() parses that same event a second time. This pattern is duplicated across the synchronous and asynchronous Realtime, Responses, and Beta Responses connections and can cause severe latency or memory exhaustion for payloads that were previously passed through unchanged; track application progress without fully materializing the raw payload.

AGENTS.md reference: AGENTS.md:L114-L121

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The raw-read change preserves retry-budget accounting after a reconnect. The extra JSON decode runs while the retry budget is consumed; a healthy non-error event resets it. Raw bytes are preserved, but parsing/allocation overhead is real and typed recv() can parse the same event again. I'd accept that tradeoff here and handle optimization separately rather than undo the retry fix. I haven't benchmarked large-frame overhead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbeckwith-oai could you take another look at the response above? Are you comfortable with retaining the retry fix here and addressing the parsing overhead separately, or is there something else you need before re-reviewing?

- items:
$ref: '#/components/schemas/InputItem'
type: array
maxItems: 131072

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid imposing a fixed Responses input-item ceiling

This publishes a new 131,072-item rejection limit for token-count requests, with the same limit added to the regular and beta compact/token-count schemas. Mock validators and clients generated from this OpenAPI contract can reject larger request bodies that previously had no item-count ceiling, despite the repository requiring an explicit owner-approved API contract and transport review for any new payload limit; remove it unless that contract has been established.

AGENTS.md reference: AGENTS.md:L114-L121

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxItems: 131072 is expected and should remain aligned with the intended Responses API contract. This PR exposes it in the bundled specification; it does not add SDK-side runtime validation. I acknowledge that schema validators now see a constraint the previous bundle omitted. I'd retain it here rather than remove the contract's limit. I am not claiming new boundary-test coverage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbeckwith-oai could you take another look at the response above? Are you comfortable with retaining the expected 131,072-item API constraint, or is there something else you need before re-reviewing?

Comment on lines +27 to +28
The paired `live.call.incoming` event derives its `session_id` by replacing the
`rtc_` prefix with `live_`. Use the ID returned by the event with the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the documented Live ID transformation

The documented prefix replacement is inconsistent with the paired examples in the generated API reference: replacing rtc_ in rtc_479a... with live_ produces live_479a..., while the Live event now shows live_u0_479a.... Consumers following this rule to correlate the two webhook events or derive an ID will obtain a value that cannot match the Live ID; document the actual transformation, including u0_ if it is invariant, or avoid claiming the ID can be derived.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that the prefix-conversion guidance is inconsistent. Callers should use the ID supplied by the corresponding webhook unchanged. This is tracked for a documentation correction; I'd like to address the wording in a follow-up. It is not fixed in this head.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbeckwith-oai could you take another look at the response above? Are you comfortable with taking the documented wording correction as a follow-up, or is there something else you need before re-reviewing?

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — the GPT Image 2.5 model aliases, quality values, custom dimensions, and nullable image-call metadata are largely generated as expected, and the current CI is green. I found three blocking regressions on this exact head:

  1. The new Live/Realtime webhook guidance gives an invalid deterministic mapping. The example pairs rtc_479a… with live_u0_479a…, but the prose says to replace only rtc_ with live_, which produces live_479a…. Please correct the authoritative spec and regenerate, or avoid telling callers to derive this ID and direct them to the event-provided session ID.

  2. The bundled transformed spec adds maxItems: 131072 to four existing Responses input arrays (stable/beta create, compact, and token-count paths). That is unrelated to this image update and newly makes schema-validating consumers reject shapes that were previously accepted. Please remove this unrelated constraint from this PR unless it is an approved API contract change with the appropriate boundary coverage.

  3. The reconnect bookkeeping now calls json.loads(message) inside each raw recv_bytes() path and the ordinary recv() path then parses the same payload again. After a reconnect this makes large image/audio/Responses frames incur a full extra decode/allocation even for callers explicitly using the raw-byte API. Please reset the retry budget without decoding the full raw frame twice, and add coverage for the raw receive path.

Once these are addressed and regenerated, I am happy to re-review.

Copy link
Copy Markdown
Contributor Author

Thanks Justin — I'd like to propose the following disposition:

  • Webhook docs: agreed the ID-conversion wording is wrong. The correction is tracked separately. Callers should use the event-provided ID unchanged; I'd like to handle the wording in a follow-up.
  • maxItems: 131,072 is expected and should stay aligned with the Responses API contract. It is newly visible in this bundle, so schema validators will see the constraint; this adds no SDK-side runtime validation. I'd retain it here.
  • Reconnect parsing: the extra decode preserves retry-budget accounting for raw reads and runs while the reconnect budget is consumed. I accept that performance tradeoff here and propose optimizing separately. I haven't benchmarked large-frame overhead.

CI is complete and green on the unchanged head. @jbeckwith-oai, could you re-review and confirm whether you're comfortable with these follow-ups? The deferred issues are acknowledged, not fixed by this PR.

@marcuswood-oai
marcuswood-oai merged commit 5b39c45 into main Sep 8, 2026
28 checks passed
@marcuswood-oai
marcuswood-oai deleted the castiron/promotions/pr-79 branch September 8, 2026 23:48
@openai-sdks openai-sdks Bot mentioned this pull request Sep 8, 2026
pull Bot pushed a commit to TheDegenerateDev5150/openai-python.py that referenced this pull request Sep 9, 2026
Automated Release PR
---


##
[3.10.0](openai/openai-python@v3.9.0...v3.10.0)
(2026-09-08)


### Features

* **api:** add GPT Image 2.5 models and image options
([openai#3824](openai#3824))
([5b39c45](openai@5b39c45))
* **api:** add service-account API key expiration fields
([openai#3802](openai#3802))
([f1cd7f0](openai@f1cd7f0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants