mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
Co-authored-by: quzard <1191890118@qq.com>
This commit is contained in:
@@ -63,6 +63,7 @@ func SetApiRouter(router *gin.Engine) {
|
||||
{
|
||||
channelRoute.GET("/", controller.GetAllChannels)
|
||||
channelRoute.GET("/search", controller.SearchChannels)
|
||||
channelRoute.GET("/models", controller.ListModels)
|
||||
channelRoute.GET("/:id", controller.GetChannel)
|
||||
channelRoute.GET("/test", controller.TestAllChannels)
|
||||
channelRoute.GET("/test/:id", controller.TestChannel)
|
||||
|
@@ -8,11 +8,15 @@ import (
|
||||
|
||||
func SetRelayRouter(router *gin.Engine) {
|
||||
// https://platform.openai.com/docs/api-reference/introduction
|
||||
modelsRouter := router.Group("/v1/models")
|
||||
modelsRouter.Use(middleware.TokenAuth())
|
||||
{
|
||||
modelsRouter.GET("/", controller.ListModels)
|
||||
modelsRouter.GET("/:model", controller.RetrieveModel)
|
||||
}
|
||||
relayV1Router := router.Group("/v1")
|
||||
relayV1Router.Use(middleware.TokenAuth(), middleware.Distribute())
|
||||
{
|
||||
relayV1Router.GET("/models", controller.ListModels)
|
||||
relayV1Router.GET("/models/:model", controller.RetrieveModel)
|
||||
relayV1Router.POST("/completions", controller.RelayNotImplemented)
|
||||
relayV1Router.POST("/chat/completions", controller.Relay)
|
||||
relayV1Router.POST("/edits", controller.RelayNotImplemented)
|
||||
|
Reference in New Issue
Block a user