// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/api/channel": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds a new channel to the system", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Add a single channel", "parameters": [ { "description": "Channel information", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channel/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a specific channel", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Get a channel by ID", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Channel" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates an existing channel by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Update a channel", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true }, { "description": "Updated channel information", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Channel" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a channel by its ID", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Delete a channel", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channel/{id}/balance": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the balance for a single channel", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Update channel balance", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "number" } } } ] } } } } }, "/api/channel/{id}/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests all models in the channel", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Test channel models", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "Return success", "name": "return_success", "in": "query" }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "type": "boolean", "description": "Stream", "name": "stream", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.TestResult" } } } } ] } } } } }, "/api/channel/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a channel by its ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Update channel status", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true }, { "description": "Status information", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateChannelStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channel/{id}/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests a single model in the channel", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Test channel model", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ChannelTest" } } } ] } } } } }, "/api/channels": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of channels with optional filters", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Get channels with pagination", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Filter by key", "name": "key", "in": "query" }, { "type": "integer", "description": "Filter by channel type", "name": "channel_type", "in": "query" }, { "type": "string", "description": "Filter by base URL", "name": "base_url", "in": "query" }, { "type": "string", "description": "Order by field", "name": "order", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "channels": { "type": "array", "items": { "$ref": "#/definitions/model.Channel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds multiple channels in a batch operation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Add multiple channels", "parameters": [ { "description": "Channel information", "name": "channels", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.AddChannelRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channels/all": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all channels without pagination", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Get all channels", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.Channel" } } } } ] } } } } }, "/api/channels/balance": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the balance for all channels", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Update all channels balance", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channels/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes multiple channels by their IDs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Delete multiple channels", "parameters": [ { "description": "Channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/channels/import/oneapi": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Imports channels from OneAPI", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Import channel from OneAPI", "parameters": [ { "description": "Import channel from OneAPI request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.ImportChannelFromOneAPIRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": {} } } } ] } } } } }, "/api/channels/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search channels with keyword and optional filters", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Search channels", "parameters": [ { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Filter by key", "name": "key", "in": "query" }, { "type": "integer", "description": "Filter by channel type", "name": "channel_type", "in": "query" }, { "type": "string", "description": "Filter by base URL", "name": "base_url", "in": "query" }, { "type": "string", "description": "Order by field", "name": "order", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "channels": { "type": "array", "items": { "$ref": "#/definitions/model.Channel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/channels/test": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests all channels", "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Test all channels", "parameters": [ { "type": "boolean", "description": "Test disabled", "name": "test_disabled", "in": "query" }, { "type": "boolean", "description": "Return success", "name": "return_success", "in": "query" }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "type": "boolean", "description": "Stream", "name": "stream", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.TestResult" } } } } ] } } } } }, "/api/channels/type_metas": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns metadata for all channel types", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Get channel type metadata", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "$ref": "#/definitions/channeltype.AdaptorMeta" } } } } ] } } } } }, "/api/channels/type_names": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all available channel type names", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Get all channel type names", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "string" } } } } ] } } } } }, "/api/dashboard": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns the general dashboard data including usage statistics and metrics", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get dashboard data", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Type of time span (day, week, month, two_week)", "name": "type", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardResponse" } } } ] } } } } }, "/api/dashboard/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns dashboard data and metrics specific to the given group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get dashboard data for a specific group", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Type of time span (day, week, month, two_week)", "name": "type", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model or *", "name": "model", "in": "query" }, { "type": "integer", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupDashboardResponse" } } } ] } } } } }, "/api/dashboard/{group}/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns model-specific metrics and usage data for the given group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model usage data for a specific group", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } } } } ] } } } } }, "/api/group/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a specific group", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Get a group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.GroupResponse" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates an existing group with the given information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update a group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Updated group information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.CreateGroupRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Group" } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Creates a new group with the given information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Create a new group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Group information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.CreateGroupRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Group" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a group by its name", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Delete a group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/model_config/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get group model config", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Get group model config", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupModelConfig" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update group model config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update group model config", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true }, { "description": "Group model config information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.SaveGroupModelConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Save group model config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Save group model config", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Group model config information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.SaveGroupModelConfigRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete group model config", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Delete group model config", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/model_configs/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get group model configs", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Get group model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupModelConfig" } } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update group model configs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update group model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Group model config information", "name": "data", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.SaveGroupModelConfigRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Save group model configs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Save group model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Group model config information", "name": "data", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.SaveGroupModelConfigRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete group model configs", "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Delete group model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Model names", "name": "models", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/rpm_ratio": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the RPM (Requests Per Minute) ratio for a group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update group RPM ratio", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "RPM ratio information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupRPMRatioRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update group status", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Status information", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/tpm_ratio": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the TPM (Tokens Per Minute) ratio for a group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group" ], "summary": "Update group TPM ratio", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "TPM ratio information", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupTPMRatioRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/groups": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all groups with pagination", "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Get all groups", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/groups/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes multiple groups by their IDs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Delete multiple groups", "parameters": [ { "description": "Group IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/groups/batch_status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of multiple groups", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Update multiple groups status", "parameters": [ { "description": "Group IDs and status", "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupsStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/groups/ip_groups": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get IP group list", "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Get IP group list", "parameters": [ { "type": "integer", "description": "Threshold", "name": "threshold", "in": "query" }, { "type": "integer", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp", "name": "end_timestamp", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } } ] } } } } }, "/api/groups/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search groups with keyword and pagination", "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Search groups", "parameters": [ { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Status", "name": "status", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/log/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get logs for a specific group", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group logs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Start timestamp (milliseconds)", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp (milliseconds)", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Code type", "name": "code_type", "in": "query" }, { "type": "boolean", "description": "With body", "name": "with_body", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "boolean", "description": "Result only", "name": "result_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupLogsResult" } } } ] } } } } }, "/api/log/{group}/detail/{log_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get detailed information about a specific log entry in a group", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group log detail", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Log ID", "name": "log_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.RequestDetail" } } } ] } } } } }, "/api/log/{group}/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search logs for a specific group with filters", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Search group logs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Keyword", "name": "keyword", "in": "query", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Start timestamp (milliseconds)", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp (milliseconds)", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Filter by token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Filter by model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Filter by channel", "name": "channel", "in": "query" }, { "type": "integer", "description": "Filter by token id", "name": "token_id", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Code type", "name": "code_type", "in": "query" }, { "type": "boolean", "description": "With body", "name": "with_body", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "boolean", "description": "Result only", "name": "result_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupLogsResult" } } } ] } } } } }, "/api/log/{group}/used/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of models that have been used in a specific group's logs", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group used models", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/api/log/{group}/used/token_names": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of token names that have been used in a specific group's logs", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group used token names", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/api/logs": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of all logs with optional filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get all logs", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Start timestamp (milliseconds)", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp (milliseconds)", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Code type", "name": "code_type", "in": "query" }, { "type": "boolean", "description": "With body", "name": "with_body", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "boolean", "description": "Result only", "name": "result_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetLogsResult" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes logs older than the specified retention period", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Delete historical logs", "parameters": [ { "type": "integer", "description": "Timestamp (milliseconds)", "name": "timestamp", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "integer" } } } ] } } } } }, "/api/logs/consume_error": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search for logs with consumption errors", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Search consumption errors", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Start timestamp (milliseconds)", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp (milliseconds)", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Keyword", "name": "keyword", "in": "query" }, { "type": "string", "description": "Group", "name": "group", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "string", "description": "Content", "name": "content", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/definitions/model.RequestDetail" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/logs/detail/{log_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get detailed information about a specific log entry", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get log detail", "parameters": [ { "type": "string", "description": "Log ID", "name": "log_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.RequestDetail" } } } ] } } } } }, "/api/logs/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search logs with various filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Search logs", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" }, { "type": "string", "description": "Keyword", "name": "keyword", "in": "query", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "integer", "description": "Start timestamp (milliseconds)", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp (milliseconds)", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Filter by token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Filter by model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Filter by channel", "name": "channel", "in": "query" }, { "type": "integer", "description": "Filter by token id", "name": "token_id", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Code type", "name": "code_type", "in": "query" }, { "type": "boolean", "description": "With body", "name": "with_body", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "boolean", "description": "Result only", "name": "result_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetLogsResult" } } } ] } } } } }, "/api/logs/used/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of models that have been used in logs", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get used models", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/api/logs/used/token_names": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of token names that have been used in logs", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get used token names", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } } } } }, "/api/mcp/group/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of Group MCPs with pagination and filtering", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get Group MCPs", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "MCP type", "name": "type", "in": "query" }, { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupMCP" } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new Group MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Create Group MCP", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group MCP object", "name": "mcp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.GroupMCP" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupMCP" } } } ] } } } } }, "/api/mcp/group/{group}/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a specific Group MCP by its ID and Group ID", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get Group MCP by ID", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupMCP" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update an existing Group MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Update Group MCP", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group MCP object", "name": "mcp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.GroupMCP" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupMCP" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete a Group MCP by ID and Group ID", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Delete Group MCP", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/public/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a list of MCPs with pagination and filtering", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get MCPs", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "MCP type", "name": "type", "in": "query" }, { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.PublicMCP" } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Create MCP", "parameters": [ { "description": "MCP object", "name": "mcp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.PublicMCP" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/public/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a specific MCP by its ID", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get MCP by ID", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.PublicMCP" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update an existing MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Update MCP", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "description": "MCP object", "name": "mcp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.PublicMCP" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete an MCP by ID", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Delete MCP", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/public/{id}/group/{group}/params": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get reusing parameters for a specific group and MCP", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get group MCP reusing parameters", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.PublicMCPReusingParam" } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create or update reusing parameters for a specific group and MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Create or update group MCP reusing parameters", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Reusing parameters", "name": "params", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.PublicMCPReusingParam" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/model_config": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Saves a model config", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Save model config", "parameters": [ { "description": "Model config", "name": "config", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.SaveModelConfigsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/model_config/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a model config", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Get model config", "parameters": [ { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ModelConfig" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a model config", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Delete model config", "parameters": [ { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/model_configs": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of model configs with pagination", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Get model configs", "parameters": [ { "type": "string", "description": "Model name", "name": "model", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "configs": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } }, "total": { "type": "integer" } } } ] } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Saves a list of model configs", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Save model configs", "parameters": [ { "description": "Model configs", "name": "configs", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.SaveModelConfigsRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/model_configs/all": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all model configs", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Get all model configs", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } } } } ] } } } } }, "/api/model_configs/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a list of model configs", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Delete model configs", "parameters": [ { "description": "Model names", "name": "models", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/model_configs/contains": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of model configs by models contains", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Get model configs by models contains", "parameters": [ { "description": "Models", "name": "models", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.GetModelConfigsByModelsContainsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } } } } ] } } } } }, "/api/model_configs/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of model configs by keyword", "produces": [ "application/json" ], "tags": [ "modelconfig" ], "summary": "Search model configs", "parameters": [ { "type": "string", "description": "Keyword", "name": "keyword", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "string", "description": "Owner", "name": "owner", "in": "query" }, { "type": "integer", "description": "Page", "name": "page", "in": "query" }, { "type": "integer", "description": "Per page", "name": "per_page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "configs": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/model_cost_rank": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns ranking data for models based on cost", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model cost ranking data", "parameters": [ { "type": "string", "description": "Group or *", "name": "group", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "integer", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp", "name": "end_timestamp", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ModelCostRank" } } } } ] } } } } }, "/api/model_cost_rank/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns model cost ranking data specific to the given group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model cost ranking data for a specific group", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp", "name": "end_timestamp", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ModelCostRank" } } } } ] } } } } }, "/api/models/builtin": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of builtin models", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get builtin models", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.BuiltinModelConfig" } } } } ] } } } } }, "/api/models/builtin/channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of channel builtin models", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get channel builtin models", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/controller.BuiltinModelConfig" } } } } } ] } } } } }, "/api/models/builtin/channel/{type}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of channel builtin models by type", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get channel builtin models by type", "parameters": [ { "type": "string", "description": "Channel type", "name": "type", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.BuiltinModelConfig" } } } } ] } } } } }, "/api/models/default": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of channel default models and mapping", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get channel default models and mapping", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } } } } ] } } } } ] } } } } }, "/api/models/default/{type}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of channel default models and mapping by type", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get channel default models and mapping by type", "parameters": [ { "type": "string", "description": "Channel type", "name": "type", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } } } } ] } } } } ] } } } } }, "/api/models/enabled": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of enabled models", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get enabled models", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } } } } } ] } } } } }, "/api/monitor": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all channel model error rates", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get all channel model error rates", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "number" } } } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Clears all model errors", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Clear all model errors", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/monitor/banned_channels": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of all banned model channels", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get all banned model channels", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "integer" } } } } } ] } } } } }, "/api/monitor/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of models error rate", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get models error rate", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "number" } } } } ] } } } } }, "/api/monitor/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of channel model error rates", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get channel model error rates", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "number" } } } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Clears all model errors for a specific channel", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Clear channel all model errors", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/monitor/{id}/{model}": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Clears model errors for a specific channel and model", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Clear channel model errors", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/options": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of options", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Get options", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "string" } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates multiple options", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Update options", "parameters": [ { "description": "Options", "name": "options", "in": "body", "required": true, "schema": { "type": "object", "additionalProperties": { "type": "string" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/options/": { "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates a single option", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Update option", "parameters": [ { "description": "Option value", "name": "value", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Option" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates a single option", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Update option", "parameters": [ { "description": "Option value", "name": "value", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.Option" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/options/{key}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a single option", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Get option", "parameters": [ { "type": "string", "description": "Option key", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.Option" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates a single option by key", "produces": [ "application/json" ], "tags": [ "option" ], "summary": "Update option by key", "parameters": [ { "type": "string", "description": "Option key", "name": "key", "in": "path", "required": true }, { "description": "Option value", "name": "value", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/status": { "get": { "description": "Returns the status of the server", "produces": [ "application/json" ], "tags": [ "misc" ], "summary": "Get status", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.StatusData" } } } ] } } } } }, "/api/token/{group}": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds a new token to a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Add group token", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "boolean", "description": "Auto create group", "name": "auto_create_group", "in": "query" }, { "type": "boolean", "description": "Ignore exist", "name": "ignore_exist", "in": "query" }, { "description": "Token information", "name": "token", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.TokenResponse" } } } ] } } } } }, "/api/token/{group}/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes multiple tokens from a specific group", "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Delete group tokens", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Token IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/token/{group}/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of tokens for a specific group based on search criteria", "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Search tokens for a specific group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Keyword", "name": "keyword", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Name", "name": "name", "in": "query" }, { "type": "string", "description": "Key", "name": "key", "in": "query" }, { "type": "integer", "description": "Status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/controller.TokenResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/token/{group}/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a specific token for a specific group", "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Get token by ID for a specific group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.TokenResponse" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates an existing token in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Update group token", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Updated token information", "name": "token", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.TokenResponse" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a specific token from a group", "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Delete group token", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/token/{group}/{id}/name": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the name of a token in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Update group token name", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Name information", "name": "name", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateTokenNameRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/token/{group}/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a token in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "token" ], "summary": "Update group token status", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Status information", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateTokenStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/tokens": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of all tokens", "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Get all tokens", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "Group name", "name": "group", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "integer", "description": "Status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/controller.TokenResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/tokens/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes multiple tokens by their IDs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Delete multiple tokens", "parameters": [ { "description": "Token IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/tokens/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of tokens based on search criteria", "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Search tokens", "parameters": [ { "type": "string", "description": "Keyword", "name": "keyword", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Name", "name": "name", "in": "query" }, { "type": "string", "description": "Key", "name": "key", "in": "query" }, { "type": "integer", "description": "Status", "name": "status", "in": "query" }, { "type": "string", "description": "Group", "name": "group", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/controller.TokenResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/tokens/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of all tokens for a specific group", "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Get all tokens for a specific group", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page", "name": "per_page", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "integer", "description": "Status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "allOf": [ {}, { "type": "object", "properties": { "tokens": { "type": "array", "items": { "$ref": "#/definitions/controller.TokenResponse" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/tokens/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a specific token", "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Get token by ID", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.TokenResponse" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates an existing token's information", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Update token", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Updated token information", "name": "token", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddTokenRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.TokenResponse" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a specific token by ID", "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Delete token", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/tokens/{id}/name": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the name of a specific token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Update token name", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Name information", "name": "name", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateTokenNameRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/tokens/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a specific token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "tokens" ], "summary": "Update token status", "parameters": [ { "type": "integer", "description": "Token ID", "name": "id", "in": "path", "required": true }, { "description": "Status information", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateTokenStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/mcp/group/message": { "post": { "summary": "MCP SSE Proxy", "responses": {} } }, "/mcp/group/{id}/sse": { "get": { "summary": "Group MCP SSE Server", "responses": {} } }, "/mcp/group/{id}/streamable": { "get": { "summary": "Group MCP Streamable Server", "responses": {} }, "post": { "summary": "Group MCP Streamable Server", "responses": {} }, "delete": { "summary": "Group MCP Streamable Server", "responses": {} } }, "/mcp/public/message": { "post": { "summary": "Public MCP SSE Server", "responses": {} } }, "/mcp/public/{id}/sse": { "get": { "summary": "Public MCP SSE Server", "responses": {} } }, "/mcp/public/{id}/streamable": { "get": { "summary": "Public MCP Streamable Server", "responses": {} }, "post": { "summary": "Public MCP Streamable Server", "responses": {} }, "delete": { "summary": "Public MCP Streamable Server", "responses": {} } }, "/v1/audio/speech": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "AudioSpeech", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "AudioSpeech", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.TextToSpeechRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "audio binary", "schema": { "type": "file" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/audio/transcription": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "AudioTranscription", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "AudioTranscription", "parameters": [ { "type": "string", "description": "Model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "File", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SttJSONResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/audio/translation": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "AudioTranslation", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "AudioTranslation", "parameters": [ { "type": "string", "description": "Model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "File", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.SttJSONResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/chat/completions": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "ChatCompletions", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "ChatCompletions", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.GeneralOpenAIRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.TextResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/completions": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Completions", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Completions", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.GeneralOpenAIRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.TextResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/dashboard/billing/subscription": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get subscription", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get subscription", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/openai.SubscriptionResponse" } } } } }, "/v1/dashboard/billing/usage": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get usage", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get usage", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/openai.UsageResponse" } } } } }, "/v1/embeddings": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Embeddings", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Embeddings", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.EmbeddingRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.EmbeddingResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/images/generations": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "ImagesGenerations", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "ImagesGenerations", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.ImageRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ImageResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/message": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Anthropic", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Anthropic", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.AnthropicMessageRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.TextResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "List all models", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "List models", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.OpenAIModels" } }, "object": { "type": "string" } } } } } } }, "/v1/models/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Retrieve a model", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Retrieve model", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/controller.OpenAIModels" } } } } }, "/v1/parse-pdf": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "ParsePdf", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "ParsePdf", "parameters": [ { "type": "string", "description": "Model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "File", "name": "file", "in": "formData", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ParsePdfResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } }, "/v1/rerank": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Rerank", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Rerank", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.RerankRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.RerankResponse" }, "headers": { "X-RateLimit-Limit-Requests": { "type": "integer", "description": "X-RateLimit-Limit-Requests" }, "X-RateLimit-Limit-Tokens": { "type": "integer", "description": "X-RateLimit-Limit-Tokens" }, "X-RateLimit-Remaining-Requests": { "type": "integer", "description": "X-RateLimit-Remaining-Requests" }, "X-RateLimit-Remaining-Tokens": { "type": "integer", "description": "X-RateLimit-Remaining-Tokens" }, "X-RateLimit-Reset-Requests": { "type": "string", "description": "X-RateLimit-Reset-Requests" }, "X-RateLimit-Reset-Tokens": { "type": "string", "description": "X-RateLimit-Reset-Tokens" } } } } } } }, "definitions": { "channeltype.AdaptorMeta": { "type": "object", "properties": { "defaultBaseUrl": { "type": "string" }, "keyHelp": { "type": "string" }, "name": { "type": "string" } } }, "controller.AddChannelRequest": { "type": "object", "properties": { "base_url": { "type": "string" }, "config": { "$ref": "#/definitions/model.ChannelConfig" }, "key": { "type": "string" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "sets": { "type": "array", "items": { "type": "string" } }, "status": { "type": "integer" }, "type": { "type": "integer" } } }, "controller.AddTokenRequest": { "type": "object", "properties": { "expiredAt": { "type": "integer" }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "quota": { "type": "number" }, "subnets": { "type": "array", "items": { "type": "string" } } } }, "controller.BuiltinModelConfig": { "type": "object", "properties": { "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "exclude_from_tests": { "type": "boolean" }, "image_prices": { "type": "object", "additionalProperties": { "type": "number" } }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "price": { "$ref": "#/definitions/model.Price" }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "controller.CreateGroupRequest": { "type": "object", "properties": { "available_set": { "type": "array", "items": { "type": "string" } }, "balance_alert_enabled": { "type": "boolean" }, "balance_alert_threshold": { "type": "number" }, "rpm_ratio": { "type": "number" }, "tpm_ratio": { "type": "number" } } }, "controller.GetModelConfigsByModelsContainsRequest": { "type": "object", "properties": { "models": { "type": "array", "items": { "type": "string" } } } }, "controller.GroupResponse": { "type": "object", "properties": { "accessed_at": { "type": "string" }, "available_sets": { "type": "array", "items": { "type": "string" } }, "balance_alert_enabled": { "type": "boolean" }, "balance_alert_threshold": { "type": "number" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "request_count": { "type": "integer" }, "rpm_ratio": { "type": "number" }, "status": { "type": "integer" }, "tpm_ratio": { "type": "number" }, "used_amount": { "type": "number" } } }, "controller.ImportChannelFromOneAPIRequest": { "type": "object", "properties": { "dsn": { "type": "string" } } }, "controller.OpenAIModelPermission": { "type": "object", "properties": { "allow_create_engine": { "type": "boolean" }, "allow_fine_tuning": { "type": "boolean" }, "allow_logprobs": { "type": "boolean" }, "allow_sampling": { "type": "boolean" }, "allow_search_indices": { "type": "boolean" }, "allow_view": { "type": "boolean" }, "created": { "type": "integer" }, "group": { "type": "string" }, "id": { "type": "string" }, "is_blocking": { "type": "boolean" }, "object": { "type": "string" }, "organization": { "type": "string" } } }, "controller.OpenAIModels": { "type": "object", "properties": { "created": { "type": "integer" }, "id": { "type": "string" }, "object": { "type": "string" }, "owned_by": { "type": "string" }, "parent": { "type": "string" }, "permission": { "type": "array", "items": { "$ref": "#/definitions/controller.OpenAIModelPermission" } }, "root": { "type": "string" } } }, "controller.SaveGroupModelConfigRequest": { "type": "object", "properties": { "image_prices": { "type": "object", "additionalProperties": { "type": "number" } }, "model": { "type": "string" }, "override_limit": { "type": "boolean" }, "override_price": { "type": "boolean" }, "price": { "$ref": "#/definitions/model.Price" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" } } }, "controller.SaveModelConfigsRequest": { "type": "object", "properties": { "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "exclude_from_tests": { "type": "boolean" }, "image_prices": { "type": "object", "additionalProperties": { "type": "number" } }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "price": { "$ref": "#/definitions/model.Price" }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "controller.StatusData": { "type": "object", "properties": { "startTime": { "type": "integer" } } }, "controller.TestResult": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ChannelTest" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "controller.TokenResponse": { "type": "object", "properties": { "accessed_at": { "type": "string" }, "created_at": { "type": "string" }, "expired_at": { "type": "string" }, "group": { "type": "string" }, "id": { "type": "integer" }, "key": { "type": "string" }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "quota": { "type": "number" }, "request_count": { "type": "integer" }, "status": { "type": "integer" }, "subnets": { "type": "array", "items": { "type": "string" } }, "used_amount": { "type": "number" } } }, "controller.UpdateChannelStatusRequest": { "type": "object", "properties": { "status": { "type": "integer" } } }, "controller.UpdateGroupRPMRatioRequest": { "type": "object", "properties": { "rpm_ratio": { "type": "number" } } }, "controller.UpdateGroupStatusRequest": { "type": "object", "properties": { "status": { "type": "integer" } } }, "controller.UpdateGroupTPMRatioRequest": { "type": "object", "properties": { "tpm_ratio": { "type": "number" } } }, "controller.UpdateGroupsStatusRequest": { "type": "object", "properties": { "groups": { "type": "array", "items": { "type": "string" } }, "status": { "type": "integer" } } }, "controller.UpdateTokenNameRequest": { "type": "object", "properties": { "name": { "type": "string" } } }, "controller.UpdateTokenStatusRequest": { "type": "object", "properties": { "status": { "type": "integer" } } }, "github_com_labring_aiproxy_core_model.Usage": { "type": "object", "properties": { "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "web_search_count": { "type": "integer" } } }, "github_com_labring_aiproxy_core_relay_model.Usage": { "type": "object", "properties": { "completion_tokens": { "type": "integer" }, "completion_tokens_details": { "$ref": "#/definitions/model.CompletionTokensDetails" }, "prompt_tokens": { "type": "integer" }, "prompt_tokens_details": { "$ref": "#/definitions/model.PromptTokensDetails" }, "total_tokens": { "type": "integer" }, "web_search_count": { "type": "integer" } } }, "middleware.APIResponse": { "type": "object", "properties": { "data": {}, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "mode.Mode": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ], "x-enum-varnames": [ "Unknown", "ChatCompletions", "Completions", "Embeddings", "Moderations", "ImagesGenerations", "Edits", "AudioSpeech", "AudioTranscription", "AudioTranslation", "Rerank", "ParsePdf", "Anthropic" ] }, "model.AnthropicMessageRequest": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/definitions/model.Message" } }, "model": { "type": "string" } } }, "model.Audio": { "type": "object", "properties": { "format": { "type": "string" }, "voice": { "type": "string" } } }, "model.Channel": { "type": "object", "properties": { "balance": { "type": "number" }, "balance_threshold": { "type": "number" }, "balance_updated_at": { "type": "string" }, "base_url": { "type": "string" }, "channel_tests": { "type": "array", "items": { "$ref": "#/definitions/model.ChannelTest" } }, "config": { "$ref": "#/definitions/model.ChannelConfig" }, "created_at": { "type": "string" }, "enabled_auto_balance_check": { "type": "boolean" }, "id": { "type": "integer" }, "key": { "type": "string" }, "last_test_error_at": { "type": "string" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "request_count": { "type": "integer" }, "sets": { "type": "array", "items": { "type": "string" } }, "status": { "type": "integer" }, "type": { "type": "integer" }, "used_amount": { "type": "number" } } }, "model.ChannelConfig": { "type": "object", "properties": { "split_think": { "type": "boolean" } } }, "model.ChannelTest": { "type": "object", "properties": { "actual_model": { "type": "string" }, "channel_id": { "type": "integer" }, "channel_name": { "type": "string" }, "channel_type": { "type": "integer" }, "code": { "type": "integer" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model": { "type": "string" }, "response": { "type": "string" }, "success": { "type": "boolean" }, "test_at": { "type": "string" }, "took": { "type": "number" } } }, "model.ChartData": { "type": "object", "properties": { "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "exception_count": { "type": "integer" }, "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "timestamp": { "type": "integer" }, "total_tokens": { "type": "integer" }, "used_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.CompletionTokensDetails": { "type": "object", "properties": { "accepted_prediction_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "rejected_prediction_tokens": { "type": "integer" } } }, "model.DashboardResponse": { "type": "object", "properties": { "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "integer" } }, "chart_data": { "type": "array", "items": { "$ref": "#/definitions/model.ChartData" } }, "exception_count": { "type": "integer" }, "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "rpm": { "type": "integer" }, "total_count": { "type": "integer" }, "total_tokens": { "type": "integer" }, "tpm": { "type": "integer" }, "used_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.Document": { "type": "object", "properties": { "text": { "type": "string" } } }, "model.EmbeddingRequest": { "type": "object", "properties": { "dimensions": { "type": "integer" }, "encoding_format": { "type": "string" }, "input": { "type": "string" }, "model": { "type": "string" } } }, "model.EmbeddingResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.EmbeddingResponseItem" } }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/definitions/github_com_labring_aiproxy_core_relay_model.Usage" } } }, "model.EmbeddingResponseItem": { "type": "object", "properties": { "embedding": { "type": "array", "items": { "type": "number" } }, "index": { "type": "integer" }, "object": { "type": "string" } } }, "model.FinishReason": { "type": "string", "enum": [ "stop", "length", "content_filter", "tool_calls", "function_call" ], "x-enum-varnames": [ "FinishReasonStop", "FinishReasonLength", "FinishReasonContentFilter", "FinishReasonToolCalls", "FinishReasonFunctionCall" ] }, "model.Function": { "type": "object", "properties": { "arguments": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "parameters": {} } }, "model.GeneralOpenAIRequest": { "type": "object", "properties": { "audio": { "$ref": "#/definitions/model.Audio" }, "dimensions": { "type": "integer" }, "encoding_format": { "type": "string" }, "frequency_penalty": { "type": "number" }, "function_call": {}, "functions": {}, "input": {}, "instruction": { "type": "string" }, "logit_bias": {}, "logprobs": { "type": "boolean" }, "max_completion_tokens": { "type": "integer" }, "max_tokens": { "type": "integer" }, "messages": { "type": "array", "items": { "$ref": "#/definitions/model.Message" } }, "metadata": {}, "modalities": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" }, "n": { "type": "integer" }, "num_ctx": { "type": "integer" }, "parallel_tool_calls": { "type": "boolean" }, "prediction": {}, "presence_penalty": { "type": "number" }, "prompt": {}, "quality": { "type": "string" }, "response_format": { "$ref": "#/definitions/model.ResponseFormat" }, "seed": { "type": "number" }, "service_tier": { "type": "string" }, "size": { "type": "string" }, "stop": {}, "store": { "type": "boolean" }, "stream": { "type": "boolean" }, "stream_options": { "$ref": "#/definitions/model.StreamOptions" }, "style": { "type": "string" }, "temperature": { "type": "number" }, "tool_choice": {}, "tools": { "type": "array", "items": { "$ref": "#/definitions/model.Tool" } }, "top_k": { "type": "integer" }, "top_logprobs": { "type": "integer" }, "top_p": { "type": "number" }, "user": { "type": "string" } } }, "model.GetGroupLogsResult": { "type": "object", "properties": { "channels": { "type": "array", "items": { "type": "integer" } }, "logs": { "type": "array", "items": { "$ref": "#/definitions/model.Log" } }, "models": { "type": "array", "items": { "type": "string" } }, "token_names": { "type": "array", "items": { "type": "string" } }, "total": { "type": "integer" } } }, "model.GetLogsResult": { "type": "object", "properties": { "channels": { "type": "array", "items": { "type": "integer" } }, "logs": { "type": "array", "items": { "$ref": "#/definitions/model.Log" } }, "total": { "type": "integer" } } }, "model.Group": { "type": "object", "properties": { "available_sets": { "type": "array", "items": { "type": "string" } }, "balance_alert_enabled": { "type": "boolean" }, "balance_alert_threshold": { "type": "number" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "request_count": { "type": "integer" }, "rpm_ratio": { "type": "number" }, "status": { "type": "integer" }, "tpm_ratio": { "type": "number" }, "used_amount": { "type": "number" } } }, "model.GroupDashboardResponse": { "type": "object", "properties": { "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "integer" } }, "chart_data": { "type": "array", "items": { "$ref": "#/definitions/model.ChartData" } }, "exception_count": { "type": "integer" }, "input_tokens": { "type": "integer" }, "models": { "type": "array", "items": { "type": "string" } }, "output_tokens": { "type": "integer" }, "rpm": { "type": "integer" }, "token_names": { "type": "array", "items": { "type": "string" } }, "total_count": { "type": "integer" }, "total_tokens": { "type": "integer" }, "tpm": { "type": "integer" }, "used_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.GroupMCP": { "type": "object", "properties": { "created_at": { "type": "string" }, "group_id": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "proxy_config": { "$ref": "#/definitions/model.GroupMCPProxyConfig" }, "type": { "$ref": "#/definitions/model.GroupMCPType" }, "update_at": { "type": "string" } } }, "model.GroupMCPProxyConfig": { "type": "object", "properties": { "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "querys": { "type": "object", "additionalProperties": { "type": "string" } }, "url": { "type": "string" } } }, "model.GroupMCPType": { "type": "string", "enum": [ "mcp_proxy_sse", "mcp_proxy_streamable", "mcp_openapi" ], "x-enum-varnames": [ "GroupMCPTypeProxySSE", "GroupMCPTypeProxyStreamable", "GroupMCPTypeOpenAPI" ] }, "model.GroupModelConfig": { "type": "object", "properties": { "group_id": { "type": "string" }, "image_prices": { "type": "object", "additionalProperties": { "type": "number" } }, "model": { "type": "string" }, "override_limit": { "type": "boolean" }, "override_price": { "type": "boolean" }, "override_retry_times": { "type": "boolean" }, "price": { "$ref": "#/definitions/model.Price" }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" } } }, "model.ImageData": { "type": "object", "properties": { "b64_json": { "type": "string" }, "revised_prompt": { "type": "string" }, "url": { "type": "string" } } }, "model.ImageRequest": { "type": "object", "properties": { "model": { "type": "string" }, "n": { "type": "integer" }, "prompt": { "type": "string" }, "quality": { "type": "string" }, "response_format": { "type": "string" }, "size": { "type": "string" }, "style": { "type": "string" }, "user": { "type": "string" } } }, "model.ImageResponse": { "type": "object", "properties": { "created": { "type": "integer" }, "data": { "type": "array", "items": { "$ref": "#/definitions/model.ImageData" } } } }, "model.JSONSchema": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "schema": { "type": "object", "additionalProperties": true }, "strict": { "type": "boolean" } } }, "model.Log": { "type": "object", "properties": { "channel": { "type": "integer" }, "code": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "downstream_result": { "type": "boolean" }, "endpoint": { "type": "string" }, "group": { "type": "string" }, "id": { "type": "integer" }, "ip": { "type": "string" }, "mode": { "type": "integer" }, "model": { "type": "string" }, "price": { "$ref": "#/definitions/model.Price" }, "request_at": { "type": "string" }, "request_detail": { "$ref": "#/definitions/model.RequestDetail" }, "request_id": { "type": "string" }, "retry_at": { "type": "string" }, "retry_times": { "type": "integer" }, "token_id": { "type": "integer" }, "token_name": { "type": "string" }, "ttfb_milliseconds": { "type": "integer" }, "usage": { "$ref": "#/definitions/github_com_labring_aiproxy_core_model.Usage" }, "used_amount": { "type": "number" } } }, "model.MCPOpenAPIConfig": { "type": "object", "properties": { "authorization": { "type": "string" }, "openapi_content": { "type": "string" }, "openapi_spec": { "type": "string" }, "server_addr": { "type": "string" }, "v2": { "type": "boolean" } } }, "model.MCPPrice": { "type": "object", "properties": { "default_tools_call_price": { "type": "number" }, "tools_call_prices": { "type": "object", "additionalProperties": { "type": "number" } } } }, "model.Message": { "type": "object", "properties": { "content": {}, "name": { "type": "string" }, "reasoning_content": { "type": "string" }, "role": { "type": "string" }, "tool_call_id": { "type": "string" }, "tool_calls": { "type": "array", "items": { "$ref": "#/definitions/model.Tool" } } } }, "model.ModelConfig": { "type": "object", "properties": { "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "exclude_from_tests": { "type": "boolean" }, "image_prices": { "type": "object", "additionalProperties": { "type": "number" } }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "price": { "$ref": "#/definitions/model.Price" }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "model.ModelCostRank": { "type": "object", "properties": { "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "input_tokens": { "type": "integer" }, "model": { "type": "string" }, "output_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "total_tokens": { "type": "integer" }, "used_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.ModelOwner": { "type": "string", "enum": [ "openai", "alibaba", "tencent", "xunfei", "deepseek", "moonshot", "minimax", "baidu", "google", "baai", "funaudiollm", "doubao", "fishaudio", "chatglm", "stabilityai", "netease", "ai360", "anthropic", "meta", "baichuan", "mistral", "openchat", "microsoft", "defog", "nexusflow", "cohere", "huggingface", "lingyiwanwu", "stepfun", "xai", "doc2x", "jina" ], "x-enum-varnames": [ "ModelOwnerOpenAI", "ModelOwnerAlibaba", "ModelOwnerTencent", "ModelOwnerXunfei", "ModelOwnerDeepSeek", "ModelOwnerMoonshot", "ModelOwnerMiniMax", "ModelOwnerBaidu", "ModelOwnerGoogle", "ModelOwnerBAAI", "ModelOwnerFunAudioLLM", "ModelOwnerDoubao", "ModelOwnerFishAudio", "ModelOwnerChatGLM", "ModelOwnerStabilityAI", "ModelOwnerNetease", "ModelOwnerAI360", "ModelOwnerAnthropic", "ModelOwnerMeta", "ModelOwnerBaichuan", "ModelOwnerMistral", "ModelOwnerOpenChat", "ModelOwnerMicrosoft", "ModelOwnerDefog", "ModelOwnerNexusFlow", "ModelOwnerCohere", "ModelOwnerHuggingFace", "ModelOwnerLingyiWanwu", "ModelOwnerStepFun", "ModelOwnerXAI", "ModelOwnerDoc2x", "ModelOwnerJina" ] }, "model.Option": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "model.ParamType": { "type": "string", "enum": [ "header", "query" ], "x-enum-varnames": [ "ParamTypeHeader", "ParamTypeQuery" ] }, "model.ParsePdfResponse": { "type": "object", "properties": { "markdown": { "type": "string" }, "pages": { "type": "integer" } } }, "model.Price": { "type": "object", "properties": { "cache_creation_price": { "type": "number" }, "cache_creation_price_unit": { "type": "integer" }, "cached_price": { "type": "number" }, "cached_price_unit": { "type": "integer" }, "input_price": { "type": "number" }, "input_price_unit": { "type": "integer" }, "output_price": { "type": "number" }, "output_price_unit": { "type": "integer" }, "per_request_price": { "type": "number" }, "web_search_price": { "type": "number" }, "web_search_price_unit": { "type": "integer" } } }, "model.PromptTokensDetails": { "type": "object", "properties": { "audio_tokens": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" } } }, "model.PublicMCP": { "type": "object", "properties": { "author": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "string" }, "logo_url": { "type": "string" }, "name": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "price": { "$ref": "#/definitions/model.MCPPrice" }, "proxy_config": { "$ref": "#/definitions/model.PublicMCPProxyConfig" }, "readme": { "type": "string" }, "readme_url": { "type": "string" }, "repo_url": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "type": { "$ref": "#/definitions/model.PublicMCPType" }, "update_at": { "type": "string" } } }, "model.PublicMCPProxyConfig": { "type": "object", "properties": { "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "querys": { "type": "object", "additionalProperties": { "type": "string" } }, "reusing_params": { "type": "object", "additionalProperties": { "$ref": "#/definitions/model.ReusingParam" } }, "url": { "type": "string" } } }, "model.PublicMCPReusingParam": { "type": "object", "properties": { "created_at": { "type": "string" }, "group_id": { "type": "string" }, "mcp_id": { "type": "string" }, "reusing_params": { "type": "object", "additionalProperties": { "type": "string" } }, "update_at": { "type": "string" } } }, "model.PublicMCPType": { "type": "string", "enum": [ "mcp_proxy_sse", "mcp_proxy_streamable", "mcp_git_repo", "mcp_openapi" ], "x-enum-comments": { "PublicMCPTypeGitRepo": "read only" }, "x-enum-varnames": [ "PublicMCPTypeProxySSE", "PublicMCPTypeProxyStreamable", "PublicMCPTypeGitRepo", "PublicMCPTypeOpenAPI" ] }, "model.RequestDetail": { "type": "object", "properties": { "id": { "type": "integer" }, "log_id": { "type": "integer" }, "request_body": { "type": "string" }, "request_body_truncated": { "type": "boolean" }, "response_body": { "type": "string" }, "response_body_truncated": { "type": "boolean" } } }, "model.RerankMeta": { "type": "object", "properties": { "model": { "type": "string" }, "tokens": { "$ref": "#/definitions/model.RerankMetaTokens" } } }, "model.RerankMetaTokens": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" } } }, "model.RerankRequest": { "type": "object", "properties": { "documents": { "type": "array", "items": { "type": "string" } }, "max_chunks_per_doc": { "type": "integer" }, "model": { "type": "string" }, "overlap_tokens": { "type": "integer" }, "query": { "type": "string" }, "return_documents": { "type": "boolean" }, "top_n": { "type": "integer" } } }, "model.RerankResponse": { "type": "object", "properties": { "id": { "type": "string" }, "meta": { "$ref": "#/definitions/model.RerankMeta" }, "results": { "type": "array", "items": { "$ref": "#/definitions/model.RerankResult" } } } }, "model.RerankResult": { "type": "object", "properties": { "document": { "$ref": "#/definitions/model.Document" }, "index": { "type": "integer" }, "relevance_score": { "type": "number" } } }, "model.ResponseFormat": { "type": "object", "properties": { "json_schema": { "$ref": "#/definitions/model.JSONSchema" }, "type": { "type": "string" } } }, "model.ReusingParam": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "required": { "type": "boolean" }, "type": { "$ref": "#/definitions/model.ParamType" } } }, "model.StreamOptions": { "type": "object", "properties": { "include_usage": { "type": "boolean" } } }, "model.SttJSONResponse": { "type": "object", "properties": { "text": { "type": "string" } } }, "model.TextResponse": { "type": "object", "properties": { "choices": { "type": "array", "items": { "$ref": "#/definitions/model.TextResponseChoice" } }, "created": { "type": "integer" }, "id": { "type": "string" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "$ref": "#/definitions/github_com_labring_aiproxy_core_relay_model.Usage" } } }, "model.TextResponseChoice": { "type": "object", "properties": { "finish_reason": { "$ref": "#/definitions/model.FinishReason" }, "index": { "type": "integer" }, "message": { "$ref": "#/definitions/model.Message" }, "text": { "type": "string" } } }, "model.TextToSpeechRequest": { "type": "object", "required": [ "input", "model", "voice" ], "properties": { "input": { "type": "string" }, "model": { "type": "string" }, "response_format": { "type": "string" }, "speed": { "type": "number" }, "voice": { "type": "string" } } }, "model.Tool": { "type": "object", "properties": { "function": { "$ref": "#/definitions/model.Function" }, "id": { "type": "string" }, "type": { "type": "string" } } }, "openai.SubscriptionResponse": { "type": "object", "properties": { "access_until": { "type": "integer" }, "hard_limit_usd": { "type": "number" }, "has_payment_method": { "type": "boolean" }, "object": { "type": "string" }, "soft_limit_usd": { "type": "number" }, "system_hard_limit_usd": { "type": "number" } } }, "openai.UsageResponse": { "type": "object", "properties": { "object": { "type": "string" }, "total_usage": { "description": "DailyCosts []OpenAIUsageDailyCost ` + "`" + `json:\"daily_costs\"` + "`" + `", "type": "number" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0", Host: "", BasePath: "", Schemes: []string{}, Title: "AI Proxy Swagger API", Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }