-
Notifications
You must be signed in to change notification settings - Fork 938
Open
Labels
Description
What Would You Like to See with the Gateway?
Description:
OpenRouter now supports the Responses API (POST /v1/responses), which is compatible with the OpenAI Responses API format. The OpenRouter provider in the gateway currently only supports chatComplete — this issue tracks adding support for the Responses API endpoints.
Endpoints to support:
POST /v1/responses— Create a responseGET /v1/responses/:id— Retrieve a responseDELETE /v1/responses/:id— Delete a responseGET /v1/responses/:id/input_items— List response input items
Implementation approach:
Since OpenRouter's Responses API is OpenAI-compatible, this can reuse the existing open-ai-base infrastructure:
createModelResponse.ts— UsecreateModelResponseParams()fromopen-ai-basewith OpenRouter-specific extra parameters:provider(routing preferences),plugins,top_k,frequency_penalty,presence_penalty,session_id, andtrace.api.ts— Add endpoint mappings forcreateModelResponse→/v1/responsesand basePath handling for the other three endpoints.index.ts— Register configs and reuseOpenAICreateModelResponseTransformer,OpenAIGetModelResponseTransformer,OpenAIDeleteModelResponseTransformer, andOpenAIListInputItemsResponseTransformerparameterized with theOPENROUTERprovider constant.
OpenRouter-specific parameters (beyond standard OpenAI Responses API):
provider— Routing preferences (order, only, ignore, sort, max_price)plugins— Enable features like auto-router, moderation, web, file-parsertop_k— Sampling parameterfrequency_penalty/presence_penalty— Generation parameterssession_id— Conversation/workflow groupingtrace— Observability (trace_id, span_name, parent_span_id)
Streaming and non-streaming modes are both supported. Streaming uses native SSE passthrough (same event format as OpenAI), and JSON-to-stream conversion for cache hits works via the existing OpenAIModelResponseJSONToStreamGenerator.
Context for your Request
No response
Your Twitter/LinkedIn
Reactions are currently unavailable