Skip to content

Conversation

@DeJeune
Copy link
Collaborator

@DeJeune DeJeune commented Jan 3, 2026

What this PR does

Before this PR:

  • API Server only supported basic Chat Completions (/v1/chat/completions) and Anthropic Messages (/v1/messages) endpoints
  • No OpenAI Responses API support
  • No model grouping/gateway functionality for routing requests to different providers
  • Basic settings UI with limited configuration options

After this PR:

  • Full OpenAI Responses API support (/v1/responses endpoint) with streaming
  • API Gateway with Model Groups - each group gets a unique URL path (e.g., http://localhost:23333/{groupId}/v1/...) mapped to a specific provider/model
  • Enhanced settings UI with endpoint management, model group CRUD, and network exposure options
  • Composable validators utility for real-time input validation

Why we need it and why it was done in this way

The following tradeoffs were made:

  • Model Groups use createdAt as stable identifier since id can be changed by user for URL customization
  • Gateway middleware intercepts /{groupId}/v1/... routes before standard API routes
  • Reused existing adapter pattern for Responses API to maintain consistency

The following alternatives were considered:

  • Single model endpoint vs Model Groups: Chose Model Groups for flexibility in exposing multiple provider/model combinations
  • Separate config vs extended ApiServerConfig: Extended existing config with backwards compatibility via type alias

Breaking changes

  • ApiServerConfig type is now deprecated, use ApiGatewayConfig instead (alias provided for backwards compatibility)
  • Redux store migration adds new fields (modelGroups, enabledEndpoints, exposeToNetwork) with defaults

Special notes for your reviewer

Checklist

Release note

feat(api-gateway): Add OpenAI Responses API support and Model Groups

- New `/v1/responses` endpoint with full streaming support
- Model Groups: Create unique API endpoints for different provider/model combinations
- Gateway routing: Access models via `/{groupId}/v1/...` URLs
- Configurable endpoint exposure and network settings
- Enhanced settings UI for gateway management

- Updated SettingsPage to link to API Gateway settings.
- Refactored ApiServerSettings to manage API Gateway settings including model groups and enabled endpoints.
- Introduced new Redux actions and state management for API Gateway configuration.
- Enhanced migration scripts to support new API Gateway fields and ensure backward compatibility.
- Updated types to define GatewayEndpoint and ModelGroup structures.
@DeJeune DeJeune requested a review from 0xfullex as a code owner January 3, 2026 13:58
@DeJeune DeJeune marked this pull request as draft January 3, 2026 13:59
DeJeune and others added 3 commits January 4, 2026 16:43
Add dispose() method to StreamAbortController that explicitly removes
the abort event listener when stream ends normally. Previously, the
listener would only be removed when abort was triggered ({ once: true }),
but if the stream completed normally without abort, the listener would
remain attached until garbage collection.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@DeJeune DeJeune changed the base branch from main to feat/proxy-api-server January 4, 2026 10:14
- Introduced new routes and services for handling OpenAI Responses API requests.
- Implemented `AiSdkToOpenAIResponsesSSE` adapter for streaming responses.
- Added `OpenAIResponsesSSEFormatter` for formatting SSE events.
- Enhanced `MessageConverterFactory` to support 'openai-responses' format.
- Updated `StreamAdapterFactory` to include OpenAI Responses streaming.
- Created `ResponsesService` for direct passthrough to OpenAI Responses API.
- Added validation and processing logic for OpenAI Responses API requests.
- Implemented model compatibility checks for OpenAI Responses API.
@DeJeune DeJeune marked this pull request as ready for review January 5, 2026 05:12
@kangfenmao
Copy link
Collaborator

image

@DeJeune
Copy link
Collaborator Author

DeJeune commented Jan 7, 2026

image

fixed

@0xfullex
Copy link
Collaborator

0xfullex commented Jan 7, 2026

Note

This comment was translated by Claude.

Directory names and variable names have all been changed from apiServer to apiGateway.


Original Content

目录名、变量名,都从 apiServer 改为 apiGateway

@vaayne
Copy link
Collaborator

vaayne commented Jan 7, 2026

[!NOTE]
This comment was translated by Claude.

Directory names and variable names have all been changed from apiServer to apiGateway.


Original Content

目录名、变量名,都从 apiServer 改为 apiGateway

Note

This comment was translated by Claude.

Are we planning to only support API Gateway functionality? Do we still plan to expose Cherry's native capabilities in the future?


Original Content

我们是打算只支持 API Gateway 的功能吗?今后还准备暴露 Cherry 本身的能力吗?

@0xfullex
Copy link
Collaborator

0xfullex commented Jan 7, 2026

[!NOTE]
This comment was translated by Claude.

Are we planning to only support API Gateway functionality? Do we still plan to expose Cherry's native capabilities in the future?

Note

This comment was translated by Claude.

This was discussed previously, it's just a naming change. apiServer can be confusing internally and externally. The functionality remains the same, still serving the CSaaS responsibility by exposing Cherry's capabilities to the outside.


Original Content

这是上次讨论过的,只是一个命名上的更改,apiserver在内外容易混淆。其功能不变,仍是为了CSaaS的职责,对外提供Cherry的能力

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.

5 participants