Skip to content

Commit d25f72b

Browse files
github-actions[bot]lukehinds
authored andcommitted
Update OpenAPI to version generated from ref b35e9b9 (#781)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f50ecc2 commit d25f72b

File tree

1 file changed

+102
-1
lines changed

1 file changed

+102
-1
lines changed

api/openapi.json

+102-1
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,51 @@
977977
}
978978
}
979979
}
980+
},
981+
"/api/v1/workspaces/{workspace_name}/token-usage": {
982+
"get": {
983+
"tags": [
984+
"CodeGate API",
985+
"Workspaces",
986+
"Token Usage"
987+
],
988+
"summary": "Get Workspace Token Usage",
989+
"description": "Get the token usage of a workspace.",
990+
"operationId": "v1_get_workspace_token_usage",
991+
"parameters": [
992+
{
993+
"name": "workspace_name",
994+
"in": "path",
995+
"required": true,
996+
"schema": {
997+
"type": "string",
998+
"title": "Workspace Name"
999+
}
1000+
}
1001+
],
1002+
"responses": {
1003+
"200": {
1004+
"description": "Successful Response",
1005+
"content": {
1006+
"application/json": {
1007+
"schema": {
1008+
"$ref": "#/components/schemas/TokenUsage"
1009+
}
1010+
}
1011+
}
1012+
},
1013+
"422": {
1014+
"description": "Validation Error",
1015+
"content": {
1016+
"application/json": {
1017+
"schema": {
1018+
"$ref": "#/components/schemas/HTTPValidationError"
1019+
}
1020+
}
1021+
}
1022+
}
1023+
}
1024+
}
9801025
}
9811026
},
9821027
"components": {
@@ -1183,6 +1228,16 @@
11831228
"type": "string",
11841229
"format": "date-time",
11851230
"title": "Conversation Timestamp"
1231+
},
1232+
"token_usage": {
1233+
"anyOf": [
1234+
{
1235+
"$ref": "#/components/schemas/TokenUsage"
1236+
},
1237+
{
1238+
"type": "null"
1239+
}
1240+
]
11861241
}
11871242
},
11881243
"type": "object",
@@ -1191,7 +1246,8 @@
11911246
"provider",
11921247
"type",
11931248
"chat_id",
1194-
"conversation_timestamp"
1249+
"conversation_timestamp",
1250+
"token_usage"
11951251
],
11961252
"title": "Conversation",
11971253
"description": "Represents a conversation."
@@ -1430,6 +1486,51 @@
14301486
],
14311487
"title": "QuestionType"
14321488
},
1489+
"TokenUsage": {
1490+
"properties": {
1491+
"tokens_by_model": {
1492+
"items": {
1493+
"$ref": "#/components/schemas/TokenUsageByModel"
1494+
},
1495+
"type": "array",
1496+
"title": "Tokens By Model"
1497+
},
1498+
"used_tokens": {
1499+
"type": "integer",
1500+
"title": "Used Tokens"
1501+
}
1502+
},
1503+
"type": "object",
1504+
"required": [
1505+
"tokens_by_model",
1506+
"used_tokens"
1507+
],
1508+
"title": "TokenUsage",
1509+
"description": "Represents the tokens used. Includes the information of the tokens used by model.\n`used_tokens` are the total tokens used in the `tokens_by_model` list."
1510+
},
1511+
"TokenUsageByModel": {
1512+
"properties": {
1513+
"provider_type": {
1514+
"$ref": "#/components/schemas/ProviderType"
1515+
},
1516+
"model": {
1517+
"type": "string",
1518+
"title": "Model"
1519+
},
1520+
"used_tokens": {
1521+
"type": "integer",
1522+
"title": "Used Tokens"
1523+
}
1524+
},
1525+
"type": "object",
1526+
"required": [
1527+
"provider_type",
1528+
"model",
1529+
"used_tokens"
1530+
],
1531+
"title": "TokenUsageByModel",
1532+
"description": "Represents the tokens used by a model."
1533+
},
14331534
"ValidationError": {
14341535
"properties": {
14351536
"loc": {

0 commit comments

Comments
 (0)