feat: expose raw HTTP responses - #262
Open
ktamulonis wants to merge 3 commits into
Open
Conversation
ktamulonis
force-pushed
the
add-response-header-observability
branch
from
March 31, 2026 21:04
5db14bc to
eaef87f
Compare
jbeckwith-oai
force-pushed
the
add-response-header-observability
branch
from
August 10, 2026 21:56
eaef87f to
4571067
Compare
HAYDEN-OAI
approved these changes
Aug 10, 2026
HAYDEN-OAI
left a comment
Contributor
There was a problem hiding this comment.
Overall looks good. I left one low-priority serialization-boundary comment inline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit raw-response modifier for generated HTTP operations:
OpenAI::RawResponse[T]exposes the HTTP status, normalized immutable headers,request ID, buffered body, and a lazy cached parsed value without changing the
operation's arguments or normal error behavior.
API contract
_request_idconvenienceintroduced by feat: expose request IDs #352.
raw.request_idandraw.parse._request_idare the same value when theparsed result is a model or page.
nilresults.
helper-assembled streaming snapshots.
statusandheadersdirectly on their stream objects.
Ruby, RBI, and RBS.
This follows the explicit raw-response pattern used by the other OpenAI SDKs
while keeping transport metadata separate from API-schema models.
Generator ownership
The generated resource wrappers and type signatures are owned by the Castiron
source change in openai/openai#1272460. That companion PR prevents future SDK
generation from overwriting this API.
Validation