mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
@@ -3668,6 +3668,70 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{bot_id}/token-usage": {
|
||||
"get": {
|
||||
"description": "Get daily aggregated token usage for a bot, split by chat and heartbeat, with optional model filter and per-model breakdown",
|
||||
"tags": [
|
||||
"token-usage"
|
||||
],
|
||||
"summary": "Get token usage statistics",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Bot ID",
|
||||
"name": "bot_id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Start date (YYYY-MM-DD)",
|
||||
"name": "from",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "End date exclusive (YYYY-MM-DD)",
|
||||
"name": "to",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Optional model UUID to filter by",
|
||||
"name": "model_id",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.TokenUsageResponse"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/handlers.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bots/{bot_id}/tools": {
|
||||
"post": {
|
||||
"description": "MCP endpoint for tool discovery and invocation.",
|
||||
@@ -7668,6 +7732,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.DailyTokenUsage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"cache_read_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"cache_write_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"day": {
|
||||
"type": "string"
|
||||
},
|
||||
"input_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"output_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"reasoning_tokens": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.EmbeddingsInput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -7990,6 +8077,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.ModelTokenUsage": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"input_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"model_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"model_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"model_slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"output_tokens": {
|
||||
"type": "integer"
|
||||
},
|
||||
"provider_name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.PingResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -8110,6 +8220,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.TokenUsageResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"by_model": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.ModelTokenUsage"
|
||||
}
|
||||
},
|
||||
"chat": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.DailyTokenUsage"
|
||||
}
|
||||
},
|
||||
"heartbeat": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/handlers.DailyTokenUsage"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"handlers.fsOpResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user