|
|
@@ -0,0 +1,6913 @@
|
|
|
+// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
|
+package docs
|
|
|
+
|
|
|
+import "github.com/swaggo/swag"
|
|
|
+
|
|
|
+const docTemplate = `{
|
|
|
+ "schemes": {{ marshal .Schemes }},
|
|
|
+ "swagger": "2.0",
|
|
|
+ "info": {
|
|
|
+ "description": "{{escape .Description}}",
|
|
|
+ "title": "{{.Title}}",
|
|
|
+ "contact": {},
|
|
|
+ "version": "{{.Version}}"
|
|
|
+ },
|
|
|
+ "host": "{{.Host}}",
|
|
|
+ "basePath": "{{.BasePath}}",
|
|
|
+ "paths": {
|
|
|
+ "/api/channel": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Adds a new channel to the system",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Add a single channel",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Channel information",
|
|
|
+ "name": "channel",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.AddChannelRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channel/{id}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns detailed information about a specific channel",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Get a channel by ID",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.Channel"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "put": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates an existing channel by its ID",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Update a channel",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Updated channel information",
|
|
|
+ "name": "channel",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.AddChannelRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.Channel"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "delete": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Deletes a channel by its ID",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Delete a channel",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channel/{id}/balance": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the balance for a single channel",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Update channel balance",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channel/{id}/models": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Tests all models in the channel",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Test channel models",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.TestResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channel/{id}/status": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the status of a channel by its ID",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Update channel status",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Status information",
|
|
|
+ "name": "status",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.UpdateChannelStatusRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channel/{id}/{model}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Tests a single model in the channel",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Test channel model",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model name",
|
|
|
+ "name": "model",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.ChannelTest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a paginated list of channels with optional filters",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Get channels with pagination",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Page number",
|
|
|
+ "name": "page",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Items per page",
|
|
|
+ "name": "per_page",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by name",
|
|
|
+ "name": "name",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by key",
|
|
|
+ "name": "key",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by channel type",
|
|
|
+ "name": "channel_type",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by base URL",
|
|
|
+ "name": "base_url",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Order by field",
|
|
|
+ "name": "order",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "channels": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Channel"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Adds multiple channels in a batch operation",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Add multiple channels",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Channel information",
|
|
|
+ "name": "channels",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.AddChannelRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/all": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of all channels without pagination",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Get all channels",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Channel"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/balance": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the balance for all channels",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Update all channels balance",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/batch_delete": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Deletes multiple channels by their IDs",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Delete multiple channels",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Channel IDs",
|
|
|
+ "name": "ids",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/import/oneapi": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Imports channels from OneAPI",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Import channel from OneAPI",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Import channel from OneAPI request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.ImportChannelFromOneAPIRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/search": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Search channels with keyword and optional filters",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Search channels",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Search keyword",
|
|
|
+ "name": "keyword",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Page number",
|
|
|
+ "name": "page",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Items per page",
|
|
|
+ "name": "per_page",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by name",
|
|
|
+ "name": "name",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by key",
|
|
|
+ "name": "key",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by channel type",
|
|
|
+ "name": "channel_type",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by base URL",
|
|
|
+ "name": "base_url",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Order by field",
|
|
|
+ "name": "order",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "channels": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Channel"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/test": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Tests all channels",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channel"
|
|
|
+ ],
|
|
|
+ "summary": "Test all channels",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.TestResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/type_metas": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns metadata for all channel types",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel type metadata",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "$ref": "#/definitions/channeltype.AdaptorMeta"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/channels/type_names": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of all available channel type names",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "channels"
|
|
|
+ ],
|
|
|
+ "summary": "Get all channel type names",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/dashboard": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns the general dashboard data including usage statistics and metrics",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "dashboard"
|
|
|
+ ],
|
|
|
+ "summary": "Get dashboard data",
|
|
|
+ "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 or ID",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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 or ID",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/group/{group}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns detailed information about a specific group",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "group"
|
|
|
+ ],
|
|
|
+ "summary": "Get a group",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/controller.GroupResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "put": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates an existing group with the given information",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "group"
|
|
|
+ ],
|
|
|
+ "summary": "Update a group",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Updated group information",
|
|
|
+ "name": "data",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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}/rpm": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the RPM (Requests Per Minute) for a group",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "group"
|
|
|
+ ],
|
|
|
+ "summary": "Update group RPM",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "RPM information",
|
|
|
+ "name": "data",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/group/{group}/status": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the status of a group",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "group"
|
|
|
+ ],
|
|
|
+ "summary": "Update group status",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Status information",
|
|
|
+ "name": "status",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/group/{group}/tpm": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates the TPM (Tokens Per Minute) for a group",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "group"
|
|
|
+ ],
|
|
|
+ "summary": "Update group TPM",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "TPM information",
|
|
|
+ "name": "data",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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": {
|
|
|
+ "type": "object"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/groups": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of all groups with pagination",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "groups"
|
|
|
+ ],
|
|
|
+ "summary": "Get all groups",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Page number",
|
|
|
+ "name": "page",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Items per page",
|
|
|
+ "name": "per_page",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "groups": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.GroupResponse"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/groups/batch_delete": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Deletes multiple groups by their IDs",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "groups"
|
|
|
+ ],
|
|
|
+ "summary": "Delete multiple groups",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Group IDs",
|
|
|
+ "name": "ids",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/groups/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"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "End timestamp (milliseconds)",
|
|
|
+ "name": "end_time",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.GetGroupLogsResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/log/{group}/detail/{log_id}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get detailed information about a specific log entry in a group",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "log"
|
|
|
+ ],
|
|
|
+ "summary": "Get group log detail",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Log ID",
|
|
|
+ "name": "log_id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.RequestDetail"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/log/{group}/search": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Search logs for a specific group with filters",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "log"
|
|
|
+ ],
|
|
|
+ "summary": "Search group logs",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "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_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "End timestamp (milliseconds)",
|
|
|
+ "name": "end_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by token name",
|
|
|
+ "name": "token_name",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by model name",
|
|
|
+ "name": "model",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by status",
|
|
|
+ "name": "status",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.GetGroupLogsResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/log/{group}/used/models": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get a list of models that have been used in a specific group's logs",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "log"
|
|
|
+ ],
|
|
|
+ "summary": "Get group used models",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/log/{group}/used/token_names": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get a list of token names that have been used in a specific group's logs",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "log"
|
|
|
+ ],
|
|
|
+ "summary": "Get group used token names",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/logs": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a paginated list of all logs with optional filters",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "logs"
|
|
|
+ ],
|
|
|
+ "summary": "Get all logs",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "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_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "End timestamp (milliseconds)",
|
|
|
+ "name": "end_time",
|
|
|
+ "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",
|
|
|
+ "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_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "End timestamp (milliseconds)",
|
|
|
+ "name": "end_time",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "logs": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.RequestDetail"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/logs/detail/{log_id}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get detailed information about a specific log entry",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "logs"
|
|
|
+ ],
|
|
|
+ "summary": "Get log detail",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Log ID",
|
|
|
+ "name": "log_id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.RequestDetail"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/logs/search": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Search logs with various filters",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "logs"
|
|
|
+ ],
|
|
|
+ "summary": "Search logs",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "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_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "End timestamp (milliseconds)",
|
|
|
+ "name": "end_time",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by token name",
|
|
|
+ "name": "token_name",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Filter by model name",
|
|
|
+ "name": "model",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Filter by status",
|
|
|
+ "name": "status",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.GetLogsResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/logs/used/models": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get a list of models that have been used in logs",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "logs"
|
|
|
+ ],
|
|
|
+ "summary": "Get used models",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/model_config": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Saves a model config",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "modelconfig"
|
|
|
+ ],
|
|
|
+ "summary": "Save model config",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Model config",
|
|
|
+ "name": "config",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.SaveModelConfigsRequest"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/model_config/{model}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a model config",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "modelconfig"
|
|
|
+ ],
|
|
|
+ "summary": "Get model config",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model name",
|
|
|
+ "name": "model",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.ModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "delete": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Deletes a model config",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "modelconfig"
|
|
|
+ ],
|
|
|
+ "summary": "Delete model config",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model name",
|
|
|
+ "name": "model",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/model_configs": {
|
|
|
+ "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/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_cost_rank": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns ranking data for models based on cost",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "dashboard"
|
|
|
+ ],
|
|
|
+ "summary": "Get model cost ranking data",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ModelCostRank"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/model_cost_rank/{group}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns model cost ranking data specific to the given group",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "dashboard"
|
|
|
+ ],
|
|
|
+ "summary": "Get model cost ranking data for a specific group",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name or ID",
|
|
|
+ "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.ModelCostRank"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/modelconfigs": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of model configs with pagination",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "modelconfig"
|
|
|
+ ],
|
|
|
+ "summary": "Get model configs",
|
|
|
+ "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/modelconfigs/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/modelconfigs/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",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/modelconfigs/search": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of model configs by keyword",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "modelconfig"
|
|
|
+ ],
|
|
|
+ "summary": "Search model configs",
|
|
|
+ "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": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Channel type",
|
|
|
+ "name": "type",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.BuiltinModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/models/default": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of channel default models and mapping",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "model"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel default models and mapping",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "mapping": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/models/default/{type}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of channel default models and mapping by type",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "model"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel default models and mapping by type",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Channel type",
|
|
|
+ "name": "type",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "mapping": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/models/enabled": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of enabled models",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "model"
|
|
|
+ ],
|
|
|
+ "summary": "Get enabled models",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/models/enabled/channel": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of channel enabled models",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "model"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel 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/channel/{type}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of channel enabled models by type",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "model"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel enabled models by type",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Channel type",
|
|
|
+ "name": "type",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ModelConfig"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/monitor": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of all channel model error rates",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Get all channel model error rates",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "delete": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Clears all model errors",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Clear all model errors",
|
|
|
+ "responses": {
|
|
|
+ "204": {
|
|
|
+ "description": "No Content",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/monitor/banned_channels": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of all banned model channels",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Get all banned model channels",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/monitor/models": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of models error rate",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Get models error rate",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/monitor/{id}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of channel model error rates",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Get channel model error rates",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "delete": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Clears all model errors for a specific channel",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "monitor"
|
|
|
+ ],
|
|
|
+ "summary": "Clear channel all model errors",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Channel ID",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "204": {
|
|
|
+ "description": "No Content",
|
|
|
+ "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": {
|
|
|
+ "204": {
|
|
|
+ "description": "No Content",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/options": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a list of options",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "option"
|
|
|
+ ],
|
|
|
+ "summary": "Get options",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "put": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Updates multiple options",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "option"
|
|
|
+ ],
|
|
|
+ "summary": "Update options",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Options",
|
|
|
+ "name": "options",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/options/{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",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "option"
|
|
|
+ ],
|
|
|
+ "summary": "Update option",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Option key",
|
|
|
+ "name": "key",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Option value",
|
|
|
+ "name": "value",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/status": {
|
|
|
+ "get": {
|
|
|
+ "description": "Returns the status of the server",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "misc"
|
|
|
+ ],
|
|
|
+ "summary": "Get status",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/controller.StatusData"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/token/{group}": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Adds a new token to a specific group",
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "token"
|
|
|
+ ],
|
|
|
+ "summary": "Add group token",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "description": "Token information",
|
|
|
+ "name": "token",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.Token"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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": [
|
|
|
+ "tokens"
|
|
|
+ ],
|
|
|
+ "summary": "Search tokens for a specific 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": {
|
|
|
+ "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": [
|
|
|
+ "tokens"
|
|
|
+ ],
|
|
|
+ "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.Token"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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": "string",
|
|
|
+ "description": "Order",
|
|
|
+ "name": "order",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Name",
|
|
|
+ "name": "name",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Key",
|
|
|
+ "name": "key",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "Status",
|
|
|
+ "name": "status",
|
|
|
+ "in": "query"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group",
|
|
|
+ "name": "group",
|
|
|
+ "in": "query"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "allOf": [
|
|
|
+ {
|
|
|
+ "$ref": "#/definitions/middleware.APIResponse"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "allOf": [
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "tokens": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.TokenResponse"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/api/tokens/{group}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Returns a paginated list of all tokens for a specific group",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "tokens"
|
|
|
+ ],
|
|
|
+ "summary": "Get all tokens for a specific group",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Group name",
|
|
|
+ "name": "group",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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.Token"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "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"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/audio/speech": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "AudioSpeech",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "AudioSpeech",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.TextToSpeechRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "audio binary",
|
|
|
+ "schema": {
|
|
|
+ "type": "file"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/audio/transcription": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "AudioTranscription",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "AudioTranscription",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model",
|
|
|
+ "name": "model",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "file",
|
|
|
+ "description": "File",
|
|
|
+ "name": "file",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.SttJSONResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/audio/translation": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "AudioTranslation",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "AudioTranslation",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model",
|
|
|
+ "name": "model",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "file",
|
|
|
+ "description": "File",
|
|
|
+ "name": "file",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.SttJSONResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/chat/completions": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "ChatCompletions",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "ChatCompletions",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.GeneralOpenAIRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.TextResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/completions": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Completions",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "Completions",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.GeneralOpenAIRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.TextResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/dashboard/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/usage": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Get usage",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "Get usage",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/openai.UsageResponse"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/embeddings": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Embeddings",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "Embeddings",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.EmbeddingRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.EmbeddingResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/images/generations": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "ImagesGenerations",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "ImagesGenerations",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.ImageRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.ImageResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/models": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "List all models",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "List models",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.OpenAIModels"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/models/{model}": {
|
|
|
+ "get": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Retrieve a model",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "Retrieve model",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/controller.OpenAIModels"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/parse-pdf": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "ParsePdf",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "ParsePdf",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Model",
|
|
|
+ "name": "model",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "file",
|
|
|
+ "description": "File",
|
|
|
+ "name": "file",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.ParsePdfResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/v1/rerank": {
|
|
|
+ "post": {
|
|
|
+ "security": [
|
|
|
+ {
|
|
|
+ "ApiKeyAuth": []
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "description": "Rerank",
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "relay"
|
|
|
+ ],
|
|
|
+ "summary": "Rerank",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "Request",
|
|
|
+ "name": "request",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.RerankRequest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "Optional Aiproxy-Channel header",
|
|
|
+ "name": "Aiproxy-Channel",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.RerankResponse"
|
|
|
+ },
|
|
|
+ "headers": {
|
|
|
+ "X-RateLimit-Limit-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Limit-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Limit-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Requests": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Remaining-Tokens": {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "X-RateLimit-Remaining-Tokens"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Requests": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Requests"
|
|
|
+ },
|
|
|
+ "X-RateLimit-Reset-Tokens": {
|
|
|
+ "type": "string",
|
|
|
+ "description": "X-RateLimit-Reset-Tokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "definitions": {
|
|
|
+ "channeltype.AdaptorMeta": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "defaultBaseUrl": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "keyHelp": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.AddChannelRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "base_url": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "config": {
|
|
|
+ "$ref": "#/definitions/model.ChannelConfig"
|
|
|
+ },
|
|
|
+ "key": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "model_mapping": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "priority": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.BuiltinModelConfig": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "cache_creation_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "cached_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "config": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {}
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "exclude_from_tests": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "image_batch_size": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "image_prices": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "input_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "output_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "owner": {
|
|
|
+ "$ref": "#/definitions/model.ModelOwner"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "$ref": "#/definitions/mode.Mode"
|
|
|
+ },
|
|
|
+ "updated_at": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.GroupResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "accessed_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "rpm_ratio": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "tpm_ratio": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.ImportChannelFromOneAPIRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "dsn": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.OpenAIModelPermission": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "allow_create_engine": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "allow_fine_tuning": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "allow_logprobs": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "allow_sampling": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "allow_search_indices": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "allow_view": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "created": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "group": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "is_blocking": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "organization": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.OpenAIModels": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "created": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "owned_by": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "parent": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "permission": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/controller.OpenAIModelPermission"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "root": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.SaveModelConfigsRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "cache_creation_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "cached_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "config": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {}
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "exclude_from_tests": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "image_batch_size": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "image_prices": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "input_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "output_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "owner": {
|
|
|
+ "$ref": "#/definitions/model.ModelOwner"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "$ref": "#/definitions/mode.Mode"
|
|
|
+ },
|
|
|
+ "updated_at": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.StatusData": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "startTime": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.TestResult": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "$ref": "#/definitions/model.ChannelTest"
|
|
|
+ },
|
|
|
+ "message": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "success": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.TokenResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "accessed_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "expired_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "group": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "key": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "quota": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "subnets": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.UpdateChannelStatusRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.UpdateTokenNameRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "controller.UpdateTokenStatusRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "middleware.APIResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {},
|
|
|
+ "message": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "success": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "mode.Mode": {
|
|
|
+ "type": "integer",
|
|
|
+ "enum": [
|
|
|
+ 0,
|
|
|
+ 1,
|
|
|
+ 2,
|
|
|
+ 3,
|
|
|
+ 4,
|
|
|
+ 5,
|
|
|
+ 6,
|
|
|
+ 7,
|
|
|
+ 8,
|
|
|
+ 9,
|
|
|
+ 10,
|
|
|
+ 11
|
|
|
+ ],
|
|
|
+ "x-enum-varnames": [
|
|
|
+ "Unknown",
|
|
|
+ "ChatCompletions",
|
|
|
+ "Completions",
|
|
|
+ "Embeddings",
|
|
|
+ "Moderations",
|
|
|
+ "ImagesGenerations",
|
|
|
+ "Edits",
|
|
|
+ "AudioSpeech",
|
|
|
+ "AudioTranscription",
|
|
|
+ "AudioTranslation",
|
|
|
+ "Rerank",
|
|
|
+ "ParsePdf"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "model.Audio": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "format": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "voice": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Channel": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "balance": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "balance_threshold": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "balance_updated_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "base_url": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "channel_tests": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ChannelTest"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "config": {
|
|
|
+ "$ref": "#/definitions/model.ChannelConfig"
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "enabled_auto_balance_check": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "key": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "last_test_error_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "model_mapping": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "priority": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ChannelConfig": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "split_think": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ChannelTest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "actual_model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "channel_id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "channel_name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "channel_type": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "code": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "mode": {
|
|
|
+ "$ref": "#/definitions/mode.Mode"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "response": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "success": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "test_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "took": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ChartData": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "exception_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "timestamp": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.DashboardResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "chart_data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ChartData"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "exception_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "total_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Document": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "text": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.EmbeddingRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "dimensions": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "encoding_format": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "input": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.EmbeddingResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.EmbeddingResponseItem"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "usage": {
|
|
|
+ "$ref": "#/definitions/model.Usage"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.EmbeddingResponseItem": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "embedding": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "index": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Function": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "arguments": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "description": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "parameters": {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.GeneralOpenAIRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "audio": {
|
|
|
+ "$ref": "#/definitions/model.Audio"
|
|
|
+ },
|
|
|
+ "dimensions": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "encoding_format": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "frequency_penalty": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "function_call": {},
|
|
|
+ "functions": {},
|
|
|
+ "input": {},
|
|
|
+ "instruction": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "logit_bias": {},
|
|
|
+ "logprobs": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "max_completion_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "max_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "messages": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Message"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "metadata": {},
|
|
|
+ "modalities": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "n": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "num_ctx": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "parallel_tool_calls": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "prediction": {},
|
|
|
+ "presence_penalty": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "prompt": {},
|
|
|
+ "quality": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "response_format": {
|
|
|
+ "$ref": "#/definitions/model.ResponseFormat"
|
|
|
+ },
|
|
|
+ "seed": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "service_tier": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "size": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "stop": {},
|
|
|
+ "store": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "stream": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "stream_options": {
|
|
|
+ "$ref": "#/definitions/model.StreamOptions"
|
|
|
+ },
|
|
|
+ "style": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "temperature": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "tool_choice": {},
|
|
|
+ "tools": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Tool"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "top_k": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "top_logprobs": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "top_p": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "user": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.GetGroupLogsResult": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "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": {
|
|
|
+ "logs": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Log"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Group": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "rpm_ratio": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "tpm_ratio": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.GroupDashboardResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "chart_data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ChartData"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "exception_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "token_names": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "total_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ImageData": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "b64_json": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "revised_prompt": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "url": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ImageRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "n": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "prompt": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "quality": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "response_format": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "size": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "style": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "user": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ImageResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "created": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "data": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.ImageData"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.JSONSchema": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "description": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "schema": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": true
|
|
|
+ },
|
|
|
+ "strict": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Log": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "cache_creation_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "cache_creation_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "cached_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "cached_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "channel": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "code": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "completion_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "completion_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "content": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "downstream_result": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "endpoint": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "group": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "ip": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "mode": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "prompt_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "request_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "request_detail": {
|
|
|
+ "$ref": "#/definitions/model.RequestDetail"
|
|
|
+ },
|
|
|
+ "request_id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "retry_times": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "timestamp_trunc_by_day": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "timestamp_trunc_by_hour": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "token_id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "token_name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "total_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Message": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "content": {},
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "reasoning_content": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "role": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "tool_call_id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "tool_calls": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.Tool"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ModelConfig": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "cache_creation_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "cached_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "config": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {}
|
|
|
+ },
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "exclude_from_tests": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "image_batch_size": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "image_prices": {
|
|
|
+ "type": "object",
|
|
|
+ "additionalProperties": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "input_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "output_price": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "owner": {
|
|
|
+ "$ref": "#/definitions/model.ModelOwner"
|
|
|
+ },
|
|
|
+ "rpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "tpm": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "$ref": "#/definitions/mode.Mode"
|
|
|
+ },
|
|
|
+ "updated_at": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ModelCostRank": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "total": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "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"
|
|
|
+ ],
|
|
|
+ "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"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ "model.Option": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "key": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "value": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ParsePdfResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "markdown": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "pages": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.PromptTokensDetails": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "cache_creation_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "cached_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RequestDetail": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "log_id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "request_body": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "request_body_truncated": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "response_body": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "response_body_truncated": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RerankMeta": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "tokens": {
|
|
|
+ "$ref": "#/definitions/model.RerankMetaTokens"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RerankMetaTokens": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "input_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "output_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RerankRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "documents": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "max_chunks_per_doc": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "overlap_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "query": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "return_documents": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "top_n": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RerankResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "meta": {
|
|
|
+ "$ref": "#/definitions/model.RerankMeta"
|
|
|
+ },
|
|
|
+ "results": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.RerankResult"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RerankResult": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "document": {
|
|
|
+ "$ref": "#/definitions/model.Document"
|
|
|
+ },
|
|
|
+ "index": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "relevance_score": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.ResponseFormat": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "json_schema": {
|
|
|
+ "$ref": "#/definitions/model.JSONSchema"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.StreamOptions": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "include_usage": {
|
|
|
+ "type": "boolean"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.SttJSONResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "text": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.TextResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "choices": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "$ref": "#/definitions/model.TextResponseChoice"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "created": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "usage": {
|
|
|
+ "$ref": "#/definitions/model.Usage"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.TextResponseChoice": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "finish_reason": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "index": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "message": {
|
|
|
+ "$ref": "#/definitions/model.Message"
|
|
|
+ },
|
|
|
+ "text": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.TextToSpeechRequest": {
|
|
|
+ "type": "object",
|
|
|
+ "required": [
|
|
|
+ "input",
|
|
|
+ "model",
|
|
|
+ "voice"
|
|
|
+ ],
|
|
|
+ "properties": {
|
|
|
+ "input": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "model": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "response_format": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "speed": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "voice": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Token": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "created_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "expired_at": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "group": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "key": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "models": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "quota": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "request_count": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "status": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "subnets": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "used_amount": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Tool": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "function": {
|
|
|
+ "$ref": "#/definitions/model.Function"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Usage": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "completion_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "prompt_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "prompt_tokens_details": {
|
|
|
+ "$ref": "#/definitions/model.PromptTokensDetails"
|
|
|
+ },
|
|
|
+ "total_tokens": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "openai.SubscriptionResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "access_until": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "hard_limit_usd": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "has_payment_method": {
|
|
|
+ "type": "boolean"
|
|
|
+ },
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "soft_limit_usd": {
|
|
|
+ "type": "number"
|
|
|
+ },
|
|
|
+ "system_hard_limit_usd": {
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "openai.UsageResponse": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "object": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "total_usage": {
|
|
|
+ "description": "DailyCosts []OpenAIUsageDailyCost ` + "`" + `json:\"daily_costs\"` + "`" + `",
|
|
|
+ "type": "number"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "securityDefinitions": {
|
|
|
+ "ApiKeyAuth": {
|
|
|
+ "type": "apiKey",
|
|
|
+ "name": "Authorization",
|
|
|
+ "in": "header"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}`
|
|
|
+
|
|
|
+// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
+var SwaggerInfo = &swag.Spec{
|
|
|
+ Version: "",
|
|
|
+ Host: "",
|
|
|
+ BasePath: "",
|
|
|
+ Schemes: []string{},
|
|
|
+ Title: "",
|
|
|
+ Description: "",
|
|
|
+ InfoInstanceName: "swagger",
|
|
|
+ SwaggerTemplate: docTemplate,
|
|
|
+ LeftDelim: "{{",
|
|
|
+ RightDelim: "}}",
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
+}
|