Integrate pricing with canonical model (#6130)

This commit is contained in:
David Katz
2025-12-18 11:44:36 -05:00
committed by GitHub
parent 473f269daa
commit 6a0b8c25d5
17 changed files with 263 additions and 1034 deletions
+98
View File
@@ -854,6 +854,36 @@
}
}
},
"/config/pricing": {
"post": {
"tags": [
"super::routes::config_management"
],
"operationId": "get_pricing",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PricingQuery"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Model pricing data retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PricingResponse"
}
}
}
}
}
}
},
"/config/providers": {
"get": {
"tags": [
@@ -4223,6 +4253,74 @@
"never_allow"
]
},
"PricingData": {
"type": "object",
"required": [
"provider",
"model",
"input_token_cost",
"output_token_cost",
"currency"
],
"properties": {
"context_length": {
"type": "integer",
"format": "int32",
"nullable": true,
"minimum": 0
},
"currency": {
"type": "string"
},
"input_token_cost": {
"type": "number",
"format": "double"
},
"model": {
"type": "string"
},
"output_token_cost": {
"type": "number",
"format": "double"
},
"provider": {
"type": "string"
}
}
},
"PricingQuery": {
"type": "object",
"required": [
"provider",
"model"
],
"properties": {
"model": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"PricingResponse": {
"type": "object",
"required": [
"pricing",
"source"
],
"properties": {
"pricing": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PricingData"
}
},
"source": {
"type": "string"
}
}
},
"PrincipalType": {
"type": "string",
"enum": [