{ "swagger": "2.0", "info": { "title": "AI Proxy Swagger API", "contact": {}, "version": "1.0" }, "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/test-preview": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test a single model in channel without saving to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Test channel preview (single model)", "parameters": [ { "description": "Channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestSingleModelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ChannelTest" } } } ] } } } } }, "/api/channel/test-preview-all": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test all models in channel without saving to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channel" ], "summary": "Test channel preview (all models)", "parameters": [ { "type": "boolean", "description": "Return success", "name": "return_success", "in": "query" }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "type": "boolean", "description": "Stream mode (SSE)", "name": "stream", "in": "query" }, { "description": "Channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.TestResult" } } } } ] } } } } }, "/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 only supplied fields. Omitted fields and null retain current values; empty strings, false, zero, empty arrays and empty objects explicitly replace values, subject to channel validation.", "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": "Optional channel fields to update", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateChannelRequest" } } ], "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}/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}/test": { "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}/update_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", "format": "float64" } } } ] } } } } }, "/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": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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/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/batch_info": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns id, name, remark, type, current status, and backup-only status for a batch of channel IDs, including soft-deleted channels", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Get basic info for multiple channels", "parameters": [ { "description": "Channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.ChannelBasicInfo" } } } } ] } } } } }, "/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 channel names, remarks, keys, URLs, models and sets with a keyword, combined with optional exact filters", "produces": [ "application/json" ], "tags": [ "channels" ], "summary": "Search channels", "parameters": [ { "type": "string", "description": "Search keyword, including remark content", "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": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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/adaptors.AdaptorMeta" } } } } ] } } } } }, "/api/channels/update_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/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": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardResponse" } } } ] } } } } }, "/api/dashboard/group_channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel usage statistics across groups, optionally filtered by group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get global group channel dashboard data", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "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": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model or *", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "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/controller.GroupModel" } } } } ] } } } } }, "/api/dashboardv2/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns model-specific metrics and usage data for the given channel", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model usage data for a specific channel", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.TimeSummaryDataV2" } } } } ] } } } } }, "/api/dashboardv2/group_channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel model usage time series across groups, optionally filtered by group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get global group channel time series data", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.TimeSummaryDataV2" } } } } ] } } } } }, "/api/dashboardv2/{group}": { "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 }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.TimeSummaryDataV2" } } } } ] } } } } }, "/api/dashboardv3/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns model-specific metrics and usage data for the given channel with detailed amount breakdown", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model usage data for a specific channel (V3 with detailed amounts)", "parameters": [ { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardV3Response" } } } ] } } } } }, "/api/dashboardv3/group_channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel dashboard V3 data across groups, optionally filtered by group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get global group channel dashboard V3 data", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardV3Response" } } } ] } } } } }, "/api/dashboardv3/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns model-specific metrics and usage data for the given group with detailed amount breakdown", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get model usage data for a specific group (V3 with detailed amounts)", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select (e.g., request_count,exception_count,cache_hit_count). Available: request_count,retry_count,exception_count,status4xx_count,status5xx_count,status400_count,status429_count,status500_count,cache_hit_count,input_tokens,image_input_tokens,audio_input_tokens,video_input_tokens,output_tokens,image_output_tokens,audio_output_tokens,cached_tokens,cache_creation_tokens,total_tokens,web_search_count,used_amount,total_time,total_ttfb. Groups: count,usage,time,all", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardV3Response" } } } ] } } } } }, "/api/embedmcp/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get embed mcp", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "embedmcp" ], "summary": "Get embed mcp", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.EmbedMCP" } } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Save embed mcp", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "embedmcp" ], "summary": "Save embed mcp", "parameters": [ { "description": "Save embed mcp request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.SaveEmbedMCPRequest" } } ], "responses": { "200": { "description": "OK" } } } }, "/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/model.UpdateGroupRequest" } } ], "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}/channel-dashboard": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel usage statistics for a specific group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get group channel dashboard data", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start second timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End second timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardResponse" } } } ] } } } } }, "/api/group/{group}/channel-dashboard/models": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel model configs backed by enabled group channels for the given group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get group channel dashboard models", "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/controller.GroupModel" } } } } ] } } } } }, "/api/group/{group}/channel-dashboardv2": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel model usage time series for a specific group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get group channel time series data", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.TimeSummaryDataV2" } } } } ] } } } } }, "/api/group/{group}/channel-dashboardv3": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel dashboard V3 data for a specific group", "produces": [ "application/json" ], "tags": [ "dashboard" ], "summary": "Get group channel dashboard V3 data", "parameters": [ { "type": "string", "description": "Group", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group channel ID", "name": "group_channel", "in": "query" }, { "type": "string", "description": "Model name", "name": "model", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "string", "description": "Time span type (minute, hour, day, month)", "name": "timespan", "in": "query" }, { "type": "string", "description": "Comma-separated list of fields to select", "name": "fields", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.DashboardV3Response" } } } ] } } } } }, "/api/group/{group}/channel-models/enabled": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group channel model configs grouped by set for a group", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get enabled group channel models", "parameters": [ { "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": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/model.ModelConfig" } } } } } ] } } } } }, "/api/group/{group}/channel-models/enabled/{set}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group channel model configs for a specific set", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get enabled group channel models by set", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Models set", "name": "set", "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}/channel/": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds a group channel to a specific group and atomically creates the group when it does not exist. Existing group configuration is preserved.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Add a group channel", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group channel information", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/channel/test-preview": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test a single model in a group channel without saving to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Test group channel preview", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "description": "Group channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestSingleGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannelTest" } } } ] } } } } }, "/api/group/{group}/channel/test-preview-all": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test all models in a group channel without saving to database", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Test group channel preview models", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "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 mode (SSE)", "name": "stream", "in": "query" }, { "description": "Group channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupChannelTestResult" } } } } ] } } } } }, "/api/group/{group}/channel/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a group channel in a specific group", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get a group channel by ID", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group 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.GroupChannel" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates a group channel by ID in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Update a group channel", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group channel ID", "name": "id", "in": "path", "required": true }, { "description": "Optional group channel fields to update", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannel" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a group channel by ID in a specific group", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Delete a group channel", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/channel/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a group channel by ID in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Update group channel status", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group 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/group/{group}/channel/{id}/test": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests all models in the group channel", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Test group channel models", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group 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.GroupChannelTestResult" } } } } ] } } } } }, "/api/group/{group}/channel/{id}/test/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests a single model in the group channel", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Test group channel model", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group Channel ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannelTest" } } } ] } } } } }, "/api/group/{group}/channel/{id}/tests": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns persisted test results for a group channel", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get group channel test results", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Group Channel ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelTest" } } } } ] } } } } }, "/api/group/{group}/channels/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of group channels for a specific group", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get group channels with pagination", "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": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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.GroupChannel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds group channels to a specific group and atomically creates the group when it does not exist. Existing group configuration is preserved.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Add multiple group channels", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group channel information", "name": "channels", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.AddGroupChannelRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/channels/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes group channels by IDs in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Delete multiple group channels", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/channels/batch_info": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns id, group, name, and type for a batch of group channel IDs filtered by group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Get basic info for multiple group channels in a group", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Group channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelBasicInfo" } } } } ] } } } } }, "/api/group/{group}/channels/import/oneapi": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Imports group channels from OneAPI into a group and atomically creates the group when it does not exist. Existing group configuration is preserved.", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Import group channel from OneAPI", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "Import group 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/group/{group}/channels/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search group channels for a specific group with keyword and optional filters", "produces": [ "application/json" ], "tags": [ "group-channel" ], "summary": "Search group channels", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Search 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": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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.GroupChannel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/group/{group}/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/adaptors.AdaptorMeta" } } } } ] } } } } }, "/api/group/{group}/mcp/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get MCPs by group", "produces": [ "application/json" ], "tags": [ "mcp", "group" ], "summary": "Get MCPs by group", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Page", "name": "page", "in": "query" }, { "type": "integer", "description": "Per Page", "name": "per_page", "in": "query" }, { "type": "string", "description": "MCP ID", "name": "id", "in": "query" }, { "type": "string", "description": "hosted or local", "name": "type", "in": "query" }, { "type": "string", "description": "Keyword", "name": "keyword", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupPublicMCPResponse" } } } } ] } } } } }, "/api/group/{group}/mcp/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a specific MCP by its ID", "produces": [ "application/json" ], "tags": [ "mcp", "group" ], "summary": "Get MCP by ID", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "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/controller.GroupPublicMCPDetailResponse" } } } ] } } } } }, "/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}/scope_model_config/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a group-channel scope model config for a specific group", "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Get group scope 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.GroupScopeModelConfig" } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Saves a group-channel scope model config for a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Save group scope 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": "Model config", "name": "config", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.SaveGroupScopeModelConfigsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a group-channel scope model config for a specific group", "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Delete group scope 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}/scope_model_configs/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel scope model configs with pagination for a specific group", "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Get group scope model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "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.GroupScopeModelConfig" } }, "total": { "type": "integer" } } } ] } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Saves group-channel scope model configs for a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Save group scope model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "description": "Model configs", "name": "configs", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.SaveGroupScopeModelConfigsRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group/{group}/scope_model_configs/all": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns all group-channel scope model configs for a specific group", "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Get all group scope 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.GroupScopeModelConfig" } } } } ] } } } } }, "/api/group/{group}/scope_model_configs/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes group-channel scope model configs by model names for a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Delete group scope 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}/scope_model_configs/contains": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel scope model configs for the requested models in a specific group", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Get group scope model configs by models", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "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.GroupScopeModelConfig" } } } } ] } } } } }, "/api/group/{group}/scope_model_configs/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns group-channel scope model configs by keyword for a specific group", "produces": [ "application/json" ], "tags": [ "group-scope-modelconfig" ], "summary": "Search group scope model configs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "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.GroupScopeModelConfig" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/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/group_channel/": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds a group channel from the global management view and atomically creates the group when it does not exist. Existing group configuration is preserved. The request body must include group_id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Add a group channel", "parameters": [ { "description": "Group channel information", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.AddGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group_channel/test-preview": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test a single model in a group channel without saving to database from the global management view. The request body must include group_id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Test group channel preview", "parameters": [ { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "description": "Group channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestSingleGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannelTest" } } } ] } } } } }, "/api/group_channel/test-preview-all": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test all models in a group channel without saving to database from the global management view. The request body must include group_id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Test group channel preview models", "parameters": [ { "type": "boolean", "description": "Return success", "name": "return_success", "in": "query" }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" }, { "type": "boolean", "description": "Stream mode (SSE)", "name": "stream", "in": "query" }, { "description": "Group channel test request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.TestGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupChannelTestResult" } } } } ] } } } } }, "/api/group_channel/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns detailed information about a group channel across groups", "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Get a group channel by ID", "parameters": [ { "type": "integer", "description": "Group 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.GroupChannel" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates a group channel by ID from the global management view", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Update a group channel", "parameters": [ { "type": "integer", "description": "Group channel ID", "name": "id", "in": "path", "required": true }, { "description": "Optional group channel fields to update", "name": "channel", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupChannelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannel" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes a group channel by ID from the global management view", "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Delete a group channel", "parameters": [ { "type": "integer", "description": "Group channel ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group_channel/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Updates the status of a group channel by ID from the global management view", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Update group channel status", "parameters": [ { "type": "integer", "description": "Group 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/group_channel/{id}/test": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests all models in a group channel from the global management view", "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Test group channel models", "parameters": [ { "type": "integer", "description": "Group 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.GroupChannelTestResult" } } } } ] } } } } }, "/api/group_channel/{id}/test/{model}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Tests a single model in a group channel from the global management view", "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Test group channel model", "parameters": [ { "type": "integer", "description": "Group Channel ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Model name", "name": "model", "in": "path", "required": true }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannelTest" } } } ] } } } } }, "/api/group_channel/{id}/tests": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns persisted test results for a group channel from the global management view", "produces": [ "application/json" ], "tags": [ "group_channel" ], "summary": "Get group channel test results", "parameters": [ { "type": "integer", "description": "Group Channel ID", "name": "id", "in": "path", "required": true }, { "type": "boolean", "description": "Success body", "name": "success_body", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelTest" } } } } ] } } } } }, "/api/group_channels/": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a paginated list of group channels across groups with optional filters", "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Get group channels with pagination", "parameters": [ { "type": "string", "description": "Filter by group", "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": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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.GroupChannel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Adds group channels from the global management view and atomically creates missing groups. Existing group configuration is preserved. Each request item must include group_id.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Add multiple group channels", "parameters": [ { "description": "Group channel information", "name": "channels", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/controller.AddGroupChannelRequest" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group_channels/batch_delete": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes group channels by IDs from the global management view", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Delete multiple group channels", "parameters": [ { "description": "Group channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/group_channels/batch_info": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns id, group, name, and type for a batch of group channel IDs across groups", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Get basic info for multiple group channels", "parameters": [ { "description": "Group channel IDs", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "integer" } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelBasicInfo" } } } } ] } } } } }, "/api/group_channels/import/oneapi": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Imports group channels from OneAPI from the global management view and atomically creates the group when it does not exist. Existing group configuration is preserved. The request body must include group_id.", "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Import group channel from OneAPI", "parameters": [ { "description": "Import group 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/group_channels/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search group channels across groups with keyword and optional filters", "produces": [ "application/json" ], "tags": [ "group_channels" ], "summary": "Search group channels", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "type": "string", "description": "Search 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": "integer", "description": "Filter by id", "name": "id", "in": "query" }, { "type": "string", "description": "Filter by name", "name": "name", "in": "query" }, { "type": "string", "description": "Exact remark filter; empty matches channels without remarks", "name": "remark", "in": "query" }, { "type": "boolean", "description": "Filter backup-only channels; omit for all channels", "name": "backup_only", "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.GroupChannel" } }, "total": { "type": "integer" } } } ] } } } } ] } } } } }, "/api/group_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/adaptors.AdaptorMeta" } } } } ] } } } } }, "/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/consumption_ranking": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns channel, model, or group consumption ranking aggregated from summary data", "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Get consumption ranking", "parameters": [ { "type": "string", "default": "group", "description": "Ranking type: channel, model, group", "name": "type", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "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: used_amount_desc, used_amount_asc, request_count_desc, request_count_asc, total_tokens_desc, total_tokens_asc, channel_id_asc, channel_id_desc, model_asc, model_desc, group_id_asc, group_id_desc", "name": "order", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/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/ranking": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns channel, model, or group consumption ranking aggregated from summary data", "produces": [ "application/json" ], "tags": [ "groups" ], "summary": "Get consumption ranking", "parameters": [ { "type": "string", "default": "group", "description": "Ranking type: channel, model, group", "name": "type", "in": "query" }, { "type": "integer", "format": "int64", "description": "Start timestamp", "name": "start_timestamp", "in": "query" }, { "type": "integer", "format": "int64", "description": "End timestamp", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "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: used_amount_desc, used_amount_asc, request_count_desc, request_count_asc, total_tokens_desc, total_tokens_asc, channel_id_asc, channel_id_desc, model_asc, model_desc, group_id_asc, group_id_desc", "name": "order", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": true } } } ] } } } } }, "/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": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "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}/export": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Streams filtered group logs as a CSV table file", "produces": [ "text/csv" ], "tags": [ "log" ], "summary": "Export group logs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Start timestamp, max span 30 days", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp, max span 30 days", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Sort order for created_at, supports desc or asc", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail, default false", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "integer", "description": "Maximum exported rows; zero or negative means unlimited", "name": "max_entries", "in": "query" }, { "type": "boolean", "description": "Include channel column, default false", "name": "include_channel", "in": "query" }, { "type": "boolean", "description": "Include retry_at column, default false", "name": "include_retry_at", "in": "query" }, { "type": "string", "description": "Chunk interval, default 30m, min 10m, max 4h, e.g. 10m, 30m, 1h", "name": "chunk_interval", "in": "query" } ], "responses": {} } }, "/api/log/{group}/group_channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get group-channel logs for a specific group", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group channel 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": "Group 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": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupChannelLogsResult" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes group-channel logs older than the specified retention period", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Delete historical group channel 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/log/{group}/group_channel/detail/{log_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get detailed information about a group channel log entry in a group", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Get group channel log detail for a group", "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}/group_channel/export": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Streams filtered group-channel logs as a CSV table file", "produces": [ "text/csv" ], "tags": [ "log" ], "summary": "Export group channel logs", "parameters": [ { "type": "string", "description": "Group name", "name": "group", "in": "path", "required": true }, { "type": "integer", "description": "Start timestamp, max span 30 days", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp, max span 30 days", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Group channel ID", "name": "channel", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Sort order for created_at, supports desc or asc", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail, default false", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "integer", "description": "Maximum exported rows; zero or negative means unlimited", "name": "max_entries", "in": "query" }, { "type": "boolean", "description": "Include retry_at column, default false", "name": "include_retry_at", "in": "query" }, { "type": "string", "description": "Chunk interval, default 30m, min 10m, max 4h, e.g. 10m, 30m, 1h", "name": "chunk_interval", "in": "query" } ], "responses": {} } }, "/api/log/{group}/group_channel/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search group-channel logs for a specific group", "produces": [ "application/json" ], "tags": [ "log" ], "summary": "Search group channel logs", "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": "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 token id", "name": "token_id", "in": "query" }, { "type": "integer", "description": "Filter by group channel", "name": "channel", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupChannelLogsResult" } } } ] } } } } }, "/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" }, { "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 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": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupLogsResult" } } } ] } } } } }, "/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": "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": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "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/export": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Streams filtered global logs as a CSV table file", "produces": [ "text/csv" ], "tags": [ "logs" ], "summary": "Export global logs", "parameters": [ { "type": "integer", "description": "Start timestamp, max span 30 days", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp, max span 30 days", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Channel ID", "name": "channel", "in": "query" }, { "type": "string", "description": "Sort order for created_at, supports desc or asc", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail, default false", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "integer", "description": "Maximum exported rows; zero or negative means unlimited", "name": "max_entries", "in": "query" }, { "type": "string", "description": "Chunk interval, default 30m, min 10m, max 4h, e.g. 10m, 30m, 1h", "name": "chunk_interval", "in": "query" } ], "responses": {} } }, "/api/logs/group_channel": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get group-channel logs across groups with optional filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get global group channel logs", "parameters": [ { "type": "string", "description": "Filter by group", "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": "Group 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": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupChannelLogsResult" } } } ] } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Deletes group-channel logs older than the specified retention period, optionally filtered by group", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Delete historical group channel logs", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "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/group_channel/detail/{log_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get detailed information about a group channel log entry across groups", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Get global group channel 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/group_channel/export": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Streams filtered group-channel logs across groups as a CSV table file", "produces": [ "text/csv" ], "tags": [ "logs" ], "summary": "Export global group channel logs", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "type": "integer", "description": "Start timestamp, max span 30 days", "name": "start_timestamp", "in": "query" }, { "type": "integer", "description": "End timestamp, max span 30 days", "name": "end_timestamp", "in": "query" }, { "type": "string", "description": "Model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Group channel ID", "name": "channel", "in": "query" }, { "type": "integer", "description": "Token ID", "name": "token_id", "in": "query" }, { "type": "string", "description": "Token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Sort order for created_at, supports desc or asc", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail, default false", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" }, { "type": "string", "description": "Timezone, default is Local", "name": "timezone", "in": "query" }, { "type": "integer", "description": "Maximum exported rows; zero or negative means unlimited", "name": "max_entries", "in": "query" }, { "type": "boolean", "description": "Include retry_at column, default false", "name": "include_retry_at", "in": "query" }, { "type": "string", "description": "Chunk interval, default 30m, min 10m, max 4h, e.g. 10m, 30m, 1h", "name": "chunk_interval", "in": "query" } ], "responses": {} } }, "/api/logs/group_channel/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search group-channel logs across groups with optional filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Search global group channel logs", "parameters": [ { "type": "string", "description": "Filter by group", "name": "group", "in": "query" }, { "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": "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 token id", "name": "token_id", "in": "query" }, { "type": "integer", "description": "Filter by group channel", "name": "channel", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetGroupChannelLogsResult" } } } ] } } } } }, "/api/logs/search": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Search logs with various filters", "produces": [ "application/json" ], "tags": [ "logs" ], "summary": "Search logs", "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": "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 model name", "name": "model_name", "in": "query" }, { "type": "integer", "description": "Filter by channel", "name": "channel", "in": "query" }, { "type": "string", "description": "Group name", "name": "group", "in": "query", "required": true }, { "type": "integer", "description": "Filter by token id", "name": "token_id", "in": "query" }, { "type": "string", "description": "Filter by token name", "name": "token_name", "in": "query" }, { "type": "string", "description": "Order", "name": "order", "in": "query" }, { "type": "string", "description": "Request ID", "name": "request_id", "in": "query" }, { "type": "string", "description": "Upstream ID", "name": "upstream_id", "in": "query" }, { "type": "string", "description": "Status code type", "name": "code_type", "in": "query" }, { "type": "integer", "description": "Status code", "name": "code", "in": "query" }, { "type": "boolean", "description": "Include request and response detail", "name": "include_detail", "in": "query" }, { "type": "string", "description": "IP", "name": "ip", "in": "query" }, { "type": "string", "description": "User", "name": "user", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GetLogsResult" } } } ] } } } } }, "/api/mcp/group/all": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all Group MCPs with filtering", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get all Group MCPs", "parameters": [ { "type": "integer", "description": "MCP status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupMCPResponse" } } } } ] } } } } }, "/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 id", "name": "id", "in": "query" }, { "type": "string", "description": "MCP type, mcp_proxy_sse, mcp_proxy_streamable, mcp_openapi", "name": "type", "in": "query" }, { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query" }, { "type": "integer", "description": "MCP status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupMCPResponse" } } } } ] } } } }, "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/controller.GroupMCPResponse" } } } ] } } } } }, "/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/controller.GroupMCPResponse" } } } ] } } } }, "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/controller.GroupMCPResponse" } } } ] } } } }, "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/group/{group}/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update the status of a Group MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Update Group MCP status", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "description": "MCP status", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdateGroupMCPStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/public/": { "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": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.PublicMCPResponse" } } } ] } } } } }, "/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/controller.PublicMCPResponse" } } } ] } } } }, "put": { "security": [ { "ApiKeyAuth": [] } ], "description": "Save a MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Save 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": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.PublicMCPResponse" } } } ] } } } }, "post": { "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": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.PublicMCPResponse" } } } ] } } } }, "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/mcp/public/{id}/status": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Update the status of an MCP", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Update MCP status", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "description": "MCP status", "name": "status", "in": "body", "required": true, "schema": { "$ref": "#/definitions/controller.UpdatePublicMCPStatusRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/publics/": { "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": "hosted or local", "name": "type", "in": "query" }, { "type": "string", "description": "MCP id", "name": "id", "in": "query" }, { "type": "string", "description": "Search keyword", "name": "keyword", "in": "query" }, { "type": "integer", "description": "MCP status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.PublicMCPResponse" } } } } ] } } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Save a list of MCPs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Save MCPs", "parameters": [ { "description": "MCP object", "name": "mcp", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/model.PublicMCP" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/middleware.APIResponse" } } } } }, "/api/mcp/publics/all": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get all MCPs with filtering", "produces": [ "application/json" ], "tags": [ "mcp" ], "summary": "Get all MCPs", "parameters": [ { "type": "integer", "description": "MCP status", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/controller.PublicMCPResponse" } } } } ] } } } } }, "/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" } } } ] } } } }, "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" } } } }, "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/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": [ { "enum": [ 1, 3, 4, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ], "type": "integer", "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/models/enabled/{set}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of enabled models by set", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get enabled models by set", "parameters": [ { "type": "string", "description": "Models set", "name": "set", "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/models/sets": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns a list of enabled models and channels sets", "produces": [ "application/json" ], "tags": [ "model" ], "summary": "Get enabled models and channels sets", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/controller.EnabledModelChannel" } } } } } } ] } } } } }, "/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", "format": "float64" } } } } } ] } } } }, "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", "format": "int64" } } } } } ] } } } } }, "/api/monitor/batch_group_token_metrics": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns runtime rpm/tpm summary metrics for explicit group and token-name pairs", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Batch get runtime metrics for api key rows", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.BatchGroupTokenMetricsResponse" } } } ] } } } } }, "/api/monitor/group_model_metrics/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns runtime rpm/tpm metrics grouped by model in a group", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get model runtime metrics for a group", "parameters": [ { "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/controller.GroupModelMetricsResponse" } } } ] } } } } }, "/api/monitor/group_summary_metrics": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns rpm/tpm summary metrics for one or more groups", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get summary metrics for multiple groups", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.GroupSummaryMetricsResponse" } } } ] } } } } }, "/api/monitor/group_token_metrics/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns runtime rpm/tpm metrics grouped by token name in a group", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get token runtime metrics for a group", "parameters": [ { "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/controller.GroupTokenMetricsResponse" } } } ] } } } } }, "/api/monitor/group_tokenname_model_metrics/{group}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns runtime rpm/tpm metrics for token name and model combinations in a group", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get token-model runtime metrics for a group", "parameters": [ { "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/controller.GroupTokennameModelMetricsResponse" } } } ] } } } } }, "/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", "format": "float64" } } } } ] } } } } }, "/api/monitor/runtime_metrics": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Returns runtime rpm/tpm/error metrics sourced from reqlimit and monitor", "produces": [ "application/json" ], "tags": [ "monitor" ], "summary": "Get runtime metrics for models and channels", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/middleware.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/controller.RuntimeMetricsResponse" } } } ] } } } } }, "/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", "format": "float64" } } } } } ] } } } }, "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/option/": { "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" } } } } ] } } } }, "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/option/batch": { "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/option/{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/test-embedmcp/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test Embed MCP Streamable Server with various HTTP methods", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "embedmcp" ], "summary": "Test Embed MCP Streamable Server", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Initial configuration parameters (e.g. config[host]=http://localhost:3000)", "name": "config[key]", "in": "query" }, { "type": "string", "description": "Reusing configuration parameters (e.g., reusing[authorization]=apikey)", "name": "reusing[key]", "in": "query" } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" } } }, "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test Embed MCP Streamable Server with various HTTP methods", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "embedmcp" ], "summary": "Test Embed MCP Streamable Server", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Initial configuration parameters (e.g. config[host]=http://localhost:3000)", "name": "config[key]", "in": "query" }, { "type": "string", "description": "Reusing configuration parameters (e.g., reusing[authorization]=apikey)", "name": "reusing[key]", "in": "query" } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test Embed MCP Streamable Server with various HTTP methods", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "embedmcp" ], "summary": "Test Embed MCP Streamable Server", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Initial configuration parameters (e.g. config[host]=http://localhost:3000)", "name": "config[key]", "in": "query" }, { "type": "string", "description": "Reusing configuration parameters (e.g., reusing[authorization]=apikey)", "name": "reusing[key]", "in": "query" } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" } } } }, "/api/test-embedmcp/{id}/sse": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Test Embed MCP SSE Server", "tags": [ "embedmcp" ], "summary": "Test Embed MCP SSE Server", "parameters": [ { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Initial configuration parameters (e.g. config[host]=http://localhost:3000)", "name": "config[key]", "in": "query" }, { "type": "string", "description": "Reusing configuration parameters (e.g. reusing[authorization]=apikey)", "name": "reusing[key]", "in": "query" } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" } } } }, "/api/test-publicmcp/{group}/{id}/sse": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Test Public MCP SSE Server", "parameters": [ { "type": "string", "description": "Group ID", "name": "group", "in": "path", "required": true }, { "type": "string", "description": "MCP ID", "name": "id", "in": "path", "required": true } ], "responses": {} } }, "/api/token/{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" } } } ] } } } } ] } } } }, "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/model.UpdateTokenRequest" } } ], "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/{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/model.UpdateTokenRequest" } } ], "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" } } } } }, "/api/v1/services/aigc/video-generation/video-synthesis": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create an Ali DashScope native video generation task.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Create Ali native video task", "parameters": [ { "description": "Ali DashScope video synthesis request", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } } } } }, "/api/v1/tasks/{task_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get an Ali DashScope native video generation task.", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get Ali native video task", "parameters": [ { "type": "string", "description": "Task ID", "name": "task_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } } } } }, "/api/v3/contents/generations/tasks": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a Doubao native video generation task.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Create Doubao native video task", "parameters": [ { "description": "Doubao video generation task request", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } } } } }, "/api/v3/contents/generations/tasks/{task_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a Doubao native video generation task.", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get Doubao native video task", "parameters": [ { "type": "string", "description": "Task ID", "name": "task_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete a Doubao native video generation task.", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Delete Doubao native video task", "parameters": [ { "type": "string", "description": "Task ID", "name": "task_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } }, "204": { "description": "No Content", "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" } } } } } }, "/mcp": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Host MCP Streamable Server", "responses": {} }, "post": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Host MCP Streamable Server", "responses": {} }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Host MCP Streamable Server", "responses": {} } }, "/mcp/group/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Group MCP Streamable Server", "responses": {} }, "post": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Group MCP Streamable Server", "responses": {} }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Group MCP Streamable Server", "responses": {} } }, "/mcp/group/{id}/sse": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Group MCP SSE Server", "responses": {} } }, "/mcp/public/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Public MCP Streamable Server", "responses": {} }, "post": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Public MCP Streamable Server", "responses": {} }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Public MCP Streamable Server", "responses": {} } }, "/mcp/public/{id}/sse": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Public MCP SSE Server", "responses": {} } }, "/message": { "post": { "summary": "MCP SSE Message", "responses": {} } }, "/sse": { "get": { "security": [ { "ApiKeyAuth": [] } ], "summary": "Public MCP SSE 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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/transcriptions": { "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/translations": { "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/quota": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get quota", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get quota", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/balance.GroupQuota" } } } } }, "/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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/edits": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "ImagesEdits", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "ImagesEdits", "parameters": [ { "type": "string", "description": "Prompt", "name": "prompt", "in": "formData", "required": true }, { "type": "string", "description": "Model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "Images", "name": "image", "in": "formData", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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/messages": { "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "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" } } } } } }, "/v1/responses": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new response", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Create response", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.CreateResponseRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Response" }, "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/responses/{response_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a response by ID", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get response", "parameters": [ { "type": "string", "description": "Response ID", "name": "response_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Response" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete a response by ID", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Delete response", "parameters": [ { "type": "string", "description": "Response ID", "name": "response_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "204": { "description": "No Content" } } } }, "/v1/responses/{response_id}/cancel": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Cancel a response by ID", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Cancel response", "parameters": [ { "type": "string", "description": "Response ID", "name": "response_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Response" } } } } }, "/v1/responses/{response_id}/input_items": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get input items for a response", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get response input items", "parameters": [ { "type": "string", "description": "Response ID", "name": "response_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.InputItemList" } } } } }, "/v1/video/generations/jobs": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "VideoGenerationsJobs", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "VideoGenerationsJobs", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideoGenerationJobRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.VideoGenerationJob" }, "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/video/generations/jobs/{id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "VideoGenerationsGetJobs", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "VideoGenerationsGetJobs", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideoGenerationJobRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.VideoGenerationJob" }, "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/video/generations/{id}/content/video": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "VideoGenerationsContent", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "VideoGenerationsContent", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideoGenerationJobRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "video 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/videos": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a video generation job", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Create video", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideosRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Video" }, "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/videos/edits": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new video by editing a source video", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Edit video", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideosEditRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Video" } } } } }, "/v1/videos/extensions": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create an extension of a completed video", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Extend video", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideosExtensionRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Video" } } } } }, "/v1/videos/{video_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a video by ID", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Get video", "parameters": [ { "type": "string", "description": "Video ID", "name": "video_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Video" } } } }, "delete": { "security": [ { "ApiKeyAuth": [] } ], "description": "Delete a video by ID", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Delete video", "parameters": [ { "type": "string", "description": "Video ID", "name": "video_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "204": { "description": "No Content" } } } }, "/v1/videos/{video_id}/content": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get generated video binary content", "produces": [ "application/octet-stream" ], "tags": [ "relay" ], "summary": "Get video content", "parameters": [ { "type": "string", "description": "Video ID", "name": "video_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "video binary", "schema": { "type": "file" } } } } }, "/v1/videos/{video_id}/remix": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Create a new video from an existing video", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Remix video", "parameters": [ { "type": "string", "description": "Video ID", "name": "video_id", "in": "path", "required": true }, { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.VideosRemixRequest" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.Video" } } } } }, "/{version}/models/{model}": { "post": { "security": [ { "ApiKeyAuth": [] } ], "description": "Gemini Native API", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Gemini Native API", "parameters": [ { "type": "string", "description": "API Version (v1 or v1beta)", "name": "version", "in": "path", "required": true }, { "type": "string", "description": "Model name with action (e.g., gemini-2.0-flash:generateContent)", "name": "model", "in": "path", "required": true }, { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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" } } } } } }, "/{version}/operations/{operation_id}": { "get": { "security": [ { "ApiKeyAuth": [] } ], "description": "Get a Gemini long-running operation, including Gemini video generation operations.", "produces": [ "application/json" ], "tags": [ "relay" ], "summary": "Gemini Operation API", "parameters": [ { "type": "string", "description": "API Version (v1 or v1beta)", "name": "version", "in": "path", "required": true }, { "type": "string", "description": "Operation ID", "name": "operation_id", "in": "path", "required": true }, { "type": "string", "description": "Optional Aiproxy-Channel header", "name": "Aiproxy-Channel", "in": "header" }, { "type": "string", "description": "Optional group ID for internal token requests", "name": "X-Aiproxy-Group", "in": "header" }, { "enum": [ "global", "own" ], "type": "string", "description": "Optional group channel mode for internal token requests. Values: global, own", "name": "X-Aiproxy-Group-Channel-Mode", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object" }, "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": { "adaptors.AdaptorMeta": { "type": "object", "properties": { "configSchema": { "type": "object", "additionalProperties": {} }, "defaultBaseUrl": { "type": "string" }, "keyHelp": { "type": "string" }, "name": { "type": "string" }, "readme": { "type": "string" } } }, "balance.GroupQuota": { "type": "object", "properties": { "remain": { "type": "number" }, "total": { "type": "number" } } }, "controller.AddChannelRequest": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "enabled_auto_balance_check": { "type": "boolean" }, "enabled_no_permission_ban": { "type": "boolean" }, "key": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "warn_error_rate": { "type": "number" } } }, "controller.AddGroupChannelRequest": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "enabled_no_permission_ban": { "type": "boolean" }, "group_id": { "type": "string" }, "key": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "warn_error_rate": { "type": "number" } } }, "controller.AddTokenRequest": { "type": "object", "properties": { "group_channel_models": { "type": "array", "items": { "type": "string" } }, "group_channel_sets": { "type": "array", "items": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "period_last_update_time": { "type": "integer" }, "period_quota": { "type": "number" }, "period_type": { "type": "string" }, "quota": { "type": "number" }, "scope": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "subnets": { "type": "array", "items": { "type": "string" } } } }, "controller.BatchGroupTokenMetricsItem": { "type": "object", "properties": { "group": { "type": "string" }, "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "token_name": { "type": "string" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.BatchGroupTokenMetricsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/controller.BatchGroupTokenMetricsItem" } } } }, "controller.BuiltinModelConfig": { "type": "object", "properties": { "allowed_resolutions": { "type": "array", "items": { "type": "string" } }, "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "disable_resolution_fuzzy_match": { "type": "boolean" }, "exclude_from_tests": { "type": "boolean" }, "force_save_detail": { "type": "boolean" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "plugin": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": {} } }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "description": "Seconds; nil inherits the global budget, zero disables it.", "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "controller.CreateGroupRequest": { "type": "object", "properties": { "available_sets": { "type": "array", "items": { "type": "string" } }, "balance_alert_enabled": { "type": "boolean" }, "balance_alert_threshold": { "type": "number" }, "rpm_ratio": { "type": "number" }, "tpm_ratio": { "type": "number" } } }, "controller.EmbedMCP": { "type": "object", "properties": { "config_templates": { "$ref": "#/definitions/controller.EmbedMCPConfigTemplates" }, "embed_config": { "$ref": "#/definitions/model.MCPEmbeddingConfig" }, "enabled": { "type": "boolean" }, "github_url": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "name_cn": { "type": "string" }, "readme": { "type": "string" }, "readme_cn": { "type": "string" }, "readme_cn_url": { "type": "string" }, "readme_url": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "controller.EmbedMCPConfigTemplate": { "type": "object", "properties": { "description": { "type": "string" }, "example": { "type": "string" }, "name": { "type": "string" }, "required": { "type": "boolean" } } }, "controller.EmbedMCPConfigTemplates": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.EmbedMCPConfigTemplate" } }, "controller.EnabledModelChannel": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "id": { "type": "integer" }, "name": { "type": "string" }, "priority": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "weight": { "description": "权重百分比 (0-100)", "type": "number" } } }, "controller.GetModelConfigsByModelsContainsRequest": { "type": "object", "properties": { "models": { "type": "array", "items": { "type": "string" } } } }, "controller.GroupChannelTestResult": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.GroupChannelTest" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "controller.GroupMCPResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "endpoints": { "$ref": "#/definitions/controller.MCPEndpoint" }, "group_id": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "proxy_config": { "$ref": "#/definitions/model.GroupMCPProxyConfig" }, "status": { "$ref": "#/definitions/model.GroupMCPStatus" }, "type": { "$ref": "#/definitions/model.GroupMCPType" }, "update_at": { "type": "string" } } }, "controller.GroupModel": { "type": "object", "properties": { "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "integer" }, "enabled_plugins": { "type": "array", "items": { "type": "string" } }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "price": { "$ref": "#/definitions/model.Price" }, "rpm": { "type": "integer" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "integer" } } }, "controller.GroupModelMetricsResponse": { "type": "object", "properties": { "models": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeRateMetric" } } } }, "controller.GroupPublicMCPDetailResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "description_cn": { "type": "string" }, "embed_config": { "$ref": "#/definitions/model.MCPEmbeddingConfig" }, "endpoints": { "$ref": "#/definitions/controller.MCPEndpoint" }, "github_url": { "type": "string" }, "hosted": { "type": "boolean" }, "id": { "type": "string" }, "logo_url": { "type": "string" }, "name": { "type": "string" }, "name_cn": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "params": { "type": "object", "additionalProperties": { "type": "string" } }, "price": { "$ref": "#/definitions/model.MCPPrice" }, "proxy_config": { "$ref": "#/definitions/model.PublicMCPProxyConfig" }, "readme": { "type": "string" }, "readme_cn": { "type": "string" }, "readme_cn_url": { "type": "string" }, "readme_url": { "type": "string" }, "reusing": { "type": "object", "additionalProperties": { "$ref": "#/definitions/model.ReusingParam" } }, "status": { "$ref": "#/definitions/model.PublicMCPStatus" }, "tags": { "type": "array", "items": { "type": "string" } }, "test_config": { "description": "only used by list tools", "allOf": [ { "$ref": "#/definitions/model.TestConfig" } ] }, "tools": { "type": "array", "items": { "$ref": "#/definitions/mcp.Tool" } }, "type": { "$ref": "#/definitions/model.PublicMCPType" }, "update_at": { "type": "string" } } }, "controller.GroupPublicMCPResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "description_cn": { "type": "string" }, "embed_config": { "$ref": "#/definitions/model.MCPEmbeddingConfig" }, "github_url": { "type": "string" }, "hosted": { "type": "boolean" }, "id": { "type": "string" }, "logo_url": { "type": "string" }, "name": { "type": "string" }, "name_cn": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "price": { "$ref": "#/definitions/model.MCPPrice" }, "proxy_config": { "$ref": "#/definitions/model.PublicMCPProxyConfig" }, "readme": { "type": "string" }, "readme_cn": { "type": "string" }, "readme_cn_url": { "type": "string" }, "readme_url": { "type": "string" }, "status": { "$ref": "#/definitions/model.PublicMCPStatus" }, "tags": { "type": "array", "items": { "type": "string" } }, "test_config": { "description": "only used by list tools", "allOf": [ { "$ref": "#/definitions/model.TestConfig" } ] }, "type": { "$ref": "#/definitions/model.PublicMCPType" }, "update_at": { "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" }, "group_channel_request_count": { "type": "integer" }, "group_channel_used_amount": { "type": "number" }, "id": { "type": "string" }, "request_count": { "type": "integer" }, "rpm_ratio": { "type": "number" }, "status": { "type": "integer" }, "tpm_ratio": { "type": "number" }, "used_amount": { "type": "number" } } }, "controller.GroupSummaryMetricsResponse": { "type": "object", "properties": { "groups": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeRateMetric" } } } }, "controller.GroupTokenMetricsResponse": { "type": "object", "properties": { "tokens": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeRateMetric" } } } }, "controller.GroupTokennameModelMetricsItem": { "type": "object", "properties": { "group": { "type": "string" }, "model": { "type": "string" }, "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "token_name": { "type": "string" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.GroupTokennameModelMetricsResponse": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/controller.GroupTokennameModelMetricsItem" } } } }, "controller.ImportChannelFromOneAPIRequest": { "type": "object", "properties": { "dsn": { "type": "string" }, "group_id": { "type": "string" } } }, "controller.MCPEndpoint": { "type": "object", "properties": { "host": { "type": "string" }, "sse": { "type": "string" }, "streamable_http": { "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.PublicMCPResponse": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "description_cn": { "type": "string" }, "embed_config": { "$ref": "#/definitions/model.MCPEmbeddingConfig" }, "endpoints": { "$ref": "#/definitions/controller.MCPEndpoint" }, "github_url": { "type": "string" }, "id": { "type": "string" }, "logo_url": { "type": "string" }, "name": { "type": "string" }, "name_cn": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "price": { "$ref": "#/definitions/model.MCPPrice" }, "proxy_config": { "$ref": "#/definitions/model.PublicMCPProxyConfig" }, "readme": { "type": "string" }, "readme_cn": { "type": "string" }, "readme_cn_url": { "type": "string" }, "readme_url": { "type": "string" }, "status": { "$ref": "#/definitions/model.PublicMCPStatus" }, "tags": { "type": "array", "items": { "type": "string" } }, "test_config": { "description": "only used by list tools", "allOf": [ { "$ref": "#/definitions/model.TestConfig" } ] }, "type": { "$ref": "#/definitions/model.PublicMCPType" }, "update_at": { "type": "string" } } }, "controller.RuntimeChannelMetric": { "type": "object", "properties": { "banned_models": { "type": "integer" }, "error_rate": { "type": "number" }, "errors": { "type": "integer" }, "models": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeModelMetric" } }, "requests": { "type": "integer" }, "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.RuntimeChannelModelMetric": { "type": "object", "properties": { "banned": { "type": "boolean" }, "error_rate": { "type": "number" }, "errors": { "type": "integer" }, "requests": { "type": "integer" }, "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.RuntimeMetricsResponse": { "type": "object", "properties": { "channel_models": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeChannelModelMetric" } } }, "channels": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeChannelMetric" } }, "models": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeModelMetric" } } } }, "controller.RuntimeModelMetric": { "type": "object", "properties": { "accessible_groups": { "type": "integer" }, "accessible_sets": { "type": "array", "items": { "type": "string" } }, "banned_channels": { "type": "integer" }, "channels": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.RuntimeChannelMetric" } }, "error_rate": { "type": "number" }, "errors": { "type": "integer" }, "requests": { "type": "integer" }, "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.RuntimeRateMetric": { "type": "object", "properties": { "rpm": { "type": "integer" }, "rps": { "type": "integer" }, "tpm": { "type": "integer" }, "tps": { "type": "integer" } } }, "controller.SaveEmbedMCPRequest": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "id": { "type": "string" }, "init_config": { "type": "object", "additionalProperties": { "type": "string" } } } }, "controller.SaveGroupModelConfigRequest": { "type": "object", "properties": { "force_save_detail": { "type": "boolean" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "override_force_save_detail": { "type": "boolean" }, "override_limit": { "type": "boolean" }, "override_max_image_generation_count": { "type": "boolean" }, "override_max_video_generation_count": { "type": "boolean" }, "override_max_video_generation_seconds": { "type": "boolean" }, "override_price": { "type": "boolean" }, "override_request_body_storage_max_size": { "type": "boolean" }, "override_response_body_storage_max_size": { "type": "boolean" }, "override_retry_budget": { "type": "boolean" }, "override_retry_times": { "type": "boolean" }, "override_summary_claude_long_context": { "type": "boolean" }, "override_summary_service_tier": { "type": "boolean" }, "override_timeout_config": { "type": "boolean" }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" } } }, "controller.SaveGroupScopeModelConfigsRequest": { "type": "object", "properties": { "allowed_resolutions": { "type": "array", "items": { "type": "string" } }, "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "disable_resolution_fuzzy_match": { "type": "boolean" }, "exclude_from_tests": { "type": "boolean" }, "force_save_detail": { "type": "boolean" }, "group_id": { "type": "string" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "plugin": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": {} } }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "description": "Seconds; nil inherits the global budget, zero disables it.", "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "controller.SaveModelConfigsRequest": { "type": "object", "properties": { "allowed_resolutions": { "type": "array", "items": { "type": "string" } }, "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "disable_resolution_fuzzy_match": { "type": "boolean" }, "exclude_from_tests": { "type": "boolean" }, "force_save_detail": { "type": "boolean" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "plugin": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": {} } }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "description": "Seconds; nil inherits the global budget, zero disables it.", "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "controller.StatusData": { "type": "object", "properties": { "startTime": { "type": "integer" } } }, "controller.TestChannelRequest": { "type": "object", "required": [ "key", "type" ], "properties": { "base_url": { "type": "string" }, "configs": { "type": "object", "additionalProperties": {} }, "key": { "type": "string" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "model_overrides": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.TestModelOverride" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "proxy_url": { "type": "string" }, "request_body": { "type": "array", "items": { "type": "integer" } }, "skip_tls_verify": { "type": "boolean" }, "type": { "type": "integer" } } }, "controller.TestGroupChannelRequest": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "enabled_no_permission_ban": { "type": "boolean" }, "group_id": { "type": "string" }, "key": { "type": "string" }, "max_error_rate": { "type": "number" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "model_overrides": { "type": "object", "additionalProperties": { "$ref": "#/definitions/controller.TestModelOverride" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "request_body": { "type": "array", "items": { "type": "integer" } }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "warn_error_rate": { "type": "number" } } }, "controller.TestModelOverride": { "type": "object", "properties": { "mode": { "$ref": "#/definitions/mode.Mode" }, "request_body": { "type": "array", "items": { "type": "integer" } } } }, "controller.TestResult": { "type": "object", "properties": { "data": { "$ref": "#/definitions/model.ChannelTest" }, "message": { "type": "string" }, "success": { "type": "boolean" } } }, "controller.TestSingleGroupChannelRequest": { "type": "object", "required": [ "key", "model", "type" ], "properties": { "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "group_id": { "type": "string" }, "key": { "type": "string" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model": { "type": "string" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "proxy_url": { "type": "string" }, "request_body": { "type": "array", "items": { "type": "integer" } }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "type": { "type": "integer" } } }, "controller.TestSingleModelRequest": { "type": "object", "required": [ "key", "model", "type" ], "properties": { "base_url": { "type": "string" }, "configs": { "type": "object", "additionalProperties": {} }, "key": { "type": "string" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model": { "type": "string" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "proxy_url": { "type": "string" }, "request_body": { "type": "array", "items": { "type": "integer" } }, "skip_tls_verify": { "type": "boolean" }, "type": { "type": "integer" } } }, "controller.TokenResponse": { "type": "object", "properties": { "accessed_at": { "type": "string" }, "created_at": { "type": "string" }, "group": { "type": "string" }, "group_channel_models": { "type": "array", "items": { "type": "string" } }, "group_channel_request_count": { "type": "integer" }, "group_channel_sets": { "type": "array", "items": { "type": "string" } }, "group_channel_used_amount": { "type": "number" }, "id": { "type": "integer" }, "key": { "type": "string" }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "period_last_update_amount": { "description": "Total usage at last period reset", "type": "number" }, "period_last_update_time": { "description": "Last time period was reset", "type": "string" }, "period_quota": { "type": "number" }, "period_type": { "description": "daily, weekly, monthly, default is monthly", "type": "string" }, "quota": { "type": "number" }, "request_count": { "type": "integer" }, "scope": { "$ref": "#/definitions/model.ChannelScope" }, "sets": { "type": "array", "items": { "type": "string" } }, "status": { "type": "integer" }, "subnets": { "type": "array", "items": { "type": "string" } }, "used_amount": { "type": "number" } } }, "controller.UpdateChannelRequest": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "balance_threshold": { "type": "number" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "enabled_auto_balance_check": { "type": "boolean" }, "enabled_no_permission_ban": { "type": "boolean" }, "key": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "warn_error_rate": { "type": "number" } } }, "controller.UpdateChannelStatusRequest": { "type": "object", "properties": { "status": { "type": "integer" } } }, "controller.UpdateGroupChannelRequest": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "enabled_no_permission_ban": { "type": "boolean" }, "key": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "warn_error_rate": { "type": "number" } } }, "controller.UpdateGroupMCPStatusRequest": { "type": "object", "properties": { "status": { "$ref": "#/definitions/model.GroupMCPStatus" } } }, "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.UpdatePublicMCPStatusRequest": { "type": "object", "properties": { "status": { "$ref": "#/definitions/model.PublicMCPStatus" } } }, "controller.UpdateTokenNameRequest": { "type": "object", "properties": { "name": { "type": "string" } } }, "controller.UpdateTokenStatusRequest": { "type": "object", "properties": { "status": { "type": "integer" } } }, "mcp.Icon": { "type": "object", "properties": { "mimeType": { "description": "Optional MIME type (e.g., \"image/png\", \"image/svg+xml\")", "type": "string" }, "sizes": { "description": "Optional size specifications (e.g., [\"48x48\"], [\"any\"] for SVG)", "type": "array", "items": { "type": "string" } }, "src": { "description": "URI pointing to the icon resource (HTTPS URL or data URI)", "type": "string" }, "theme": { "description": "Theme is an optional specifier for the background theme this icon is designed for.\nUse IconThemeLight for light backgrounds or IconThemeDark for dark backgrounds.", "allOf": [ { "$ref": "#/definitions/mcp.IconTheme" } ] } } }, "mcp.IconTheme": { "type": "string", "enum": [ "light", "dark" ], "x-enum-varnames": [ "IconThemeLight", "IconThemeDark" ] }, "mcp.Meta": { "type": "object", "properties": { "additionalFields": { "description": "AdditionalFields are any fields present in the Meta that are not\notherwise defined in the protocol.", "type": "object", "additionalProperties": {} }, "progressToken": { "description": "If specified, the caller is requesting out-of-band progress\nnotifications for this request (as represented by\nnotifications/progress). The value of this parameter is an\nopaque token that will be attached to any subsequent\nnotifications. The receiver is not obligated to provide these\nnotifications." } } }, "mcp.TaskSupport": { "type": "string", "enum": [ "forbidden", "optional", "required" ], "x-enum-varnames": [ "TaskSupportForbidden", "TaskSupportOptional", "TaskSupportRequired" ] }, "mcp.Tool": { "type": "object", "properties": { "_meta": { "description": "Meta is a metadata object that is reserved by MCP for storing additional information.", "allOf": [ { "$ref": "#/definitions/mcp.Meta" } ] }, "annotations": { "description": "Optional properties describing tool behavior", "allOf": [ { "$ref": "#/definitions/mcp.ToolAnnotation" } ] }, "defer_loading": { "description": "Support for deferred loading", "type": "boolean" }, "description": { "description": "A human-readable description of the tool.", "type": "string" }, "execution": { "description": "Execution describes execution behavior for the tool", "allOf": [ { "$ref": "#/definitions/mcp.ToolExecution" } ] }, "icons": { "description": "Icons provides visual identifiers for the tool", "type": "array", "items": { "$ref": "#/definitions/mcp.Icon" } }, "inputSchema": { "description": "A JSON Schema object defining the expected parameters for the tool.", "allOf": [ { "$ref": "#/definitions/mcp.ToolInputSchema" } ] }, "name": { "description": "The name of the tool.", "type": "string" }, "outputSchema": { "description": "A JSON Schema object defining the expected output returned by the tool .", "allOf": [ { "$ref": "#/definitions/mcp.ToolOutputSchema" } ] }, "title": { "description": "Title is an optional human-readable, UI-friendly display name for the tool.\nIf not provided, clients should use Annotations.Title (if set) and fall back to Name.", "type": "string" } } }, "mcp.ToolAnnotation": { "type": "object", "properties": { "destructiveHint": { "description": "If true, the tool may perform destructive updates", "type": "boolean" }, "idempotentHint": { "description": "If true, repeated calls with same args have no additional effect", "type": "boolean" }, "openWorldHint": { "description": "If true, tool interacts with external entities", "type": "boolean" }, "readOnlyHint": { "description": "If true, the tool does not modify its environment", "type": "boolean" }, "title": { "description": "Human-readable title for the tool", "type": "string" } } }, "mcp.ToolExecution": { "type": "object", "properties": { "taskSupport": { "description": "TaskSupport indicates whether the tool supports task augmentation.", "allOf": [ { "$ref": "#/definitions/mcp.TaskSupport" } ] } } }, "mcp.ToolInputSchema": { "type": "object", "properties": { "$defs": { "type": "object", "additionalProperties": {} }, "additionalProperties": {}, "properties": { "type": "object", "additionalProperties": {} }, "required": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } } }, "mcp.ToolOutputSchema": { "type": "object", "properties": { "$defs": { "type": "object", "additionalProperties": {} }, "additionalProperties": {}, "properties": { "type": "object", "additionalProperties": {} }, "required": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } } }, "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, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 ], "x-enum-varnames": [ "Unknown", "ChatCompletions", "Completions", "Embeddings", "Moderations", "ImagesGenerations", "ImagesEdits", "AudioSpeech", "AudioTranscription", "AudioTranslation", "Rerank", "ParsePdf", "Anthropic", "VideoGenerationsJobs", "VideoGenerationsGetJobs", "VideoGenerationsContent", "Responses", "ResponsesGet", "ResponsesDelete", "ResponsesCancel", "ResponsesInputItems", "Gemini", "Videos", "VideosGet", "VideosContent", "VideosDelete", "VideosRemix", "GeminiVideo", "GeminiVideoOperations", "GeminiTTS", "GeminiImage", "GeminiFiles", "VideosEdits", "VideosExtensions", "AliVideo", "AliVideoTasks", "DoubaoVideo", "DoubaoVideoTasks", "DoubaoVideoTasksDelete", "ResponsesCompact", "AlphaSearch" ] }, "model.Amount": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_output_amount": { "type": "number" }, "cache_creation_amount": { "type": "number" }, "cached_amount": { "type": "number" }, "image_input_amount": { "type": "number" }, "image_output_amount": { "type": "number" }, "input_amount": { "type": "number" }, "output_amount": { "type": "number" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "web_search_amount": { "type": "number" } } }, "model.AnthropicMessageRequest": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/definitions/model.Message" } }, "model": { "type": "string" } } }, "model.AsyncUsageStatus": { "type": "integer", "enum": [ 0, 1, 2, 3 ], "x-enum-varnames": [ "AsyncUsageStatusNone", "AsyncUsageStatusPending", "AsyncUsageStatusCompleted", "AsyncUsageStatusFailed" ] }, "model.Audio": { "type": "object", "properties": { "format": { "type": "string" }, "voice": { "type": "string" } } }, "model.Channel": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "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" } }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "created_at": { "type": "string" }, "enabled_auto_balance_check": { "type": "boolean" }, "enabled_no_permission_ban": { "type": "boolean" }, "id": { "type": "integer" }, "key": { "type": "string" }, "last_test_error_at": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "used_amount": { "type": "number" }, "warn_error_rate": { "type": "number" } } }, "model.ChannelBasicInfo": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "id": { "type": "integer" }, "name": { "type": "string" }, "remark": { "type": "string" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" } } }, "model.ChannelConfigs": { "type": "object", "additionalProperties": {} }, "model.ChannelScope": { "type": "string", "enum": [ "global", "group" ], "x-enum-varnames": [ "ChannelScopeGlobal", "ChannelScopeGroup" ] }, "model.ChannelTest": { "type": "object", "properties": { "actual_model": { "type": "string" }, "channel_id": { "type": "integer" }, "channel_name": { "type": "string" }, "channel_type": { "$ref": "#/definitions/model.ChannelType" }, "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.ChannelType": { "type": "integer", "enum": [ 1, 3, 4, 12, 13, 14, 15, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ], "x-enum-varnames": [ "ChannelTypeOpenAI", "ChannelTypeAzure", "ChannelTypeAzure2", "ChannelTypeGoogleGeminiOpenAI", "ChannelTypeBaiduV2", "ChannelTypeAnthropic", "ChannelTypeBaidu", "ChannelTypeZhipu", "ChannelTypeAli", "ChannelTypeXunfei", "ChannelTypeAI360", "ChannelTypeOpenRouter", "ChannelTypeTencent", "ChannelTypeGoogleGemini", "ChannelTypeMoonshot", "ChannelTypeBaichuan", "ChannelTypeMinimax", "ChannelTypeMistral", "ChannelTypeGroq", "ChannelTypeOllama", "ChannelTypeLingyiwanwu", "ChannelTypeStepfun", "ChannelTypeAWS", "ChannelTypeCoze", "ChannelTypeCohere", "ChannelTypeDeepseek", "ChannelTypeCloudflare", "ChannelTypeDoubao", "ChannelTypeNovita", "ChannelTypeVertexAI", "ChannelTypeSiliconflow", "ChannelTypeDoubaoAudio", "ChannelTypeXAI", "ChannelTypeDoc2x", "ChannelTypeJina", "ChannelTypeTextEmbeddingsInference", "ChannelTypeQianfan", "ChannelTypeSangforAICP", "ChannelTypeStreamlake", "ChannelTypeZhipuCoding", "ChannelTypeFake", "ChannelTypeAntLing", "ChannelTypeFakeError", "ChannelTypeQwenCloud", "ChannelTypeAIProxyHZH", "ChannelTypeAIProxyUSW1", "ChannelTypeTokenDance" ] }, "model.ChartData": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_input_tokens": { "type": "integer" }, "audio_output_amount": { "type": "number" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_amount": { "type": "number" }, "cache_creation_count": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_hit_count": { "type": "integer" }, "cached_amount": { "type": "number" }, "cached_tokens": { "type": "integer" }, "claude_long_context": { "$ref": "#/definitions/model.SummaryDataSet" }, "exception_count": { "type": "integer" }, "image_input_amount": { "type": "number" }, "image_input_tokens": { "type": "integer" }, "image_output_amount": { "type": "number" }, "image_output_tokens": { "type": "integer" }, "input_amount": { "type": "number" }, "input_tokens": { "type": "integer" }, "output_amount": { "type": "number" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "service_tier_flex": { "$ref": "#/definitions/model.SummaryDataSet" }, "service_tier_priority": { "$ref": "#/definitions/model.SummaryDataSet" }, "status_2xx_count": { "type": "integer" }, "status_400_count": { "type": "integer" }, "status_429_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_500_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "status_other_count": { "type": "integer" }, "timestamp": { "type": "integer" }, "total_time_milliseconds": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_ttfb_milliseconds": { "type": "integer" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "video_input_tokens": { "type": "integer" }, "web_search_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.ChatCompletionTokenLogprob": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "$ref": "#/definitions/model.TopLogprob" } } } }, "model.ChatUsage": { "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" } } }, "model.ChoiceLogprobs": { "type": "object", "properties": { "content": { "type": "array", "items": { "$ref": "#/definitions/model.ChatCompletionTokenLogprob" } }, "refusal": { "type": "array", "items": { "$ref": "#/definitions/model.ChatCompletionTokenLogprob" } } } }, "model.ClaudeThinkingType": { "type": "string", "enum": [ "enabled", "adaptive", "disabled" ], "x-enum-varnames": [ "ClaudeThinkingTypeEnabled", "ClaudeThinkingTypeAdaptive", "ClaudeThinkingTypeDisabled" ] }, "model.CompletionTokensDetails": { "type": "object", "properties": { "accepted_prediction_tokens": { "type": "integer" }, "audio_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "rejected_prediction_tokens": { "type": "integer" } } }, "model.ConditionalPrice": { "type": "object", "properties": { "condition": { "$ref": "#/definitions/model.PriceCondition" }, "price": { "$ref": "#/definitions/model.Price" } } }, "model.CreateResponseRequest": { "type": "object", "properties": { "background": { "type": "boolean" }, "conversation": { "description": "string or object" }, "include": { "type": "array", "items": { "type": "string" } }, "input": {}, "instructions": { "type": "string" }, "max_output_tokens": { "type": "integer" }, "max_tool_calls": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": {} }, "model": { "type": "string" }, "moderation": {}, "parallel_tool_calls": { "type": "boolean" }, "previous_response_id": { "type": "string" }, "prompt_cache_key": { "type": "string" }, "prompt_cache_options": { "$ref": "#/definitions/model.PromptCacheOptions" }, "prompt_cache_retention": { "type": "string" }, "reasoning": { "$ref": "#/definitions/model.ResponseReasoning" }, "safety_identifier": { "type": "string" }, "service_tier": { "type": "string" }, "store": { "type": "boolean" }, "stream": { "type": "boolean" }, "stream_options": { "$ref": "#/definitions/model.ResponseStreamOptions" }, "temperature": { "type": "number" }, "text": { "$ref": "#/definitions/model.ResponseText" }, "tool_choice": {}, "tools": { "type": "array", "items": { "$ref": "#/definitions/model.ResponseTool" } }, "top_logprobs": { "type": "integer" }, "top_p": { "type": "number" }, "truncation": { "type": "string" }, "user": { "description": "Deprecated, use prompt_cache_key", "type": "string" } } }, "model.DashboardResponse": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_input_tokens": { "type": "integer" }, "audio_output_amount": { "type": "number" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_amount": { "type": "number" }, "cache_creation_count": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_hit_count": { "type": "integer" }, "cached_amount": { "type": "number" }, "cached_tokens": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "integer" } }, "chart_data": { "type": "array", "items": { "$ref": "#/definitions/model.ChartData" } }, "claude_long_context": { "$ref": "#/definitions/model.SummaryDataSet" }, "exception_count": { "type": "integer" }, "image_input_amount": { "type": "number" }, "image_input_tokens": { "type": "integer" }, "image_output_amount": { "type": "number" }, "image_output_tokens": { "type": "integer" }, "input_amount": { "type": "number" }, "input_tokens": { "type": "integer" }, "max_rpm": { "type": "integer" }, "max_tpm": { "type": "integer" }, "models": { "type": "array", "items": { "type": "string" } }, "output_amount": { "type": "number" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "rpm": { "type": "integer" }, "service_tier_flex": { "$ref": "#/definitions/model.SummaryDataSet" }, "service_tier_priority": { "$ref": "#/definitions/model.SummaryDataSet" }, "status_2xx_count": { "type": "integer" }, "status_400_count": { "type": "integer" }, "status_429_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_500_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "status_other_count": { "type": "integer" }, "total_count": { "description": "use Count.RequestCount instead", "type": "integer" }, "total_time_milliseconds": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_ttfb_milliseconds": { "type": "integer" }, "tpm": { "type": "integer" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "video_input_tokens": { "type": "integer" }, "web_search_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.DashboardV3Response": { "type": "object", "properties": { "channels": { "type": "array", "items": { "type": "integer" } }, "models": { "type": "array", "items": { "type": "string" } }, "rpm": { "type": "integer" }, "time_series": { "type": "array", "items": { "$ref": "#/definitions/model.TimeSummaryDataV2" } }, "tpm": { "type": "integer" } } }, "model.Document": { "type": "object", "properties": { "text": { "type": "string" } } }, "model.EmbeddingPromptTokensDetails": { "type": "object", "properties": { "image_tokens": { "type": "integer" }, "text_tokens": { "type": "integer" }, "video_tokens": { "type": "integer" } } }, "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/model.EmbeddingUsage" } } }, "model.EmbeddingResponseItem": { "type": "object", "properties": { "embedding": { "type": "array", "items": { "type": "number" } }, "index": { "type": "integer" }, "object": { "type": "string" } } }, "model.EmbeddingUsage": { "type": "object", "properties": { "prompt_tokens": { "type": "integer" }, "prompt_tokens_details": { "$ref": "#/definitions/model.EmbeddingPromptTokensDetails" }, "total_tokens": { "type": "integer" } } }, "model.ExtraContent": { "type": "object", "properties": { "google": { "$ref": "#/definitions/model.GoogleExtraContent" } } }, "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": {}, "strict": { "type": "boolean" } } }, "model.GeneralOpenAIRequest": { "type": "object", "properties": { "audio": { "$ref": "#/definitions/model.Audio" }, "enable_thinking": { "type": "boolean" }, "frequency_penalty": { "type": "number" }, "function_call": {}, "functions": {}, "input": {}, "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" }, "moderation": {}, "n": { "type": "integer" }, "num_ctx": { "type": "integer" }, "parallel_tool_calls": { "type": "boolean" }, "presence_penalty": { "type": "number" }, "prompt": {}, "prompt_cache_key": { "type": "string" }, "prompt_cache_options": { "$ref": "#/definitions/model.PromptCacheOptions" }, "prompt_cache_retention": { "type": "string" }, "reasoning_effort": { "type": "string" }, "response_format": { "$ref": "#/definitions/model.ResponseFormat" }, "safety_identifier": { "type": "string" }, "seed": { "type": "number" }, "service_tier": { "type": "string" }, "size": { "type": "string" }, "stop": {}, "stream": { "type": "boolean" }, "stream_options": { "$ref": "#/definitions/model.StreamOptions" }, "temperature": { "type": "number" }, "thinking": { "description": "aiproxy control field", "allOf": [ { "$ref": "#/definitions/model.GeneralThinking" } ] }, "thinking_budget": { "type": "integer" }, "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" }, "verbosity": { "type": "string" } } }, "model.GeneralThinking": { "type": "object", "properties": { "budget_tokens": { "description": "when type is \"disabled\", this field must be 0", "type": "integer" }, "type": { "$ref": "#/definitions/model.ClaudeThinkingType" } } }, "model.GetGroupChannelLogsResult": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelLog" } }, "models": { "type": "array", "items": { "type": "string" } }, "token_names": { "type": "array", "items": { "type": "string" } }, "total": { "type": "integer" } } }, "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" } }, "models": { "type": "array", "items": { "type": "string" } }, "total": { "type": "integer" } } }, "model.GoogleExtraContent": { "type": "object", "properties": { "thought_signature": { "type": "string" } } }, "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" }, "group_channel_request_count": { "type": "integer" }, "group_channel_used_amount": { "type": "number" }, "id": { "type": "string" }, "request_count": { "type": "integer" }, "rpm_ratio": { "type": "number" }, "status": { "type": "integer" }, "tpm_ratio": { "type": "number" }, "used_amount": { "type": "number" } } }, "model.GroupChannel": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "base_url": { "type": "string" }, "configs": { "$ref": "#/definitions/model.ChannelConfigs" }, "created_at": { "type": "string" }, "enabled_no_permission_ban": { "type": "boolean" }, "group_channel_tests": { "type": "array", "items": { "$ref": "#/definitions/model.GroupChannelTest" } }, "group_id": { "type": "string" }, "id": { "type": "integer" }, "key": { "type": "string" }, "last_test_error_at": { "type": "string" }, "max_error_rate": { "type": "number" }, "model_mapping": { "type": "object", "additionalProperties": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "priority": { "type": "integer" }, "proxy_url": { "type": "string" }, "remark": { "type": "string" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "sets": { "type": "array", "items": { "type": "string" } }, "skip_tls_verify": { "type": "boolean" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" }, "used_amount": { "type": "number" }, "warn_error_rate": { "type": "number" } } }, "model.GroupChannelBasicInfo": { "type": "object", "properties": { "backup_only": { "type": "boolean" }, "group_id": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "remark": { "type": "string" }, "status": { "type": "integer" }, "type": { "$ref": "#/definitions/model.ChannelType" } } }, "model.GroupChannelLog": { "type": "object", "properties": { "amount": { "$ref": "#/definitions/model.Amount" }, "async_usage_status": { "$ref": "#/definitions/model.AsyncUsageStatus" }, "code": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "endpoint": { "type": "string" }, "group": { "type": "string" }, "group_channel_id": { "type": "integer" }, "id": { "type": "integer" }, "ip": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "mode": { "type": "integer" }, "model": { "type": "string" }, "price": { "$ref": "#/definitions/model.Price" }, "prompt_cache_key": { "type": "string" }, "request_at": { "type": "string" }, "request_detail": { "$ref": "#/definitions/model.GroupChannelRequestDetail" }, "request_id": { "type": "string" }, "retry_at": { "type": "string" }, "retry_times": { "type": "integer" }, "token_id": { "type": "integer" }, "token_name": { "type": "string" }, "ttfb_milliseconds": { "type": "integer" }, "upstream_id": { "type": "string" }, "usage": { "$ref": "#/definitions/model.Usage" }, "usage_context": { "$ref": "#/definitions/model.UsageContext" }, "user": { "type": "string" } } }, "model.GroupChannelRequestDetail": { "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.GroupChannelTest": { "type": "object", "properties": { "actual_model": { "type": "string" }, "channel_name": { "type": "string" }, "channel_type": { "$ref": "#/definitions/model.ChannelType" }, "code": { "type": "integer" }, "group_channel_id": { "type": "integer" }, "group_id": { "type": "string" }, "mode": { "$ref": "#/definitions/mode.Mode" }, "model": { "type": "string" }, "response": { "type": "string" }, "success": { "type": "boolean" }, "test_at": { "type": "string" }, "took": { "type": "number" } } }, "model.GroupDashboardResponse": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_input_tokens": { "type": "integer" }, "audio_output_amount": { "type": "number" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_amount": { "type": "number" }, "cache_creation_count": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_hit_count": { "type": "integer" }, "cached_amount": { "type": "number" }, "cached_tokens": { "type": "integer" }, "channels": { "type": "array", "items": { "type": "integer" } }, "chart_data": { "type": "array", "items": { "$ref": "#/definitions/model.ChartData" } }, "claude_long_context": { "$ref": "#/definitions/model.SummaryDataSet" }, "exception_count": { "type": "integer" }, "image_input_amount": { "type": "number" }, "image_input_tokens": { "type": "integer" }, "image_output_amount": { "type": "number" }, "image_output_tokens": { "type": "integer" }, "input_amount": { "type": "number" }, "input_tokens": { "type": "integer" }, "max_rpm": { "type": "integer" }, "max_tpm": { "type": "integer" }, "models": { "type": "array", "items": { "type": "string" } }, "output_amount": { "type": "number" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "rpm": { "type": "integer" }, "service_tier_flex": { "$ref": "#/definitions/model.SummaryDataSet" }, "service_tier_priority": { "$ref": "#/definitions/model.SummaryDataSet" }, "status_2xx_count": { "type": "integer" }, "status_400_count": { "type": "integer" }, "status_429_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_500_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "status_other_count": { "type": "integer" }, "token_names": { "type": "array", "items": { "type": "string" } }, "total_count": { "description": "use Count.RequestCount instead", "type": "integer" }, "total_time_milliseconds": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_ttfb_milliseconds": { "type": "integer" }, "tpm": { "type": "integer" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "video_input_tokens": { "type": "integer" }, "web_search_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.GroupMCP": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "group_id": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "proxy_config": { "$ref": "#/definitions/model.GroupMCPProxyConfig" }, "status": { "$ref": "#/definitions/model.GroupMCPStatus" }, "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.GroupMCPStatus": { "type": "integer", "enum": [ 1, 2 ], "x-enum-varnames": [ "GroupMCPStatusEnabled", "GroupMCPStatusDisabled" ] }, "model.GroupMCPType": { "type": "string", "enum": [ "mcp_proxy_sse", "mcp_proxy_streamable", "mcp_openapi" ], "x-enum-varnames": [ "GroupMCPTypeProxySSE", "GroupMCPTypeProxyStreamable", "GroupMCPTypeOpenAPI" ] }, "model.GroupModelConfig": { "type": "object", "properties": { "force_save_detail": { "type": "boolean" }, "group_id": { "type": "string" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "override_force_save_detail": { "type": "boolean" }, "override_limit": { "type": "boolean" }, "override_max_image_generation_count": { "type": "boolean" }, "override_max_video_generation_count": { "type": "boolean" }, "override_max_video_generation_seconds": { "type": "boolean" }, "override_price": { "type": "boolean" }, "override_request_body_storage_max_size": { "type": "boolean" }, "override_response_body_storage_max_size": { "type": "boolean" }, "override_retry_budget": { "type": "boolean" }, "override_retry_times": { "type": "boolean" }, "override_summary_claude_long_context": { "type": "boolean" }, "override_summary_service_tier": { "type": "boolean" }, "override_timeout_config": { "type": "boolean" }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" } } }, "model.GroupScopeModelConfig": { "type": "object", "properties": { "allowed_resolutions": { "type": "array", "items": { "type": "string" } }, "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "disable_resolution_fuzzy_match": { "type": "boolean" }, "exclude_from_tests": { "type": "boolean" }, "force_save_detail": { "type": "boolean" }, "group_id": { "type": "string" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "plugin": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": {} } }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "description": "Seconds; nil inherits the global budget, zero disables it.", "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "model.ImageData": { "type": "object", "properties": { "b64_json": { "type": "string" }, "revised_prompt": { "type": "string" }, "url": { "type": "string" } } }, "model.ImageInputTokensDetails": { "type": "object", "properties": { "image_tokens": { "description": "The number of image tokens in the input prompt.", "type": "integer" }, "text_tokens": { "description": "The number of text tokens in the input prompt.", "type": "integer" } } }, "model.ImageOutputTokensDetails": { "type": "object", "properties": { "image_tokens": { "description": "The number of image output tokens generated by the model.", "type": "integer" }, "text_tokens": { "description": "The number of text output tokens generated by the model.", "type": "integer" } } }, "model.ImageRequest": { "type": "object", "properties": { "background": { "type": "string" }, "model": { "type": "string" }, "moderation": { "type": "string" }, "n": { "type": "integer" }, "output_compression": { "type": "integer" }, "output_format": { "description": "png, jpeg, webp", "type": "string" }, "partial_images": { "type": "integer" }, "prompt": { "type": "string" }, "quality": { "description": "auto, high, medium, low, hd, standard", "type": "string" }, "response_format": { "description": "url, b64_json", "type": "string" }, "size": { "description": "1024x1024, 1536x1024, 1024x1536, auto, 256x256, 512x512, 1792x1024, 1024x1792", "type": "string" }, "stream": { "type": "boolean" }, "style": { "description": "vivid, natural", "type": "string" }, "user": { "type": "string" } } }, "model.ImageResponse": { "type": "object", "properties": { "created": { "type": "integer" }, "data": { "type": "array", "items": { "$ref": "#/definitions/model.ImageData" } }, "usage": { "description": "For gpt-image-1 only, the token usage information for the image generation.", "allOf": [ { "$ref": "#/definitions/model.ImageUsage" } ] } } }, "model.ImageUsage": { "type": "object", "properties": { "input_tokens": { "description": "The number of tokens (images and text) in the input prompt.", "type": "integer" }, "input_tokens_details": { "description": "The input tokens detailed information for the image generation.", "allOf": [ { "$ref": "#/definitions/model.ImageInputTokensDetails" } ] }, "output_tokens": { "description": "The number of image tokens in the output image.", "type": "integer" }, "output_tokens_details": { "description": "The output token details for the image generation.", "allOf": [ { "$ref": "#/definitions/model.ImageOutputTokensDetails" } ] }, "total_tokens": { "description": "The total number of tokens (images and text) used for the image generation.", "type": "integer" } } }, "model.IncompleteDetails": { "type": "object", "properties": { "reason": { "type": "string" } } }, "model.InputContent": { "type": "object", "properties": { "arguments": { "type": "string" }, "call_id": { "description": "Fields for function_result type", "type": "string" }, "detail": { "type": "string" }, "file_id": { "type": "string" }, "id": { "description": "Fields for function_call type", "type": "string" }, "image_url": { "description": "Fields for input_image type", "type": "string" }, "name": { "type": "string" }, "output": { "type": "string" }, "prompt_cache_breakpoint": {}, "refusal": { "type": "string" }, "text": { "type": "string" }, "type": { "type": "string" } } }, "model.InputItem": { "type": "object", "properties": { "arguments": { "type": "string" }, "call_id": { "description": "Fields for function_result type", "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/definitions/model.InputContent" } }, "id": { "type": "string" }, "name": { "description": "Fields for function_call type", "type": "string" }, "output": { "type": "string" }, "role": { "type": "string" }, "type": { "type": "string" } } }, "model.InputItemList": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/model.InputItem" } }, "first_id": { "type": "string" }, "has_more": { "type": "boolean" }, "last_id": { "type": "string" }, "object": { "type": "string" } } }, "model.JSONSchema": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "schema": { "type": "object", "additionalProperties": {} }, "strict": { "type": "boolean" } } }, "model.Log": { "type": "object", "properties": { "amount": { "$ref": "#/definitions/model.Amount" }, "async_usage_status": { "$ref": "#/definitions/model.AsyncUsageStatus" }, "channel": { "type": "integer" }, "code": { "type": "integer" }, "content": { "type": "string" }, "created_at": { "type": "string" }, "endpoint": { "type": "string" }, "group": { "type": "string" }, "id": { "type": "integer" }, "ip": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "mode": { "type": "integer" }, "model": { "type": "string" }, "price": { "$ref": "#/definitions/model.Price" }, "prompt_cache_key": { "type": "string" }, "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" }, "upstream_id": { "type": "string" }, "usage": { "$ref": "#/definitions/model.Usage" }, "usage_context": { "$ref": "#/definitions/model.UsageContext" }, "user": { "description": "https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids", "type": "string" } } }, "model.MCPEmbeddingConfig": { "type": "object", "properties": { "init": { "type": "object", "additionalProperties": { "type": "string" } }, "reusing": { "type": "object", "additionalProperties": { "$ref": "#/definitions/model.ReusingParam" } } } }, "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", "format": "float64" } } } }, "model.Message": { "type": "object", "properties": { "annotations": { "type": "array", "items": {} }, "audio": { "$ref": "#/definitions/model.OutputAudio" }, "content": {}, "name": { "type": "string" }, "reasoning_content": { "type": "string" }, "refusal": { "type": "string" }, "role": { "type": "string" }, "signature": { "type": "string" }, "tool_call_id": { "type": "string" }, "tool_calls": { "type": "array", "items": { "$ref": "#/definitions/model.ToolCall" } } } }, "model.ModelConfig": { "type": "object", "properties": { "allowed_resolutions": { "type": "array", "items": { "type": "string" } }, "config": { "type": "object", "additionalProperties": {} }, "created_at": { "type": "string" }, "disable_resolution_fuzzy_match": { "type": "boolean" }, "exclude_from_tests": { "type": "boolean" }, "force_save_detail": { "type": "boolean" }, "max_image_generation_count": { "type": "integer" }, "max_video_generation_count": { "type": "integer" }, "max_video_generation_seconds": { "type": "integer" }, "model": { "type": "string" }, "owner": { "$ref": "#/definitions/model.ModelOwner" }, "plugin": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": {} } }, "price": { "$ref": "#/definitions/model.Price" }, "request_body_storage_max_size": { "type": "integer" }, "response_body_storage_max_size": { "type": "integer" }, "retry_budget": { "description": "Seconds; nil inherits the global budget, zero disables it.", "type": "integer", "maximum": 180, "minimum": 0 }, "retry_times": { "type": "integer" }, "rpm": { "type": "integer" }, "summary_claude_long_context": { "type": "boolean" }, "summary_service_tier": { "type": "boolean" }, "timeout_config": { "$ref": "#/definitions/model.TimeoutConfig" }, "tpm": { "type": "integer" }, "type": { "$ref": "#/definitions/mode.Mode" }, "updated_at": { "type": "string" } } }, "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", "antgroup" ], "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", "ModelOwnerAntGroup" ] }, "model.Option": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "model.OutputAudio": { "type": "object", "properties": { "data": { "type": "string" }, "expires_at": { "type": "integer" }, "id": { "type": "string" }, "transcript": { "type": "string" } } }, "model.OutputContent": { "type": "object", "properties": { "annotations": { "type": "array", "items": {} }, "logprobs": { "type": "array", "items": { "$ref": "#/definitions/model.ChatCompletionTokenLogprob" } }, "refusal": { "type": "string" }, "text": { "type": "string" }, "type": { "type": "string" } } }, "model.OutputItem": { "type": "object", "properties": { "arguments": { "description": "For function_call type", "type": "string" }, "call_id": { "description": "For function_call type", "type": "string" }, "content": { "type": "array", "items": { "$ref": "#/definitions/model.OutputContent" } }, "id": { "type": "string" }, "name": { "description": "For function_call type", "type": "string" }, "role": { "type": "string" }, "status": { "$ref": "#/definitions/model.ResponseStatus" }, "summary": { "description": "For reasoning type: []SummaryPart or string" }, "type": { "type": "string" } } }, "model.Params": { "type": "object", "additionalProperties": { "type": "string" } }, "model.ParsePdfResponse": { "type": "object", "properties": { "markdown": { "type": "string" }, "pages": { "type": "integer" } } }, "model.Price": { "type": "object", "properties": { "audio_input_price": { "type": "number" }, "audio_input_price_unit": { "type": "integer" }, "audio_output_price": { "type": "number" }, "audio_output_price_unit": { "type": "integer" }, "cache_creation_price": { "type": "number" }, "cache_creation_price_unit": { "type": "integer" }, "cached_price": { "type": "number" }, "cached_price_unit": { "type": "integer" }, "conditional_prices": { "type": "array", "items": { "$ref": "#/definitions/model.ConditionalPrice" } }, "image_input_price": { "type": "number" }, "image_input_price_unit": { "type": "integer" }, "image_output_price": { "type": "number" }, "image_output_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" }, "thinking_mode_output_price": { "description": "when ThinkingModeOutputPrice and ReasoningTokens are not 0, OutputPrice and OutputPriceUnit\nwill be overwritten", "type": "number" }, "thinking_mode_output_price_unit": { "type": "integer" }, "video_input_price": { "type": "number" }, "video_input_price_unit": { "type": "integer" }, "web_search_price": { "type": "number" }, "web_search_price_unit": { "type": "integer" } } }, "model.PriceCondition": { "type": "object", "properties": { "daily_end_time": { "description": "HH:mm, exclusive; earlier than start crosses midnight", "type": "string" }, "daily_start_time": { "description": "HH:mm, inclusive", "type": "string" }, "end_time": { "description": "Unix timestamp, 0 means no end limit", "type": "integer" }, "input_media": { "type": "boolean" }, "input_token_max": { "type": "integer" }, "input_token_min": { "type": "integer" }, "input_video": { "type": "boolean" }, "output_audio": { "type": "boolean" }, "output_token_max": { "type": "integer" }, "output_token_min": { "type": "integer" }, "quality": { "type": "array", "items": { "type": "string" } }, "resolution": { "type": "array", "items": { "type": "string" } }, "service_tier": { "type": "string" }, "start_time": { "description": "Unix timestamp, 0 means no start limit", "type": "integer" }, "timezone": { "description": "IANA timezone for the daily time range", "type": "string" } } }, "model.PromptCacheOptions": { "type": "object", "properties": { "mode": { "type": "string" }, "ttl": { "type": "string" } } }, "model.PromptTokensDetails": { "type": "object", "properties": { "audio_tokens": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_write_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "video_tokens": { "type": "integer" } } }, "model.ProxyParamType": { "type": "string", "enum": [ "url", "header", "query" ], "x-enum-varnames": [ "ParamTypeURL", "ParamTypeHeader", "ParamTypeQuery" ] }, "model.PublicMCP": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "description_cn": { "type": "string" }, "embed_config": { "$ref": "#/definitions/model.MCPEmbeddingConfig" }, "github_url": { "type": "string" }, "id": { "type": "string" }, "logo_url": { "type": "string" }, "name": { "type": "string" }, "name_cn": { "type": "string" }, "openapi_config": { "$ref": "#/definitions/model.MCPOpenAPIConfig" }, "price": { "$ref": "#/definitions/model.MCPPrice" }, "proxy_config": { "$ref": "#/definitions/model.PublicMCPProxyConfig" }, "readme": { "type": "string" }, "readme_cn": { "type": "string" }, "readme_cn_url": { "type": "string" }, "readme_url": { "type": "string" }, "status": { "$ref": "#/definitions/model.PublicMCPStatus" }, "tags": { "type": "array", "items": { "type": "string" } }, "test_config": { "description": "only used by list tools", "allOf": [ { "$ref": "#/definitions/model.TestConfig" } ] }, "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": { "type": "object", "additionalProperties": { "$ref": "#/definitions/model.PublicMCPProxyReusingParam" } }, "url": { "type": "string" } } }, "model.PublicMCPProxyReusingParam": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "required": { "type": "boolean" }, "type": { "$ref": "#/definitions/model.ProxyParamType" } } }, "model.PublicMCPReusingParam": { "type": "object", "properties": { "created_at": { "type": "string" }, "group_id": { "type": "string" }, "mcp_id": { "type": "string" }, "params": { "$ref": "#/definitions/model.Params" }, "update_at": { "type": "string" } } }, "model.PublicMCPStatus": { "type": "integer", "enum": [ 1, 2 ], "x-enum-varnames": [ "PublicMCPStatusEnabled", "PublicMCPStatusDisabled" ] }, "model.PublicMCPType": { "type": "string", "enum": [ "mcp_proxy_sse", "mcp_proxy_streamable", "mcp_docs", "mcp_openapi", "mcp_embed" ], "x-enum-comments": { "PublicMCPTypeDocs": "read only" }, "x-enum-descriptions": [ "", "", "read only", "", "" ], "x-enum-varnames": [ "PublicMCPTypeProxySSE", "PublicMCPTypeProxyStreamable", "PublicMCPTypeDocs", "PublicMCPTypeOpenAPI", "PublicMCPTypeEmbed" ] }, "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.Response": { "type": "object", "properties": { "background": { "type": "boolean" }, "created_at": { "type": "integer" }, "error": { "$ref": "#/definitions/model.ResponseError" }, "id": { "type": "string" }, "incomplete_details": { "$ref": "#/definitions/model.IncompleteDetails" }, "instructions": { "type": "string" }, "max_output_tokens": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": {} }, "model": { "type": "string" }, "moderation": {}, "object": { "type": "string" }, "output": { "type": "array", "items": { "$ref": "#/definitions/model.OutputItem" } }, "parallel_tool_calls": { "type": "boolean" }, "previous_response_id": { "type": "string" }, "prompt_cache_retention": { "type": "string" }, "reasoning": { "$ref": "#/definitions/model.ResponseReasoning" }, "service_tier": { "type": "string" }, "status": { "$ref": "#/definitions/model.ResponseStatus" }, "store": { "type": "boolean" }, "temperature": { "type": "number" }, "text": { "$ref": "#/definitions/model.ResponseText" }, "tool_choice": {}, "tool_usage": { "$ref": "#/definitions/model.ResponseToolUsage" }, "tools": { "type": "array", "items": { "$ref": "#/definitions/model.ResponseTool" } }, "top_p": { "type": "number" }, "truncation": { "type": "string" }, "usage": { "$ref": "#/definitions/model.ResponseUsage" }, "user": { "type": "string" } } }, "model.ResponseError": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } } }, "model.ResponseFormat": { "type": "object", "properties": { "json_schema": { "$ref": "#/definitions/model.JSONSchema" }, "type": { "type": "string" } } }, "model.ResponseReasoning": { "type": "object", "properties": { "effort": { "type": "string" }, "summary": { "description": "string (\"detailed\", \"auto\", \"concise\") or []SummaryPart in response" } } }, "model.ResponseStatus": { "type": "string", "enum": [ "in_progress", "queued", "completed", "failed", "incomplete", "cancelled" ], "x-enum-varnames": [ "ResponseStatusInProgress", "ResponseStatusQueued", "ResponseStatusCompleted", "ResponseStatusFailed", "ResponseStatusIncomplete", "ResponseStatusCancelled" ] }, "model.ResponseStreamOptions": { "type": "object", "properties": { "include_obfuscation": { "type": "boolean" } } }, "model.ResponseText": { "type": "object", "properties": { "format": { "$ref": "#/definitions/model.ResponseTextFormat" }, "verbosity": { "type": "string" } } }, "model.ResponseTextFormat": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "schema": { "type": "object", "additionalProperties": {} }, "strict": { "type": "boolean" }, "type": { "type": "string" } } }, "model.ResponseTool": { "type": "object", "properties": { "defer_loading": { "type": "boolean" }, "description": { "type": "string" }, "execution": { "type": "string" }, "name": { "type": "string" }, "parameters": {}, "strict": { "type": "boolean" }, "type": { "type": "string" } } }, "model.ResponseToolUsage": { "type": "object", "properties": { "image_gen": { "$ref": "#/definitions/model.ResponseToolUsageImageGen" }, "web_search": { "$ref": "#/definitions/model.ResponseToolUsageWebSearch" } } }, "model.ResponseToolUsageImageGen": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "input_tokens_details": { "$ref": "#/definitions/model.ResponseToolUsageTokensDetails" }, "output_tokens": { "type": "integer" }, "output_tokens_details": { "$ref": "#/definitions/model.ResponseToolUsageTokensDetails" }, "total_tokens": { "type": "integer" } } }, "model.ResponseToolUsageTokensDetails": { "type": "object", "properties": { "image_tokens": { "type": "integer" }, "text_tokens": { "type": "integer" } } }, "model.ResponseToolUsageWebSearch": { "type": "object", "properties": { "num_requests": { "type": "integer" } } }, "model.ResponseUsage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "input_tokens_details": { "$ref": "#/definitions/model.ResponseUsageDetails" }, "output_tokens": { "type": "integer" }, "output_tokens_details": { "$ref": "#/definitions/model.ResponseUsageDetails" }, "total_tokens": { "type": "integer" } } }, "model.ResponseUsageDetails": { "type": "object", "properties": { "audio_tokens": { "type": "integer" }, "cache_write_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "image_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "video_tokens": { "type": "integer" } } }, "model.ReusingParam": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "required": { "type": "boolean" } } }, "model.StreamOptions": { "type": "object", "properties": { "include_obfuscation": { "type": "boolean" }, "include_usage": { "type": "boolean" } } }, "model.SttJSONResponse": { "type": "object", "properties": { "text": { "type": "string" } } }, "model.SummaryDataSet": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_input_tokens": { "type": "integer" }, "audio_output_amount": { "type": "number" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_amount": { "type": "number" }, "cache_creation_count": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_hit_count": { "type": "integer" }, "cached_amount": { "type": "number" }, "cached_tokens": { "type": "integer" }, "exception_count": { "type": "integer" }, "image_input_amount": { "type": "number" }, "image_input_tokens": { "type": "integer" }, "image_output_amount": { "type": "number" }, "image_output_tokens": { "type": "integer" }, "input_amount": { "type": "number" }, "input_tokens": { "type": "integer" }, "output_amount": { "type": "number" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "status_2xx_count": { "type": "integer" }, "status_400_count": { "type": "integer" }, "status_429_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_500_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "status_other_count": { "type": "integer" }, "total_time_milliseconds": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_ttfb_milliseconds": { "type": "integer" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "video_input_tokens": { "type": "integer" }, "web_search_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.SummaryDataV2": { "type": "object", "properties": { "audio_input_amount": { "type": "number" }, "audio_input_tokens": { "type": "integer" }, "audio_output_amount": { "type": "number" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_amount": { "type": "number" }, "cache_creation_count": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cache_hit_count": { "type": "integer" }, "cached_amount": { "type": "number" }, "cached_tokens": { "type": "integer" }, "channel_id": { "type": "integer" }, "claude_long_context": { "$ref": "#/definitions/model.SummaryDataSet" }, "exception_count": { "type": "integer" }, "group_channel_id": { "type": "integer" }, "group_id": { "type": "string" }, "image_input_amount": { "type": "number" }, "image_input_tokens": { "type": "integer" }, "image_output_amount": { "type": "number" }, "image_output_tokens": { "type": "integer" }, "input_amount": { "type": "number" }, "input_tokens": { "type": "integer" }, "max_rpm": { "type": "integer" }, "max_tpm": { "type": "integer" }, "model": { "type": "string" }, "output_amount": { "type": "number" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "request_count": { "type": "integer" }, "retry_count": { "type": "integer" }, "service_tier_flex": { "$ref": "#/definitions/model.SummaryDataSet" }, "service_tier_priority": { "$ref": "#/definitions/model.SummaryDataSet" }, "status_2xx_count": { "type": "integer" }, "status_400_count": { "type": "integer" }, "status_429_count": { "type": "integer" }, "status_4xx_count": { "type": "integer" }, "status_500_count": { "type": "integer" }, "status_5xx_count": { "type": "integer" }, "status_other_count": { "type": "integer" }, "timestamp": { "type": "integer" }, "token_name": { "type": "string" }, "total_time_milliseconds": { "type": "integer" }, "total_tokens": { "type": "integer" }, "total_ttfb_milliseconds": { "type": "integer" }, "used_amount": { "type": "number" }, "video_input_amount": { "type": "number" }, "video_input_tokens": { "type": "integer" }, "web_search_amount": { "type": "number" }, "web_search_count": { "type": "integer" } } }, "model.TestConfig": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "params": { "$ref": "#/definitions/model.Params" } } }, "model.TextResponse": { "type": "object", "properties": { "choices": { "type": "array", "items": { "$ref": "#/definitions/model.TextResponseChoice" } }, "created": { "type": "integer" }, "id": { "type": "string" }, "model": { "type": "string" }, "moderation": {}, "object": { "type": "string" }, "service_tier": { "type": "string" }, "usage": { "$ref": "#/definitions/model.ChatUsage" } } }, "model.TextResponseChoice": { "type": "object", "properties": { "finish_reason": { "$ref": "#/definitions/model.FinishReason" }, "index": { "type": "integer" }, "logprobs": { "$ref": "#/definitions/model.ChoiceLogprobs" }, "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" }, "stream_format": { "type": "string" }, "voice": { "type": "string" } } }, "model.TimeSummaryDataV2": { "type": "object", "properties": { "summary": { "type": "array", "items": { "$ref": "#/definitions/model.SummaryDataV2" } }, "timestamp": { "type": "integer" } } }, "model.TimeoutConfig": { "type": "object", "properties": { "request_timeout": { "type": "integer" }, "stream_request_timeout": { "type": "integer" } } }, "model.Tool": { "type": "object", "properties": { "defer_loading": { "type": "boolean" }, "description": { "type": "string" }, "execution": { "type": "string" }, "function": { "$ref": "#/definitions/model.Function" }, "name": { "type": "string" }, "parameters": {}, "strict": { "type": "boolean" }, "type": { "type": "string" } } }, "model.ToolCall": { "type": "object", "properties": { "extra_content": { "$ref": "#/definitions/model.ExtraContent" }, "function": { "$ref": "#/definitions/model.Function" }, "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string" } } }, "model.TopLogprob": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } }, "model.UpdateGroupRequest": { "type": "object", "properties": { "available_sets": { "type": "array", "items": { "type": "string" } }, "balance_alert_enabled": { "type": "boolean" }, "balance_alert_threshold": { "type": "number" }, "rpm_ratio": { "type": "number" }, "status": { "type": "integer" }, "tpm_ratio": { "type": "number" } } }, "model.UpdateTokenRequest": { "type": "object", "properties": { "group_channel_models": { "type": "array", "items": { "type": "string" } }, "group_channel_sets": { "type": "array", "items": { "type": "string" } }, "models": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "period_last_update_time": { "type": "integer" }, "period_quota": { "type": "number" }, "period_type": { "type": "string" }, "quota": { "description": "Quota system", "type": "number" }, "scope": { "type": "string" }, "sets": { "type": "array", "items": { "type": "string" } }, "status": { "type": "integer" }, "subnets": { "type": "array", "items": { "type": "string" } } } }, "model.Usage": { "type": "object", "properties": { "audio_input_tokens": { "type": "integer" }, "audio_output_tokens": { "type": "integer" }, "cache_creation_tokens": { "type": "integer" }, "cached_tokens": { "type": "integer" }, "image_input_tokens": { "type": "integer" }, "image_output_tokens": { "type": "integer" }, "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" }, "reasoning_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" }, "video_input_tokens": { "type": "integer" }, "web_search_count": { "type": "integer" } } }, "model.UsageContext": { "type": "object", "properties": { "input_media": { "type": "boolean" }, "input_video": { "type": "boolean" }, "native_resolution": { "type": "string" }, "output_audio": { "type": "boolean" }, "quality": { "type": "string" }, "resolution": { "type": "string" }, "service_tier": { "type": "string" } } }, "model.Video": { "type": "object", "properties": { "created_at": { "type": "integer" }, "error": { "type": "object", "additionalProperties": {} }, "id": { "type": "string" }, "model": { "type": "string" }, "object": { "type": "string" }, "progress": { "type": "integer" }, "prompt": { "type": "string" }, "seconds": { "type": "integer" }, "size": { "type": "string" }, "status": { "$ref": "#/definitions/model.VideoStatus" } } }, "model.VideoGenerationJob": { "type": "object", "properties": { "created_at": { "type": "integer" }, "expires_at": { "type": "integer" }, "finish_reason": { "type": "string" }, "finished_at": { "type": "integer" }, "generations": { "type": "array", "items": { "$ref": "#/definitions/model.VideoGenerations" } }, "height": { "type": "integer" }, "id": { "type": "string" }, "model": { "type": "string" }, "n_seconds": { "type": "integer" }, "n_variants": { "type": "integer" }, "object": { "type": "string" }, "prompt": { "type": "string" }, "status": { "$ref": "#/definitions/model.VideoGenerationJobStatus" }, "width": { "type": "integer" } } }, "model.VideoGenerationJobRequest": { "type": "object", "properties": { "height": { "type": "integer" }, "model": { "type": "string" }, "n_seconds": { "type": "integer" }, "n_variants": { "type": "integer" }, "prompt": { "type": "string" }, "seconds": { "type": "integer" }, "width": { "type": "integer" } } }, "model.VideoGenerationJobStatus": { "type": "string", "enum": [ "queued", "processing", "running", "succeeded" ], "x-enum-varnames": [ "VideoGenerationJobStatusQueued", "VideoGenerationJobStatusProcessing", "VideoGenerationJobStatusRunning", "VideoGenerationJobStatusSucceeded" ] }, "model.VideoGenerations": { "type": "object", "properties": { "created_at": { "type": "integer" }, "height": { "type": "integer" }, "id": { "type": "string" }, "job_id": { "type": "string" }, "n_seconds": { "type": "integer" }, "object": { "type": "string" }, "prompt": { "type": "string" }, "width": { "type": "integer" } } }, "model.VideoStatus": { "type": "string", "enum": [ "queued", "in_progress", "completed", "succeeded", "failed", "cancelled" ], "x-enum-varnames": [ "VideoStatusQueued", "VideoStatusInProgress", "VideoStatusCompleted", "VideoStatusSucceeded", "VideoStatusFailed", "VideoStatusCancelled" ] }, "model.VideosEditRequest": { "type": "object", "properties": { "input_reference": { "type": "string" }, "model": { "type": "string" }, "prompt": { "type": "string" }, "seconds": {}, "size": { "type": "string" }, "video": {} } }, "model.VideosExtensionRequest": { "type": "object", "properties": { "input_reference": { "type": "string" }, "model": { "type": "string" }, "prompt": { "type": "string" }, "seconds": {}, "size": { "type": "string" }, "video": {} } }, "model.VideosRemixRequest": { "type": "object", "properties": { "input_reference": { "type": "string" }, "model": { "type": "string" }, "prompt": { "type": "string" }, "seconds": {}, "size": { "type": "string" } } }, "model.VideosRequest": { "type": "object", "properties": { "input_reference": { "type": "string" }, "model": { "type": "string" }, "prompt": { "type": "string" }, "seconds": {}, "size": { "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" } } }