You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DOCS] Python SDK: Responses API + zai provider #420
The Python SDK (inference-gateway) gained support for the OpenAI-compatible Responses API and the zai provider in inference-gateway/python-sdk#77 (syncs to schemas v0.6.2). The docs should cover the new client surface so users can discover it.
InferenceGatewayClient.create_response_stream(...) -> yields SSEvent (callers json.loads(chunk.data) and validate against ResponseStreamEvent, mirroring the chat streaming example).
New provider value zai.
New public models: CreateResponseRequest, Response, ResponseStreamEvent, ResponseInputItem, ResponseTool, ResponseToolChoice, ResponseReasoning, ResponseTextConfig, and related output/usage types.
1. "Mention this is currently only supported using OpenAI" - done. The new note reads: the Responses API is provider-dependent and today only the OpenAI provider implements it; other providers return 400 Bad Request, so use create_chat_completion for those.
2. "Validate if the endpoint is implemented on the inference-gateway - I think it's not yet" - you're right, it is not. Evidence:
Canonical schemas/openapi.yaml@maindoes define POST /responses (that's why the Python SDK could generate create_response / create_response_stream + the Response* models in v0.6.2).
But the gateway (inference-gateway/inference-gateway@main) only registers these routes in cmd/gateway/main.go: GET /health, ANY /proxy/:provider/*path, GET /v1/models, GET /v1/mcp/tools, POST /v1/chat/completions, POST /v1/metrics.
There is noPOST /v1/responses route and noResponsesHandler (not on the Router interface in api/routes.go; 0 symbol matches; no open gateway PR). A call today falls through to NoRoute -> 404.
So the docs document the real SDK surface but add an honest caveat that the endpoint is not routed by the gateway yet (returns 404) until a gateway release ships the handler.
What was documented (sdks.md, Python section)
create_response(model, input, provider=None, max_output_tokens=None, tools=None, **kwargs) -> Response, with an example walking response.output for output_text parts.
create_response_stream(...) -> yields SSEvent; streaming example does json.loads(chunk.data) -> ResponseStreamEvent.model_validate(...) and reads response.output_text.delta events (mirrors the chat streaming example).
Notes on the flattened ResponseTool function shape and string-or-items input.
Notes / scope
zai needed no change - it is already in the schema Provider enum and renders in every generated region (supported-providers.md, the sdks-provider-list in sdks.md, etc.).
Scoped to the Python SDK as the issue asks; the TypeScript SDK exposes no Responses helper, so I did not add a capability-matrix row (avoids an unverifiable claim across the other SDKs).
Downstream follow-up filed:inference-gateway/inference-gateway#454 to implement the POST /v1/responses handler; the docs caveat should be removed once it ships.
Activity
edenreich commentedon Jul 18, 2026
@claude Can you work on this? mention this is currently only supported using OpenAI.
Please also validate if the endpoint is implemented on the inference-gateway - because I think it's not yet implemented.
inference-gateway-maintainer commentedon Jul 18, 2026
Claude finished @edenreich's task in 13m 16s —— View job •
docs/issue-420-20260718-2016• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-420-20260718-2016?quick_pull=1&title=Issue%20%23420%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23420%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Done - Python Responses API documented + gateway support validated
Opened PR: inference-gateway/docs#423
sdks.md) and provider list/responsesis implemented on the gatewayzaihandling (already generated from schema)### Responses APIsubsection (usage + streaming decode + OpenAI-only + not-yet-routed note)format/lint:md/build/bun testall passAnswer to your two asks
1. "Mention this is currently only supported using OpenAI" - done. The new note reads: the Responses API is provider-dependent and today only the OpenAI provider implements it; other providers return
400 Bad Request, so usecreate_chat_completionfor those.2. "Validate if the endpoint is implemented on the inference-gateway - I think it's not yet" - you're right, it is not. Evidence:
schemas/openapi.yaml@maindoes definePOST /responses(that's why the Python SDK could generatecreate_response/create_response_stream+ theResponse*models in v0.6.2).inference-gateway/inference-gateway@main) only registers these routes incmd/gateway/main.go:GET /health,ANY /proxy/:provider/*path,GET /v1/models,GET /v1/mcp/tools,POST /v1/chat/completions,POST /v1/metrics.POST /v1/responsesroute and noResponsesHandler(not on theRouterinterface inapi/routes.go; 0 symbol matches; no open gateway PR). A call today falls through toNoRoute-> 404.So the docs document the real SDK surface but add an honest caveat that the endpoint is not routed by the gateway yet (returns 404) until a gateway release ships the handler.
What was documented (
sdks.md, Python section)create_response(model, input, provider=None, max_output_tokens=None, tools=None, **kwargs)->Response, with an example walkingresponse.outputforoutput_textparts.create_response_stream(...)-> yieldsSSEvent; streaming example doesjson.loads(chunk.data)->ResponseStreamEvent.model_validate(...)and readsresponse.output_text.deltaevents (mirrors the chat streaming example).ResponseToolfunction shape and string-or-itemsinput.Notes / scope
zaineeded no change - it is already in the schemaProviderenum and renders in every generated region (supported-providers.md, thesdks-provider-listinsdks.md, etc.).POST /v1/responseshandler; the docs caveat should be removed once it ships.docs/issue-420-20260718-2016- PR #423inference-gateway-releaser commentedon Jul 18, 2026
🎉 This issue has been resolved in version 0.9.2 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀