feat(llm): mask API keys in UI responses and prevent masked-key leakage in fetch/test/save payloads

- Add mask_api_key() and is_masked_or_placeholder() to llm_provider service
- Return masked keys in all provider CRUD endpoints
- Reject masked/placeholder keys in fetch_models and test_provider_config
- Show masked key with Change button in ProviderConfig.svelte edit form
- Exclude masked keys from fetch-models, test, and submit payloads on frontend
- Update semantics-core skill with clarified complexity tier rules
- Switch agent modes from subagent to all
This commit is contained in:
2026-05-15 23:34:09 +03:00
parent b3572ce443
commit 30ba70933d
203 changed files with 158083 additions and 28396 deletions

View File

@@ -0,0 +1,339 @@
{
"/models": {
"get": {
"tags": [
"model management"
],
"summary": "Model List",
"description": "Use `/model/info` - to get detailed model information, example - pricing, mode, etc.\n\nThis is just for compatibility with openai projects like aider.\n\nQuery Parameters:\n- include_metadata: Include additional metadata in the response with fallback information\n- fallback_type: Type of fallbacks to include (\"general\", \"context_window\", \"content_policy\")\n Defaults to \"general\" when include_metadata=true\n- scope: Optional scope parameter. Currently only accepts \"expand\".\n When scope=expand is passed, proxy admins, team admins, and org admins\n will receive all proxy models as if they are a proxy admin.",
"operationId": "model_list_models_get",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "return_wildcard_routes",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Return Wildcard Routes"
}
},
{
"name": "team_id",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Team Id"
}
},
{
"name": "include_model_access_groups",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Include Model Access Groups"
}
},
{
"name": "only_model_access_groups",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Only Model Access Groups"
}
},
{
"name": "include_metadata",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"title": "Include Metadata"
}
},
{
"name": "fallback_type",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Fallback Type"
}
},
{
"name": "scope",
"in": "query",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Scope"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/models/{model_id}": {
"get": {
"tags": [
"model management"
],
"summary": "Model Info",
"description": "Retrieve information about a specific model accessible to your API key.\n\nReturns model details only if the model is available to your API key/team.\nReturns 404 if the model doesn't exist or is not accessible.\n\nFollows OpenAI API specification for individual model retrieval.\nhttps://platform.openai.com/docs/api-reference/models/retrieve",
"operationId": "model_info_models__model_id__get",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "model_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Model Id"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/models/{model_name}:countTokens": {
"post": {
"tags": [
"google genai endpoints"
],
"summary": "Google Count Tokens",
"description": "```json\nreturn {\n \"totalTokens\": 31,\n \"totalBillableCharacters\": 96,\n \"promptTokensDetails\": [\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 31\n }\n ]\n}\n```",
"operationId": "google_count_tokens_models__model_name__countTokens_post",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "model_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Model Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TokenCountDetailsResponse"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/models/{model_name}:generateContent": {
"post": {
"tags": [
"google genai endpoints"
],
"summary": "Google Generate Content",
"operationId": "google_generate_content_models__model_name__generateContent_post",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "model_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Model Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/models/{model_name}:streamGenerateContent": {
"post": {
"tags": [
"google genai endpoints"
],
"summary": "Google Stream Generate Content",
"operationId": "google_stream_generate_content_models__model_name__streamGenerateContent_post",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "model_name",
"in": "path",
"required": true,
"schema": {
"type": "string",
"title": "Model Name"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
}
}