Repository navigation
Add OpenAI Responses API route (/v1/responses) to gateway - #57
Merged
Merged
Conversation
This was referenced May 28, 2026
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.
Motivation
/v1/responses) so callers can sendmodel+input(string or message-array) and receive Responses-shaped output.TToolLoopConfig/RunToolLoop) so Responses requests get the same provider/tool execution semantics as/v1/chat/completions.Description
POST /v1/responsesand included the route in the/v1index and README examples (files touched:src/pkg/gateway/PasClaw.Gateway.Server.pas,README.md).TGatewayServer.HandleResponsesto parsemodel,input(accepting either a string or an array of message/content items),stream,temperature, andmax_output_tokens/max_tokens, convert toTMessagearray, and run the existing tool-loop.GenResponseIdandBuildResponsesObjecthelpers to emit a minimal Responses-compatible non-streaming JSON object withid,object: "response",created_at,model,status,output(assistant message content) andusagefields.stream:trueis requested.Testing
git diff --checkand repository grep checks for the new route and handler (rg -n "POST /v1/responses|HandleResponses|unsupported_streaming|/v1/responses") which reported the expected symbols insrc/pkg/gateway/PasClaw.Gateway.Server.pasandREADME.md.README.mdshowing curl examples for stringinput, message-arrayinput, missing/empty input, and unsupported streaming behavior (examples added to README).make test-hashlinebut the build step is blocked in this environment becausefpcresis not available, so FPC-focused tests could not run here.Codex Task