Skip to content

Send response.create fields at the top level over WebSocket - #8

Merged
khasinski merged 1 commit into
khasinski:mainfrom
lucas-domeij:fix/ws-envelope-shape
May 26, 2026
Merged

khasinski merged 1 commit into
khasinski:mainfrom
lucas-domeij:fix/ws-envelope-shape

Conversation

@lucas-domeij

Copy link
Copy Markdown
Contributor

Hit this trying to use the WS transport against wss://api.openai.com/v1/responses. Every response.create came back with:

{"type":"error","error":{"message":"[ObjectParam] [model] [missing_required_parameter] Missing required parameter: 'model'.","type":"invalid_request_error"},"status":400}

The endpoint wants the response fields at the top level of the message, not nested under a response key. Switching to a top-level layout makes the API accept the request and stream chunks back normally.

Verified with a small repro against the live endpoint with gpt-4.1-mini and gpt-5. Existing specs updated to match the shape that actually goes over the wire.

The OpenAI WS endpoint expects response.create messages with model/input/etc
at the top level. Wrapping them in a 'response' key gets back:

  {"type":"error","error":{"message":"[ObjectParam] [model]
  [missing_required_parameter] Missing required parameter: 'model'."}}

Updated #call and #warmup to merge fields into the envelope, and adjusted
the specs that asserted the nested shape.
@khasinski
khasinski merged commit 96d74fd into khasinski:main May 26, 2026
4 of 5 checks passed
@khasinski

Copy link
Copy Markdown
Owner

Thanks @lucas-domeij, this fix and the matching spec changes have been merged in 96d74fd. Much appreciated.

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.

2 participants