diff --git a/.github/workflows/check-lazy-openapi-snapshot.yml b/.github/workflows/check-lazy-openapi-snapshot.yml new file mode 100644 index 0000000000..cf5fc56a6d --- /dev/null +++ b/.github/workflows/check-lazy-openapi-snapshot.yml @@ -0,0 +1,75 @@ +name: Check Lazy OpenAPI Snapshot + +on: + pull_request: + branches: + - main + - litellm_internal_staging + - "litellm_**" + +permissions: + contents: read + checks: write + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + verify: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: "3.12" + + - name: Set up uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7 + with: + version: "0.10.9" + + - name: Cache uv dependencies + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: | + ~/.cache/uv + .venv + key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + + - name: Install dependencies + run: uv sync --frozen --all-groups --all-extras + + - name: Regenerate snapshot to /tmp + id: regen + run: | + cp litellm/proxy/_lazy_openapi_snapshot.json /tmp/snapshot.committed.json + uv run --no-sync python -m litellm.proxy._lazy_openapi_snapshot + mv litellm/proxy/_lazy_openapi_snapshot.json /tmp/snapshot.fresh.json + mv /tmp/snapshot.committed.json litellm/proxy/_lazy_openapi_snapshot.json + + - name: Compare + id: diff + continue-on-error: true + run: | + diff -q /tmp/snapshot.fresh.json litellm/proxy/_lazy_openapi_snapshot.json + + - name: Mark neutral if drift + if: steps.diff.outcome == 'failure' + uses: LouisBrunner/checks-action@v2.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: lazy-openapi-snapshot + conclusion: neutral + output: | + { + "title": "Lazy openapi snapshot is stale", + "summary": "Run `python -m litellm.proxy._lazy_openapi_snapshot` and commit the regenerated `litellm/proxy/_lazy_openapi_snapshot.json`. Not blocking — the snapshot will regenerate at release if not committed." + } diff --git a/litellm/proxy/_lazy_features.py b/litellm/proxy/_lazy_features.py index 3a8129987d..5902c7c145 100644 --- a/litellm/proxy/_lazy_features.py +++ b/litellm/proxy/_lazy_features.py @@ -309,15 +309,81 @@ class LazyFeatureMiddleware: def attach_lazy_features(app: "FastAPI") -> None: + app.include_router(_make_warmup_router(app)) app.add_middleware(LazyFeatureMiddleware, fastapi_app=app) +def _make_warmup_router(app: "FastAPI") -> "APIRouter": + """POST /lazy/warm/{name}: load a feature and return its partial openapi + so the Swagger plugin can merge in-place without a full /openapi.json refetch.""" + from fastapi import APIRouter, HTTPException + from fastapi.openapi.utils import get_openapi + + router = APIRouter() + + @router.post("/lazy/warm/{name}", include_in_schema=False) + async def warm(name: str): + feat = next((f for f in LAZY_FEATURES if f.name == name), None) + if feat is None: + raise HTTPException(404, f"unknown lazy feature: {name}") + if feat.persistent_swagger_stub: + return {"stub_path": None, "paths": {}, "components": {"schemas": {}}} + + already = any( + any(getattr(r, "path", "").startswith(p) for p in feat.path_prefixes) + for r in app.routes + ) + if not already: + loop = asyncio.get_running_loop() + module = await loop.run_in_executor( + None, importlib.import_module, feat.module_path + ) + feat.register_fn(app, module) + app.openapi_schema = None + + feat_routes = [ + r + for r in app.routes + if any(getattr(r, "path", "").startswith(p) for p in feat.path_prefixes) + ] + full = get_openapi(title=app.title, version=app.version, routes=feat_routes) + # Force all operations under one tag so they group under a single Swagger + # section — many lazy modules tag routes inconsistently. + for path_ops in full.get("paths", {}).values(): + for op in path_ops.values(): + if isinstance(op, dict): + op["tags"] = [feat.name] + return { + "stub_path": feat.path_prefixes[0], + "paths": full.get("paths", {}), + "components": {"schemas": full.get("components", {}).get("schemas", {})}, + } + + return router + + def inject_lazy_stubs(schema: Dict) -> Dict: - """Stub openapi entries for unloaded features so Swagger renders sections.""" + """Inject openapi entries for unloaded features. Uses the snapshot file + when available (full route info), otherwise falls back to a single + placeholder per feature.""" + from litellm.proxy._lazy_openapi_snapshot import load_snapshot + + snapshot = load_snapshot() paths = schema.setdefault("paths", {}) + schemas = schema.setdefault("components", {}).setdefault("schemas", {}) + for feat in LAZY_FEATURES: if feat.module_path in sys.modules and not feat.persistent_swagger_stub: continue + + fragment = (snapshot or {}).get(feat.name) + if fragment: + for p, ops in fragment.get("paths", {}).items(): + paths.setdefault(p, ops) + for name, sch in fragment.get("components", {}).get("schemas", {}).items(): + schemas.setdefault(name, sch) + continue + prefix = feat.path_prefixes[0] if prefix in paths: continue @@ -333,8 +399,12 @@ def inject_lazy_stubs(schema: Dict) -> Dict: def lazy_tag_to_prefix() -> Dict[str, str]: """feature.name -> first prefix, used by the Swagger warmup JS plugin. - Excludes persistent-stub features (mounted sub-apps) — warming them - triggers a streaming hit and no useful new routes appear.""" + Returns empty when the snapshot is loaded — the plugin is unnecessary + because /openapi.json already has full route info.""" + from litellm.proxy._lazy_openapi_snapshot import load_snapshot + + if load_snapshot(): + return {} return { feat.name: feat.path_prefixes[0] for feat in LAZY_FEATURES diff --git a/litellm/proxy/_lazy_openapi_snapshot.json b/litellm/proxy/_lazy_openapi_snapshot.json new file mode 100644 index 0000000000..8331f748c6 --- /dev/null +++ b/litellm/proxy/_lazy_openapi_snapshot.json @@ -0,0 +1,31651 @@ +{ + "a2a": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/a2a/{agent_id}": { + "post": { + "description": "Invoke an agent using the A2A protocol (JSON-RPC 2.0).\n\nSupported methods:\n- message/send: Send a message and get a response\n- message/stream: Send a message and stream the response", + "operationId": "invoke_agent_a2a_a2a__agent_id__post", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Invoke Agent A2A", + "tags": [ + "a2a" + ] + } + }, + "/a2a/{agent_id}/.well-known/agent-card.json": { + "get": { + "description": "Get the agent card for an agent (A2A discovery endpoint).\n\nSupports both standard paths:\n- /.well-known/agent-card.json\n- /.well-known/agent.json\n\nThe URL in the agent card is rewritten to point to the LiteLLM proxy,\nso all subsequent A2A calls go through LiteLLM for logging and cost tracking.", + "operationId": "get_agent_card_a2a__agent_id___well_known_agent_card_json_get", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Agent Card", + "tags": [ + "a2a" + ] + } + }, + "/a2a/{agent_id}/.well-known/agent.json": { + "get": { + "description": "Get the agent card for an agent (A2A discovery endpoint).\n\nSupports both standard paths:\n- /.well-known/agent-card.json\n- /.well-known/agent.json\n\nThe URL in the agent card is rewritten to point to the LiteLLM proxy,\nso all subsequent A2A calls go through LiteLLM for logging and cost tracking.", + "operationId": "get_agent_card_a2a__agent_id___well_known_agent_json_get", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Agent Card", + "tags": [ + "a2a" + ] + } + }, + "/a2a/{agent_id}/message/send": { + "post": { + "description": "Invoke an agent using the A2A protocol (JSON-RPC 2.0).\n\nSupported methods:\n- message/send: Send a message and get a response\n- message/stream: Send a message and stream the response", + "operationId": "invoke_agent_a2a_a2a__agent_id__message_send_post", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Invoke Agent A2A", + "tags": [ + "a2a" + ] + } + }, + "/v1/a2a/{agent_id}/message/send": { + "post": { + "description": "Invoke an agent using the A2A protocol (JSON-RPC 2.0).\n\nSupported methods:\n- message/send: Send a message and get a response\n- message/stream: Send a message and stream the response", + "operationId": "invoke_agent_a2a_v1_a2a__agent_id__message_send_post", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Invoke Agent A2A", + "tags": [ + "a2a" + ] + } + } + } + }, + "access_groups": { + "components": { + "schemas": { + "AccessGroupCreateRequest": { + "properties": { + "access_agent_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Agent Ids" + }, + "access_group_name": { + "title": "Access Group Name", + "type": "string" + }, + "access_mcp_server_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Mcp Server Ids" + }, + "access_model_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Model Names" + }, + "assigned_key_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Assigned Key Ids" + }, + "assigned_team_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Assigned Team Ids" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + } + }, + "required": [ + "access_group_name" + ], + "title": "AccessGroupCreateRequest", + "type": "object" + }, + "AccessGroupInfo": { + "properties": { + "access_group": { + "title": "Access Group", + "type": "string" + }, + "deployment_count": { + "title": "Deployment Count", + "type": "integer" + }, + "model_names": { + "items": { + "type": "string" + }, + "title": "Model Names", + "type": "array" + } + }, + "required": [ + "access_group", + "model_names", + "deployment_count" + ], + "title": "AccessGroupInfo", + "type": "object" + }, + "AccessGroupResponse": { + "properties": { + "access_agent_ids": { + "items": { + "type": "string" + }, + "title": "Access Agent Ids", + "type": "array" + }, + "access_group_id": { + "title": "Access Group Id", + "type": "string" + }, + "access_group_name": { + "title": "Access Group Name", + "type": "string" + }, + "access_mcp_server_ids": { + "items": { + "type": "string" + }, + "title": "Access Mcp Server Ids", + "type": "array" + }, + "access_model_names": { + "items": { + "type": "string" + }, + "title": "Access Model Names", + "type": "array" + }, + "assigned_key_ids": { + "items": { + "type": "string" + }, + "title": "Assigned Key Ids", + "type": "array" + }, + "assigned_team_ids": { + "items": { + "type": "string" + }, + "title": "Assigned Team Ids", + "type": "array" + }, + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + } + }, + "required": [ + "access_group_id", + "access_group_name", + "access_model_names", + "access_mcp_server_ids", + "access_agent_ids", + "assigned_team_ids", + "assigned_key_ids", + "created_at", + "updated_at" + ], + "title": "AccessGroupResponse", + "type": "object" + }, + "AccessGroupUpdateRequest": { + "properties": { + "access_agent_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Agent Ids" + }, + "access_group_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Access Group Name" + }, + "access_mcp_server_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Mcp Server Ids" + }, + "access_model_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Access Model Names" + }, + "assigned_key_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Assigned Key Ids" + }, + "assigned_team_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Assigned Team Ids" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + } + }, + "title": "AccessGroupUpdateRequest", + "type": "object" + }, + "DeleteModelGroupResponse": { + "properties": { + "access_group": { + "title": "Access Group", + "type": "string" + }, + "message": { + "title": "Message", + "type": "string" + }, + "models_updated": { + "title": "Models Updated", + "type": "integer" + } + }, + "required": [ + "access_group", + "models_updated", + "message" + ], + "title": "DeleteModelGroupResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListAccessGroupsResponse": { + "properties": { + "access_groups": { + "items": { + "$ref": "#/components/schemas/AccessGroupInfo" + }, + "title": "Access Groups", + "type": "array" + } + }, + "required": [ + "access_groups" + ], + "title": "ListAccessGroupsResponse", + "type": "object" + }, + "NewModelGroupRequest": { + "properties": { + "access_group": { + "title": "Access Group", + "type": "string" + }, + "model_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Ids" + }, + "model_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Names" + } + }, + "required": [ + "access_group" + ], + "title": "NewModelGroupRequest", + "type": "object" + }, + "NewModelGroupResponse": { + "properties": { + "access_group": { + "title": "Access Group", + "type": "string" + }, + "model_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Ids" + }, + "model_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Names" + }, + "models_updated": { + "title": "Models Updated", + "type": "integer" + } + }, + "required": [ + "access_group", + "models_updated" + ], + "title": "NewModelGroupResponse", + "type": "object" + }, + "UpdateModelGroupRequest": { + "properties": { + "model_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Ids" + }, + "model_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Model Names" + } + }, + "title": "UpdateModelGroupRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/access_group/list": { + "get": { + "description": "List all access groups.\n\nReturns a list of all access groups with their model names and deployment counts.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/list' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nReturns:\n- ListAccessGroupsResponse with all access groups", + "operationId": "list_access_groups_access_group_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListAccessGroupsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Access Groups", + "tags": [ + "access_groups" + ] + } + }, + "/access_group/new": { + "post": { + "description": "Create a new access group containing multiple model names.\n\nAn access group is a named collection of model groups that can be referenced\nby teams/keys for simplified access control.\n\nExample:\n```bash\ncurl -X POST 'http://localhost:4000/access_group/new' \\\n -H 'Authorization: Bearer sk-1234' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"access_group\": \"production-models\",\n \"model_names\": [\"gpt-4\", \"claude-3-opus\", \"gemini-pro\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (e.g., \"production-models\")\n- model_names: List[str] - List of existing model groups to include\n\nReturns:\n- NewModelGroupResponse with the created access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 500: If database operations fail", + "operationId": "create_model_group_access_group_new_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewModelGroupRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewModelGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Model Group", + "tags": [ + "access_groups" + ] + } + }, + "/access_group/{access_group}/delete": { + "delete": { + "description": "Delete an access group.\n\nRemoves the access group from all deployments that have it.\n\nExample:\n```bash\ncurl -X DELETE 'http://localhost:4000/access_group/production-models/delete' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- DeleteModelGroupResponse with deletion details\n\nRaises:\n- HTTPException 404: If access group not found", + "operationId": "delete_access_group_access_group__access_group__delete_delete", + "parameters": [ + { + "in": "path", + "name": "access_group", + "required": true, + "schema": { + "title": "Access Group", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteModelGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Access Group", + "tags": [ + "access_groups" + ] + } + }, + "/access_group/{access_group}/info": { + "get": { + "description": "Get information about a specific access group.\n\nExample:\n```bash\ncurl -X GET 'http://localhost:4000/access_group/production-models/info' \\\n -H 'Authorization: Bearer sk-1234'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n\nReturns:\n- AccessGroupInfo with the access group details\n\nRaises:\n- HTTPException 404: If access group not found", + "operationId": "get_access_group_info_access_group__access_group__info_get", + "parameters": [ + { + "in": "path", + "name": "access_group", + "required": true, + "schema": { + "title": "Access Group", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupInfo" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Access Group Info", + "tags": [ + "access_groups" + ] + } + }, + "/access_group/{access_group}/update": { + "put": { + "description": "Update an access group's model names.\n\nThis will:\n1. Remove the access group from all current deployments\n2. Add the access group to all deployments for the new model_names list\n\nExample:\n```bash\ncurl -X PUT 'http://localhost:4000/access_group/production-models/update' \\\n -H 'Authorization: Bearer sk-1234' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"model_names\": [\"gpt-4\", \"claude-3-sonnet\"]\n }'\n```\n\nParameters:\n- access_group: str - The access group name (URL path parameter)\n- model_names: List[str] - New list of model groups to include\n\nReturns:\n- NewModelGroupResponse with the updated access group details\n\nRaises:\n- HTTPException 400: If any model names don't exist\n- HTTPException 404: If access group not found", + "operationId": "update_access_group_access_group__access_group__update_put", + "parameters": [ + { + "in": "path", + "name": "access_group", + "required": true, + "schema": { + "title": "Access Group", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateModelGroupRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewModelGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Access Group", + "tags": [ + "access_groups" + ] + } + }, + "/v1/access_group": { + "get": { + "operationId": "list_access_groups_v1_access_group_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/AccessGroupResponse" + }, + "title": "Response List Access Groups V1 Access Group Get", + "type": "array" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Access Groups", + "tags": [ + "access_groups" + ] + }, + "post": { + "operationId": "create_access_group_v1_access_group_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Access Group", + "tags": [ + "access_groups" + ] + } + }, + "/v1/access_group/{access_group_id}": { + "delete": { + "operationId": "delete_access_group_v1_access_group__access_group_id__delete", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Access Group", + "tags": [ + "access_groups" + ] + }, + "get": { + "operationId": "get_access_group_v1_access_group__access_group_id__get", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Access Group", + "tags": [ + "access_groups" + ] + }, + "put": { + "operationId": "update_access_group_v1_access_group__access_group_id__put", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Access Group", + "tags": [ + "access_groups" + ] + } + }, + "/v1/unified_access_group": { + "get": { + "operationId": "list_access_groups_v1_unified_access_group_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/AccessGroupResponse" + }, + "title": "Response List Access Groups V1 Unified Access Group Get", + "type": "array" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Access Groups", + "tags": [ + "access_groups" + ] + }, + "post": { + "operationId": "create_access_group_v1_unified_access_group_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Access Group", + "tags": [ + "access_groups" + ] + } + }, + "/v1/unified_access_group/{access_group_id}": { + "delete": { + "operationId": "delete_access_group_v1_unified_access_group__access_group_id__delete", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Access Group", + "tags": [ + "access_groups" + ] + }, + "get": { + "operationId": "get_access_group_v1_unified_access_group__access_group_id__get", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Access Group", + "tags": [ + "access_groups" + ] + }, + "put": { + "operationId": "update_access_group_v1_unified_access_group__access_group_id__put", + "parameters": [ + { + "in": "path", + "name": "access_group_id", + "required": true, + "schema": { + "title": "Access Group Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessGroupResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Access Group", + "tags": [ + "access_groups" + ] + } + } + } + }, + "agents": { + "components": { + "schemas": { + "APIKeySecurityScheme": { + "description": "Defines a security scheme using an API key.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "in_": { + "enum": [ + "query", + "header", + "cookie" + ], + "title": "In", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "type": { + "const": "apiKey", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "in_", + "name" + ], + "title": "APIKeySecurityScheme", + "type": "object" + }, + "AgentCapabilities": { + "description": "Defines optional capabilities supported by an agent.", + "properties": { + "extensions": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AgentExtension" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extensions" + }, + "pushNotifications": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Pushnotifications" + }, + "stateTransitionHistory": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Statetransitionhistory" + }, + "streaming": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Streaming" + } + }, + "title": "AgentCapabilities", + "type": "object" + }, + "AgentCard": { + "description": "The AgentCard is a self-describing manifest for an agent.\nIt provides essential metadata including the agent's identity, capabilities,\nskills, supported communication methods, and security requirements.", + "properties": { + "additionalInterfaces": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AgentInterface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Additionalinterfaces" + }, + "capabilities": { + "$ref": "#/components/schemas/AgentCapabilities" + }, + "defaultInputModes": { + "items": { + "type": "string" + }, + "title": "Defaultinputmodes", + "type": "array" + }, + "defaultOutputModes": { + "items": { + "type": "string" + }, + "title": "Defaultoutputmodes", + "type": "array" + }, + "description": { + "title": "Description", + "type": "string" + }, + "documentationUrl": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Documentationurl" + }, + "iconUrl": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Iconurl" + }, + "name": { + "title": "Name", + "type": "string" + }, + "preferredTransport": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Preferredtransport" + }, + "protocolVersion": { + "title": "Protocolversion", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "$ref": "#/components/schemas/AgentProvider" + }, + { + "type": "null" + } + ] + }, + "security": { + "anyOf": [ + { + "items": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Security" + }, + "securitySchemes": { + "anyOf": [ + { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/components/schemas/APIKeySecurityScheme" + }, + { + "$ref": "#/components/schemas/HTTPAuthSecurityScheme" + }, + { + "$ref": "#/components/schemas/OAuth2SecurityScheme" + }, + { + "$ref": "#/components/schemas/OpenIdConnectSecurityScheme" + }, + { + "$ref": "#/components/schemas/MutualTLSSecurityScheme" + } + ] + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Securityschemes" + }, + "signatures": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/AgentCardSignature" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Signatures" + }, + "skills": { + "items": { + "$ref": "#/components/schemas/AgentSkill" + }, + "title": "Skills", + "type": "array" + }, + "supportsAuthenticatedExtendedCard": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Supportsauthenticatedextendedcard" + }, + "url": { + "title": "Url", + "type": "string" + }, + "version": { + "title": "Version", + "type": "string" + } + }, + "title": "AgentCard", + "type": "object" + }, + "AgentCardSignature": { + "description": "Represents a JWS signature of an AgentCard.", + "properties": { + "header": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Header" + }, + "protected": { + "title": "Protected", + "type": "string" + }, + "signature": { + "title": "Signature", + "type": "string" + } + }, + "title": "AgentCardSignature", + "type": "object" + }, + "AgentConfig": { + "properties": { + "agent_card_params": { + "$ref": "#/components/schemas/AgentCard" + }, + "agent_name": { + "title": "Agent Name", + "type": "string" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "litellm_params": { + "additionalProperties": true, + "title": "Litellm Params", + "type": "object" + }, + "object_permission": { + "$ref": "#/components/schemas/AgentObjectPermission" + }, + "rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Rpm Limit" + }, + "session_rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Rpm Limit" + }, + "session_tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Tpm Limit" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Tpm Limit" + } + }, + "required": [ + "agent_name", + "agent_card_params" + ], + "title": "AgentConfig", + "type": "object" + }, + "AgentExtension": { + "description": "A declaration of a protocol extension supported by an Agent.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Params" + }, + "required": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Required" + }, + "uri": { + "title": "Uri", + "type": "string" + } + }, + "title": "AgentExtension", + "type": "object" + }, + "AgentInterface": { + "description": "Declares a combination of a target URL and a transport protocol.", + "properties": { + "transport": { + "title": "Transport", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "title": "AgentInterface", + "type": "object" + }, + "AgentMakePublicResponse": { + "properties": { + "message": { + "title": "Message", + "type": "string" + }, + "public_agent_groups": { + "items": { + "type": "string" + }, + "title": "Public Agent Groups", + "type": "array" + }, + "updated_by": { + "title": "Updated By", + "type": "string" + } + }, + "required": [ + "message", + "public_agent_groups", + "updated_by" + ], + "title": "AgentMakePublicResponse", + "type": "object" + }, + "AgentObjectPermission": { + "properties": { + "agents": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Agents" + }, + "mcp_access_groups": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Mcp Access Groups" + }, + "mcp_servers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Mcp Servers" + }, + "mcp_tool_permissions": { + "anyOf": [ + { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Tool Permissions" + }, + "models": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Models" + } + }, + "title": "AgentObjectPermission", + "type": "object" + }, + "AgentProvider": { + "description": "Represents the service provider of an agent.", + "properties": { + "organization": { + "title": "Organization", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "title": "AgentProvider", + "type": "object" + }, + "AgentResponse": { + "properties": { + "agent_card_params": { + "additionalProperties": true, + "title": "Agent Card Params", + "type": "object" + }, + "agent_id": { + "title": "Agent Id", + "type": "string" + }, + "agent_name": { + "title": "Agent Name", + "type": "string" + }, + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "litellm_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Litellm Params" + }, + "object_permission": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Object Permission" + }, + "rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Rpm Limit" + }, + "session_rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Rpm Limit" + }, + "session_tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Tpm Limit" + }, + "spend": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Spend" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Tpm Limit" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + } + }, + "required": [ + "agent_id", + "agent_name", + "agent_card_params" + ], + "title": "AgentResponse", + "type": "object" + }, + "AgentSkill": { + "description": "Represents a distinct capability or function that an agent can perform.", + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "examples": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Examples" + }, + "id": { + "title": "Id", + "type": "string" + }, + "inputModes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Inputmodes" + }, + "name": { + "title": "Name", + "type": "string" + }, + "outputModes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Outputmodes" + }, + "security": { + "anyOf": [ + { + "items": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Security" + }, + "tags": { + "items": { + "type": "string" + }, + "title": "Tags", + "type": "array" + } + }, + "title": "AgentSkill", + "type": "object" + }, + "BreakdownMetrics": { + "description": "Breakdown of spend by different dimensions", + "properties": { + "api_keys": { + "additionalProperties": { + "$ref": "#/components/schemas/KeyMetricWithMetadata" + }, + "title": "Api Keys", + "type": "object" + }, + "endpoints": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Endpoints", + "type": "object" + }, + "entities": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Entities", + "type": "object" + }, + "mcp_servers": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Mcp Servers", + "type": "object" + }, + "model_groups": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Model Groups", + "type": "object" + }, + "models": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Models", + "type": "object" + }, + "providers": { + "additionalProperties": { + "$ref": "#/components/schemas/MetricWithMetadata" + }, + "title": "Providers", + "type": "object" + } + }, + "title": "BreakdownMetrics", + "type": "object" + }, + "DailySpendData": { + "properties": { + "breakdown": { + "$ref": "#/components/schemas/BreakdownMetrics" + }, + "date": { + "format": "date", + "title": "Date", + "type": "string" + }, + "metrics": { + "$ref": "#/components/schemas/SpendMetrics" + } + }, + "required": [ + "date", + "metrics" + ], + "title": "DailySpendData", + "type": "object" + }, + "DailySpendMetadata": { + "properties": { + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + }, + "page": { + "default": 1, + "title": "Page", + "type": "integer" + }, + "total_api_requests": { + "default": 0, + "title": "Total Api Requests", + "type": "integer" + }, + "total_cache_creation_input_tokens": { + "default": 0, + "title": "Total Cache Creation Input Tokens", + "type": "integer" + }, + "total_cache_read_input_tokens": { + "default": 0, + "title": "Total Cache Read Input Tokens", + "type": "integer" + }, + "total_completion_tokens": { + "default": 0, + "title": "Total Completion Tokens", + "type": "integer" + }, + "total_failed_requests": { + "default": 0, + "title": "Total Failed Requests", + "type": "integer" + }, + "total_pages": { + "default": 1, + "title": "Total Pages", + "type": "integer" + }, + "total_prompt_tokens": { + "default": 0, + "title": "Total Prompt Tokens", + "type": "integer" + }, + "total_spend": { + "default": 0.0, + "title": "Total Spend", + "type": "number" + }, + "total_successful_requests": { + "default": 0, + "title": "Total Successful Requests", + "type": "integer" + }, + "total_tokens": { + "default": 0, + "title": "Total Tokens", + "type": "integer" + } + }, + "title": "DailySpendMetadata", + "type": "object" + }, + "HTTPAuthSecurityScheme": { + "description": "Defines a security scheme using HTTP authentication.", + "properties": { + "bearerFormat": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Bearerformat" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "scheme": { + "title": "Scheme", + "type": "string" + }, + "type": { + "const": "http", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "scheme", + "bearerFormat" + ], + "title": "HTTPAuthSecurityScheme", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "KeyMetadata": { + "description": "Metadata for a key", + "properties": { + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Alias" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + } + }, + "title": "KeyMetadata", + "type": "object" + }, + "KeyMetricWithMetadata": { + "description": "Base class for metrics with additional metadata", + "properties": { + "metadata": { + "$ref": "#/components/schemas/KeyMetadata" + }, + "metrics": { + "$ref": "#/components/schemas/SpendMetrics" + } + }, + "required": [ + "metrics" + ], + "title": "KeyMetricWithMetadata", + "type": "object" + }, + "MakeAgentsPublicRequest": { + "properties": { + "agent_ids": { + "items": { + "type": "string" + }, + "title": "Agent Ids", + "type": "array" + } + }, + "required": [ + "agent_ids" + ], + "title": "MakeAgentsPublicRequest", + "type": "object" + }, + "MetricWithMetadata": { + "properties": { + "api_key_breakdown": { + "additionalProperties": { + "$ref": "#/components/schemas/KeyMetricWithMetadata" + }, + "title": "Api Key Breakdown", + "type": "object" + }, + "metadata": { + "additionalProperties": true, + "title": "Metadata", + "type": "object" + }, + "metrics": { + "$ref": "#/components/schemas/SpendMetrics" + } + }, + "required": [ + "metrics" + ], + "title": "MetricWithMetadata", + "type": "object" + }, + "MutualTLSSecurityScheme": { + "description": "Defines a security scheme using mTLS authentication.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "type": { + "const": "mutualTLS", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "MutualTLSSecurityScheme", + "type": "object" + }, + "OAuth2SecurityScheme": { + "description": "Defines a security scheme using OAuth 2.0.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "flows": { + "$ref": "#/components/schemas/OAuthFlows" + }, + "oauth2MetadataUrl": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Oauth2Metadataurl" + }, + "type": { + "const": "oauth2", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "flows", + "oauth2MetadataUrl" + ], + "title": "OAuth2SecurityScheme", + "type": "object" + }, + "OAuthFlows": { + "description": "Defines the configuration for the supported OAuth 2.0 flows.", + "properties": { + "authorizationCode": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Authorizationcode" + }, + "clientCredentials": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Clientcredentials" + }, + "implicit": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Implicit" + }, + "password": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Password" + } + }, + "title": "OAuthFlows", + "type": "object" + }, + "OpenIdConnectSecurityScheme": { + "description": "Defines a security scheme using OpenID Connect.", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "openIdConnectUrl": { + "title": "Openidconnecturl", + "type": "string" + }, + "type": { + "const": "openIdConnect", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "openIdConnectUrl" + ], + "title": "OpenIdConnectSecurityScheme", + "type": "object" + }, + "PatchAgentRequest": { + "properties": { + "agent_card_params": { + "$ref": "#/components/schemas/AgentCard" + }, + "agent_name": { + "title": "Agent Name", + "type": "string" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "litellm_params": { + "additionalProperties": true, + "title": "Litellm Params", + "type": "object" + }, + "object_permission": { + "$ref": "#/components/schemas/AgentObjectPermission" + }, + "rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Rpm Limit" + }, + "session_rpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Rpm Limit" + }, + "session_tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Session Tpm Limit" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "tpm_limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Tpm Limit" + } + }, + "title": "PatchAgentRequest", + "type": "object" + }, + "SpendAnalyticsPaginatedResponse": { + "properties": { + "metadata": { + "$ref": "#/components/schemas/DailySpendMetadata" + }, + "results": { + "items": { + "$ref": "#/components/schemas/DailySpendData" + }, + "title": "Results", + "type": "array" + } + }, + "required": [ + "results" + ], + "title": "SpendAnalyticsPaginatedResponse", + "type": "object" + }, + "SpendMetrics": { + "properties": { + "api_requests": { + "default": 0, + "title": "Api Requests", + "type": "integer" + }, + "cache_creation_input_tokens": { + "default": 0, + "title": "Cache Creation Input Tokens", + "type": "integer" + }, + "cache_read_input_tokens": { + "default": 0, + "title": "Cache Read Input Tokens", + "type": "integer" + }, + "completion_tokens": { + "default": 0, + "title": "Completion Tokens", + "type": "integer" + }, + "failed_requests": { + "default": 0, + "title": "Failed Requests", + "type": "integer" + }, + "prompt_tokens": { + "default": 0, + "title": "Prompt Tokens", + "type": "integer" + }, + "spend": { + "default": 0.0, + "title": "Spend", + "type": "number" + }, + "successful_requests": { + "default": 0, + "title": "Successful Requests", + "type": "integer" + }, + "total_tokens": { + "default": 0, + "title": "Total Tokens", + "type": "integer" + } + }, + "title": "SpendMetrics", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/agent/daily/activity": { + "get": { + "description": "Get daily activity for specific agents or all accessible agents.", + "operationId": "get_agent_daily_activity_agent_daily_activity_get", + "parameters": [ + { + "in": "query", + "name": "agent_ids", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Agent Ids" + } + }, + { + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Start Date" + } + }, + { + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "End Date" + } + }, + { + "in": "query", + "name": "model", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + } + }, + { + "in": "query", + "name": "api_key", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Api Key" + } + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 10, + "title": "Page Size", + "type": "integer" + } + }, + { + "in": "query", + "name": "exclude_agent_ids", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Exclude Agent Ids" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpendAnalyticsPaginatedResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Agent Daily Activity", + "tags": [ + "agents" + ] + } + }, + "/v1/agents": { + "get": { + "description": "Example usage:\n```\ncurl -X GET \"http://localhost:4000/v1/agents\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer your-key\" ```\n\nPass `?health_check=true` to filter out agents whose URL is unreachable:\n```\ncurl -X GET \"http://localhost:4000/v1/agents?health_check=true\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer your-key\" ```\n\nReturns: List[AgentResponse]", + "operationId": "get_agents_v1_agents_get", + "parameters": [ + { + "description": "When true, performs a GET request to each agent's URL. Agents with reachable URLs (HTTP status < 500) and agents without a URL are returned; unreachable agents are filtered out.", + "in": "query", + "name": "health_check", + "required": false, + "schema": { + "default": false, + "description": "When true, performs a GET request to each agent's URL. Agents with reachable URLs (HTTP status < 500) and agents without a URL are returned; unreachable agents are filtered out.", + "title": "Health Check", + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/AgentResponse" + }, + "title": "Response Get Agents V1 Agents Get", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Agents", + "tags": [ + "agents" + ] + }, + "post": { + "description": "Create a new agent\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/agents\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"agent\": {\n \"agent_name\": \"my-custom-agent\",\n \"agent_card_params\": {\n \"protocolVersion\": \"1.0\",\n \"name\": \"Hello World Agent\",\n \"description\": \"Just a hello world agent\",\n \"url\": \"http://localhost:9999/\",\n \"version\": \"1.0.0\",\n \"defaultInputModes\": [\"text\"],\n \"defaultOutputModes\": [\"text\"],\n \"capabilities\": {\n \"streaming\": true\n },\n \"skills\": [\n {\n \"id\": \"hello_world\",\n \"name\": \"Returns hello world\",\n \"description\": \"just returns hello world\",\n \"tags\": [\"hello world\"],\n \"examples\": [\"hi\", \"hello world\"]\n }\n ]\n },\n \"litellm_params\": {\n \"make_public\": true\n }\n }\n }'\n```", + "operationId": "create_agent_v1_agents_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Agent", + "tags": [ + "agents" + ] + } + }, + "/v1/agents/make_public": { + "post": { + "description": "Make multiple agents publicly discoverable\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/v1/agents/make_public\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"agent_ids\": [\"123e4567-e89b-12d3-a456-426614174000\", \"123e4567-e89b-12d3-a456-426614174001\"]\n }'\n```\n\nExample Response:\n```json\n{\n \"agent_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"agent_name\": \"my-custom-agent\",\n \"litellm_params\": {\n \"make_public\": true\n },\n \"agent_card_params\": {...},\n \"created_at\": \"2025-11-15T10:30:00Z\",\n \"updated_at\": \"2025-11-15T10:35:00Z\",\n \"created_by\": \"user123\",\n \"updated_by\": \"user123\"\n}\n```", + "operationId": "make_agents_public_v1_agents_make_public_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MakeAgentsPublicRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentMakePublicResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Make Agents Public", + "tags": [ + "agents" + ] + } + }, + "/v1/agents/{agent_id}": { + "delete": { + "description": "Delete an agent\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/agents/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Agent 123e4567-e89b-12d3-a456-426614174000 deleted successfully\"\n}\n```", + "operationId": "delete_agent_v1_agents__agent_id__delete", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Agent", + "tags": [ + "agents" + ] + }, + "get": { + "description": "Get a specific agent by ID\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/agents/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```", + "operationId": "get_agent_by_id_v1_agents__agent_id__get", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Agent By Id", + "tags": [ + "agents" + ] + }, + "patch": { + "description": "Update an existing agent\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/agents/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"agent\": {\n \"agent_name\": \"updated-agent\",\n \"agent_card_params\": {\n \"protocolVersion\": \"1.0\",\n \"name\": \"Updated Agent\",\n \"description\": \"Updated description\",\n \"url\": \"http://localhost:9999/\",\n \"version\": \"1.1.0\",\n \"defaultInputModes\": [\"text\"],\n \"defaultOutputModes\": [\"text\"],\n \"capabilities\": {\n \"streaming\": true\n },\n \"skills\": []\n },\n \"litellm_params\": {\n \"make_public\": false\n }\n }\n }'\n```", + "operationId": "patch_agent_v1_agents__agent_id__patch", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchAgentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Patch Agent", + "tags": [ + "agents" + ] + }, + "put": { + "description": "Update an existing agent\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/agents/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"agent\": {\n \"agent_name\": \"updated-agent\",\n \"agent_card_params\": {\n \"protocolVersion\": \"1.0\",\n \"name\": \"Updated Agent\",\n \"description\": \"Updated description\",\n \"url\": \"http://localhost:9999/\",\n \"version\": \"1.1.0\",\n \"defaultInputModes\": [\"text\"],\n \"defaultOutputModes\": [\"text\"],\n \"capabilities\": {\n \"streaming\": true\n },\n \"skills\": []\n },\n \"litellm_params\": {\n \"make_public\": false\n }\n }\n }'\n```", + "operationId": "update_agent_v1_agents__agent_id__put", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Agent", + "tags": [ + "agents" + ] + } + }, + "/v1/agents/{agent_id}/make_public": { + "post": { + "description": "Make an agent publicly discoverable\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/v1/agents/123e4567-e89b-12d3-a456-426614174000/make_public\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\"\n```\n\nExample Response:\n```json\n{\n \"agent_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"agent_name\": \"my-custom-agent\",\n \"litellm_params\": {\n \"make_public\": true\n },\n \"agent_card_params\": {...},\n \"created_at\": \"2025-11-15T10:30:00Z\",\n \"updated_at\": \"2025-11-15T10:35:00Z\",\n \"created_by\": \"user123\",\n \"updated_by\": \"user123\"\n}\n```", + "operationId": "make_agent_public_v1_agents__agent_id__make_public_post", + "parameters": [ + { + "in": "path", + "name": "agent_id", + "required": true, + "schema": { + "title": "Agent Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentMakePublicResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Make Agent Public", + "tags": [ + "agents" + ] + } + } + } + }, + "anthropic_passthrough": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/anthropic/{endpoint}": { + "delete": { + "description": "[Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion)", + "operationId": "anthropic_proxy_route_anthropic__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Proxy Route", + "tags": [ + "anthropic_passthrough" + ] + }, + "get": { + "description": "[Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion)", + "operationId": "anthropic_proxy_route_anthropic__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Proxy Route", + "tags": [ + "anthropic_passthrough" + ] + }, + "patch": { + "description": "[Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion)", + "operationId": "anthropic_proxy_route_anthropic__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Proxy Route", + "tags": [ + "anthropic_passthrough" + ] + }, + "post": { + "description": "[Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion)", + "operationId": "anthropic_proxy_route_anthropic__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Proxy Route", + "tags": [ + "anthropic_passthrough" + ] + }, + "put": { + "description": "[Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion)", + "operationId": "anthropic_proxy_route_anthropic__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Proxy Route", + "tags": [ + "anthropic_passthrough" + ] + } + }, + "/api/event_logging/batch": { + "post": { + "description": "Stubbed endpoint for Anthropic event logging batch requests.\n\nThis endpoint accepts event logging requests but does nothing with them.\nIt exists to prevent 404 errors from Claude Code clients that send telemetry.", + "operationId": "event_logging_batch_api_event_logging_batch_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Event Logging Batch", + "tags": [ + "anthropic_passthrough" + ] + } + }, + "/v1/messages": { + "post": { + "description": "Use `{PROXY_BASE_URL}/anthropic/v1/messages` instead - [Docs](https://docs.litellm.ai/docs/pass_through/anthropic_completion).\n\nThis was a BETA endpoint that calls 100+ LLMs in the anthropic format.", + "operationId": "anthropic_response_v1_messages_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Anthropic Response", + "tags": [ + "anthropic_passthrough" + ] + } + }, + "/v1/messages/count_tokens": { + "post": { + "description": "Count tokens for Anthropic Messages API format.\n\nThis endpoint follows the Anthropic Messages API token counting specification.\nIt accepts the same parameters as the /v1/messages endpoint but returns\ntoken counts instead of generating a response.\n\nExample usage:\n```\ncurl -X POST \"http://localhost:4000/v1/messages/count_tokens?beta=true\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer your-key\" -d '{\n \"model\": \"claude-3-sonnet-20240229\",\n \"messages\": [{\"role\": \"user\", \"content\": \"Hello Claude!\"}]\n }'\n```\n\nReturns: {\"input_tokens\": }", + "operationId": "count_tokens_v1_messages_count_tokens_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Count Tokens", + "tags": [ + "anthropic_passthrough" + ] + } + } + } + }, + "anthropic_skills": { + "components": { + "schemas": { + "DeleteSkillResponse": { + "description": "Response from deleting a skill", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "type": { + "default": "skill_deleted", + "title": "Type", + "type": "string" + } + }, + "required": [ + "id" + ], + "title": "DeleteSkillResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListSkillsResponse": { + "description": "Response from listing skills", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Skill" + }, + "title": "Data", + "type": "array" + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + }, + "next_page": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next Page" + } + }, + "required": [ + "data" + ], + "title": "ListSkillsResponse", + "type": "object" + }, + "Skill": { + "description": "Represents a skill from the Anthropic Skills API", + "properties": { + "created_at": { + "title": "Created At", + "type": "string" + }, + "display_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Display Title" + }, + "id": { + "title": "Id", + "type": "string" + }, + "latest_version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Latest Version" + }, + "source": { + "title": "Source", + "type": "string" + }, + "type": { + "default": "skill", + "title": "Type", + "type": "string" + }, + "updated_at": { + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "created_at", + "source", + "updated_at" + ], + "title": "Skill", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/v1/skills": { + "get": { + "description": "List skills on Anthropic.\n\nRequires `?beta=true` query parameter.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: claude-account-1`\n- Pass model via query: `?model=claude-account-1`\n- Pass model via body: `{\"model\": \"claude-account-1\"}`\n\nExample usage:\n```bash\n# Basic usage\ncurl \"http://localhost:4000/v1/skills?beta=true&limit=10\" -H \"Authorization: Bearer your-key\"\n\n# With model-based routing\ncurl \"http://localhost:4000/v1/skills?beta=true&limit=10\" -H \"Authorization: Bearer your-key\" -H \"x-litellm-model: claude-account-1\"\n```\n\nReturns: ListSkillsResponse with list of skills", + "operationId": "list_skills_v1_skills_get", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 10, + "title": "Limit" + } + }, + { + "in": "query", + "name": "after_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After Id" + } + }, + { + "in": "query", + "name": "before_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before Id" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "anthropic", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSkillsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Skills", + "tags": [ + "anthropic_skills" + ] + }, + "post": { + "description": "Create a new skill on Anthropic.\n\nRequires `?beta=true` query parameter.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: claude-account-1`\n- Pass model via query: `?model=claude-account-1`\n- Pass model via form field: `model=claude-account-1`\n\nExample usage:\n```bash\n# Basic usage\ncurl -X POST \"http://localhost:4000/v1/skills?beta=true\" -H \"Content-Type: multipart/form-data\" -H \"Authorization: Bearer your-key\" -F \"display_title=My Skill\" -F \"files[]=@skill.zip\"\n\n# With model-based routing\ncurl -X POST \"http://localhost:4000/v1/skills?beta=true\" -H \"Content-Type: multipart/form-data\" -H \"Authorization: Bearer your-key\" -H \"x-litellm-model: claude-account-1\" -F \"display_title=My Skill\" -F \"files[]=@skill.zip\"\n```\n\nReturns: Skill object with id, display_title, etc.", + "operationId": "create_skill_v1_skills_post", + "parameters": [ + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "anthropic", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Skill" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Skill", + "tags": [ + "anthropic_skills" + ] + } + }, + "/v1/skills/{skill_id}": { + "delete": { + "description": "Delete a skill by ID from Anthropic.\n\nRequires `?beta=true` query parameter.\n\nNote: Anthropic does not allow deleting skills with existing versions.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: claude-account-1`\n- Pass model via query: `?model=claude-account-1`\n- Pass model via body: `{\"model\": \"claude-account-1\"}`\n\nExample usage:\n```bash\n# Basic usage\ncurl -X DELETE \"http://localhost:4000/v1/skills/skill_123?beta=true\" -H \"Authorization: Bearer your-key\"\n\n# With model-based routing\ncurl -X DELETE \"http://localhost:4000/v1/skills/skill_123?beta=true\" -H \"Authorization: Bearer your-key\" -H \"x-litellm-model: claude-account-1\"\n```\n\nReturns: DeleteSkillResponse with type=\"skill_deleted\"", + "operationId": "delete_skill_v1_skills__skill_id__delete", + "parameters": [ + { + "in": "path", + "name": "skill_id", + "required": true, + "schema": { + "title": "Skill Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "anthropic", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSkillResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Skill", + "tags": [ + "anthropic_skills" + ] + }, + "get": { + "description": "Get a specific skill by ID from Anthropic.\n\nRequires `?beta=true` query parameter.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: claude-account-1`\n- Pass model via query: `?model=claude-account-1`\n- Pass model via body: `{\"model\": \"claude-account-1\"}`\n\nExample usage:\n```bash\n# Basic usage\ncurl \"http://localhost:4000/v1/skills/skill_123?beta=true\" -H \"Authorization: Bearer your-key\"\n\n# With model-based routing\ncurl \"http://localhost:4000/v1/skills/skill_123?beta=true\" -H \"Authorization: Bearer your-key\" -H \"x-litellm-model: claude-account-1\"\n```\n\nReturns: Skill object", + "operationId": "get_skill_v1_skills__skill_id__get", + "parameters": [ + { + "in": "path", + "name": "skill_id", + "required": true, + "schema": { + "title": "Skill Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "anthropic", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Skill" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Skill", + "tags": [ + "anthropic_skills" + ] + } + } + } + }, + "claude_code_marketplace": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListPluginsResponse": { + "description": "Response from listing plugins.", + "properties": { + "count": { + "title": "Count", + "type": "integer" + }, + "plugins": { + "items": { + "$ref": "#/components/schemas/PluginListItem" + }, + "title": "Plugins", + "type": "array" + } + }, + "required": [ + "plugins", + "count" + ], + "title": "ListPluginsResponse", + "type": "object" + }, + "PluginAuthor": { + "description": "Plugin author information.", + "properties": { + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Author email", + "title": "Email" + }, + "name": { + "description": "Author name", + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "PluginAuthor", + "type": "object" + }, + "PluginListItem": { + "description": "Plugin item in list responses.", + "properties": { + "author": { + "anyOf": [ + { + "$ref": "#/components/schemas/PluginAuthor" + }, + { + "type": "null" + } + ] + }, + "category": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Category" + }, + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "domain": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Domain" + }, + "enabled": { + "title": "Enabled", + "type": "boolean" + }, + "homepage": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Homepage" + }, + "id": { + "title": "Id", + "type": "string" + }, + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Keywords" + }, + "name": { + "title": "Name", + "type": "string" + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Namespace" + }, + "source": { + "additionalProperties": { + "type": "string" + }, + "title": "Source", + "type": "object" + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version" + } + }, + "required": [ + "id", + "name", + "version", + "description", + "source", + "enabled", + "created_at", + "updated_at" + ], + "title": "PluginListItem", + "type": "object" + }, + "RegisterPluginRequest": { + "description": "Request body for registering a plugin in the marketplace.\n\nLiteLLM acts as a registry/discovery layer. Plugins are hosted on\nGitHub/GitLab/Bitbucket and referenced by their git source.", + "properties": { + "author": { + "anyOf": [ + { + "$ref": "#/components/schemas/PluginAuthor" + }, + { + "type": "null" + } + ], + "description": "Plugin author" + }, + "category": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Plugin category", + "title": "Category" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Plugin description", + "title": "Description" + }, + "domain": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Skill domain (e.g., 'Productivity')", + "title": "Domain" + }, + "homepage": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Plugin homepage URL", + "title": "Homepage" + }, + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Search keywords", + "title": "Keywords" + }, + "name": { + "description": "Plugin name (kebab-case, e.g., 'my-plugin')", + "pattern": "^[a-z0-9-]+$", + "title": "Name", + "type": "string" + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Skill namespace within domain (e.g., 'workflows')", + "title": "Namespace" + }, + "source": { + "additionalProperties": { + "type": "string" + }, + "description": "Git source reference. Supported formats:\n- GitHub: {'source': 'github', 'repo': 'org/repo'}\n- Git URL: {'source': 'url', 'url': 'https://github.com/org/repo.git'}\n- Git Subdir: {'source': 'git-subdir', 'url': 'https://github.com/org/repo.git', 'path': 'plugins/plugin-name'}", + "title": "Source", + "type": "object" + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "1.0.0", + "description": "Semantic version", + "title": "Version" + } + }, + "required": [ + "name", + "source" + ], + "title": "RegisterPluginRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/claude-code/marketplace.json": { + "get": { + "description": "Serve marketplace.json for Claude Code plugin discovery.\n\nThis endpoint is accessed by Claude Code CLI when users run:\n- claude plugin marketplace add \n- claude plugin install @\n\nReturns:\n Marketplace catalog with list of available plugins and their git sources.\n\nExample:\n ```bash\n claude plugin marketplace add http://localhost:4000/claude-code/marketplace.json\n claude plugin install my-plugin@litellm\n ```", + "operationId": "get_marketplace_claude_code_marketplace_json_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Get Marketplace", + "tags": [ + "claude_code_marketplace" + ] + } + }, + "/claude-code/plugins": { + "get": { + "description": "List all plugins in the marketplace.\n\nParameters:\n - enabled_only: If true, only return enabled plugins\n\nReturns:\n List of plugins with their metadata.", + "operationId": "list_plugins_claude_code_plugins_get", + "parameters": [ + { + "in": "query", + "name": "enabled_only", + "required": false, + "schema": { + "default": false, + "title": "Enabled Only", + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPluginsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Plugins", + "tags": [ + "claude_code_marketplace" + ] + }, + "post": { + "description": "Register a plugin in the LiteLLM marketplace.\n\nLiteLLM acts as a registry/discovery layer. Plugins are hosted on\nGitHub/GitLab/Bitbucket. Claude Code will clone from the git source\nwhen users install.\n\nParameters:\n - name: Plugin name (kebab-case)\n - source: Git source reference (github, url, or git-subdir format)\n - version: Semantic version (optional)\n - description: Plugin description (optional)\n - author: Author information (optional)\n - homepage: Plugin homepage URL (optional)\n - keywords: Search keywords (optional)\n - category: Plugin category (optional)\n\nReturns:\n Registration status and plugin information.\n\nExample:\n ```bash\n curl -X POST http://localhost:4000/claude-code/plugins \\\n -H \"Authorization: Bearer sk-...\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"my-plugin\",\n \"source\": {\"source\": \"github\", \"repo\": \"org/my-plugin\"},\n \"version\": \"1.0.0\",\n \"description\": \"My awesome plugin\"\n }'\n ```", + "operationId": "register_plugin_claude_code_plugins_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterPluginRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Register Plugin", + "tags": [ + "claude_code_marketplace" + ] + } + }, + "/claude-code/plugins/{plugin_name}": { + "delete": { + "description": "Delete a plugin from the marketplace.\n\nParameters:\n - plugin_name: The name of the plugin to delete", + "operationId": "delete_plugin_claude_code_plugins__plugin_name__delete", + "parameters": [ + { + "in": "path", + "name": "plugin_name", + "required": true, + "schema": { + "title": "Plugin Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Plugin", + "tags": [ + "claude_code_marketplace" + ] + }, + "get": { + "description": "Get details of a specific plugin.\n\nParameters:\n - plugin_name: The name of the plugin\n\nReturns:\n Plugin details including source and metadata.", + "operationId": "get_plugin_claude_code_plugins__plugin_name__get", + "parameters": [ + { + "in": "path", + "name": "plugin_name", + "required": true, + "schema": { + "title": "Plugin Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Plugin", + "tags": [ + "claude_code_marketplace" + ] + } + }, + "/claude-code/plugins/{plugin_name}/disable": { + "post": { + "description": "Disable a plugin without deleting it.\n\nParameters:\n - plugin_name: The name of the plugin to disable", + "operationId": "disable_plugin_claude_code_plugins__plugin_name__disable_post", + "parameters": [ + { + "in": "path", + "name": "plugin_name", + "required": true, + "schema": { + "title": "Plugin Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Disable Plugin", + "tags": [ + "claude_code_marketplace" + ] + } + }, + "/claude-code/plugins/{plugin_name}/enable": { + "post": { + "description": "Enable a disabled plugin.\n\nParameters:\n - plugin_name: The name of the plugin to enable", + "operationId": "enable_plugin_claude_code_plugins__plugin_name__enable_post", + "parameters": [ + { + "in": "path", + "name": "plugin_name", + "required": true, + "schema": { + "title": "Plugin Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Enable Plugin", + "tags": [ + "claude_code_marketplace" + ] + } + } + } + }, + "cloudzero": { + "components": { + "schemas": { + "CloudZeroExportRequest": { + "description": "Request model for CloudZero export operations", + "properties": { + "end_time_utc": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "End time for data export in UTC", + "title": "End Time Utc" + }, + "limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Optional limit on number of records to export", + "title": "Limit" + }, + "operation": { + "default": "replace_hourly", + "description": "CloudZero operation type (replace_hourly or sum)", + "title": "Operation", + "type": "string" + }, + "start_time_utc": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Start time for data export in UTC", + "title": "Start Time Utc" + } + }, + "title": "CloudZeroExportRequest", + "type": "object" + }, + "CloudZeroExportResponse": { + "description": "Response model for CloudZero export operations", + "properties": { + "dry_run_data": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Dry run data including usage data and CBF transformed data", + "title": "Dry Run Data" + }, + "message": { + "title": "Message", + "type": "string" + }, + "records_exported": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Records Exported" + }, + "status": { + "title": "Status", + "type": "string" + }, + "summary": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Summary statistics for dry run", + "title": "Summary" + } + }, + "required": [ + "message", + "status" + ], + "title": "CloudZeroExportResponse", + "type": "object" + }, + "CloudZeroInitRequest": { + "description": "Request model for initializing CloudZero settings", + "properties": { + "api_key": { + "description": "CloudZero API key for authentication", + "title": "Api Key", + "type": "string" + }, + "connection_id": { + "description": "CloudZero connection ID for data submission", + "title": "Connection Id", + "type": "string" + }, + "timezone": { + "default": "UTC", + "description": "Timezone for date handling (default: UTC)", + "title": "Timezone", + "type": "string" + } + }, + "required": [ + "api_key", + "connection_id" + ], + "title": "CloudZeroInitRequest", + "type": "object" + }, + "CloudZeroInitResponse": { + "description": "Response model for CloudZero initialization", + "properties": { + "message": { + "title": "Message", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "message", + "status" + ], + "title": "CloudZeroInitResponse", + "type": "object" + }, + "CloudZeroSettingsUpdate": { + "description": "Request model for updating CloudZero settings", + "properties": { + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New CloudZero API key for authentication", + "title": "Api Key" + }, + "connection_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New CloudZero connection ID for data submission", + "title": "Connection Id" + }, + "timezone": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New timezone for date handling", + "title": "Timezone" + } + }, + "title": "CloudZeroSettingsUpdate", + "type": "object" + }, + "CloudZeroSettingsView": { + "description": "Response model for viewing CloudZero settings with masked API key", + "properties": { + "api_key_masked": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Masked API key showing only first 4 and last 4 characters", + "title": "Api Key Masked" + }, + "connection_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "CloudZero connection ID for data submission", + "title": "Connection Id" + }, + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Configuration status", + "title": "Status" + }, + "timezone": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Timezone for date handling", + "title": "Timezone" + } + }, + "title": "CloudZeroSettingsView", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/cloudzero/delete": { + "delete": { + "description": "Delete CloudZero settings from the database.\n\nThis endpoint removes the CloudZero configuration (API key, connection ID, timezone)\nfrom the proxy database. Only the CloudZero settings entry will be deleted;\nother configuration values in the database will remain unchanged.\n\nOnly admin users can delete CloudZero settings.", + "operationId": "delete_cloudzero_settings_cloudzero_delete_delete", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroInitResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Cloudzero Settings", + "tags": [ + "cloudzero" + ] + } + }, + "/cloudzero/dry-run": { + "post": { + "description": "Perform a dry run export using the CloudZero logger.\n\nThis endpoint uses the CloudZero logger to perform a dry run export,\nwhich returns the data that would be exported without actually sending it to CloudZero.\n\nParameters:\n- limit: Optional limit on number of records to process (default: 10000)\n\nReturns:\n- usage_data: Sample of the raw usage data (first 50 records)\n- cbf_data: CloudZero CBF formatted data ready for export\n- summary: Statistics including total cost, tokens, and record counts\n\nOnly admin users can perform CloudZero exports.", + "operationId": "cloudzero_dry_run_export_cloudzero_dry_run_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroExportRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroExportResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Cloudzero Dry Run Export", + "tags": [ + "cloudzero" + ] + } + }, + "/cloudzero/export": { + "post": { + "description": "Perform an actual export using the CloudZero logger.\n\nThis endpoint uses the CloudZero logger to export usage data to CloudZero AnyCost API.\n\nParameters:\n- limit: Optional limit on number of records to export\n- operation: CloudZero operation type (\"replace_hourly\" or \"sum\", default: \"replace_hourly\")\n\nOnly admin users can perform CloudZero exports.", + "operationId": "cloudzero_export_cloudzero_export_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroExportRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroExportResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Cloudzero Export", + "tags": [ + "cloudzero" + ] + } + }, + "/cloudzero/init": { + "post": { + "description": "Initialize CloudZero settings and store in the database.\n\nThis endpoint stores the CloudZero API key, connection ID, and timezone configuration\nin the proxy database for use by the CloudZero logger.\n\nParameters:\n- api_key: CloudZero API key for authentication\n- connection_id: CloudZero connection ID for data submission\n- timezone: Timezone for date handling (default: UTC)\n\nOnly admin users can configure CloudZero settings.", + "operationId": "init_cloudzero_settings_cloudzero_init_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroInitRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroInitResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Init Cloudzero Settings", + "tags": [ + "cloudzero" + ] + } + }, + "/cloudzero/settings": { + "get": { + "description": "View current CloudZero settings.\n\nReturns the current CloudZero configuration with the API key masked for security.\nOnly the first 4 and last 4 characters of the API key are shown.\nReturns null/empty values when settings are not configured (consistent with other settings endpoints).\n\nOnly admin users can view CloudZero settings.", + "operationId": "get_cloudzero_settings_cloudzero_settings_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroSettingsView" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Cloudzero Settings", + "tags": [ + "cloudzero" + ] + }, + "put": { + "description": "Update existing CloudZero settings.\n\nAllows updating individual CloudZero configuration fields without requiring all fields.\nOnly provided fields will be updated; others will remain unchanged.\n\nParameters:\n- api_key: (Optional) New CloudZero API key for authentication\n- connection_id: (Optional) New CloudZero connection ID for data submission\n- timezone: (Optional) New timezone for date handling\n\nOnly admin users can update CloudZero settings.", + "operationId": "update_cloudzero_settings_cloudzero_settings_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroSettingsUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CloudZeroInitResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Cloudzero Settings", + "tags": [ + "cloudzero" + ] + } + } + } + }, + "compliance": { + "components": { + "schemas": { + "ComplianceCheckRequest": { + "description": "Request payload for compliance check endpoints.\n\nMirrors the spend log fields needed for compliance evaluation.", + "properties": { + "guardrail_information": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Guardrail Information" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "request_id": { + "title": "Request Id", + "type": "string" + }, + "timestamp": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Timestamp" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + } + }, + "required": [ + "request_id" + ], + "title": "ComplianceCheckRequest", + "type": "object" + }, + "ComplianceCheckResult": { + "description": "Result of a single compliance check.", + "properties": { + "article": { + "title": "Article", + "type": "string" + }, + "check_name": { + "title": "Check Name", + "type": "string" + }, + "detail": { + "title": "Detail", + "type": "string" + }, + "passed": { + "title": "Passed", + "type": "boolean" + } + }, + "required": [ + "check_name", + "article", + "passed", + "detail" + ], + "title": "ComplianceCheckResult", + "type": "object" + }, + "ComplianceResponse": { + "description": "Response from a compliance check endpoint.", + "properties": { + "checks": { + "items": { + "$ref": "#/components/schemas/ComplianceCheckResult" + }, + "title": "Checks", + "type": "array" + }, + "compliant": { + "title": "Compliant", + "type": "boolean" + }, + "regulation": { + "title": "Regulation", + "type": "string" + } + }, + "required": [ + "compliant", + "regulation", + "checks" + ], + "title": "ComplianceResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/compliance/eu-ai-act": { + "post": { + "description": "Check EU AI Act compliance for a spend log entry.\n\nChecks:\n- Art. 9: Guardrails applied (any guardrail)\n- Art. 5: Content screened before LLM (pre-call guardrails)\n- Art. 12: Audit record complete (user_id, model, timestamp, guardrail_results)", + "operationId": "check_eu_ai_act_compliance_compliance_eu_ai_act_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComplianceCheckRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComplianceResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Check Eu Ai Act Compliance", + "tags": [ + "compliance" + ] + } + }, + "/compliance/gdpr": { + "post": { + "description": "Check GDPR compliance for a spend log entry.\n\nChecks:\n- Art. 32: Data protection applied (pre-call guardrails)\n- Art. 5(1)(c): Sensitive data protected (masked/blocked or no issues)\n- Art. 30: Audit record complete (user_id, model, timestamp, guardrail_results)", + "operationId": "check_gdpr_compliance_compliance_gdpr_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComplianceCheckRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ComplianceResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Check Gdpr Compliance", + "tags": [ + "compliance" + ] + } + } + } + }, + "config_overrides": { + "components": { + "schemas": { + "ConfigOverrideSettingsResponse": { + "description": "Response model for config override settings GET endpoints.", + "properties": { + "config_type": { + "description": "The type of config override", + "title": "Config Type", + "type": "string" + }, + "field_schema": { + "additionalProperties": true, + "description": "Schema information for UI rendering", + "title": "Field Schema", + "type": "object" + }, + "values": { + "additionalProperties": true, + "description": "Current configuration values (sensitive fields decrypted)", + "title": "Values", + "type": "object" + } + }, + "required": [ + "config_type", + "values", + "field_schema" + ], + "title": "ConfigOverrideSettingsResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "HashicorpVaultConfig": { + "description": "Configuration for Hashicorp Vault secret manager integration.", + "properties": { + "approle_mount_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Mount path for the AppRole auth method (default: approle)", + "title": "Approle Mount Path" + }, + "approle_role_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Role ID for Vault AppRole authentication", + "title": "Approle Role Id" + }, + "approle_secret_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Secret ID for Vault AppRole authentication", + "title": "Approle Secret Id" + }, + "client_cert": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to the client TLS certificate for Vault", + "title": "Client Cert" + }, + "client_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to the client TLS private key for Vault", + "title": "Client Key" + }, + "vault_addr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The address of the Vault server (e.g., https://vault.example.com:8200)", + "title": "Vault Addr" + }, + "vault_cert_role": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Certificate role name for TLS cert authentication", + "title": "Vault Cert Role" + }, + "vault_mount_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "KV engine mount name (default: secret)", + "title": "Vault Mount Name" + }, + "vault_namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Vault namespace (for multi-tenant Vault, sent as X-Vault-Namespace header)", + "title": "Vault Namespace" + }, + "vault_path_prefix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional path prefix for secrets (e.g., myapp -> secret/data/myapp/{secret_name})", + "title": "Vault Path Prefix" + }, + "vault_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Token for Vault token-based authentication", + "title": "Vault Token" + } + }, + "title": "HashicorpVaultConfig", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/config_overrides/hashicorp_vault": { + "delete": { + "description": "Delete Hashicorp Vault configuration. Idempotent.", + "operationId": "delete_hashicorp_vault_config_config_overrides_hashicorp_vault_delete", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Hashicorp Vault Config", + "tags": [ + "config_overrides" + ] + }, + "get": { + "description": "Get current Hashicorp Vault configuration.\nReturns decrypted values from DB, or falls back to current env vars.", + "operationId": "get_hashicorp_vault_config_config_overrides_hashicorp_vault_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConfigOverrideSettingsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Hashicorp Vault Config", + "tags": [ + "config_overrides" + ] + }, + "post": { + "description": "Update Hashicorp Vault secret manager configuration.\nSets environment variables, encrypts sensitive fields, and stores in DB.\nReinitializes the secret manager on this pod.", + "operationId": "update_hashicorp_vault_config_config_overrides_hashicorp_vault_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HashicorpVaultConfig" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Hashicorp Vault Config", + "tags": [ + "config_overrides" + ] + } + }, + "/config_overrides/hashicorp_vault/test_connection": { + "post": { + "description": "Test the connection to the currently configured Hashicorp Vault.\nUses the already-initialized secret manager client. Does not modify any state.", + "operationId": "test_hashicorp_vault_connection_config_overrides_hashicorp_vault_test_connection_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Hashicorp Vault Connection", + "tags": [ + "config_overrides" + ] + } + } + } + }, + "evals": { + "components": { + "schemas": { + "CancelEvalResponse": { + "description": "Response from cancelling an evaluation", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "eval", + "title": "Object", + "type": "string" + }, + "status": { + "const": "cancelled", + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "status" + ], + "title": "CancelEvalResponse", + "type": "object" + }, + "CancelRunResponse": { + "description": "Response from cancelling a run", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "object": { + "default": "eval.run", + "title": "Object", + "type": "string" + }, + "status": { + "const": "cancelled", + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "status" + ], + "title": "CancelRunResponse", + "type": "object" + }, + "DeleteEvalResponse": { + "description": "Response from deleting an evaluation", + "properties": { + "deleted": { + "title": "Deleted", + "type": "boolean" + }, + "eval_id": { + "title": "Eval Id", + "type": "string" + }, + "object": { + "default": "eval.deleted", + "title": "Object", + "type": "string" + } + }, + "required": [ + "eval_id", + "deleted" + ], + "title": "DeleteEvalResponse", + "type": "object" + }, + "Eval": { + "description": "Represents an evaluation from the OpenAI Evals API", + "properties": { + "created_at": { + "title": "Created At", + "type": "integer" + }, + "data_source_config": { + "additionalProperties": true, + "title": "Data Source Config", + "type": "object" + }, + "id": { + "title": "Id", + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "object": { + "default": "eval", + "title": "Object", + "type": "string" + }, + "testing_criteria": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Testing Criteria", + "type": "array" + }, + "updated_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "id", + "created_at", + "data_source_config", + "testing_criteria" + ], + "title": "Eval", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListEvalsResponse": { + "description": "Response from listing evaluations", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Eval" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "First Id" + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + }, + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Id" + }, + "object": { + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "ListEvalsResponse", + "type": "object" + }, + "ListRunsResponse": { + "description": "Response from listing runs", + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/Run" + }, + "title": "Data", + "type": "array" + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "First Id" + }, + "has_more": { + "default": false, + "title": "Has More", + "type": "boolean" + }, + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Id" + }, + "object": { + "default": "list", + "title": "Object", + "type": "string" + } + }, + "required": [ + "data" + ], + "title": "ListRunsResponse", + "type": "object" + }, + "PerTestingCriteriaResult": { + "description": "Results for a specific testing criteria", + "properties": { + "average_score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Average Score" + }, + "result_counts": { + "$ref": "#/components/schemas/ResultCounts" + }, + "testing_criteria_index": { + "title": "Testing Criteria Index", + "type": "integer" + } + }, + "required": [ + "testing_criteria_index", + "result_counts" + ], + "title": "PerTestingCriteriaResult", + "type": "object" + }, + "ResultCounts": { + "description": "Result counts for a run", + "properties": { + "error": { + "default": 0, + "title": "Error", + "type": "integer" + }, + "failed": { + "default": 0, + "title": "Failed", + "type": "integer" + }, + "passed": { + "default": 0, + "title": "Passed", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "total" + ], + "title": "ResultCounts", + "type": "object" + }, + "Run": { + "description": "Represents a run from the OpenAI Evals API", + "properties": { + "completed_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Completed At" + }, + "created_at": { + "title": "Created At", + "type": "integer" + }, + "data_source": { + "additionalProperties": true, + "title": "Data Source", + "type": "object" + }, + "error": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "eval_id": { + "title": "Eval Id", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "object": { + "default": "eval.run", + "title": "Object", + "type": "string" + }, + "per_model_usage": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "title": "Per Model Usage" + }, + "per_testing_criteria_results": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PerTestingCriteriaResult" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Per Testing Criteria Results" + }, + "report_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Report Url" + }, + "result_counts": { + "anyOf": [ + { + "additionalProperties": { + "type": "integer" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Result Counts" + }, + "shared_with_openai": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Shared With Openai" + }, + "started_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Started At" + }, + "status": { + "enum": [ + "queued", + "running", + "completed", + "failed", + "cancelled" + ], + "title": "Status", + "type": "string" + } + }, + "required": [ + "id", + "created_at", + "status", + "data_source", + "eval_id" + ], + "title": "Run", + "type": "object" + }, + "RunDeleteResponse": { + "description": "Response from deleting a run", + "properties": { + "deleted": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "title": "Deleted" + }, + "object": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "eval.run.deleted", + "title": "Object" + }, + "run_id": { + "title": "Run Id", + "type": "string" + } + }, + "required": [ + "run_id" + ], + "title": "RunDeleteResponse", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/v1/evals": { + "get": { + "description": "List evaluations with pagination.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl \"http://localhost:4000/v1/evals?limit=10\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: ListEvalsResponse with list of evaluations", + "operationId": "list_evals_v1_evals_get", + "parameters": [ + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Order" + } + }, + { + "in": "query", + "name": "order_by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Order By" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEvalsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Evals", + "tags": [ + "evals" + ] + }, + "post": { + "description": "Create a new evaluation.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl -X POST \"http://localhost:4000/v1/evals\" -H \"Authorization: Bearer your-key\" -H \"Content-Type: application/json\" -d '{\n \"name\": \"Test Eval\",\n \"data_source_config\": {\"type\": \"file\", \"file_id\": \"file-abc123\"},\n \"testing_criteria\": {\"graders\": [{\"type\": \"llm_as_judge\"}]}\n }'\n```\n\nReturns: Eval object with id, status, timestamps, etc.", + "operationId": "create_eval_v1_evals_post", + "parameters": [ + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Eval", + "tags": [ + "evals" + ] + } + }, + "/v1/evals/{eval_id}": { + "delete": { + "description": "Delete an evaluation.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl -X DELETE \"http://localhost:4000/v1/evals/eval_123\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: DeleteEvalResponse with deletion confirmation", + "operationId": "delete_eval_v1_evals__eval_id__delete", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteEvalResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Eval", + "tags": [ + "evals" + ] + }, + "get": { + "description": "Get a specific evaluation by ID.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl \"http://localhost:4000/v1/evals/eval_123\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: Eval object", + "operationId": "get_eval_v1_evals__eval_id__get", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Eval", + "tags": [ + "evals" + ] + }, + "post": { + "description": "Update an evaluation.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl -X POST \"http://localhost:4000/v1/evals/eval_123\" -H \"Authorization: Bearer your-key\" -H \"Content-Type: application/json\" -d '{\"name\": \"Updated Name\"}'\n```\n\nReturns: Updated Eval object", + "operationId": "update_eval_v1_evals__eval_id__post", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Eval" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Eval", + "tags": [ + "evals" + ] + } + }, + "/v1/evals/{eval_id}/cancel": { + "post": { + "description": "Cancel a running evaluation.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n\nExample usage:\n```bash\ncurl -X POST \"http://localhost:4000/v1/evals/eval_123/cancel\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: CancelEvalResponse with cancellation confirmation", + "operationId": "cancel_eval_v1_evals__eval_id__cancel_post", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelEvalResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Cancel Eval", + "tags": [ + "evals" + ] + } + }, + "/v1/evals/{eval_id}/runs": { + "get": { + "description": "List all runs for an evaluation with pagination.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n\nExample usage:\n```bash\ncurl \"http://localhost:4000/v1/evals/eval_123/runs?limit=10\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: ListRunsResponse with list of runs", + "operationId": "list_runs_v1_evals__eval_id__runs_get", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Order" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRunsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Runs", + "tags": [ + "evals" + ] + }, + "post": { + "description": "Create a new run for an evaluation.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n- Pass model via body: `{\"model\": \"gpt-4-account-1\"}`\n- Pass model via completion.model: `{\"completion\": {\"model\": \"gpt-4-account-1\"}}`\n\nExample usage:\n```bash\ncurl -X POST \"http://localhost:4000/v1/evals/eval_123/runs\" -H \"Authorization: Bearer your-key\" -H \"Content-Type: application/json\" -d '{\n \"data_source\": {\"type\": \"dataset\", \"dataset_id\": \"dataset_123\"},\n \"completion\": {\"model\": \"gpt-4\", \"temperature\": 0.7}\n }'\n```\n\nReturns: Run object with id, status, timestamps, etc.", + "operationId": "create_run_v1_evals__eval_id__runs_post", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Run" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Run", + "tags": [ + "evals" + ] + } + }, + "/v1/evals/{eval_id}/runs/{run_id}": { + "delete": { + "description": "Delete a run.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n\nExample usage:\n```bash\ncurl -X DELETE \"http://localhost:4000/v1/evals/eval_123/runs/run_456\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: RunDeleteResponse with deletion confirmation", + "operationId": "delete_run_v1_evals__eval_id__runs__run_id__delete", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "title": "Run Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RunDeleteResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Run", + "tags": [ + "evals" + ] + }, + "get": { + "description": "Get a specific run by ID.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n\nExample usage:\n```bash\ncurl \"http://localhost:4000/v1/evals/eval_123/runs/run_456\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: Run object with full details", + "operationId": "get_run_v1_evals__eval_id__runs__run_id__get", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "title": "Run Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Run" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Run", + "tags": [ + "evals" + ] + }, + "post": { + "description": "Cancel a running run.\n\nModel-based routing (for multi-account support):\n- Pass model via header: `x-litellm-model: gpt-4-account-1`\n- Pass model via query: `?model=gpt-4-account-1`\n\nExample usage:\n```bash\ncurl -X POST \"http://localhost:4000/v1/evals/eval_123/runs/run_456/cancel\" -H \"Authorization: Bearer your-key\"\n```\n\nReturns: CancelRunResponse with cancellation confirmation", + "operationId": "cancel_run_v1_evals__eval_id__runs__run_id__post", + "parameters": [ + { + "in": "path", + "name": "eval_id", + "required": true, + "schema": { + "title": "Eval Id", + "type": "string" + } + }, + { + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "title": "Run Id", + "type": "string" + } + }, + { + "in": "query", + "name": "custom_llm_provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "openai", + "title": "Custom Llm Provider" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CancelRunResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Cancel Run", + "tags": [ + "evals" + ] + } + } + } + }, + "guardrails": { + "components": { + "schemas": { + "ApplyGuardrailRequest": { + "properties": { + "entities": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/PiiEntityType" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Entities" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "input_type": { + "default": "request", + "title": "Input Type", + "type": "string" + }, + "language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Language" + }, + "messages": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Messages" + }, + "text": { + "title": "Text", + "type": "string" + } + }, + "required": [ + "guardrail_name", + "text" + ], + "title": "ApplyGuardrailRequest", + "type": "object" + }, + "ApplyGuardrailResponse": { + "properties": { + "response_text": { + "title": "Response Text", + "type": "string" + } + }, + "required": [ + "response_text" + ], + "title": "ApplyGuardrailResponse", + "type": "object" + }, + "BaseLitellmParams-Input": { + "additionalProperties": true, + "properties": { + "additional_provider_specific_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Additional provider-specific parameters for generic guardrail APIs", + "title": "Additional Provider Specific Params" + }, + "api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the guardrail service API", + "title": "Api Base" + }, + "api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional custom API endpoint for Model Armor", + "title": "Api Endpoint" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "API key for the guardrail service", + "title": "Api Key" + }, + "blocked_words": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockedWord" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of blocked words with individual actions", + "title": "Blocked Words" + }, + "blocked_words_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to YAML file containing blocked_words list", + "title": "Blocked Words File" + }, + "categories": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterCategoryConfig" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of prebuilt categories to enable (harmful_*, bias_*)", + "title": "Categories" + }, + "category_thresholds": { + "anyOf": [ + { + "$ref": "#/components/schemas/LakeraCategoryThresholds" + }, + { + "type": "null" + } + ], + "description": "Threshold configuration for Lakera guardrail categories" + }, + "credentials": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to Google Cloud credentials JSON file or JSON string", + "title": "Credentials" + }, + "custom_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Python-like code containing the apply_guardrail function for custom guardrail logic", + "title": "Custom Code" + }, + "default_on": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the guardrail is enabled by default", + "title": "Default On" + }, + "detect_secrets_config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Configuration for detect-secrets guardrail", + "title": "Detect Secrets Config" + }, + "end_session_after_n_fails": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: automatically close the session after this many guardrail violations.", + "title": "End Session After N Fails" + }, + "experimental_use_latest_role_message_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "When True, guardrails only receive the latest message for the relevant role (e.g., newest user input pre-call, newest assistant output post-call)", + "title": "Experimental Use Latest Role Message Only" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Header names to forward from the client request to the guardrail (e.g. x-request-id). Only these headers' values are sent; others may be omitted or sent as [present]. Used by generic_guardrail_api (similar to MCP extra_headers).", + "title": "Extra Headers" + }, + "fail_on_error": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to fail the request if Model Armor encounters an error", + "title": "Fail On Error" + }, + "guard_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of the guardrail in guardrails.ai", + "title": "Guard Name" + }, + "keyword_redaction_tag": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Tag to use for keyword redaction", + "title": "Keyword Redaction Tag" + }, + "location": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Google Cloud location/region (e.g., us-central1)", + "title": "Location" + }, + "mask_request_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask request content if guardrail makes any changes", + "title": "Mask Request Content" + }, + "mask_response_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask response content if guardrail makes any changes", + "title": "Mask Response Content" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional field if guardrail requires a 'model' parameter", + "title": "Model" + }, + "on_violation": { + "anyOf": [ + { + "enum": [ + "warn", + "end_session" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: 'warn' speaks the violation message and continues; 'end_session' speaks the message and closes the connection.", + "title": "On Violation" + }, + "pangea_input_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for input (LLM request)", + "title": "Pangea Input Recipe" + }, + "pangea_output_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for output (LLM response)", + "title": "Pangea Output Recipe" + }, + "pattern_redaction_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Format string for pattern redaction (use {pattern_name} placeholder)", + "title": "Pattern Redaction Format" + }, + "patterns": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterPattern" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of patterns (prebuilt or custom regex) to detect", + "title": "Patterns" + }, + "realtime_violation_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The message the bot speaks aloud when a /v1/realtime guardrail fires. Falls back to violation_message_template if not set.", + "title": "Realtime Violation Message" + }, + "severity_threshold": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Minimum severity to block (high, medium, low)", + "title": "Severity Threshold" + }, + "skip_system_message_in_guardrail": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "When True, unified guardrails skip system-role messages when building evaluation inputs (texts and structured_messages). When False, system messages are included even if litellm_settings sets a global skip. When None, use the global litellm.skip_system_message_in_guardrail setting.", + "title": "Skip System Message In Guardrail" + }, + "template_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The ID of your Model Armor template", + "title": "Template Id" + }, + "unreachable_fallback": { + "default": "fail_closed", + "description": "Behavior when a guardrail endpoint is unreachable due to network errors. NOTE: This is currently only implemented by guardrail='generic_guardrail_api'. 'fail_closed' raises an error (default). 'fail_open' logs a critical error and allows the request to proceed.", + "enum": [ + "fail_closed", + "fail_open" + ], + "title": "Unreachable Fallback", + "type": "string" + }, + "violation_message_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Custom message when a guardrail blocks an action. Supports placeholders like {tool_name}, {rule_id}, and {default_message}.", + "title": "Violation Message Template" + } + }, + "title": "BaseLitellmParams", + "type": "object" + }, + "BaseLitellmParams-Output": { + "additionalProperties": true, + "properties": { + "additional_provider_specific_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Additional provider-specific parameters for generic guardrail APIs", + "title": "Additional Provider Specific Params" + }, + "api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the guardrail service API", + "title": "Api Base" + }, + "api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional custom API endpoint for Model Armor", + "title": "Api Endpoint" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "API key for the guardrail service", + "title": "Api Key" + }, + "blocked_words": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockedWord" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of blocked words with individual actions", + "title": "Blocked Words" + }, + "blocked_words_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to YAML file containing blocked_words list", + "title": "Blocked Words File" + }, + "categories": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterCategoryConfig" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of prebuilt categories to enable (harmful_*, bias_*)", + "title": "Categories" + }, + "category_thresholds": { + "anyOf": [ + { + "$ref": "#/components/schemas/LakeraCategoryThresholds" + }, + { + "type": "null" + } + ], + "description": "Threshold configuration for Lakera guardrail categories" + }, + "credentials": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to Google Cloud credentials JSON file or JSON string", + "title": "Credentials" + }, + "custom_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Python-like code containing the apply_guardrail function for custom guardrail logic", + "title": "Custom Code" + }, + "default_on": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the guardrail is enabled by default", + "title": "Default On" + }, + "detect_secrets_config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Configuration for detect-secrets guardrail", + "title": "Detect Secrets Config" + }, + "end_session_after_n_fails": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: automatically close the session after this many guardrail violations.", + "title": "End Session After N Fails" + }, + "experimental_use_latest_role_message_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "When True, guardrails only receive the latest message for the relevant role (e.g., newest user input pre-call, newest assistant output post-call)", + "title": "Experimental Use Latest Role Message Only" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Header names to forward from the client request to the guardrail (e.g. x-request-id). Only these headers' values are sent; others may be omitted or sent as [present]. Used by generic_guardrail_api (similar to MCP extra_headers).", + "title": "Extra Headers" + }, + "fail_on_error": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to fail the request if Model Armor encounters an error", + "title": "Fail On Error" + }, + "guard_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of the guardrail in guardrails.ai", + "title": "Guard Name" + }, + "keyword_redaction_tag": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Tag to use for keyword redaction", + "title": "Keyword Redaction Tag" + }, + "location": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Google Cloud location/region (e.g., us-central1)", + "title": "Location" + }, + "mask_request_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask request content if guardrail makes any changes", + "title": "Mask Request Content" + }, + "mask_response_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask response content if guardrail makes any changes", + "title": "Mask Response Content" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional field if guardrail requires a 'model' parameter", + "title": "Model" + }, + "on_violation": { + "anyOf": [ + { + "enum": [ + "warn", + "end_session" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: 'warn' speaks the violation message and continues; 'end_session' speaks the message and closes the connection.", + "title": "On Violation" + }, + "pangea_input_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for input (LLM request)", + "title": "Pangea Input Recipe" + }, + "pangea_output_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for output (LLM response)", + "title": "Pangea Output Recipe" + }, + "pattern_redaction_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Format string for pattern redaction (use {pattern_name} placeholder)", + "title": "Pattern Redaction Format" + }, + "patterns": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterPattern" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of patterns (prebuilt or custom regex) to detect", + "title": "Patterns" + }, + "realtime_violation_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The message the bot speaks aloud when a /v1/realtime guardrail fires. Falls back to violation_message_template if not set.", + "title": "Realtime Violation Message" + }, + "severity_threshold": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Minimum severity to block (high, medium, low)", + "title": "Severity Threshold" + }, + "skip_system_message_in_guardrail": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "When True, unified guardrails skip system-role messages when building evaluation inputs (texts and structured_messages). When False, system messages are included even if litellm_settings sets a global skip. When None, use the global litellm.skip_system_message_in_guardrail setting.", + "title": "Skip System Message In Guardrail" + }, + "template_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The ID of your Model Armor template", + "title": "Template Id" + }, + "unreachable_fallback": { + "default": "fail_closed", + "description": "Behavior when a guardrail endpoint is unreachable due to network errors. NOTE: This is currently only implemented by guardrail='generic_guardrail_api'. 'fail_closed' raises an error (default). 'fail_open' logs a critical error and allows the request to proceed.", + "enum": [ + "fail_closed", + "fail_open" + ], + "title": "Unreachable Fallback", + "type": "string" + }, + "violation_message_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Custom message when a guardrail blocks an action. Supports placeholders like {tool_name}, {rule_id}, and {default_message}.", + "title": "Violation Message Template" + } + }, + "title": "BaseLitellmParams", + "type": "object" + }, + "BlockedWord": { + "description": "Represents a blocked word with its action and optional description", + "properties": { + "action": { + "$ref": "#/components/schemas/ContentFilterAction", + "description": "Action to take when keyword is detected (BLOCK or MASK)" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional description explaining why this keyword is sensitive", + "title": "Description" + }, + "keyword": { + "description": "The keyword to block or mask", + "title": "Keyword", + "type": "string" + } + }, + "required": [ + "keyword", + "action" + ], + "title": "BlockedWord", + "type": "object" + }, + "ContentFilterAction": { + "description": "Action to take when content filter detects a match", + "enum": [ + "BLOCK", + "MASK" + ], + "title": "ContentFilterAction", + "type": "string" + }, + "ContentFilterCategoryConfig": { + "additionalProperties": true, + "description": "category: \"harmful_self_harm\"\n enabled: true\n action: \"BLOCK\"\n severity_threshold: \"medium\"\n category_file: \"/path/to/custom_file.yaml\" # optional override", + "properties": { + "action": { + "description": "The action to take when the category is detected", + "enum": [ + "BLOCK", + "MASK" + ], + "title": "Action", + "type": "string" + }, + "category": { + "description": "The category to detect", + "title": "Category", + "type": "string" + }, + "category_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional override. Use your own category file instead of the default one.", + "title": "Category File" + }, + "enabled": { + "default": true, + "description": "Whether the category is enabled", + "title": "Enabled", + "type": "boolean" + }, + "severity_threshold": { + "default": "medium", + "description": "The severity threshold to detect the category", + "enum": [ + "high", + "medium", + "low" + ], + "title": "Severity Threshold", + "type": "string" + } + }, + "required": [ + "category", + "action" + ], + "title": "ContentFilterCategoryConfig", + "type": "object" + }, + "ContentFilterPattern": { + "description": "Represents a content filter pattern (prebuilt or custom regex)", + "properties": { + "action": { + "$ref": "#/components/schemas/ContentFilterAction", + "description": "Action to take when pattern matches (BLOCK or MASK)" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name for this pattern (used in logging and error messages)", + "title": "Name" + }, + "pattern": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Custom regex pattern. Required if pattern_type is 'regex'", + "title": "Pattern" + }, + "pattern_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of prebuilt pattern (e.g., 'us_ssn', 'credit_card'). Required if pattern_type is 'prebuilt'", + "title": "Pattern Name" + }, + "pattern_type": { + "description": "Type of pattern: 'prebuilt' for predefined patterns or 'regex' for custom", + "enum": [ + "prebuilt", + "regex" + ], + "title": "Pattern Type", + "type": "string" + } + }, + "required": [ + "pattern_type", + "action" + ], + "title": "ContentFilterPattern", + "type": "object" + }, + "CreateGuardrailRequest": { + "properties": { + "guardrail": { + "$ref": "#/components/schemas/Guardrail" + } + }, + "required": [ + "guardrail" + ], + "title": "CreateGuardrailRequest", + "type": "object" + }, + "GUARDRAIL_DEFINITION_LOCATION": { + "enum": [ + "db", + "config" + ], + "title": "GUARDRAIL_DEFINITION_LOCATION", + "type": "string" + }, + "GraySwanGuardrailConfigModelOptionalParams": { + "description": "Optional parameters for the Gray Swan guardrail.", + "properties": { + "categories": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Default Gray Swan category definitions to send with each request.", + "title": "Categories" + }, + "fail_open": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "If true (default), errors contacting Gray Swan are logged and the request proceeds. If false, errors propagate and block the request.", + "title": "Fail Open" + }, + "guardrail_timeout": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 30.0, + "description": "Timeout in seconds for calling the Gray Swan guardrail service.", + "title": "Guardrail Timeout" + }, + "on_flagged_action": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "passthrough", + "description": "Action when a violation is detected: 'block' rejects the call (400 error), 'monitor' logs only, 'passthrough' replaces response content with violation message (200 status).", + "title": "On Flagged Action" + }, + "policy_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Gray Swan policy identifier to apply during monitoring.", + "title": "Policy Id" + }, + "reasoning_mode": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Gray Swan reasoning mode override. Accepted values: 'off', 'hybrid', 'thinking'.", + "title": "Reasoning Mode" + }, + "violation_threshold": { + "anyOf": [ + { + "maximum": 1.0, + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": 0.5, + "description": "Threshold between 0 and 1 at which Gray Swan violations trigger the configured action.", + "title": "Violation Threshold" + } + }, + "title": "GraySwanGuardrailConfigModelOptionalParams", + "type": "object" + }, + "Guardrail": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "guardrail_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Guardrail Id" + }, + "guardrail_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Guardrail Info" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "litellm_params": { + "$ref": "#/components/schemas/LitellmParams" + }, + "policy_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Policy Template" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "guardrail_name", + "litellm_params" + ], + "title": "Guardrail", + "type": "object" + }, + "GuardrailInfoResponse": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "guardrail_definition_location": { + "$ref": "#/components/schemas/GUARDRAIL_DEFINITION_LOCATION", + "default": "config" + }, + "guardrail_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Guardrail Id" + }, + "guardrail_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Guardrail Info" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "litellm_params": { + "anyOf": [ + { + "$ref": "#/components/schemas/BaseLitellmParams-Output" + }, + { + "type": "null" + } + ] + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "guardrail_name" + ], + "title": "GuardrailInfoResponse", + "type": "object" + }, + "GuardrailSubmissionItem": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "guardrail_id": { + "title": "Guardrail Id", + "type": "string" + }, + "guardrail_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Guardrail Info" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "litellm_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Litellm Params" + }, + "reviewed_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reviewed At" + }, + "status": { + "title": "Status", + "type": "string" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted At" + }, + "submitted_by_email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted By Email" + }, + "submitted_by_user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted By User Id" + }, + "team_guardrail": { + "default": false, + "title": "Team Guardrail", + "type": "boolean" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "guardrail_id", + "guardrail_name", + "status" + ], + "title": "GuardrailSubmissionItem", + "type": "object" + }, + "GuardrailSubmissionSummary": { + "properties": { + "active": { + "title": "Active", + "type": "integer" + }, + "pending_review": { + "title": "Pending Review", + "type": "integer" + }, + "rejected": { + "title": "Rejected", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "total", + "pending_review", + "active", + "rejected" + ], + "title": "GuardrailSubmissionSummary", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "LakeraCategoryThresholds": { + "additionalProperties": true, + "properties": { + "jailbreak": { + "title": "Jailbreak", + "type": "number" + }, + "prompt_injection": { + "title": "Prompt Injection", + "type": "number" + } + }, + "title": "LakeraCategoryThresholds", + "type": "object" + }, + "ListGuardrailSubmissionsResponse": { + "properties": { + "submissions": { + "items": { + "$ref": "#/components/schemas/GuardrailSubmissionItem" + }, + "title": "Submissions", + "type": "array" + }, + "summary": { + "$ref": "#/components/schemas/GuardrailSubmissionSummary" + } + }, + "required": [ + "submissions", + "summary" + ], + "title": "ListGuardrailSubmissionsResponse", + "type": "object" + }, + "ListGuardrailsResponse": { + "properties": { + "guardrails": { + "items": { + "$ref": "#/components/schemas/GuardrailInfoResponse" + }, + "title": "Guardrails", + "type": "array" + } + }, + "required": [ + "guardrails" + ], + "title": "ListGuardrailsResponse", + "type": "object" + }, + "LitellmParams": { + "additionalProperties": true, + "properties": { + "action": { + "default": "block", + "description": "'block' raises an error; 'mask' replaces the code block with a placeholder.", + "enum": [ + "block", + "mask" + ], + "title": "Action", + "type": "string" + }, + "additional_provider_specific_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Additional provider-specific parameters for generic guardrail APIs", + "title": "Additional Provider Specific Params" + }, + "akto_account_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Akto account ID for multi-tenant deployments. Env: AKTO_ACCOUNT_ID. Default: '1000000'.", + "title": "Akto Account Id" + }, + "akto_api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "API key for Akto. Env: AKTO_API_KEY.", + "title": "Akto Api Key" + }, + "akto_base_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Akto Guardrail API Base URL. Env: AKTO_GUARDRAIL_API_BASE.", + "examples": [ + "http://localhost:9090", + "https://akto-ingestion.example.com" + ], + "title": "Akto Base Url" + }, + "akto_vxlan_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Akto VXLAN ID. Env: AKTO_VXLAN_ID. Default: '0'.", + "title": "Akto Vxlan Id" + }, + "anonymize_input": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If True, replaces sensitive content with anonymized version when only PII/PCI/secrets are detected. Only applies in blocking mode. Defaults to False if not provided", + "title": "Anonymize Input" + }, + "api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the Lakera AI API", + "title": "Api Base" + }, + "api_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional custom API endpoint for Model Armor", + "title": "Api Endpoint" + }, + "api_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The Hiddenlayer API Id for the Hiddenlayer API. If not provided, the `HIDDENLAYER_CLIENT_ID` environment variable is checked or https://api.hiddenlayer.ai is used.", + "title": "Api Id" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "API key for the Lakera AI service", + "title": "Api Key" + }, + "api_version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "v1", + "description": "API version for Javelin service", + "title": "Api Version" + }, + "application": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Application name for Javelin service", + "title": "Application" + }, + "application_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Application ID for Noma Security. Defaults to 'litellm' if not provided", + "title": "Application Id" + }, + "assertions": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Custom assertions to validate against the output. Each assertion is a string describing a condition.", + "title": "Assertions" + }, + "async_mode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Set to True to request asynchronous analysis (sets `plr_async` header). Defaults to provider behaviour when omitted.", + "title": "Async Mode" + }, + "auth_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Authorization bearer token for IBM Guardrails API. Reads from IBM_GUARDRAILS_AUTH_TOKEN env var if None.", + "title": "Auth Token" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS access key ID for authentication", + "title": "Aws Access Key Id" + }, + "aws_bedrock_runtime_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS Bedrock runtime endpoint URL", + "title": "Aws Bedrock Runtime Endpoint" + }, + "aws_profile_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS profile name for credential retrieval", + "title": "Aws Profile Name" + }, + "aws_region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS region where your guardrail is deployed", + "title": "Aws Region Name" + }, + "aws_role_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS role name for assuming roles", + "title": "Aws Role Name" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS secret access key for authentication", + "title": "Aws Secret Access Key" + }, + "aws_session_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of the AWS session", + "title": "Aws Session Name" + }, + "aws_session_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS session token for temporary credentials", + "title": "Aws Session Token" + }, + "aws_sts_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "AWS STS endpoint URL", + "title": "Aws Sts Endpoint" + }, + "aws_web_identity_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Web identity token for AWS role assumption", + "title": "Aws Web Identity Token" + }, + "base_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the IBM Guardrails server", + "title": "Base Url" + }, + "block_failures": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If True, blocks requests on API failures. Defaults to True if not provided", + "title": "Block Failures" + }, + "block_on_error": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether to block the request when the PromptGuard API is unreachable. Defaults to true (fail-closed). Set to false for fail-open behaviour.", + "title": "Block On Error" + }, + "block_on_violation": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to block requests when violations are detected. Defaults to True.", + "title": "Block On Violation" + }, + "blocked_languages": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Language tags to block (e.g. python, javascript, bash). Empty or None = block all fenced code blocks.", + "options": [ + "python", + "javascript", + "typescript", + "bash", + "ruby", + "go", + "java", + "csharp", + "php", + "c", + "cpp", + "rust", + "sql" + ], + "title": "Blocked Languages", + "ui_type": "multiselect" + }, + "blocked_words": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BlockedWord" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of blocked words with individual actions", + "title": "Blocked Words" + }, + "blocked_words_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to YAML file containing blocked_words list", + "title": "Blocked Words File" + }, + "breakdown": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to include breakdown in the response", + "title": "Breakdown" + }, + "categories": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterCategoryConfig" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of prebuilt categories to enable (harmful_*, bias_*)", + "title": "Categories" + }, + "category_thresholds": { + "anyOf": [ + { + "$ref": "#/components/schemas/LakeraCategoryThresholds" + }, + { + "type": "null" + } + ], + "description": "Threshold configuration for Lakera guardrail categories" + }, + "confidence_threshold": { + "default": 0.5, + "default_value": 0.5, + "description": "Only block or mask when detection confidence >= this value; below threshold, allow or log_only.", + "max": 1.0, + "maximum": 1.0, + "min": 0.0, + "minimum": 0.0, + "step": 0.1, + "title": "Confidence Threshold", + "type": "number", + "ui_type": "percentage" + }, + "config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Additional configuration for the guardrail", + "title": "Config" + }, + "content_moderation_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable content moderation to check for harmful content (harassment, hate speech, etc.).", + "title": "Content Moderation Check" + }, + "credentials": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to Google Cloud credentials JSON file or JSON string", + "title": "Credentials" + }, + "custom_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Python-like code containing the apply_guardrail function for custom guardrail logic", + "title": "Custom Code" + }, + "default_action": { + "default": "deny", + "description": "Fallback decision when no rule matches", + "enum": [ + "allow", + "deny" + ], + "title": "Default Action", + "type": "string" + }, + "default_on": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the guardrail is enabled by default", + "title": "Default On" + }, + "deployment_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The EnkryptAI deployment name to use. Sent via X-Enkrypt-Deployment header.", + "title": "Deployment Name" + }, + "detect_execution_intent": { + "default": true, + "description": "When True, block only when user intent is to run/execute; allow when intent is explain/refactor/don't run. Also block text-only execution requests (e.g. 'run `ls`', 'read /etc/passwd').", + "title": "Detect Execution Intent", + "type": "boolean" + }, + "detect_secrets_config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Configuration for detect-secrets guardrail", + "title": "Detect Secrets Config" + }, + "detector_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of the detector inside the server (e.g., 'jailbreak-detector')", + "title": "Detector Id" + }, + "detectors": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Dictionary of detector configurations (e.g., {'nsfw': {'enabled': True}, 'toxicity': {'enabled': True}}).", + "title": "Detectors" + }, + "dev_info": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to include developer information in the response", + "title": "Dev Info" + }, + "disable_exception_on_block": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "If True, will not raise an exception when the guardrail is blocked. Useful for OpenWebUI where exceptions can end the chat flow.", + "title": "Disable Exception On Block" + }, + "end_session_after_n_fails": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: automatically close the session after this many guardrail violations.", + "title": "End Session After N Fails" + }, + "evaluation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Pre-configured evaluation ID from Qualifire dashboard. When provided, uses invoke_evaluation() instead of evaluate().", + "title": "Evaluation Id" + }, + "experimental_use_latest_role_message_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "When True, guardrails only receive the latest message for the relevant role (e.g., newest user input pre-call, newest assistant output post-call)", + "title": "Experimental Use Latest Role Message Only" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Header names to forward from the client request to the guardrail (e.g. x-request-id). Only these headers' values are sent; others may be omitted or sent as [present]. Used by generic_guardrail_api (similar to MCP extra_headers).", + "title": "Extra Headers" + }, + "fail_on_error": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to fail the request if Model Armor encounters an error", + "title": "Fail On Error" + }, + "grounding_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable grounding verification to ensure output is grounded in provided context.", + "title": "Grounding Check" + }, + "grounding_strictness": { + "anyOf": [ + { + "enum": [ + "BALANCED", + "STRICT" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Strictness level for XecGuard context-grounding validation. 'BALANCED' (default) treats INCOMPLETE answers as SAFE; 'STRICT' flags them as UNSAFE. Grounding only runs in post_call when `metadata.xecguard_grounding_documents` is provided.", + "title": "Grounding Strictness" + }, + "guard_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of the Javelin guard to use", + "title": "Guard Name" + }, + "guardrail": { + "description": "The type of guardrail integration to use", + "title": "Guardrail", + "type": "string" + }, + "guardrailIdentifier": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The ID of your guardrail on Bedrock", + "title": "Guardrailidentifier" + }, + "guardrailVersion": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The version of your Bedrock guardrail (e.g., DRAFT or version number)", + "title": "Guardrailversion" + }, + "guardrail_timeout": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "HTTP timeout in seconds. Default: 5.", + "title": "Guardrail Timeout" + }, + "hallucinations_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable hallucination detection to detect factual inaccuracies.", + "title": "Hallucinations Check" + }, + "include_evidence": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Include detailed evidence payloads in responses (sets `plr_evidence` header).", + "title": "Include Evidence" + }, + "include_scanners": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Include scanner category summaries in responses (sets `plr_scanners` header).", + "title": "Include Scanners" + }, + "is_detector_server": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Boolean flag to determine if calling a detector server (True) or the FMS Orchestrator (False). Defaults to True.", + "title": "Is Detector Server" + }, + "keyword_redaction_tag": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Tag to use for keyword redaction", + "title": "Keyword Redaction Tag" + }, + "lasso_conversation_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Conversation ID for the Lasso guardrail", + "title": "Lasso Conversation Id" + }, + "lasso_user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "User ID for the Lasso guardrail", + "title": "Lasso User Id" + }, + "location": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Google Cloud location/region (e.g., us-central1)", + "title": "Location" + }, + "mask": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Enable content masking using Lasso classifix API", + "title": "Mask" + }, + "mask_request_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask request content if guardrail makes any changes", + "title": "Mask Request Content" + }, + "mask_response_content": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Will mask response content if guardrail makes any changes", + "title": "Mask Response Content" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Additional metadata to include in the request", + "title": "Metadata" + }, + "mock_redacted_text": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Mock redacted text for testing", + "title": "Mock Redacted Text" + }, + "mode": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "$ref": "#/components/schemas/Mode" + } + ], + "description": "When to apply the guardrail (pre_call, post_call, during_call, logging_only)", + "title": "Mode" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Optional field if guardrail requires a 'model' parameter", + "title": "Model" + }, + "monitor_mode": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If True, logs violations without blocking. Defaults to False if not provided", + "title": "Monitor Mode" + }, + "on_disallowed_action": { + "default": "block", + "description": "Choose whether disallowed tools block the request or get rewritten out of the payload", + "enum": [ + "block", + "rewrite" + ], + "title": "On Disallowed Action", + "type": "string" + }, + "on_flagged": { + "anyOf": [ + { + "enum": [ + "block", + "monitor" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "block", + "description": "Action to take when content is flagged: 'block' (raise exception) or 'monitor' (log only)", + "title": "On Flagged" + }, + "on_flagged_action": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "monitor", + "description": "Action to take when content is flagged: 'block' (raise exception) or 'monitor' (log only)", + "title": "On Flagged Action" + }, + "on_violation": { + "anyOf": [ + { + "enum": [ + "warn", + "end_session" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "For /v1/realtime sessions: 'warn' speaks the violation message and continues; 'end_session' speaks the message and closes the connection.", + "title": "On Violation" + }, + "optional_params": { + "anyOf": [ + { + "$ref": "#/components/schemas/GraySwanGuardrailConfigModelOptionalParams" + }, + { + "type": "null" + } + ], + "description": "Optional parameters for the guardrail" + }, + "output_parse_pii": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "When True, LiteLLM will replace the masked text with the original text in the response", + "title": "Output Parse Pii", + "ui_type": "bool" + }, + "pangea_input_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for input (LLM request)", + "title": "Pangea Input Recipe" + }, + "pangea_output_recipe": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Recipe for output (LLM response)", + "title": "Pangea Output Recipe" + }, + "pattern_redaction_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Format string for pattern redaction (use {pattern_name} placeholder)", + "title": "Pattern Redaction Format" + }, + "patterns": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ContentFilterPattern" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of patterns (prebuilt or custom regex) to detect", + "title": "Patterns" + }, + "payload": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to include payload in the response", + "title": "Payload" + }, + "persist_session": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Controls Pillar session persistence (sets `plr_persist` header). Set to False to disable persistence.", + "title": "Persist Session" + }, + "pii_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable PII (Personally Identifiable Information) detection.", + "title": "Pii Check" + }, + "pii_entities_config": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/components/schemas/PiiAction" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Configuration for PII entity types and actions", + "title": "Pii Entities Config" + }, + "policy_id": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Policy ID for Zscaler AI Guard. Can also be set via ZSCALER_AI_GUARD_POLICY_ID environment variable", + "title": "Policy Id" + }, + "policy_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The EnkryptAI policy name to use. Sent via x-enkrypt-policy header.", + "title": "Policy Name" + }, + "policy_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "XecGuard policies to apply on each scan. Select one or more of the built-in default policies; if none are selected, the guardrail defaults to System Prompt Enforcement + Harmful Content Protection.", + "options": [ + "Default_Policy_SystemPromptEnforcement", + "Default_Policy_GeneralPromptAttackProtection", + "Default_Policy_ContentBiasProtection", + "Default_Policy_HarmfulContentProtection", + "Default_Policy_SkillsProtection", + "Default_Policy_PIISensitiveDataProtection" + ], + "title": "Policy Names", + "ui_type": "multiselect" + }, + "presidio_ad_hoc_recognizers": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Path to a JSON file containing ad-hoc recognizers for Presidio", + "title": "Presidio Ad Hoc Recognizers" + }, + "presidio_analyzer_api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the Presidio analyzer API", + "title": "Presidio Analyzer Api Base" + }, + "presidio_anonymizer_api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Base URL for the Presidio anonymizer API", + "title": "Presidio Anonymizer Api Base" + }, + "presidio_entities_deny_list": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/PiiEntityType" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of entity types to exclude from Presidio detection results. Detections of these types will be silently dropped. Useful for suppressing false positives (e.g., US_DRIVER_LICENSE on coding routes).", + "title": "Presidio Entities Deny List" + }, + "presidio_filter_scope": { + "anyOf": [ + { + "enum": [ + "input", + "output", + "both" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Where to apply Presidio checks: 'input' (user -> model), 'output' (model -> user), or 'both' (default).", + "title": "Presidio Filter Scope" + }, + "presidio_language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "en", + "description": "Language code for Presidio PII analysis (e.g., 'en', 'de', 'es', 'fr')", + "title": "Presidio Language" + }, + "presidio_run_on": { + "anyOf": [ + { + "enum": [ + "input", + "output", + "both" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Where to apply Presidio checks: input, output, or both (default).", + "title": "Presidio Run On" + }, + "presidio_score_thresholds": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Optional per-entity minimum confidence scores for Presidio detections. Entities below the threshold are ignored.", + "title": "Presidio Score Thresholds" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Project ID for the Lakera AI project", + "title": "Project Id" + }, + "prompt_injections": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable prompt injection detection. Default check if no evaluation_id and no other checks are specified.", + "title": "Prompt Injections" + }, + "realtime_violation_message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The message the bot speaks aloud when a /v1/realtime guardrail fires. Falls back to violation_message_template if not set.", + "title": "Realtime Violation Message" + }, + "rules": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ToolPermissionRule" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Ordered allow/deny rules. Patterns use regex for tool names/types and optional regex constraints on tool arguments.", + "title": "Rules" + }, + "send_user_api_key_alias": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to send user_API_key_alias in headers", + "title": "Send User Api Key Alias" + }, + "send_user_api_key_team_id": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to send user_API_key_team_id in headers", + "title": "Send User Api Key Team Id" + }, + "send_user_api_key_user_id": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to send user_API_key_user_id in headers", + "title": "Send User Api Key User Id" + }, + "severity_threshold": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Minimum severity to block (high, medium, low)", + "title": "Severity Threshold" + }, + "skip_system_message_in_guardrail": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "When True, unified guardrails skip system-role messages when building evaluation inputs (texts and structured_messages). When False, system messages are included even if litellm_settings sets a global skip. When None, use the global litellm.skip_system_message_in_guardrail setting.", + "title": "Skip System Message In Guardrail" + }, + "template_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The ID of your Model Armor template", + "title": "Template Id" + }, + "tool_selection_quality_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Enable tool selection quality check to evaluate quality of tool/function calls.", + "title": "Tool Selection Quality Check" + }, + "unreachable_fallback": { + "default": "fail_closed", + "description": "What to do when Akto is unreachable. 'fail_open' = allow, 'fail_closed' = block.", + "enum": [ + "fail_closed", + "fail_open" + ], + "title": "Unreachable Fallback", + "type": "string" + }, + "use_v2": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "If True and guardrail='noma', route to the new Noma v2 implementation instead of the legacy implementation.", + "title": "Use V2" + }, + "verify_ssl": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "description": "Whether to verify SSL certificates. Defaults to True.", + "title": "Verify Ssl" + }, + "version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 2, + "description": "Hiddenlayer guardrail version to use.", + "title": "Version" + }, + "violation_message_template": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Custom message when a guardrail blocks an action. Supports placeholders like {tool_name}, {rule_id}, and {default_message}.", + "title": "Violation Message Template" + }, + "xecguard_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "XecGuard scanning model identifier. Defaults to 'xecguard_v2'.", + "title": "Xecguard Model" + } + }, + "required": [ + "guardrail", + "mode" + ], + "title": "LitellmParams", + "type": "object" + }, + "Mode": { + "properties": { + "default": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Default mode when no tags match", + "title": "Default" + }, + "tags": { + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ] + }, + "description": "Tags for the guardrail mode", + "title": "Tags", + "type": "object" + } + }, + "required": [ + "tags" + ], + "title": "Mode", + "type": "object" + }, + "PatchGuardrailRequest": { + "properties": { + "guardrail_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Guardrail Info" + }, + "guardrail_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Guardrail Name" + }, + "litellm_params": { + "anyOf": [ + { + "$ref": "#/components/schemas/BaseLitellmParams-Input" + }, + { + "type": "null" + } + ] + } + }, + "title": "PatchGuardrailRequest", + "type": "object" + }, + "PiiAction": { + "enum": [ + "BLOCK", + "MASK" + ], + "title": "PiiAction", + "type": "string" + }, + "PiiEntityType": { + "enum": [ + "CREDIT_CARD", + "CRYPTO", + "DATE_TIME", + "EMAIL_ADDRESS", + "IBAN_CODE", + "IP_ADDRESS", + "NRP", + "LOCATION", + "PERSON", + "PHONE_NUMBER", + "MEDICAL_LICENSE", + "URL", + "US_BANK_NUMBER", + "US_DRIVER_LICENSE", + "US_ITIN", + "US_PASSPORT", + "US_SSN", + "UK_NHS", + "UK_NINO", + "ES_NIF", + "ES_NIE", + "IT_FISCAL_CODE", + "IT_DRIVER_LICENSE", + "IT_VAT_CODE", + "IT_PASSPORT", + "IT_IDENTITY_CARD", + "PL_PESEL", + "SG_NRIC_FIN", + "SG_UEN", + "AU_ABN", + "AU_ACN", + "AU_TFN", + "AU_MEDICARE", + "IN_PAN", + "IN_AADHAAR", + "IN_VEHICLE_REGISTRATION", + "IN_VOTER", + "IN_PASSPORT", + "FI_PERSONAL_IDENTITY_CODE" + ], + "title": "PiiEntityType", + "type": "string" + }, + "RegisterGuardrailRequest": { + "description": "Request body for POST /guardrails/register. Follows Generic Guardrail API config.", + "properties": { + "guardrail_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Guardrail Info" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "litellm_params": { + "additionalProperties": true, + "title": "Litellm Params", + "type": "object" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + } + }, + "required": [ + "guardrail_name", + "litellm_params" + ], + "title": "RegisterGuardrailRequest", + "type": "object" + }, + "RegisterGuardrailResponse": { + "properties": { + "guardrail_id": { + "title": "Guardrail Id", + "type": "string" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted At" + } + }, + "required": [ + "guardrail_id", + "guardrail_name", + "status" + ], + "title": "RegisterGuardrailResponse", + "type": "object" + }, + "TestCustomCodeGuardrailRequest": { + "description": "Request model for testing custom code guardrails.", + "properties": { + "custom_code": { + "title": "Custom Code", + "type": "string" + }, + "input_type": { + "default": "request", + "title": "Input Type", + "type": "string" + }, + "request_data": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Request Data" + }, + "test_input": { + "additionalProperties": true, + "title": "Test Input", + "type": "object" + } + }, + "required": [ + "custom_code", + "test_input" + ], + "title": "TestCustomCodeGuardrailRequest", + "type": "object" + }, + "TestCustomCodeGuardrailResponse": { + "description": "Response model for testing custom code guardrails.", + "properties": { + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" + }, + "error_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error Type" + }, + "result": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Result" + }, + "success": { + "title": "Success", + "type": "boolean" + } + }, + "required": [ + "success" + ], + "title": "TestCustomCodeGuardrailResponse", + "type": "object" + }, + "ToolPermissionRule": { + "description": "A rule defining permission for a specific tool or tool pattern", + "properties": { + "allowed_param_patterns": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Optional regex map enforcing nested parameter values using dot/[] paths", + "title": "Allowed Param Patterns" + }, + "decision": { + "description": "Whether to allow or deny this tool usage", + "enum": [ + "allow", + "deny" + ], + "title": "Decision", + "type": "string" + }, + "id": { + "description": "Unique identifier for the rule", + "title": "Id", + "type": "string" + }, + "tool_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Regex pattern applied to the tool's function name", + "title": "Tool Name" + }, + "tool_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Regex pattern applied to the tool type (e.g., function)", + "title": "Tool Type" + } + }, + "required": [ + "id", + "decision" + ], + "title": "ToolPermissionRule", + "type": "object" + }, + "UpdateGuardrailRequest": { + "properties": { + "guardrail": { + "$ref": "#/components/schemas/Guardrail" + } + }, + "required": [ + "guardrail" + ], + "title": "UpdateGuardrailRequest", + "type": "object" + }, + "UsageDetailResponse": { + "properties": { + "avgLatency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avglatency" + }, + "avgScore": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avgscore" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "failRate": { + "title": "Failrate", + "type": "number" + }, + "guardrail_id": { + "title": "Guardrail Id", + "type": "string" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "requestsEvaluated": { + "title": "Requestsevaluated", + "type": "integer" + }, + "status": { + "title": "Status", + "type": "string" + }, + "time_series": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Time Series", + "type": "array" + }, + "trend": { + "title": "Trend", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "guardrail_id", + "guardrail_name", + "type", + "provider", + "requestsEvaluated", + "failRate", + "avgScore", + "avgLatency", + "status", + "trend", + "description", + "time_series" + ], + "title": "UsageDetailResponse", + "type": "object" + }, + "UsageLogEntry": { + "properties": { + "action": { + "title": "Action", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "input_snippet": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Input Snippet" + }, + "latency_ms": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Latency Ms" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "output_snippet": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Output Snippet" + }, + "reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reason" + }, + "score": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Score" + }, + "timestamp": { + "title": "Timestamp", + "type": "string" + } + }, + "required": [ + "id", + "timestamp", + "action", + "score", + "latency_ms", + "model", + "input_snippet", + "output_snippet", + "reason" + ], + "title": "UsageLogEntry", + "type": "object" + }, + "UsageLogsResponse": { + "properties": { + "logs": { + "items": { + "$ref": "#/components/schemas/UsageLogEntry" + }, + "title": "Logs", + "type": "array" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "page_size": { + "title": "Page Size", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "logs", + "total", + "page", + "page_size" + ], + "title": "UsageLogsResponse", + "type": "object" + }, + "UsageOverviewResponse": { + "properties": { + "chart": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Chart", + "type": "array" + }, + "passRate": { + "title": "Passrate", + "type": "number" + }, + "rows": { + "items": { + "$ref": "#/components/schemas/UsageOverviewRow" + }, + "title": "Rows", + "type": "array" + }, + "totalBlocked": { + "title": "Totalblocked", + "type": "integer" + }, + "totalRequests": { + "title": "Totalrequests", + "type": "integer" + } + }, + "required": [ + "rows", + "chart", + "totalRequests", + "totalBlocked", + "passRate" + ], + "title": "UsageOverviewResponse", + "type": "object" + }, + "UsageOverviewRow": { + "properties": { + "avgLatency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avglatency" + }, + "avgScore": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avgscore" + }, + "failRate": { + "title": "Failrate", + "type": "number" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "requestsEvaluated": { + "title": "Requestsevaluated", + "type": "integer" + }, + "status": { + "title": "Status", + "type": "string" + }, + "trend": { + "title": "Trend", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type", + "provider", + "requestsEvaluated", + "failRate", + "avgScore", + "avgLatency", + "status", + "trend" + ], + "title": "UsageOverviewRow", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/apply_guardrail": { + "post": { + "description": "Apply a guardrail to text input and return the processed result.\n\nThis endpoint allows testing guardrails by applying them to custom text inputs.", + "operationId": "apply_guardrail_apply_guardrail_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplyGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplyGuardrailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Apply Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails": { + "post": { + "description": "Create a new guardrail\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/guardrails\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"guardrail\": {\n \"guardrail_name\": \"my-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Bedrock content moderation guardrail\"\n }\n }\n }'\n```\n\nExample Response:\n```json\n{\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"my-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Bedrock content moderation guardrail\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n}\n```", + "operationId": "create_guardrail_guardrails_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/apply_guardrail": { + "post": { + "description": "Apply a guardrail to text input and return the processed result.\n\nThis endpoint allows testing guardrails by applying them to custom text inputs.", + "operationId": "apply_guardrail_guardrails_apply_guardrail_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplyGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApplyGuardrailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Apply Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/list": { + "get": { + "description": "List the guardrails that are available on the proxy server\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/guardrails/list\" -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"guardrails\": [\n {\n \"guardrail_name\": \"bedrock-pre-guard\",\n \"guardrail_info\": {\n \"params\": [\n {\n \"name\": \"toxicity_score\",\n \"type\": \"float\",\n \"description\": \"Score between 0-1 indicating content toxicity level\"\n },\n {\n \"name\": \"pii_detection\",\n \"type\": \"boolean\"\n }\n ]\n }\n }\n ]\n}\n```", + "operationId": "list_guardrails_guardrails_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGuardrailsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Guardrails", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/register": { + "post": { + "description": "Register a guardrail for onboarding (team submission).\n\nAccepts a guardrail config in the\n[Generic Guardrail API](https://docs.litellm.ai/docs/adding_provider/generic_guardrail_api) format.\nThe submission is stored with status `pending_review` until an admin approves it.", + "operationId": "register_guardrail_guardrails_register_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterGuardrailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Register Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/submissions": { + "get": { + "description": "List team guardrail submissions. Returns only guardrails with a team_id.\n\nAdmins see all submissions. Non-admin users see submissions for teams they are\na member of.\n\nStatus values: pending_review (team-registered, awaiting approval), active (approved), rejected.\n\nOptional filters:\n- status: pending_review | active | rejected\n- team_id: filter by specific team (non-admins must be a member of that team)\n- search: name/description", + "operationId": "list_guardrail_submissions_guardrails_submissions_get", + "parameters": [ + { + "in": "query", + "name": "status", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status" + } + }, + { + "in": "query", + "name": "team_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + } + }, + { + "in": "query", + "name": "search", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Search" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGuardrailSubmissionsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Guardrail Submissions", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/submissions/{guardrail_id}": { + "get": { + "description": "Get a single guardrail submission by id. Non-admins may only access submissions for teams they belong to.", + "operationId": "get_guardrail_submission_guardrails_submissions__guardrail_id__get", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GuardrailSubmissionItem" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Guardrail Submission", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/submissions/{guardrail_id}/approve": { + "post": { + "description": "Approve a pending guardrail submission: set status to active and initialize in memory (admin only).", + "operationId": "approve_guardrail_submission_guardrails_submissions__guardrail_id__approve_post", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Approve Guardrail Submission", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/submissions/{guardrail_id}/reject": { + "post": { + "description": "Reject a guardrail submission (admin only).", + "operationId": "reject_guardrail_submission_guardrails_submissions__guardrail_id__reject_post", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Reject Guardrail Submission", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/test_custom_code": { + "post": { + "description": "Test custom code guardrail logic without creating a guardrail.\n\nThis endpoint allows admins to experiment with custom code guardrails by:\n1. Compiling the provided code in a sandbox\n2. Executing the apply_guardrail function with test input\n3. Returning the result (allow/block/modify)\n\n\ud83d\udc49 [Custom Code Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/custom_code_guardrail)\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/guardrails/test_custom_code\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"custom_code\": \"def apply_guardrail(inputs, request_data, input_type):\\n for text in inputs[\\\"texts\\\"]:\\n if regex_match(text, r\\\"\\\\d{3}-\\\\d{2}-\\\\d{4}\\\"):\\n return block(\\\"SSN detected\\\")\\n return allow()\",\n \"test_input\": {\n \"texts\": [\"My SSN is 123-45-6789\"]\n },\n \"input_type\": \"request\"\n }'\n```\n\nExample Success Response (blocked):\n```json\n{\n \"success\": true,\n \"result\": {\n \"action\": \"block\",\n \"reason\": \"SSN detected\"\n },\n \"error\": null,\n \"error_type\": null\n}\n```\n\nExample Success Response (allowed):\n```json\n{\n \"success\": true,\n \"result\": {\n \"action\": \"allow\"\n },\n \"error\": null,\n \"error_type\": null\n}\n```\n\nExample Success Response (modified):\n```json\n{\n \"success\": true,\n \"result\": {\n \"action\": \"modify\",\n \"texts\": [\"My SSN is [REDACTED]\"]\n },\n \"error\": null,\n \"error_type\": null\n}\n```\n\nExample Error Response (compilation error):\n```json\n{\n \"success\": false,\n \"result\": null,\n \"error\": \"Syntax error in custom code: invalid syntax (, line 1)\",\n \"error_type\": \"compilation\"\n}\n```", + "operationId": "test_custom_code_guardrail_guardrails_test_custom_code_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestCustomCodeGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestCustomCodeGuardrailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Custom Code Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/ui/add_guardrail_settings": { + "get": { + "description": "Get the UI settings for the guardrails\n\nReturns:\n- Supported entities for guardrails\n- Supported modes for guardrails\n- PII entity categories for UI organization\n- Content filter settings (patterns and categories)", + "operationId": "get_guardrail_ui_settings_guardrails_ui_add_guardrail_settings_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Guardrail Ui Settings", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/ui/category_yaml/{category_name}": { + "get": { + "description": "Get the YAML or JSON content for a specific content filter category.\n\nArgs:\n category_name: The name of the category (e.g., \"bias_gender\", \"harmful_self_harm\")\n\nReturns:\n The raw YAML or JSON content of the category file with file type indicator", + "operationId": "get_category_yaml_guardrails_ui_category_yaml__category_name__get", + "parameters": [ + { + "in": "path", + "name": "category_name", + "required": true, + "schema": { + "title": "Category Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Category Yaml", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/ui/major_airlines": { + "get": { + "description": "Get the major airlines list from IATA (competitor intent, airline type).\nReturns airline id, match variants (pipe-separated), and tags.", + "operationId": "get_major_airlines_guardrails_ui_major_airlines_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Major Airlines", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/ui/provider_specific_params": { + "get": { + "description": "Get provider-specific parameters for different guardrail types.\n\nReturns a dictionary mapping guardrail providers to their specific parameters,\nincluding parameter names, descriptions, and whether they are required.\n\nExample Response:\n```json\n{\n \"bedrock\": {\n \"guardrailIdentifier\": {\n \"description\": \"The ID of your guardrail on Bedrock\",\n \"required\": true,\n \"type\": null\n },\n \"guardrailVersion\": {\n \"description\": \"The version of your Bedrock guardrail (e.g., DRAFT or version number)\",\n \"required\": true,\n \"type\": null\n }\n },\n \"azure_content_safety_text_moderation\": {\n \"api_key\": {\n \"description\": \"API key for the Azure Content Safety Text Moderation guardrail\",\n \"required\": false,\n \"type\": null\n },\n \"optional_params\": {\n \"description\": \"Optional parameters for the Azure Content Safety Text Moderation guardrail\",\n \"required\": true,\n \"type\": \"nested\",\n \"fields\": {\n \"severity_threshold\": {\n \"description\": \"Severity threshold for the Azure Content Safety Text Moderation guardrail across all categories\",\n \"required\": false,\n \"type\": null\n },\n \"categories\": {\n \"description\": \"Categories to scan for the Azure Content Safety Text Moderation guardrail\",\n \"required\": false,\n \"type\": \"multiselect\",\n \"options\": [\"Hate\", \"SelfHarm\", \"Sexual\", \"Violence\"],\n \"default_value\": None\n }\n }\n }\n }\n}\n```", + "operationId": "get_provider_specific_params_guardrails_ui_provider_specific_params_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Provider Specific Params", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/usage/detail/{guardrail_id}": { + "get": { + "description": "Return single guardrail usage metrics and time series.", + "operationId": "guardrails_usage_detail_guardrails_usage_detail__guardrail_id__get", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + }, + { + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Start Date" + } + }, + { + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageDetailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Guardrails Usage Detail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/usage/logs": { + "get": { + "description": "Return paginated run logs for a guardrail (or policy) from SpendLogs via index.", + "operationId": "guardrails_usage_logs_guardrails_usage_logs_get", + "parameters": [ + { + "in": "query", + "name": "guardrail_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Guardrail Id" + } + }, + { + "in": "query", + "name": "policy_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Policy Id" + } + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 100, + "minimum": 1, + "title": "Page Size", + "type": "integer" + } + }, + { + "in": "query", + "name": "action", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Action" + } + }, + { + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Start Date" + } + }, + { + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageLogsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Guardrails Usage Logs", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/usage/overview": { + "get": { + "description": "Return guardrail performance overview for the dashboard.", + "operationId": "guardrails_usage_overview_guardrails_usage_overview_get", + "parameters": [ + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "Start Date" + } + }, + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageOverviewResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Guardrails Usage Overview", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/validate_blocked_words_file": { + "post": { + "description": "Validate a blocked_words YAML file content.\n\nArgs:\n request: Dictionary with 'file_content' key containing the YAML string\n\nReturns:\n Dictionary with 'valid' boolean and either 'message'/'errors' depending on result\n\nExample Request:\n```json\n{\n \"file_content\": \"blocked_words:\\n - keyword: \\\"test\\\"\\n action: \\\"BLOCK\\\"\"\n}\n```\n\nExample Success Response:\n```json\n{\n \"valid\": true,\n \"message\": \"Valid YAML file with 2 blocked words\"\n}\n```\n\nExample Error Response:\n```json\n{\n \"valid\": false,\n \"errors\": [\"Entry 0: missing 'action' field\"]\n}\n```", + "operationId": "validate_blocked_words_file_guardrails_validate_blocked_words_file_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "title": "Request", + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Validate Blocked Words File", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/{guardrail_id}": { + "delete": { + "description": "Delete a guardrail\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Guardrail 123e4567-e89b-12d3-a456-426614174000 deleted successfully\"\n}\n```", + "operationId": "delete_guardrail_guardrails__guardrail_id__delete", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Guardrail", + "tags": [ + "guardrails" + ] + }, + "get": { + "description": "Get detailed information about a specific guardrail by ID\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000/info\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"my-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Bedrock content moderation guardrail\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n}\n```", + "operationId": "get_guardrail_info_guardrails__guardrail_id__get", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Guardrail Info", + "tags": [ + "guardrails" + ] + }, + "patch": { + "description": "Partially update an existing guardrail\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nThis endpoint allows updating specific fields of a guardrail without sending the entire object.\nOnly the following fields can be updated:\n- guardrail_name: The name of the guardrail\n- default_on: Whether the guardrail is enabled by default\n- guardrail_info: Additional information about the guardrail\n\nExample Request:\n```bash\ncurl -X PATCH \"http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"guardrail_name\": \"updated-name\",\n \"default_on\": true,\n \"guardrail_info\": {\n \"description\": \"Updated description\"\n }\n }'\n```\n\nExample Response:\n```json\n{\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"updated-name\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Updated description\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T14:22:33.456Z\"\n}\n```", + "operationId": "patch_guardrail_guardrails__guardrail_id__patch", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Patch Guardrail", + "tags": [ + "guardrails" + ] + }, + "put": { + "description": "Update an existing guardrail\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"guardrail\": {\n \"guardrail_name\": \"updated-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"1.0\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Updated Bedrock content moderation guardrail\"\n }\n }\n }'\n```\n\nExample Response:\n```json\n{\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"updated-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"1.0\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Updated Bedrock content moderation guardrail\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T13:45:12.345Z\"\n}\n```", + "operationId": "update_guardrail_guardrails__guardrail_id__put", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateGuardrailRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Guardrail", + "tags": [ + "guardrails" + ] + } + }, + "/guardrails/{guardrail_id}/info": { + "get": { + "description": "Get detailed information about a specific guardrail by ID\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/guardrails/123e4567-e89b-12d3-a456-426614174000/info\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"my-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Bedrock content moderation guardrail\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n}\n```", + "operationId": "get_guardrail_info_guardrails__guardrail_id__info_get", + "parameters": [ + { + "in": "path", + "name": "guardrail_id", + "required": true, + "schema": { + "title": "Guardrail Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Guardrail Info", + "tags": [ + "guardrails" + ] + } + }, + "/policies/usage/overview": { + "get": { + "description": "Return policy performance overview for the dashboard.", + "operationId": "policies_usage_overview_policies_usage_overview_get", + "parameters": [ + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "Start Date" + } + }, + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageOverviewResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Policies Usage Overview", + "tags": [ + "guardrails" + ] + } + }, + "/v2/guardrails/list": { + "get": { + "description": "List the guardrails that are available in the database using GuardrailRegistry\n\n\ud83d\udc49 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/v2/guardrails/list\" -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"guardrails\": [\n {\n \"guardrail_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"guardrail_name\": \"my-bedrock-guard\",\n \"litellm_params\": {\n \"guardrail\": \"bedrock\",\n \"mode\": \"pre_call\",\n \"guardrailIdentifier\": \"ff6ujrregl1q\",\n \"guardrailVersion\": \"DRAFT\",\n \"default_on\": true\n },\n \"guardrail_info\": {\n \"description\": \"Bedrock content moderation guardrail\"\n }\n }\n ]\n}\n```", + "operationId": "list_guardrails_v2_v2_guardrails_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListGuardrailsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Guardrails V2", + "tags": [ + "guardrails" + ] + } + } + } + }, + "jwt_mappings": { + "components": { + "schemas": { + "CreateJWTKeyMappingRequest": { + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "jwt_claim_name": { + "title": "Jwt Claim Name", + "type": "string" + }, + "jwt_claim_value": { + "title": "Jwt Claim Value", + "type": "string" + }, + "key": { + "title": "Key", + "type": "string" + } + }, + "required": [ + "jwt_claim_name", + "jwt_claim_value", + "key" + ], + "title": "CreateJWTKeyMappingRequest", + "type": "object" + }, + "DeleteJWTKeyMappingRequest": { + "properties": { + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "id" + ], + "title": "DeleteJWTKeyMappingRequest", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "JWTKeyMappingResponse": { + "properties": { + "created_at": { + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "id": { + "title": "Id", + "type": "string" + }, + "is_active": { + "title": "Is Active", + "type": "boolean" + }, + "jwt_claim_name": { + "title": "Jwt Claim Name", + "type": "string" + }, + "jwt_claim_value": { + "title": "Jwt Claim Value", + "type": "string" + }, + "updated_at": { + "format": "date-time", + "title": "Updated At", + "type": "string" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + } + }, + "required": [ + "id", + "jwt_claim_name", + "jwt_claim_value", + "is_active", + "created_at", + "updated_at" + ], + "title": "JWTKeyMappingResponse", + "type": "object" + }, + "UpdateJWTKeyMappingRequest": { + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "id": { + "title": "Id", + "type": "string" + }, + "is_active": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is Active" + }, + "key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key" + } + }, + "required": [ + "id" + ], + "title": "UpdateJWTKeyMappingRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/jwt/key/mapping/delete": { + "post": { + "operationId": "delete_jwt_key_mapping_jwt_key_mapping_delete_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteJWTKeyMappingRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Jwt Key Mapping", + "tags": [ + "jwt_mappings" + ] + } + }, + "/jwt/key/mapping/info": { + "get": { + "operationId": "info_jwt_key_mapping_jwt_key_mapping_info_get", + "parameters": [ + { + "in": "query", + "name": "id", + "required": true, + "schema": { + "title": "Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTKeyMappingResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Info Jwt Key Mapping", + "tags": [ + "jwt_mappings" + ] + } + }, + "/jwt/key/mapping/list": { + "get": { + "operationId": "list_jwt_key_mappings_jwt_key_mapping_list_get", + "parameters": [ + { + "description": "Page number", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "description": "Page number", + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + { + "description": "Page size", + "in": "query", + "name": "size", + "required": false, + "schema": { + "default": 50, + "description": "Page size", + "maximum": 100, + "minimum": 1, + "title": "Size", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Jwt Key Mappings", + "tags": [ + "jwt_mappings" + ] + } + }, + "/jwt/key/mapping/new": { + "post": { + "operationId": "create_jwt_key_mapping_jwt_key_mapping_new_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateJWTKeyMappingRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTKeyMappingResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Jwt Key Mapping", + "tags": [ + "jwt_mappings" + ] + } + }, + "/jwt/key/mapping/update": { + "post": { + "operationId": "update_jwt_key_mapping_jwt_key_mapping_update_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateJWTKeyMappingRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JWTKeyMappingResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Jwt Key Mapping", + "tags": [ + "jwt_mappings" + ] + } + } + } + }, + "langfuse_passthrough": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/langfuse/{endpoint}": { + "delete": { + "description": "Call Langfuse via LiteLLM proxy. Works with Langfuse SDK.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)", + "operationId": "langfuse_proxy_route_langfuse__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Langfuse Proxy Route", + "tags": [ + "langfuse_passthrough" + ] + }, + "get": { + "description": "Call Langfuse via LiteLLM proxy. Works with Langfuse SDK.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)", + "operationId": "langfuse_proxy_route_langfuse__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Langfuse Proxy Route", + "tags": [ + "langfuse_passthrough" + ] + }, + "patch": { + "description": "Call Langfuse via LiteLLM proxy. Works with Langfuse SDK.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)", + "operationId": "langfuse_proxy_route_langfuse__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Langfuse Proxy Route", + "tags": [ + "langfuse_passthrough" + ] + }, + "post": { + "description": "Call Langfuse via LiteLLM proxy. Works with Langfuse SDK.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)", + "operationId": "langfuse_proxy_route_langfuse__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Langfuse Proxy Route", + "tags": [ + "langfuse_passthrough" + ] + }, + "put": { + "description": "Call Langfuse via LiteLLM proxy. Works with Langfuse SDK.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)", + "operationId": "langfuse_proxy_route_langfuse__endpoint__put", + "parameters": [ + { + "in": "path", + "name": "endpoint", + "required": true, + "schema": { + "title": "Endpoint", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Langfuse Proxy Route", + "tags": [ + "langfuse_passthrough" + ] + } + } + } + }, + "mcp_app": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "MCPCredentials": { + "properties": { + "auth_value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Value" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Region Name" + }, + "aws_role_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Role Name" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "aws_service_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Service Name" + }, + "aws_session_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Name" + }, + "aws_session_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Token" + }, + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Id" + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Secret" + }, + "scopes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Scopes" + } + }, + "title": "MCPCredentials", + "type": "object" + }, + "NewMCPServerRequest": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "allow_all_keys": { + "default": false, + "title": "Allow All Keys", + "type": "boolean" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Allowed Tools" + }, + "approval_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Approval Status" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "auth_type": { + "anyOf": [ + { + "enum": [ + "none", + "api_key", + "bearer_token", + "basic", + "authorization", + "oauth2", + "aws_sigv4", + "token" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Type" + }, + "authorization_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization Url" + }, + "available_on_public_internet": { + "default": true, + "title": "Available On Public Internet", + "type": "boolean" + }, + "byok_api_key_help_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Byok Api Key Help Url" + }, + "byok_description": { + "items": { + "type": "string" + }, + "title": "Byok Description", + "type": "array" + }, + "command": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Command" + }, + "credentials": { + "anyOf": [ + { + "$ref": "#/components/schemas/MCPCredentials" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "title": "Env", + "type": "object" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Instructions" + }, + "is_byok": { + "default": false, + "title": "Is Byok", + "type": "boolean" + }, + "mcp_access_groups": { + "items": { + "type": "string" + }, + "title": "Mcp Access Groups", + "type": "array" + }, + "mcp_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Info" + }, + "oauth2_flow": { + "anyOf": [ + { + "enum": [ + "client_credentials", + "authorization_code" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Oauth2 Flow" + }, + "registration_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Registration Url" + }, + "server_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Id" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source Url" + }, + "spec_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Spec Path" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted At" + }, + "submitted_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted By" + }, + "token_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Url" + }, + "tool_name_to_description": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Description" + }, + "tool_name_to_display_name": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Display Name" + }, + "transport": { + "default": "sse", + "enum": [ + "sse", + "http", + "stdio" + ], + "title": "Transport", + "type": "string" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + } + }, + "title": "NewMCPServerRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/mcp-rest/test/connection": { + "post": { + "description": "Test if we can connect to the provided MCP server before adding it", + "operationId": "test_connection_mcp_rest_test_connection_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Connection", + "tags": [ + "mcp_app" + ] + } + }, + "/mcp-rest/test/tools/list": { + "post": { + "description": "Preview tools available from MCP server before adding it", + "operationId": "test_tools_list_mcp_rest_test_tools_list_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Tools List", + "tags": [ + "mcp_app" + ] + } + }, + "/mcp-rest/tools/call": { + "post": { + "description": "REST API to call a specific MCP tool with the provided arguments", + "operationId": "call_tool_rest_api_mcp_rest_tools_call_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Call Tool Rest Api", + "tags": [ + "mcp_app" + ] + } + }, + "/mcp-rest/tools/list": { + "get": { + "description": "List all available tools with information about the server they belong to.\n\nExample response:\n{\n \"tools\": [\n {\n \"name\": \"create_zap\",\n \"description\": \"Create a new zap\",\n \"inputSchema\": \"tool_input_schema\",\n \"mcp_info\": {\n \"server_name\": \"zapier\",\n \"logo_url\": \"https://www.zapier.com/logo.png\",\n }\n }\n ],\n \"error\": null,\n \"message\": \"Successfully retrieved tools\"\n}", + "operationId": "list_tool_rest_api_mcp_rest_tools_list_get", + "parameters": [ + { + "description": "The server id to list tools for", + "in": "query", + "name": "server_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The server id to list tools for", + "title": "Server Id" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response List Tool Rest Api Mcp Rest Tools List Get", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Tool Rest Api", + "tags": [ + "mcp_app" + ] + } + } + } + }, + "mcp_byok_oauth": { + "components": { + "schemas": {} + }, + "paths": {} + }, + "mcp_discoverable": { + "components": { + "schemas": { + "CallbacksByType": { + "properties": { + "failure": { + "items": { + "type": "string" + }, + "title": "Failure", + "type": "array" + }, + "success": { + "items": { + "type": "string" + }, + "title": "Success", + "type": "array" + }, + "success_and_failure": { + "items": { + "type": "string" + }, + "title": "Success And Failure", + "type": "array" + } + }, + "required": [ + "success", + "failure", + "success_and_failure" + ], + "title": "CallbacksByType", + "type": "object" + } + } + }, + "paths": { + "/callbacks/configs": { + "get": { + "description": "Get Available Callback Configurations\n\nReturns the configuration details for all available logging callbacks,\nincluding supported parameters, field types, and descriptions.", + "operationId": "get_callback_configs_callbacks_configs_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Callback Configs", + "tags": [ + "mcp_discoverable" + ] + } + }, + "/callbacks/list": { + "get": { + "description": "View List of Active Logging Callbacks", + "operationId": "list_callbacks_callbacks_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CallbacksByType" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Callbacks", + "tags": [ + "mcp_discoverable" + ] + } + } + } + }, + "mcp_management": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "LiteLLM_MCPServerTable": { + "description": "Represents a LiteLLM_MCPServerTable record", + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "allow_all_keys": { + "default": false, + "title": "Allow All Keys", + "type": "boolean" + }, + "allowed_tools": { + "items": { + "type": "string" + }, + "title": "Allowed Tools", + "type": "array" + }, + "approval_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "active", + "description": "Approval status: 'pending_review', 'active', 'rejected'", + "title": "Approval Status" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "auth_type": { + "anyOf": [ + { + "enum": [ + "none", + "api_key", + "bearer_token", + "basic", + "authorization", + "oauth2", + "aws_sigv4", + "token" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Type" + }, + "authorization_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization Url" + }, + "available_on_public_internet": { + "default": true, + "title": "Available On Public Internet", + "type": "boolean" + }, + "byok_api_key_help_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Byok Api Key Help Url" + }, + "byok_description": { + "items": { + "type": "string" + }, + "title": "Byok Description", + "type": "array" + }, + "command": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Command" + }, + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "credentials": { + "anyOf": [ + { + "$ref": "#/components/schemas/MCPCredentials" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "title": "Env", + "type": "object" + }, + "extra_headers": { + "items": { + "type": "string" + }, + "title": "Extra Headers", + "type": "array" + }, + "has_user_credential": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Has User Credential" + }, + "health_check_error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Health Check Error" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Instructions" + }, + "is_byok": { + "default": false, + "title": "Is Byok", + "type": "boolean" + }, + "last_health_check": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Health Check" + }, + "mcp_access_groups": { + "items": { + "type": "string" + }, + "title": "Mcp Access Groups", + "type": "array" + }, + "mcp_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Info" + }, + "registration_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Registration Url" + }, + "review_notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Review Notes" + }, + "reviewed_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reviewed At" + }, + "server_id": { + "title": "Server Id", + "type": "string" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source Url" + }, + "spec_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Spec Path" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "status": { + "anyOf": [ + { + "enum": [ + "healthy", + "unhealthy", + "unknown" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "unknown", + "description": "Health status: 'healthy', 'unhealthy', 'unknown'", + "title": "Status" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted At" + }, + "submitted_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Submitted By" + }, + "teams": { + "items": { + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": "object" + }, + "title": "Teams", + "type": "array" + }, + "token_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Url" + }, + "tool_name_to_description": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Description" + }, + "tool_name_to_display_name": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Display Name" + }, + "transport": { + "enum": [ + "sse", + "http", + "stdio" + ], + "title": "Transport", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + } + }, + "required": [ + "server_id", + "transport" + ], + "title": "LiteLLM_MCPServerTable", + "type": "object" + }, + "MCPCredentials": { + "properties": { + "auth_value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Value" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Region Name" + }, + "aws_role_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Role Name" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "aws_service_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Service Name" + }, + "aws_session_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Name" + }, + "aws_session_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Token" + }, + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Id" + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Secret" + }, + "scopes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Scopes" + } + }, + "title": "MCPCredentials", + "type": "object" + }, + "MCPOAuthUserCredentialRequest": { + "description": "Stores a user's OAuth2 token for an OpenAPI MCP server.", + "properties": { + "access_token": { + "title": "Access Token", + "type": "string" + }, + "expires_in": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Expires In" + }, + "refresh_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Refresh Token" + }, + "scopes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Scopes" + } + }, + "required": [ + "access_token" + ], + "title": "MCPOAuthUserCredentialRequest", + "type": "object" + }, + "MCPOAuthUserCredentialStatus": { + "description": "Describes whether the calling user has a stored OAuth credential.", + "properties": { + "connected_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Connected At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "has_credential": { + "title": "Has Credential", + "type": "boolean" + }, + "is_expired": { + "default": false, + "title": "Is Expired", + "type": "boolean" + }, + "server_id": { + "title": "Server Id", + "type": "string" + } + }, + "required": [ + "server_id", + "has_credential" + ], + "title": "MCPOAuthUserCredentialStatus", + "type": "object" + }, + "MCPSubmissionsSummary": { + "properties": { + "active": { + "title": "Active", + "type": "integer" + }, + "items": { + "items": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + }, + "title": "Items", + "type": "array" + }, + "pending_review": { + "title": "Pending Review", + "type": "integer" + }, + "rejected": { + "title": "Rejected", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "total", + "pending_review", + "active", + "rejected", + "items" + ], + "title": "MCPSubmissionsSummary", + "type": "object" + }, + "MCPToolsetTool": { + "properties": { + "server_id": { + "title": "Server Id", + "type": "string" + }, + "tool_name": { + "title": "Tool Name", + "type": "string" + } + }, + "required": [ + "server_id", + "tool_name" + ], + "title": "MCPToolsetTool", + "type": "object" + }, + "MCPUserCredentialListItem": { + "description": "One entry in the /user-credentials list.", + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "connected_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Connected At" + }, + "credential_type": { + "title": "Credential Type", + "type": "string" + }, + "expires_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "has_credential": { + "title": "Has Credential", + "type": "boolean" + }, + "server_id": { + "title": "Server Id", + "type": "string" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + } + }, + "required": [ + "server_id", + "credential_type", + "has_credential" + ], + "title": "MCPUserCredentialListItem", + "type": "object" + }, + "MCPUserCredentialRequest": { + "properties": { + "credential": { + "title": "Credential", + "type": "string" + }, + "save": { + "default": true, + "title": "Save", + "type": "boolean" + } + }, + "required": [ + "credential" + ], + "title": "MCPUserCredentialRequest", + "type": "object" + }, + "MCPUserCredentialResponse": { + "properties": { + "has_credential": { + "title": "Has Credential", + "type": "boolean" + }, + "server_id": { + "title": "Server Id", + "type": "string" + } + }, + "required": [ + "server_id", + "has_credential" + ], + "title": "MCPUserCredentialResponse", + "type": "object" + }, + "MakeMCPServersPublicRequest": { + "properties": { + "mcp_server_ids": { + "items": { + "type": "string" + }, + "title": "Mcp Server Ids", + "type": "array" + } + }, + "required": [ + "mcp_server_ids" + ], + "title": "MakeMCPServersPublicRequest", + "type": "object" + }, + "NewMCPServerRequest": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "allow_all_keys": { + "default": false, + "title": "Allow All Keys", + "type": "boolean" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Allowed Tools" + }, + "approval_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Approval Status" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "auth_type": { + "anyOf": [ + { + "enum": [ + "none", + "api_key", + "bearer_token", + "basic", + "authorization", + "oauth2", + "aws_sigv4", + "token" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Type" + }, + "authorization_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization Url" + }, + "available_on_public_internet": { + "default": true, + "title": "Available On Public Internet", + "type": "boolean" + }, + "byok_api_key_help_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Byok Api Key Help Url" + }, + "byok_description": { + "items": { + "type": "string" + }, + "title": "Byok Description", + "type": "array" + }, + "command": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Command" + }, + "credentials": { + "anyOf": [ + { + "$ref": "#/components/schemas/MCPCredentials" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "title": "Env", + "type": "object" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Instructions" + }, + "is_byok": { + "default": false, + "title": "Is Byok", + "type": "boolean" + }, + "mcp_access_groups": { + "items": { + "type": "string" + }, + "title": "Mcp Access Groups", + "type": "array" + }, + "mcp_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Info" + }, + "oauth2_flow": { + "anyOf": [ + { + "enum": [ + "client_credentials", + "authorization_code" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Oauth2 Flow" + }, + "registration_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Registration Url" + }, + "server_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Id" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source Url" + }, + "spec_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Spec Path" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted At" + }, + "submitted_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted By" + }, + "token_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Url" + }, + "tool_name_to_description": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Description" + }, + "tool_name_to_display_name": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Display Name" + }, + "transport": { + "default": "sse", + "enum": [ + "sse", + "http", + "stdio" + ], + "title": "Transport", + "type": "string" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + } + }, + "title": "NewMCPServerRequest", + "type": "object" + }, + "NewMCPToolsetRequest": { + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "tools": { + "default": [], + "items": { + "$ref": "#/components/schemas/MCPToolsetTool" + }, + "title": "Tools", + "type": "array" + }, + "toolset_name": { + "title": "Toolset Name", + "type": "string" + } + }, + "required": [ + "toolset_name" + ], + "title": "NewMCPToolsetRequest", + "type": "object" + }, + "RejectMCPServerRequest": { + "properties": { + "review_notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Review Notes" + } + }, + "title": "RejectMCPServerRequest", + "type": "object" + }, + "UpdateMCPServerRequest": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "allow_all_keys": { + "default": false, + "title": "Allow All Keys", + "type": "boolean" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Allowed Tools" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "auth_type": { + "anyOf": [ + { + "enum": [ + "none", + "api_key", + "bearer_token", + "basic", + "authorization", + "oauth2", + "aws_sigv4", + "token" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Type" + }, + "authorization_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization Url" + }, + "available_on_public_internet": { + "default": true, + "title": "Available On Public Internet", + "type": "boolean" + }, + "byok_api_key_help_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Byok Api Key Help Url" + }, + "byok_description": { + "items": { + "type": "string" + }, + "title": "Byok Description", + "type": "array" + }, + "command": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Command" + }, + "credentials": { + "anyOf": [ + { + "$ref": "#/components/schemas/MCPCredentials" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "title": "Env", + "type": "object" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Instructions" + }, + "is_byok": { + "default": false, + "title": "Is Byok", + "type": "boolean" + }, + "mcp_access_groups": { + "items": { + "type": "string" + }, + "title": "Mcp Access Groups", + "type": "array" + }, + "mcp_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Info" + }, + "registration_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Registration Url" + }, + "server_id": { + "title": "Server Id", + "type": "string" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source Url" + }, + "spec_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Spec Path" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "token_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Url" + }, + "tool_name_to_description": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Description" + }, + "tool_name_to_display_name": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Display Name" + }, + "transport": { + "default": "sse", + "enum": [ + "sse", + "http", + "stdio" + ], + "title": "Transport", + "type": "string" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + } + }, + "required": [ + "server_id" + ], + "title": "UpdateMCPServerRequest", + "type": "object" + }, + "UpdateMCPToolsetRequest": { + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "tools": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/MCPToolsetTool" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Tools" + }, + "toolset_id": { + "title": "Toolset Id", + "type": "string" + }, + "toolset_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Toolset Name" + } + }, + "required": [ + "toolset_id" + ], + "title": "UpdateMCPToolsetRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/v1/mcp/access_groups": { + "get": { + "description": "Get all available MCP access groups from the database AND config", + "operationId": "get_mcp_access_groups_v1_mcp_access_groups_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Mcp Access Groups", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/discover": { + "get": { + "description": "Returns a curated list of well-known MCP servers for discovery UI", + "operationId": "discover_mcp_servers_v1_mcp_discover_get", + "parameters": [ + { + "description": "Search filter for server names and descriptions", + "in": "query", + "name": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Search filter for server names and descriptions", + "title": "Query" + } + }, + { + "description": "Filter by category", + "in": "query", + "name": "category", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter by category", + "title": "Category" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Discover Mcp Servers", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/make_public": { + "post": { + "description": "Allows making MCP servers public for AI Hub", + "operationId": "make_mcp_servers_public_v1_mcp_make_public_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MakeMCPServersPublicRequest" + } + } + }, + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Make Mcp Servers Public", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/network/client-ip": { + "get": { + "description": "Returns the caller's IP address as seen by the proxy.", + "operationId": "get_client_ip_v1_mcp_network_client_ip_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Client Ip", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/openapi-registry": { + "get": { + "description": "Returns well-known OpenAPI APIs with OAuth 2.0 metadata for the OpenAPI MCP picker", + "operationId": "get_openapi_registry_v1_mcp_openapi_registry_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Openapi Registry", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/registry.json": { + "get": { + "description": "MCP registry endpoint. Spec: https://github.com/modelcontextprotocol/registry", + "operationId": "get_mcp_registry_v1_mcp_registry_json_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Get Mcp Registry", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server": { + "get": { + "description": "Returns the mcp server list with associated teams", + "operationId": "fetch_all_mcp_servers_v1_mcp_server_get", + "parameters": [ + { + "description": "Filter MCP servers by team scope. When provided, returns only servers the team has access to plus globally available (allow_all_keys) servers. Used by the Create Key UI to show team-scoped MCP servers.", + "in": "query", + "name": "team_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter MCP servers by team scope. When provided, returns only servers the team has access to plus globally available (allow_all_keys) servers. Used by the Create Key UI to show team-scoped MCP servers.", + "title": "Team Id" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + }, + "title": "Response Fetch All Mcp Servers V1 Mcp Server Get", + "type": "array" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Fetch All Mcp Servers", + "tags": [ + "mcp_management" + ] + }, + "post": { + "description": "Allows creation of mcp servers", + "operationId": "add_mcp_server_v1_mcp_server_post", + "parameters": [ + { + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "title": "Litellm-Changed-By" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Add Mcp Server", + "tags": [ + "mcp_management" + ] + }, + "put": { + "description": "Allows deleting mcp serves in the db", + "operationId": "edit_mcp_server_v1_mcp_server_put", + "parameters": [ + { + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "title": "Litellm-Changed-By" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "202": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Edit Mcp Server", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/health": { + "get": { + "description": "Health check for MCP servers", + "operationId": "health_check_servers_v1_mcp_server_health_get", + "parameters": [ + { + "description": "Server IDs to check. If not provided, checks all accessible servers.", + "in": "query", + "name": "server_ids", + "required": false, + "schema": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Server IDs to check. If not provided, checks all accessible servers.", + "title": "Server Ids" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Health Check Servers", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/oauth/session": { + "post": { + "description": "Temporarily cache an MCP server in memory without writing to the database", + "operationId": "add_session_mcp_server_v1_mcp_server_oauth_session_post", + "parameters": [ + { + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "title": "Litellm-Changed-By" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Add Session Mcp Server", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/register": { + "post": { + "description": "Submit a new MCP server for admin review (non-admin users). Mirrors POST /guardrails/register.", + "operationId": "register_mcp_server_v1_mcp_server_register_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Register Mcp Server", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/submissions": { + "get": { + "description": "Returns all MCP servers submitted by non-admin users (admin review queue). Mirrors GET /guardrails/submissions.", + "operationId": "get_mcp_server_submissions_v1_mcp_server_submissions_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPSubmissionsSummary" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Mcp Server Submissions", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}": { + "delete": { + "description": "Allows deleting mcp serves in the db", + "operationId": "remove_mcp_server_v1_mcp_server__server_id__delete", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + }, + { + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The litellm-changed-by header enables tracking of actions performed by authorized users on behalf of other users, providing an audit trail for accountability", + "title": "Litellm-Changed-By" + } + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Remove Mcp Server", + "tags": [ + "mcp_management" + ] + }, + "get": { + "description": "Returns the mcp server info", + "operationId": "fetch_mcp_server_v1_mcp_server__server_id__get", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Fetch Mcp Server", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}/approve": { + "put": { + "description": "Approve a pending MCP server submission (admin only). Mirrors PUT /guardrails/{id}/approve.", + "operationId": "approve_mcp_server_submission_v1_mcp_server__server_id__approve_put", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Approve Mcp Server Submission", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}/oauth-user-credential": { + "delete": { + "description": "Revoke the calling user's stored OAuth2 token for an MCP server", + "operationId": "delete_mcp_oauth_user_credential_v1_mcp_server__server_id__oauth_user_credential_delete", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPOAuthUserCredentialStatus" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Mcp Oauth User Credential", + "tags": [ + "mcp_management" + ] + }, + "post": { + "description": "Store the calling user's OAuth2 token for an OpenAPI MCP server", + "operationId": "store_mcp_oauth_user_credential_v1_mcp_server__server_id__oauth_user_credential_post", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPOAuthUserCredentialRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPOAuthUserCredentialStatus" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Store Mcp Oauth User Credential", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}/oauth-user-credential/status": { + "get": { + "description": "Check whether the calling user has a stored OAuth2 credential for this MCP server", + "operationId": "get_mcp_oauth_user_credential_status_v1_mcp_server__server_id__oauth_user_credential_status_get", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPOAuthUserCredentialStatus" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Mcp Oauth User Credential Status", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}/reject": { + "put": { + "description": "Reject a pending MCP server submission (admin only). Mirrors PUT /guardrails/{id}/reject.", + "operationId": "reject_mcp_server_submission_v1_mcp_server__server_id__reject_put", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RejectMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_MCPServerTable" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Reject Mcp Server Submission", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/server/{server_id}/user-credential": { + "delete": { + "description": "Delete the calling user's stored API key for a BYOK MCP server", + "operationId": "delete_mcp_user_credential_v1_mcp_server__server_id__user_credential_delete", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPUserCredentialResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Mcp User Credential", + "tags": [ + "mcp_management" + ] + }, + "post": { + "description": "Store or update the calling user's API key for a BYOK MCP server", + "operationId": "store_mcp_user_credential_v1_mcp_server__server_id__user_credential_post", + "parameters": [ + { + "in": "path", + "name": "server_id", + "required": true, + "schema": { + "title": "Server Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPUserCredentialRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MCPUserCredentialResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Store Mcp User Credential", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/tools": { + "get": { + "description": "Get all MCP tools available for the current key, including those from access groups", + "operationId": "get_mcp_tools_v1_mcp_tools_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Mcp Tools", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/toolset": { + "get": { + "description": "List MCP toolsets accessible to the calling key", + "operationId": "fetch_mcp_toolsets_v1_mcp_toolset_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Fetch Mcp Toolsets", + "tags": [ + "mcp_management" + ] + }, + "post": { + "description": "Create a new MCP toolset (admin only)", + "operationId": "add_mcp_toolset_v1_mcp_toolset_post", + "parameters": [ + { + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Litellm-Changed-By" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPToolsetRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Add Mcp Toolset", + "tags": [ + "mcp_management" + ] + }, + "put": { + "description": "Update an existing MCP toolset (admin only)", + "operationId": "edit_mcp_toolset_v1_mcp_toolset_put", + "parameters": [ + { + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Litellm-Changed-By" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateMCPToolsetRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Edit Mcp Toolset", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/toolset/{toolset_id}": { + "delete": { + "description": "Delete an MCP toolset (admin only)", + "operationId": "remove_mcp_toolset_v1_mcp_toolset__toolset_id__delete", + "parameters": [ + { + "in": "path", + "name": "toolset_id", + "required": true, + "schema": { + "title": "Toolset Id", + "type": "string" + } + }, + { + "in": "header", + "name": "litellm-changed-by", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Litellm-Changed-By" + } + } + ], + "responses": { + "202": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Remove Mcp Toolset", + "tags": [ + "mcp_management" + ] + }, + "get": { + "description": "Get a specific MCP toolset by ID", + "operationId": "fetch_mcp_toolset_v1_mcp_toolset__toolset_id__get", + "parameters": [ + { + "in": "path", + "name": "toolset_id", + "required": true, + "schema": { + "title": "Toolset Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Fetch Mcp Toolset", + "tags": [ + "mcp_management" + ] + } + }, + "/v1/mcp/user-credentials": { + "get": { + "description": "List all OAuth2 MCP credentials stored for the calling user", + "operationId": "list_mcp_user_credentials_v1_mcp_user_credentials_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/MCPUserCredentialListItem" + }, + "title": "Response List Mcp User Credentials V1 Mcp User Credentials Get", + "type": "array" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Mcp User Credentials", + "tags": [ + "mcp_management" + ] + } + } + } + }, + "mcp_rest": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "MCPCredentials": { + "properties": { + "auth_value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Value" + }, + "aws_access_key_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Access Key Id" + }, + "aws_region_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Region Name" + }, + "aws_role_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Role Name" + }, + "aws_secret_access_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Secret Access Key" + }, + "aws_service_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Service Name" + }, + "aws_session_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Name" + }, + "aws_session_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Aws Session Token" + }, + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Id" + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Client Secret" + }, + "scopes": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Scopes" + } + }, + "title": "MCPCredentials", + "type": "object" + }, + "NewMCPServerRequest": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Alias" + }, + "allow_all_keys": { + "default": false, + "title": "Allow All Keys", + "type": "boolean" + }, + "allowed_tools": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Allowed Tools" + }, + "approval_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Approval Status" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "auth_type": { + "anyOf": [ + { + "enum": [ + "none", + "api_key", + "bearer_token", + "basic", + "authorization", + "oauth2", + "aws_sigv4", + "token" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Auth Type" + }, + "authorization_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Authorization Url" + }, + "available_on_public_internet": { + "default": true, + "title": "Available On Public Internet", + "type": "boolean" + }, + "byok_api_key_help_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Byok Api Key Help Url" + }, + "byok_description": { + "items": { + "type": "string" + }, + "title": "Byok Description", + "type": "array" + }, + "command": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Command" + }, + "credentials": { + "anyOf": [ + { + "$ref": "#/components/schemas/MCPCredentials" + }, + { + "type": "null" + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "env": { + "additionalProperties": { + "type": "string" + }, + "title": "Env", + "type": "object" + }, + "extra_headers": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Extra Headers" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Instructions" + }, + "is_byok": { + "default": false, + "title": "Is Byok", + "type": "boolean" + }, + "mcp_access_groups": { + "items": { + "type": "string" + }, + "title": "Mcp Access Groups", + "type": "array" + }, + "mcp_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Mcp Info" + }, + "oauth2_flow": { + "anyOf": [ + { + "enum": [ + "client_credentials", + "authorization_code" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Oauth2 Flow" + }, + "registration_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Registration Url" + }, + "server_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Id" + }, + "server_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Server Name" + }, + "source_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Source Url" + }, + "spec_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Spec Path" + }, + "static_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Static Headers" + }, + "submitted_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted At" + }, + "submitted_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Server-managed: set by the endpoint; caller values are overridden.", + "title": "Submitted By" + }, + "token_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Token Url" + }, + "tool_name_to_description": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Description" + }, + "tool_name_to_display_name": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Tool Name To Display Name" + }, + "transport": { + "default": "sse", + "enum": [ + "sse", + "http", + "stdio" + ], + "title": "Transport", + "type": "string" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" + } + }, + "title": "NewMCPServerRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/mcp-rest/test/connection": { + "post": { + "description": "Test if we can connect to the provided MCP server before adding it", + "operationId": "test_connection_mcp_rest_test_connection_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Connection", + "tags": [ + "mcp_rest" + ] + } + }, + "/mcp-rest/test/tools/list": { + "post": { + "description": "Preview tools available from MCP server before adding it", + "operationId": "test_tools_list_mcp_rest_test_tools_list_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewMCPServerRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Tools List", + "tags": [ + "mcp_rest" + ] + } + }, + "/mcp-rest/tools/call": { + "post": { + "description": "REST API to call a specific MCP tool with the provided arguments", + "operationId": "call_tool_rest_api_mcp_rest_tools_call_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Call Tool Rest Api", + "tags": [ + "mcp_rest" + ] + } + }, + "/mcp-rest/tools/list": { + "get": { + "description": "List all available tools with information about the server they belong to.\n\nExample response:\n{\n \"tools\": [\n {\n \"name\": \"create_zap\",\n \"description\": \"Create a new zap\",\n \"inputSchema\": \"tool_input_schema\",\n \"mcp_info\": {\n \"server_name\": \"zapier\",\n \"logo_url\": \"https://www.zapier.com/logo.png\",\n }\n }\n ],\n \"error\": null,\n \"message\": \"Successfully retrieved tools\"\n}", + "operationId": "list_tool_rest_api_mcp_rest_tools_list_get", + "parameters": [ + { + "description": "The server id to list tools for", + "in": "query", + "name": "server_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The server id to list tools for", + "title": "Server Id" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response List Tool Rest Api Mcp Rest Tools List Get", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Tool Rest Api", + "tags": [ + "mcp_rest" + ] + } + } + } + }, + "policies": { + "components": { + "schemas": { + "ChatCompletionAssistantMessage": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ChatCompletionTextObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionThinkingBlock" + }, + { + "$ref": "#/components/schemas/ChatCompletionRedactedThinkingBlock" + }, + { + "$ref": "#/components/schemas/ChatCompletionImageObject" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Content" + }, + "function_call": { + "anyOf": [ + { + "$ref": "#/components/schemas/ChatCompletionToolCallFunctionChunk" + }, + { + "type": "null" + } + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "reasoning_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Reasoning Content" + }, + "reasoning_items": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ChatCompletionReasoningItem" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Reasoning Items" + }, + "role": { + "const": "assistant", + "title": "Role", + "type": "string" + }, + "thinking_blocks": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ChatCompletionThinkingBlock" + }, + { + "$ref": "#/components/schemas/ChatCompletionRedactedThinkingBlock" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Thinking Blocks" + }, + "tool_calls": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ChatCompletionAssistantToolCall" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Tool Calls" + } + }, + "required": [ + "role" + ], + "title": "ChatCompletionAssistantMessage", + "type": "object" + }, + "ChatCompletionAssistantToolCall": { + "properties": { + "function": { + "$ref": "#/components/schemas/ChatCompletionToolCallFunctionChunk" + }, + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "type": { + "const": "function", + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "type", + "function" + ], + "title": "ChatCompletionAssistantToolCall", + "type": "object" + }, + "ChatCompletionAudioObject": { + "properties": { + "input_audio": { + "$ref": "#/components/schemas/InputAudio" + }, + "type": { + "const": "input_audio", + "title": "Type", + "type": "string" + } + }, + "required": [ + "input_audio", + "type" + ], + "title": "ChatCompletionAudioObject", + "type": "object" + }, + "ChatCompletionCachedContent": { + "properties": { + "type": { + "const": "ephemeral", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ChatCompletionCachedContent", + "type": "object" + }, + "ChatCompletionDeveloperMessage": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": {}, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "role": { + "const": "developer", + "title": "Role", + "type": "string" + } + }, + "required": [ + "role", + "content" + ], + "title": "ChatCompletionDeveloperMessage", + "type": "object" + }, + "ChatCompletionDocumentObject": { + "properties": { + "citations": { + "anyOf": [ + { + "$ref": "#/components/schemas/CitationsObject" + }, + { + "type": "null" + } + ] + }, + "context": { + "title": "Context", + "type": "string" + }, + "source": { + "$ref": "#/components/schemas/DocumentObject" + }, + "title": { + "title": "Title", + "type": "string" + }, + "type": { + "const": "document", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "source", + "title", + "context", + "citations" + ], + "title": "ChatCompletionDocumentObject", + "type": "object" + }, + "ChatCompletionFileObject": { + "properties": { + "file": { + "$ref": "#/components/schemas/ChatCompletionFileObjectFile" + }, + "type": { + "const": "file", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "file" + ], + "title": "ChatCompletionFileObject", + "type": "object" + }, + "ChatCompletionFileObjectFile": { + "properties": { + "detail": { + "title": "Detail", + "type": "string" + }, + "file_data": { + "title": "File Data", + "type": "string" + }, + "file_id": { + "title": "File Id", + "type": "string" + }, + "filename": { + "title": "Filename", + "type": "string" + }, + "format": { + "title": "Format", + "type": "string" + }, + "video_metadata": { + "additionalProperties": true, + "title": "Video Metadata", + "type": "object" + } + }, + "title": "ChatCompletionFileObjectFile", + "type": "object" + }, + "ChatCompletionFunctionMessage": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/ChatCompletionTextObject" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "role": { + "const": "function", + "title": "Role", + "type": "string" + }, + "tool_call_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Tool Call Id" + } + }, + "required": [ + "role", + "content", + "name", + "tool_call_id" + ], + "title": "ChatCompletionFunctionMessage", + "type": "object" + }, + "ChatCompletionImageObject": { + "properties": { + "image_url": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/ChatCompletionImageUrlObject" + } + ], + "title": "Image Url" + }, + "type": { + "const": "image_url", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "image_url" + ], + "title": "ChatCompletionImageObject", + "type": "object" + }, + "ChatCompletionImageUrlObject": { + "properties": { + "detail": { + "title": "Detail", + "type": "string" + }, + "format": { + "title": "Format", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "required": [ + "url" + ], + "title": "ChatCompletionImageUrlObject", + "type": "object" + }, + "ChatCompletionMessageToolCall": { + "additionalProperties": true, + "properties": {}, + "title": "ChatCompletionMessageToolCall", + "type": "object" + }, + "ChatCompletionReasoningItem": { + "description": "Represents an OpenAI Responses API reasoning item for round-tripping in conversation history.", + "properties": { + "encrypted_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Encrypted Content" + }, + "id": { + "title": "Id", + "type": "string" + }, + "summary": { + "items": { + "$ref": "#/components/schemas/ChatCompletionReasoningSummaryTextBlock" + }, + "title": "Summary", + "type": "array" + }, + "type": { + "const": "reasoning", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ChatCompletionReasoningItem", + "type": "object" + }, + "ChatCompletionReasoningSummaryTextBlock": { + "properties": { + "text": { + "title": "Text", + "type": "string" + }, + "type": { + "const": "summary_text", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ChatCompletionReasoningSummaryTextBlock", + "type": "object" + }, + "ChatCompletionRedactedThinkingBlock": { + "properties": { + "cache_control": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + { + "type": "null" + } + ], + "title": "Cache Control" + }, + "data": { + "title": "Data", + "type": "string" + }, + "type": { + "const": "redacted_thinking", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ChatCompletionRedactedThinkingBlock", + "type": "object" + }, + "ChatCompletionSystemMessage": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": {}, + "type": "array" + } + ], + "title": "Content" + }, + "name": { + "title": "Name", + "type": "string" + }, + "role": { + "const": "system", + "title": "Role", + "type": "string" + } + }, + "required": [ + "role", + "content" + ], + "title": "ChatCompletionSystemMessage", + "type": "object" + }, + "ChatCompletionTextObject": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "text": { + "title": "Text", + "type": "string" + }, + "type": { + "const": "text", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "text" + ], + "title": "ChatCompletionTextObject", + "type": "object" + }, + "ChatCompletionThinkingBlock": { + "properties": { + "cache_control": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + { + "type": "null" + } + ], + "title": "Cache Control" + }, + "signature": { + "title": "Signature", + "type": "string" + }, + "thinking": { + "title": "Thinking", + "type": "string" + }, + "type": { + "const": "thinking", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type" + ], + "title": "ChatCompletionThinkingBlock", + "type": "object" + }, + "ChatCompletionToolCallChunk": { + "properties": { + "function": { + "$ref": "#/components/schemas/ChatCompletionToolCallFunctionChunk" + }, + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "index": { + "title": "Index", + "type": "integer" + }, + "type": { + "const": "function", + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "type", + "function", + "index" + ], + "title": "ChatCompletionToolCallChunk", + "type": "object" + }, + "ChatCompletionToolCallFunctionChunk": { + "properties": { + "arguments": { + "title": "Arguments", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "provider_specific_fields": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Provider Specific Fields" + } + }, + "title": "ChatCompletionToolCallFunctionChunk", + "type": "object" + }, + "ChatCompletionToolMessage": { + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/components/schemas/ChatCompletionTextObject" + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "const": "tool", + "title": "Role", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "role", + "content", + "tool_call_id" + ], + "title": "ChatCompletionToolMessage", + "type": "object" + }, + "ChatCompletionToolParam": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "function": { + "$ref": "#/components/schemas/ChatCompletionToolParamFunctionChunk" + }, + "type": { + "anyOf": [ + { + "const": "function", + "type": "string" + }, + { + "type": "string" + } + ], + "title": "Type" + } + }, + "required": [ + "type", + "function" + ], + "title": "ChatCompletionToolParam", + "type": "object" + }, + "ChatCompletionToolParamFunctionChunk": { + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "parameters": { + "additionalProperties": true, + "title": "Parameters", + "type": "object" + }, + "strict": { + "title": "Strict", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "title": "ChatCompletionToolParamFunctionChunk", + "type": "object" + }, + "ChatCompletionUserMessage": { + "properties": { + "cache_control": { + "$ref": "#/components/schemas/ChatCompletionCachedContent" + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ChatCompletionTextObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionImageObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionAudioObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionDocumentObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionVideoObject" + }, + { + "$ref": "#/components/schemas/ChatCompletionFileObject" + } + ] + }, + "type": "array" + } + ], + "title": "Content" + }, + "role": { + "const": "user", + "title": "Role", + "type": "string" + } + }, + "required": [ + "role", + "content" + ], + "title": "ChatCompletionUserMessage", + "type": "object" + }, + "ChatCompletionVideoObject": { + "properties": { + "type": { + "const": "video_url", + "title": "Type", + "type": "string" + }, + "video_url": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/ChatCompletionVideoUrlObject" + } + ], + "title": "Video Url" + } + }, + "required": [ + "type", + "video_url" + ], + "title": "ChatCompletionVideoObject", + "type": "object" + }, + "ChatCompletionVideoUrlObject": { + "properties": { + "detail": { + "title": "Detail", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "required": [ + "url" + ], + "title": "ChatCompletionVideoUrlObject", + "type": "object" + }, + "CitationsObject": { + "properties": { + "enabled": { + "title": "Enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "CitationsObject", + "type": "object" + }, + "DocumentObject": { + "properties": { + "data": { + "title": "Data", + "type": "string" + }, + "media_type": { + "title": "Media Type", + "type": "string" + }, + "type": { + "const": "text", + "title": "Type", + "type": "string" + } + }, + "required": [ + "type", + "media_type", + "data" + ], + "title": "DocumentObject", + "type": "object" + }, + "EnrichTemplateRequest": { + "properties": { + "competitors": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "maxItems": 100, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Optional list of competitor names", + "title": "Competitors" + }, + "instruction": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Refinement instruction for modifying the competitor list (e.g. 'add 10 more from Asia')", + "title": "Instruction" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "parameters": { + "additionalProperties": true, + "title": "Parameters", + "type": "object" + }, + "template_id": { + "title": "Template Id", + "type": "string" + } + }, + "required": [ + "template_id", + "parameters" + ], + "title": "EnrichTemplateRequest", + "type": "object" + }, + "GenericGuardrailAPIInputs": { + "properties": { + "images": { + "items": { + "type": "string" + }, + "title": "Images", + "type": "array" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "structured_messages": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/ChatCompletionUserMessage" + }, + { + "$ref": "#/components/schemas/ChatCompletionAssistantMessage" + }, + { + "$ref": "#/components/schemas/ChatCompletionToolMessage" + }, + { + "$ref": "#/components/schemas/ChatCompletionSystemMessage" + }, + { + "$ref": "#/components/schemas/ChatCompletionFunctionMessage" + }, + { + "$ref": "#/components/schemas/ChatCompletionDeveloperMessage" + } + ] + }, + "title": "Structured Messages", + "type": "array" + }, + "texts": { + "items": { + "type": "string" + }, + "title": "Texts", + "type": "array" + }, + "tool_calls": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/ChatCompletionToolCallChunk" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/components/schemas/ChatCompletionMessageToolCall" + }, + "type": "array" + } + ], + "title": "Tool Calls" + }, + "tools": { + "items": { + "$ref": "#/components/schemas/ChatCompletionToolParam" + }, + "title": "Tools", + "type": "array" + } + }, + "title": "GenericGuardrailAPIInputs", + "type": "object" + }, + "GuardrailTestResultEntry": { + "properties": { + "action": { + "title": "Action", + "type": "string" + }, + "details": { + "title": "Details", + "type": "string" + }, + "guardrail_name": { + "title": "Guardrail Name", + "type": "string" + }, + "output_text": { + "title": "Output Text", + "type": "string" + } + }, + "required": [ + "guardrail_name", + "action", + "output_text", + "details" + ], + "title": "GuardrailTestResultEntry", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "InputAudio": { + "properties": { + "data": { + "title": "Data", + "type": "string" + }, + "format": { + "enum": [ + "wav", + "mp3" + ], + "title": "Format", + "type": "string" + } + }, + "required": [ + "data", + "format" + ], + "title": "InputAudio", + "type": "object" + }, + "PolicyGuardrailsResponse": { + "description": "Guardrails configuration for a policy.", + "properties": { + "add": { + "items": { + "type": "string" + }, + "title": "Add", + "type": "array" + }, + "remove": { + "items": { + "type": "string" + }, + "title": "Remove", + "type": "array" + } + }, + "title": "PolicyGuardrailsResponse", + "type": "object" + }, + "PolicyInfoResponse": { + "description": "Response for /policy/info/{policy_name} endpoint.", + "properties": { + "guardrails": { + "$ref": "#/components/schemas/PolicyGuardrailsResponse" + }, + "inherit": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Inherit" + }, + "inheritance_chain": { + "items": { + "type": "string" + }, + "title": "Inheritance Chain", + "type": "array" + }, + "policy_name": { + "title": "Policy Name", + "type": "string" + }, + "resolved_guardrails": { + "items": { + "type": "string" + }, + "title": "Resolved Guardrails", + "type": "array" + }, + "scope": { + "$ref": "#/components/schemas/PolicyScopeResponse" + } + }, + "required": [ + "policy_name", + "scope", + "guardrails", + "resolved_guardrails", + "inheritance_chain" + ], + "title": "PolicyInfoResponse", + "type": "object" + }, + "PolicyListResponse": { + "description": "Response for /policy/list endpoint.", + "properties": { + "policies": { + "additionalProperties": { + "$ref": "#/components/schemas/PolicySummaryItem" + }, + "title": "Policies", + "type": "object" + }, + "total_count": { + "title": "Total Count", + "type": "integer" + } + }, + "required": [ + "policies", + "total_count" + ], + "title": "PolicyListResponse", + "type": "object" + }, + "PolicyMatchContext": { + "additionalProperties": false, + "description": "Context used to match a request against policies.\n\nContains the team alias, key alias, and model from the incoming request.", + "properties": { + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "API key alias from the request.", + "title": "Key Alias" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model name from the request.", + "title": "Model" + }, + "tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Tags from key/team metadata.", + "title": "Tags" + }, + "team_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Team alias from the request.", + "title": "Team Alias" + } + }, + "title": "PolicyMatchContext", + "type": "object" + }, + "PolicyScopeResponse": { + "description": "Scope configuration for a policy.", + "properties": { + "keys": { + "items": { + "type": "string" + }, + "title": "Keys", + "type": "array" + }, + "models": { + "items": { + "type": "string" + }, + "title": "Models", + "type": "array" + }, + "tags": { + "items": { + "type": "string" + }, + "title": "Tags", + "type": "array" + }, + "teams": { + "items": { + "type": "string" + }, + "title": "Teams", + "type": "array" + } + }, + "title": "PolicyScopeResponse", + "type": "object" + }, + "PolicySummaryItem": { + "description": "Summary of a single policy for list endpoint.", + "properties": { + "guardrails": { + "$ref": "#/components/schemas/PolicyGuardrailsResponse" + }, + "inherit": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Inherit" + }, + "inheritance_chain": { + "items": { + "type": "string" + }, + "title": "Inheritance Chain", + "type": "array" + }, + "resolved_guardrails": { + "items": { + "type": "string" + }, + "title": "Resolved Guardrails", + "type": "array" + }, + "scope": { + "$ref": "#/components/schemas/PolicyScopeResponse" + } + }, + "required": [ + "scope", + "guardrails", + "resolved_guardrails", + "inheritance_chain" + ], + "title": "PolicySummaryItem", + "type": "object" + }, + "PolicyTestResponse": { + "description": "Response for /policy/test endpoint.", + "properties": { + "context": { + "$ref": "#/components/schemas/PolicyMatchContext" + }, + "matching_policies": { + "items": { + "type": "string" + }, + "title": "Matching Policies", + "type": "array" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Message" + }, + "resolved_guardrails": { + "items": { + "type": "string" + }, + "title": "Resolved Guardrails", + "type": "array" + } + }, + "required": [ + "context", + "matching_policies", + "resolved_guardrails" + ], + "title": "PolicyTestResponse", + "type": "object" + }, + "PolicyValidateRequest": { + "additionalProperties": false, + "description": "Request body for the /policy/validate endpoint.", + "properties": { + "policies": { + "additionalProperties": true, + "description": "Policy configuration to validate. Map of policy names to policy definitions.", + "title": "Policies", + "type": "object" + } + }, + "required": [ + "policies" + ], + "title": "PolicyValidateRequest", + "type": "object" + }, + "PolicyValidationError": { + "additionalProperties": false, + "description": "Represents a validation error or warning for a policy.", + "properties": { + "error_type": { + "$ref": "#/components/schemas/PolicyValidationErrorType", + "description": "Type of validation error." + }, + "field": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Specific field that caused the error (e.g., 'guardrails.add', 'scope.teams').", + "title": "Field" + }, + "message": { + "description": "Human-readable error message.", + "title": "Message", + "type": "string" + }, + "policy_name": { + "description": "Name of the policy with the issue.", + "title": "Policy Name", + "type": "string" + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The invalid value that caused the error.", + "title": "Value" + } + }, + "required": [ + "policy_name", + "error_type", + "message" + ], + "title": "PolicyValidationError", + "type": "object" + }, + "PolicyValidationErrorType": { + "description": "Types of validation errors that can occur.", + "enum": [ + "invalid_guardrail", + "invalid_team", + "invalid_key", + "invalid_model", + "invalid_inheritance", + "circular_inheritance", + "invalid_scope", + "invalid_syntax" + ], + "title": "PolicyValidationErrorType", + "type": "string" + }, + "PolicyValidationResponse": { + "additionalProperties": false, + "description": "Response from policy validation.\n\n- `valid`: True if no blocking errors were found\n- `errors`: List of blocking errors (prevent policy from being applied)\n- `warnings`: List of non-blocking warnings (policy can still be applied)", + "properties": { + "errors": { + "description": "List of blocking validation errors.", + "items": { + "$ref": "#/components/schemas/PolicyValidationError" + }, + "title": "Errors", + "type": "array" + }, + "valid": { + "description": "True if the policy configuration is valid.", + "title": "Valid", + "type": "boolean" + }, + "warnings": { + "description": "List of non-blocking validation warnings.", + "items": { + "$ref": "#/components/schemas/PolicyValidationError" + }, + "title": "Warnings", + "type": "array" + } + }, + "required": [ + "valid" + ], + "title": "PolicyValidationResponse", + "type": "object" + }, + "SuggestTemplatesRequest": { + "properties": { + "attack_examples": { + "items": { + "type": "string" + }, + "title": "Attack Examples", + "type": "array" + }, + "description": { + "default": "", + "title": "Description", + "type": "string" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + } + }, + "title": "SuggestTemplatesRequest", + "type": "object" + }, + "TestPoliciesAndGuardrailsRequest": { + "description": "Request body for POST /utils/test_policies_and_guardrails.", + "properties": { + "agent_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When set, call chat completion with this model/agent for each input and include the response in the result.", + "title": "Agent Id" + }, + "guardrail_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Guardrail names to apply directly", + "title": "Guardrail Names" + }, + "input_type": { + "default": "request", + "description": "Whether inputs are request or response", + "enum": [ + "request", + "response" + ], + "title": "Input Type", + "type": "string" + }, + "inputs_list": { + "default": [], + "description": "List of GenericGuardrailAPIInputs; each item processed separately (for batch compliance testing).", + "items": { + "$ref": "#/components/schemas/GenericGuardrailAPIInputs" + }, + "title": "Inputs List", + "type": "array" + }, + "policy_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Policy names to resolve guardrails from", + "title": "Policy Names" + }, + "request_data": { + "additionalProperties": true, + "description": "Request context (model, user_id, etc.)", + "title": "Request Data", + "type": "object" + } + }, + "title": "TestPoliciesAndGuardrailsRequest", + "type": "object" + }, + "TestPolicyTemplateRequest": { + "properties": { + "guardrail_definitions": { + "description": "All guardrailDefinitions from the policy template", + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Guardrail Definitions", + "type": "array" + }, + "text": { + "description": "Test input text to run guardrails against", + "title": "Text", + "type": "string" + } + }, + "required": [ + "guardrail_definitions", + "text" + ], + "title": "TestPolicyTemplateRequest", + "type": "object" + }, + "TestPolicyTemplateResponse": { + "properties": { + "overall_action": { + "title": "Overall Action", + "type": "string" + }, + "results": { + "items": { + "$ref": "#/components/schemas/GuardrailTestResultEntry" + }, + "title": "Results", + "type": "array" + } + }, + "required": [ + "overall_action", + "results" + ], + "title": "TestPolicyTemplateResponse", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/policy/info/{policy_name}": { + "get": { + "description": "Get detailed information about a specific policy.\n\nReturns:\n- Policy configuration\n- Resolved guardrails (after inheritance)\n- Inheritance chain", + "operationId": "get_policy_info_policy_info__policy_name__get", + "parameters": [ + { + "in": "path", + "name": "policy_name", + "required": true, + "schema": { + "title": "Policy Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyInfoResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Policy Info", + "tags": [ + "policies" + ] + } + }, + "/policy/list": { + "get": { + "description": "List all loaded policies with their resolved guardrails.\n\nReturns information about each policy including:\n- Inheritance configuration\n- Scope (teams, keys, models)\n- Guardrails to add/remove\n- Resolved guardrails (after inheritance)\n- Inheritance chain", + "operationId": "list_policies_policy_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyListResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Policies", + "tags": [ + "policies" + ] + } + }, + "/policy/templates": { + "get": { + "description": "Get policy templates for the UI (pre-configured guardrail combinations).\n\nFetches from GitHub with automatic fallback to local backup on failure.\nSet LITELLM_LOCAL_POLICY_TEMPLATES=true to skip GitHub and use local backup only.", + "operationId": "get_policy_templates_policy_templates_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": {}, + "title": "Response Get Policy Templates Policy Templates Get", + "type": "array" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Policy Templates", + "tags": [ + "policies" + ] + } + }, + "/policy/templates/enrich": { + "post": { + "description": "Enrich a policy template with LLM-discovered data (e.g. competitor names).\n\nCalls an onboarded LLM to discover competitors for the given brand name,\nthen returns enriched guardrailDefinitions with the discovered data populated.", + "operationId": "enrich_policy_template_policy_templates_enrich_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnrichTemplateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response Enrich Policy Template Policy Templates Enrich Post", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Enrich Policy Template", + "tags": [ + "policies" + ] + } + }, + "/policy/templates/enrich/stream": { + "post": { + "description": "Stream competitor names as SSE events as the LLM generates them.\n\nEvents:\n- data: {\"type\": \"competitor\", \"name\": \"...\"} \u2014 each competitor as discovered\n- data: {\"type\": \"done\", \"competitors\": [...], \"competitor_variations\": {...}, \"guardrailDefinitions\": [...]}", + "operationId": "enrich_policy_template_stream_policy_templates_enrich_stream_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnrichTemplateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Enrich Policy Template Stream", + "tags": [ + "policies" + ] + } + }, + "/policy/templates/suggest": { + "post": { + "description": "Use AI to suggest policy templates based on attack examples and descriptions.\n\nCalls an LLM with tool calling to match user requirements to available templates.", + "operationId": "suggest_policy_templates_policy_templates_suggest_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuggestTemplatesRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response Suggest Policy Templates Policy Templates Suggest Post", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Suggest Policy Templates", + "tags": [ + "policies" + ] + } + }, + "/policy/templates/test": { + "post": { + "description": "Test a policy template's guardrails against a text input without creating them.\n\nInstantiates temporary guardrails from the template definitions, runs them\nagainst the provided text, and returns per-guardrail results so users can\nverify the template solves their problem before creating it.", + "operationId": "test_policy_template_policy_templates_test_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestPolicyTemplateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestPolicyTemplateResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Policy Template", + "tags": [ + "policies" + ] + } + }, + "/policy/test": { + "post": { + "description": "Test which policies would match a given request context.\n\nThis is useful for debugging and understanding policy behavior.\n\nRequest body:\n```json\n{\n \"team_alias\": \"healthcare-team\",\n \"key_alias\": \"my-api-key\",\n \"model\": \"gpt-4\"\n}\n```\n\nReturns:\n- matching_policies: List of policy names that match\n- resolved_guardrails: Final list of guardrails that would be applied", + "operationId": "test_policy_matching_policy_test_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyMatchContext" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyTestResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Policy Matching", + "tags": [ + "policies" + ] + } + }, + "/policy/validate": { + "post": { + "description": "Validate a policy configuration before applying it.\n\nChecks:\n- All referenced guardrails exist in the guardrail registry\n- All non-wildcard team aliases exist in the database\n- All non-wildcard key aliases exist in the database\n- Inheritance chains are valid (no cycles, parents exist)\n- Scope patterns are syntactically valid\n\nReturns:\n- valid: True if the policy configuration is valid (no blocking errors)\n- errors: List of blocking validation errors\n- warnings: List of non-blocking validation warnings\n\nExample request:\n```json\n{\n \"policies\": {\n \"global-baseline\": {\n \"guardrails\": {\n \"add\": [\"pii_blocker\", \"phi_blocker\"]\n },\n \"scope\": {\n \"teams\": [\"*\"],\n \"keys\": [\"*\"],\n \"models\": [\"*\"]\n }\n },\n \"healthcare-compliance\": {\n \"inherit\": \"global-baseline\",\n \"guardrails\": {\n \"add\": [\"hipaa_audit\"]\n },\n \"scope\": {\n \"teams\": [\"healthcare-team\"]\n }\n }\n }\n}\n```", + "operationId": "validate_policy_policy_validate_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyValidateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyValidationResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Validate Policy", + "tags": [ + "policies" + ] + } + }, + "/utils/test_policies_and_guardrails": { + "post": { + "description": "Apply policies and/or guardrails to inputs (for compliance UI testing).\n\nUse inputs_list for batch testing: each input is processed as a separate call so\nper-input block/allow and errors are returned.\n\nUse inputs for a single call (legacy).", + "operationId": "test_policies_and_guardrails_utils_test_policies_and_guardrails_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestPoliciesAndGuardrailsRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Policies And Guardrails", + "tags": [ + "policies" + ] + } + } + } + }, + "policy_engine": { + "components": { + "schemas": { + "AttachmentImpactResponse": { + "description": "Response for estimating the impact of a policy attachment.", + "properties": { + "affected_keys_count": { + "default": 0, + "description": "Number of keys that would be affected (named + unnamed).", + "title": "Affected Keys Count", + "type": "integer" + }, + "affected_teams_count": { + "default": 0, + "description": "Number of teams that would be affected (named + unnamed).", + "title": "Affected Teams Count", + "type": "integer" + }, + "sample_keys": { + "description": "Sample of affected key aliases (up to 10).", + "items": { + "type": "string" + }, + "title": "Sample Keys", + "type": "array" + }, + "sample_teams": { + "description": "Sample of affected team aliases (up to 10).", + "items": { + "type": "string" + }, + "title": "Sample Teams", + "type": "array" + }, + "unnamed_keys_count": { + "default": 0, + "description": "Number of affected keys without an alias.", + "title": "Unnamed Keys Count", + "type": "integer" + }, + "unnamed_teams_count": { + "default": 0, + "description": "Number of affected teams without an alias.", + "title": "Unnamed Teams Count", + "type": "integer" + } + }, + "title": "AttachmentImpactResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "PipelineTestRequest": { + "description": "Request body for testing a guardrail pipeline with sample messages.", + "properties": { + "pipeline": { + "additionalProperties": true, + "description": "Pipeline definition with 'mode' and 'steps'.", + "title": "Pipeline", + "type": "object" + }, + "test_messages": { + "description": "Test messages to run through the pipeline, e.g. [{'role': 'user', 'content': '...'}].", + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "title": "Test Messages", + "type": "array" + } + }, + "required": [ + "pipeline", + "test_messages" + ], + "title": "PipelineTestRequest", + "type": "object" + }, + "PolicyAttachmentCreateRequest": { + "description": "Request body for creating a policy attachment.", + "properties": { + "keys": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Key aliases or patterns this attachment applies to.", + "title": "Keys" + }, + "models": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Model names or patterns this attachment applies to.", + "title": "Models" + }, + "policy_name": { + "description": "Name of the policy to attach.", + "title": "Policy Name", + "type": "string" + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Use '*' for global scope (applies to all requests).", + "title": "Scope" + }, + "tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Tag patterns this attachment applies to. Supports wildcards (e.g., health-*).", + "title": "Tags" + }, + "teams": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Team aliases or patterns this attachment applies to.", + "title": "Teams" + } + }, + "required": [ + "policy_name" + ], + "title": "PolicyAttachmentCreateRequest", + "type": "object" + }, + "PolicyAttachmentDBResponse": { + "description": "Response for a policy attachment from the database.", + "properties": { + "attachment_id": { + "description": "Unique ID of the attachment.", + "title": "Attachment Id", + "type": "string" + }, + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the attachment was created.", + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Who created the attachment.", + "title": "Created By" + }, + "keys": { + "description": "Key patterns.", + "items": { + "type": "string" + }, + "title": "Keys", + "type": "array" + }, + "models": { + "description": "Model patterns.", + "items": { + "type": "string" + }, + "title": "Models", + "type": "array" + }, + "policy_name": { + "description": "Name of the attached policy.", + "title": "Policy Name", + "type": "string" + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Scope of the attachment.", + "title": "Scope" + }, + "tags": { + "description": "Tag patterns.", + "items": { + "type": "string" + }, + "title": "Tags", + "type": "array" + }, + "teams": { + "description": "Team patterns.", + "items": { + "type": "string" + }, + "title": "Teams", + "type": "array" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the attachment was last updated.", + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Who last updated the attachment.", + "title": "Updated By" + } + }, + "required": [ + "attachment_id", + "policy_name" + ], + "title": "PolicyAttachmentDBResponse", + "type": "object" + }, + "PolicyAttachmentListResponse": { + "description": "Response for listing policy attachments.", + "properties": { + "attachments": { + "description": "List of policy attachments.", + "items": { + "$ref": "#/components/schemas/PolicyAttachmentDBResponse" + }, + "title": "Attachments", + "type": "array" + }, + "total_count": { + "default": 0, + "description": "Total number of attachments.", + "title": "Total Count", + "type": "integer" + } + }, + "title": "PolicyAttachmentListResponse", + "type": "object" + }, + "PolicyConditionRequest": { + "description": "Condition for when a policy applies.", + "properties": { + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model name pattern (exact match or regex) for when policy applies.", + "title": "Model" + } + }, + "title": "PolicyConditionRequest", + "type": "object" + }, + "PolicyCreateRequest": { + "description": "Request body for creating a new policy.", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/components/schemas/PolicyConditionRequest" + }, + { + "type": "null" + } + ], + "description": "Condition for when this policy applies." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable description of the policy.", + "title": "Description" + }, + "guardrails_add": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of guardrail names to add.", + "title": "Guardrails Add" + }, + "guardrails_remove": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of guardrail names to remove (from inherited).", + "title": "Guardrails Remove" + }, + "inherit": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of parent policy to inherit from.", + "title": "Inherit" + }, + "pipeline": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Optional guardrail pipeline for ordered execution. Contains 'mode' and 'steps'.", + "title": "Pipeline" + }, + "policy_name": { + "description": "Unique name for the policy.", + "title": "Policy Name", + "type": "string" + } + }, + "required": [ + "policy_name" + ], + "title": "PolicyCreateRequest", + "type": "object" + }, + "PolicyDBResponse": { + "description": "Response for a policy from the database.", + "properties": { + "condition": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Policy condition.", + "title": "Condition" + }, + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the policy was created.", + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Who created the policy.", + "title": "Created By" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Policy description.", + "title": "Description" + }, + "guardrails_add": { + "description": "Guardrails to add.", + "items": { + "type": "string" + }, + "title": "Guardrails Add", + "type": "array" + }, + "guardrails_remove": { + "description": "Guardrails to remove.", + "items": { + "type": "string" + }, + "title": "Guardrails Remove", + "type": "array" + }, + "inherit": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Parent policy name.", + "title": "Inherit" + }, + "is_latest": { + "default": true, + "description": "True if this is the latest version by version_number.", + "title": "Is Latest", + "type": "boolean" + }, + "parent_version_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Policy ID this version was cloned from.", + "title": "Parent Version Id" + }, + "pipeline": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Optional guardrail pipeline.", + "title": "Pipeline" + }, + "policy_id": { + "description": "Unique ID of the policy.", + "title": "Policy Id", + "type": "string" + }, + "policy_name": { + "description": "Name of the policy.", + "title": "Policy Name", + "type": "string" + }, + "production_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When this version was promoted to production.", + "title": "Production At" + }, + "published_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When this version was published.", + "title": "Published At" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the policy was last updated.", + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Who last updated the policy.", + "title": "Updated By" + }, + "version_number": { + "default": 1, + "description": "Version number of this policy.", + "title": "Version Number", + "type": "integer" + }, + "version_status": { + "default": "production", + "description": "One of: draft, published, production.", + "title": "Version Status", + "type": "string" + } + }, + "required": [ + "policy_id", + "policy_name" + ], + "title": "PolicyDBResponse", + "type": "object" + }, + "PolicyListDBResponse": { + "description": "Response for listing policies from the database.", + "properties": { + "policies": { + "description": "List of policies.", + "items": { + "$ref": "#/components/schemas/PolicyDBResponse" + }, + "title": "Policies", + "type": "array" + }, + "total_count": { + "default": 0, + "description": "Total number of policies.", + "title": "Total Count", + "type": "integer" + } + }, + "title": "PolicyListDBResponse", + "type": "object" + }, + "PolicyMatchDetail": { + "description": "Details about why a specific policy matched.", + "properties": { + "guardrails_added": { + "description": "Guardrails this policy contributes.", + "items": { + "type": "string" + }, + "title": "Guardrails Added", + "type": "array" + }, + "matched_via": { + "description": "How the policy was matched (e.g., 'tag:healthcare', 'team:health-team', 'scope:*').", + "title": "Matched Via", + "type": "string" + }, + "policy_name": { + "description": "Name of the matched policy.", + "title": "Policy Name", + "type": "string" + } + }, + "required": [ + "policy_name", + "matched_via" + ], + "title": "PolicyMatchDetail", + "type": "object" + }, + "PolicyResolveRequest": { + "description": "Request body for resolving effective policies/guardrails for a context.", + "properties": { + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Key alias to resolve for.", + "title": "Key Alias" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model name to resolve for.", + "title": "Model" + }, + "tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Tags to resolve for.", + "title": "Tags" + }, + "team_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Team alias to resolve for.", + "title": "Team Alias" + } + }, + "title": "PolicyResolveRequest", + "type": "object" + }, + "PolicyResolveResponse": { + "description": "Response for resolving effective policies/guardrails for a context.", + "properties": { + "effective_guardrails": { + "description": "Final list of guardrails that would be applied.", + "items": { + "type": "string" + }, + "title": "Effective Guardrails", + "type": "array" + }, + "matched_policies": { + "description": "Details about each matched policy and why it matched.", + "items": { + "$ref": "#/components/schemas/PolicyMatchDetail" + }, + "title": "Matched Policies", + "type": "array" + } + }, + "title": "PolicyResolveResponse", + "type": "object" + }, + "PolicyUpdateRequest": { + "description": "Request body for updating a policy.", + "properties": { + "condition": { + "anyOf": [ + { + "$ref": "#/components/schemas/PolicyConditionRequest" + }, + { + "type": "null" + } + ], + "description": "Condition for when this policy applies." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Human-readable description of the policy.", + "title": "Description" + }, + "guardrails_add": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of guardrail names to add.", + "title": "Guardrails Add" + }, + "guardrails_remove": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "List of guardrail names to remove (from inherited).", + "title": "Guardrails Remove" + }, + "inherit": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Name of parent policy to inherit from.", + "title": "Inherit" + }, + "pipeline": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Optional guardrail pipeline for ordered execution. Contains 'mode' and 'steps'.", + "title": "Pipeline" + }, + "policy_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New name for the policy.", + "title": "Policy Name" + } + }, + "title": "PolicyUpdateRequest", + "type": "object" + }, + "PolicyVersionCompareResponse": { + "description": "Response for comparing two policy versions.", + "properties": { + "field_diffs": { + "additionalProperties": { + "additionalProperties": true, + "type": "object" + }, + "description": "Field name -> {version_a: val, version_b: val} for differing fields.", + "title": "Field Diffs", + "type": "object" + }, + "version_a": { + "$ref": "#/components/schemas/PolicyDBResponse", + "description": "First version." + }, + "version_b": { + "$ref": "#/components/schemas/PolicyDBResponse", + "description": "Second version." + } + }, + "required": [ + "version_a", + "version_b" + ], + "title": "PolicyVersionCompareResponse", + "type": "object" + }, + "PolicyVersionCreateRequest": { + "description": "Request body for creating a new policy version (draft).", + "properties": { + "source_policy_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Policy ID to clone from. If None, clone from current production version.", + "title": "Source Policy Id" + } + }, + "title": "PolicyVersionCreateRequest", + "type": "object" + }, + "PolicyVersionListResponse": { + "description": "Response for listing all versions of a policy.", + "properties": { + "policy_name": { + "description": "Name of the policy.", + "title": "Policy Name", + "type": "string" + }, + "total_count": { + "default": 0, + "description": "Total number of versions.", + "title": "Total Count", + "type": "integer" + }, + "versions": { + "description": "All versions ordered by version_number desc.", + "items": { + "$ref": "#/components/schemas/PolicyDBResponse" + }, + "title": "Versions", + "type": "array" + } + }, + "required": [ + "policy_name" + ], + "title": "PolicyVersionListResponse", + "type": "object" + }, + "PolicyVersionStatusUpdateRequest": { + "description": "Request body for updating a policy version's status.", + "properties": { + "version_status": { + "description": "New status: 'published' or 'production'.", + "title": "Version Status", + "type": "string" + } + }, + "required": [ + "version_status" + ], + "title": "PolicyVersionStatusUpdateRequest", + "type": "object" + }, + "UsageOverviewResponse": { + "properties": { + "chart": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "title": "Chart", + "type": "array" + }, + "passRate": { + "title": "Passrate", + "type": "number" + }, + "rows": { + "items": { + "$ref": "#/components/schemas/UsageOverviewRow" + }, + "title": "Rows", + "type": "array" + }, + "totalBlocked": { + "title": "Totalblocked", + "type": "integer" + }, + "totalRequests": { + "title": "Totalrequests", + "type": "integer" + } + }, + "required": [ + "rows", + "chart", + "totalRequests", + "totalBlocked", + "passRate" + ], + "title": "UsageOverviewResponse", + "type": "object" + }, + "UsageOverviewRow": { + "properties": { + "avgLatency": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avglatency" + }, + "avgScore": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Avgscore" + }, + "failRate": { + "title": "Failrate", + "type": "number" + }, + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "provider": { + "title": "Provider", + "type": "string" + }, + "requestsEvaluated": { + "title": "Requestsevaluated", + "type": "integer" + }, + "status": { + "title": "Status", + "type": "string" + }, + "trend": { + "title": "Trend", + "type": "string" + }, + "type": { + "title": "Type", + "type": "string" + } + }, + "required": [ + "id", + "name", + "type", + "provider", + "requestsEvaluated", + "failRate", + "avgScore", + "avgLatency", + "status", + "trend" + ], + "title": "UsageOverviewRow", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/policies": { + "post": { + "description": "Create a new policy.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"policy_name\": \"global-baseline\",\n \"description\": \"Base guardrails for all requests\",\n \"guardrails_add\": [\"pii_masking\", \"prompt_injection\"],\n \"guardrails_remove\": []\n }'\n```\n\nExample Response:\n```json\n{\n \"policy_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"policy_name\": \"global-baseline\",\n \"inherit\": null,\n \"description\": \"Base guardrails for all requests\",\n \"guardrails_add\": [\"pii_masking\", \"prompt_injection\"],\n \"guardrails_remove\": [],\n \"condition\": null,\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n}\n```", + "operationId": "create_policy_policies_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Policy", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/attachments": { + "post": { + "description": "Create a new policy attachment.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/attachments\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"policy_name\": \"global-baseline\",\n \"scope\": \"*\"\n }'\n```\n\nExample with team-specific attachment:\n```bash\ncurl -X POST \"http://localhost:4000/policies/attachments\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"policy_name\": \"healthcare-compliance\",\n \"teams\": [\"healthcare-team\", \"medical-research\"]\n }'\n```\n\nExample Response:\n```json\n{\n \"attachment_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"policy_name\": \"global-baseline\",\n \"scope\": \"*\",\n \"teams\": [],\n \"keys\": [],\n \"models\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n}\n```", + "operationId": "create_policy_attachment_policies_attachments_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Policy Attachment", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/attachments/estimate-impact": { + "post": { + "description": "Estimate how many keys and teams would be affected by a policy attachment.\n\nUse this before creating an attachment to preview the blast radius.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/attachments/estimate-impact\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"policy_name\": \"hipaa-compliance\",\n \"tags\": [\"healthcare\", \"health-*\"]\n }'\n```", + "operationId": "estimate_attachment_impact_policies_attachments_estimate_impact_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentImpactResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Estimate Attachment Impact", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/attachments/list": { + "get": { + "description": "List all policy attachments from the database.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/policies/attachments/list\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"attachments\": [\n {\n \"attachment_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"policy_name\": \"global-baseline\",\n \"scope\": \"*\",\n \"teams\": [],\n \"keys\": [],\n \"models\": [],\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n ],\n \"total_count\": 1\n}\n```", + "operationId": "list_policy_attachments_policies_attachments_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentListResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Policy Attachments", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/attachments/{attachment_id}": { + "delete": { + "description": "Delete a policy attachment.\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/policies/attachments/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Attachment 123e4567-e89b-12d3-a456-426614174000 deleted successfully\"\n}\n```", + "operationId": "delete_policy_attachment_policies_attachments__attachment_id__delete", + "parameters": [ + { + "in": "path", + "name": "attachment_id", + "required": true, + "schema": { + "title": "Attachment Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Policy Attachment", + "tags": [ + "policy_engine" + ] + }, + "get": { + "description": "Get a policy attachment by ID.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/policies/attachments/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```", + "operationId": "get_policy_attachment_policies_attachments__attachment_id__get", + "parameters": [ + { + "in": "path", + "name": "attachment_id", + "required": true, + "schema": { + "title": "Attachment Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Policy Attachment", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/compare": { + "get": { + "description": "Compare two policy versions. Query params: version_a, version_b (policy version IDs).", + "operationId": "compare_policy_versions_policies_compare_get", + "parameters": [ + { + "in": "query", + "name": "version_a", + "required": true, + "schema": { + "title": "Version A", + "type": "string" + } + }, + { + "in": "query", + "name": "version_b", + "required": true, + "schema": { + "title": "Version B", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyVersionCompareResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Compare Policy Versions", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/list": { + "get": { + "description": "List all policies from the database. Optionally filter by version_status.\n\nQuery params:\n- version_status: Optional. One of \"draft\", \"published\", \"production\".\n If omitted, all versions are returned.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/policies/list\" \\\n -H \"Authorization: Bearer \"\ncurl -X GET \"http://localhost:4000/policies/list?version_status=production\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"policies\": [\n {\n \"policy_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"policy_name\": \"global-baseline\",\n \"version_number\": 1,\n \"version_status\": \"production\",\n \"inherit\": null,\n \"description\": \"Base guardrails for all requests\",\n \"guardrails_add\": [\"pii_masking\"],\n \"guardrails_remove\": [],\n \"condition\": null,\n \"created_at\": \"2024-01-01T00:00:00Z\",\n \"updated_at\": \"2024-01-01T00:00:00Z\"\n }\n ],\n \"total_count\": 1\n}\n```", + "operationId": "list_policies_policies_list_get", + "parameters": [ + { + "in": "query", + "name": "version_status", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version Status" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyListDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Policies", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/name/{policy_name}/all-versions": { + "delete": { + "description": "Delete all versions of a policy. Also removes from in-memory registry.", + "operationId": "delete_all_policy_versions_policies_name__policy_name__all_versions_delete", + "parameters": [ + { + "in": "path", + "name": "policy_name", + "required": true, + "schema": { + "title": "Policy Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete All Policy Versions", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/name/{policy_name}/versions": { + "get": { + "description": "List all versions of a policy by name, ordered by version_number descending.", + "operationId": "list_policy_versions_policies_name__policy_name__versions_get", + "parameters": [ + { + "in": "path", + "name": "policy_name", + "required": true, + "schema": { + "title": "Policy Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyVersionListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Policy Versions", + "tags": [ + "policy_engine" + ] + }, + "post": { + "description": "Create a new draft version of a policy. Copies all fields from the source.\nSource is current production if source_policy_id is not provided.", + "operationId": "create_policy_version_policies_name__policy_name__versions_post", + "parameters": [ + { + "in": "path", + "name": "policy_name", + "required": true, + "schema": { + "title": "Policy Name", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyVersionCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Policy Version", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/resolve": { + "post": { + "description": "Resolve which policies and guardrails apply for a given context.\n\nUse this endpoint to debug \"what guardrails would apply to a request\nwith this team/key/model/tags combination?\"\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/resolve\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"tags\": [\"healthcare\"],\n \"model\": \"gpt-4\"\n }'\n```", + "operationId": "resolve_policies_for_context_policies_resolve_post", + "parameters": [ + { + "description": "Force a DB sync before resolving. Default uses in-memory cache.", + "in": "query", + "name": "force_sync", + "required": false, + "schema": { + "default": false, + "description": "Force a DB sync before resolving. Default uses in-memory cache.", + "title": "Force Sync", + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResolveRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResolveResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Resolve Policies For Context", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/test-pipeline": { + "post": { + "description": "Test a guardrail pipeline with sample messages.\n\nExecutes the pipeline steps against the provided test messages and returns\nstep-by-step results showing which guardrails passed/failed, actions taken,\nand timing information.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/test-pipeline\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"pipeline\": {\n \"mode\": \"pre_call\",\n \"steps\": [\n {\"guardrail\": \"pii-guard\", \"on_pass\": \"next\", \"on_fail\": \"block\"}\n ]\n },\n \"test_messages\": [{\"role\": \"user\", \"content\": \"My SSN is 123-45-6789\"}]\n }'\n```", + "operationId": "test_pipeline_policies_test_pipeline_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PipelineTestRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Pipeline", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/usage/overview": { + "get": { + "description": "Return policy performance overview for the dashboard.", + "operationId": "policies_usage_overview_policies_usage_overview_get", + "parameters": [ + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "Start Date" + } + }, + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageOverviewResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Policies Usage Overview", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/{policy_id}": { + "delete": { + "description": "Delete a policy.\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/policies/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Policy 123e4567-e89b-12d3-a456-426614174000 deleted successfully\"\n}\n```", + "operationId": "delete_policy_policies__policy_id__delete", + "parameters": [ + { + "in": "path", + "name": "policy_id", + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Policy", + "tags": [ + "policy_engine" + ] + }, + "get": { + "description": "Get a policy by ID.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/policies/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```", + "operationId": "get_policy_policies__policy_id__get", + "parameters": [ + { + "in": "path", + "name": "policy_id", + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Policy", + "tags": [ + "policy_engine" + ] + }, + "put": { + "description": "Update an existing policy.\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/policies/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"description\": \"Updated description\",\n \"guardrails_add\": [\"pii_masking\", \"toxicity_filter\"]\n }'\n```", + "operationId": "update_policy_policies__policy_id__put", + "parameters": [ + { + "in": "path", + "name": "policy_id", + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Policy", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/{policy_id}/resolved-guardrails": { + "get": { + "description": "Get the resolved guardrails for a policy (including inherited guardrails).\n\nThis endpoint resolves the full inheritance chain and returns the final\nset of guardrails that would be applied for this policy.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/policies/123e4567-e89b-12d3-a456-426614174000/resolved-guardrails\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"policy_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"policy_name\": \"healthcare-compliance\",\n \"resolved_guardrails\": [\"pii_masking\", \"prompt_injection\", \"toxicity_filter\"]\n}\n```", + "operationId": "get_resolved_guardrails_policies__policy_id__resolved_guardrails_get", + "parameters": [ + { + "in": "path", + "name": "policy_id", + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Resolved Guardrails", + "tags": [ + "policy_engine" + ] + } + }, + "/policies/{policy_id}/status": { + "put": { + "description": "Update a policy version's status. Valid transitions:\n- draft -> published\n- published -> production (demotes current production to published)\n- production -> published (demotes, policy becomes inactive)", + "operationId": "update_policy_version_status_policies__policy_id__status_put", + "parameters": [ + { + "in": "path", + "name": "policy_id", + "required": true, + "schema": { + "title": "Policy Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyVersionStatusUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyDBResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Policy Version Status", + "tags": [ + "policy_engine" + ] + } + } + } + }, + "policy_resolve": { + "components": { + "schemas": { + "AttachmentImpactResponse": { + "description": "Response for estimating the impact of a policy attachment.", + "properties": { + "affected_keys_count": { + "default": 0, + "description": "Number of keys that would be affected (named + unnamed).", + "title": "Affected Keys Count", + "type": "integer" + }, + "affected_teams_count": { + "default": 0, + "description": "Number of teams that would be affected (named + unnamed).", + "title": "Affected Teams Count", + "type": "integer" + }, + "sample_keys": { + "description": "Sample of affected key aliases (up to 10).", + "items": { + "type": "string" + }, + "title": "Sample Keys", + "type": "array" + }, + "sample_teams": { + "description": "Sample of affected team aliases (up to 10).", + "items": { + "type": "string" + }, + "title": "Sample Teams", + "type": "array" + }, + "unnamed_keys_count": { + "default": 0, + "description": "Number of affected keys without an alias.", + "title": "Unnamed Keys Count", + "type": "integer" + }, + "unnamed_teams_count": { + "default": 0, + "description": "Number of affected teams without an alias.", + "title": "Unnamed Teams Count", + "type": "integer" + } + }, + "title": "AttachmentImpactResponse", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "PolicyAttachmentCreateRequest": { + "description": "Request body for creating a policy attachment.", + "properties": { + "keys": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Key aliases or patterns this attachment applies to.", + "title": "Keys" + }, + "models": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Model names or patterns this attachment applies to.", + "title": "Models" + }, + "policy_name": { + "description": "Name of the policy to attach.", + "title": "Policy Name", + "type": "string" + }, + "scope": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Use '*' for global scope (applies to all requests).", + "title": "Scope" + }, + "tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Tag patterns this attachment applies to. Supports wildcards (e.g., health-*).", + "title": "Tags" + }, + "teams": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Team aliases or patterns this attachment applies to.", + "title": "Teams" + } + }, + "required": [ + "policy_name" + ], + "title": "PolicyAttachmentCreateRequest", + "type": "object" + }, + "PolicyMatchDetail": { + "description": "Details about why a specific policy matched.", + "properties": { + "guardrails_added": { + "description": "Guardrails this policy contributes.", + "items": { + "type": "string" + }, + "title": "Guardrails Added", + "type": "array" + }, + "matched_via": { + "description": "How the policy was matched (e.g., 'tag:healthcare', 'team:health-team', 'scope:*').", + "title": "Matched Via", + "type": "string" + }, + "policy_name": { + "description": "Name of the matched policy.", + "title": "Policy Name", + "type": "string" + } + }, + "required": [ + "policy_name", + "matched_via" + ], + "title": "PolicyMatchDetail", + "type": "object" + }, + "PolicyResolveRequest": { + "description": "Request body for resolving effective policies/guardrails for a context.", + "properties": { + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Key alias to resolve for.", + "title": "Key Alias" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model name to resolve for.", + "title": "Model" + }, + "tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Tags to resolve for.", + "title": "Tags" + }, + "team_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Team alias to resolve for.", + "title": "Team Alias" + } + }, + "title": "PolicyResolveRequest", + "type": "object" + }, + "PolicyResolveResponse": { + "description": "Response for resolving effective policies/guardrails for a context.", + "properties": { + "effective_guardrails": { + "description": "Final list of guardrails that would be applied.", + "items": { + "type": "string" + }, + "title": "Effective Guardrails", + "type": "array" + }, + "matched_policies": { + "description": "Details about each matched policy and why it matched.", + "items": { + "$ref": "#/components/schemas/PolicyMatchDetail" + }, + "title": "Matched Policies", + "type": "array" + } + }, + "title": "PolicyResolveResponse", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/policies/attachments/estimate-impact": { + "post": { + "description": "Estimate how many keys and teams would be affected by a policy attachment.\n\nUse this before creating an attachment to preview the blast radius.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/attachments/estimate-impact\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"policy_name\": \"hipaa-compliance\",\n \"tags\": [\"healthcare\", \"health-*\"]\n }'\n```", + "operationId": "estimate_attachment_impact_policies_attachments_estimate_impact_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyAttachmentCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AttachmentImpactResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Estimate Attachment Impact", + "tags": [ + "policy_resolve" + ] + } + }, + "/policies/resolve": { + "post": { + "description": "Resolve which policies and guardrails apply for a given context.\n\nUse this endpoint to debug \"what guardrails would apply to a request\nwith this team/key/model/tags combination?\"\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/policies/resolve\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"tags\": [\"healthcare\"],\n \"model\": \"gpt-4\"\n }'\n```", + "operationId": "resolve_policies_for_context_policies_resolve_post", + "parameters": [ + { + "description": "Force a DB sync before resolving. Default uses in-memory cache.", + "in": "query", + "name": "force_sync", + "required": false, + "schema": { + "default": false, + "description": "Force a DB sync before resolving. Default uses in-memory cache.", + "title": "Force Sync", + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResolveRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PolicyResolveResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Resolve Policies For Context", + "tags": [ + "policy_resolve" + ] + } + } + } + }, + "prompts": { + "components": { + "schemas": { + "Body_convert_prompt_file_to_json_utils_dotprompt_json_converter_post": { + "properties": { + "file": { + "format": "binary", + "title": "File", + "type": "string" + } + }, + "required": [ + "file" + ], + "title": "Body_convert_prompt_file_to_json_utils_dotprompt_json_converter_post", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListPromptsResponse": { + "properties": { + "prompts": { + "items": { + "$ref": "#/components/schemas/PromptSpec" + }, + "title": "Prompts", + "type": "array" + } + }, + "required": [ + "prompts" + ], + "title": "ListPromptsResponse", + "type": "object" + }, + "PatchPromptRequest": { + "properties": { + "litellm_params": { + "anyOf": [ + { + "$ref": "#/components/schemas/PromptLiteLLMParams" + }, + { + "type": "null" + } + ] + }, + "prompt_info": { + "anyOf": [ + { + "$ref": "#/components/schemas/PromptInfo" + }, + { + "type": "null" + } + ] + } + }, + "title": "PatchPromptRequest", + "type": "object" + }, + "Prompt": { + "properties": { + "litellm_params": { + "$ref": "#/components/schemas/PromptLiteLLMParams" + }, + "prompt_id": { + "title": "Prompt Id", + "type": "string" + }, + "prompt_info": { + "anyOf": [ + { + "$ref": "#/components/schemas/PromptInfo" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "prompt_id", + "litellm_params" + ], + "title": "Prompt", + "type": "object" + }, + "PromptInfo": { + "additionalProperties": true, + "properties": { + "environment": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "development", + "title": "Environment" + }, + "prompt_type": { + "enum": [ + "config", + "db" + ], + "title": "Prompt Type", + "type": "string" + } + }, + "required": [ + "prompt_type" + ], + "title": "PromptInfo", + "type": "object" + }, + "PromptInfoResponse": { + "properties": { + "environments": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Environments" + }, + "prompt_spec": { + "$ref": "#/components/schemas/PromptSpec" + }, + "raw_prompt_template": { + "anyOf": [ + { + "$ref": "#/components/schemas/PromptTemplateBase" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "prompt_spec" + ], + "title": "PromptInfoResponse", + "type": "object" + }, + "PromptLiteLLMParams": { + "additionalProperties": true, + "properties": { + "api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Api Base" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Api Key" + }, + "dotprompt_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Dotprompt Content" + }, + "ignore_prompt_manager_model": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "title": "Ignore Prompt Manager Model" + }, + "ignore_prompt_manager_optional_params": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "title": "Ignore Prompt Manager Optional Params" + }, + "prompt_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Prompt Id" + }, + "prompt_integration": { + "title": "Prompt Integration", + "type": "string" + }, + "provider_specific_query_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Provider Specific Query Params" + } + }, + "required": [ + "prompt_integration" + ], + "title": "PromptLiteLLMParams", + "type": "object" + }, + "PromptSpec": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "environment": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "development", + "title": "Environment" + }, + "litellm_params": { + "$ref": "#/components/schemas/PromptLiteLLMParams" + }, + "prompt_id": { + "title": "Prompt Id", + "type": "string" + }, + "prompt_info": { + "$ref": "#/components/schemas/PromptInfo" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Version" + } + }, + "required": [ + "prompt_id", + "litellm_params", + "prompt_info" + ], + "title": "PromptSpec", + "type": "object" + }, + "PromptTemplateBase": { + "properties": { + "content": { + "title": "Content", + "type": "string" + }, + "litellm_prompt_id": { + "title": "Litellm Prompt Id", + "type": "string" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + } + }, + "required": [ + "litellm_prompt_id", + "content" + ], + "title": "PromptTemplateBase", + "type": "object" + }, + "TestPromptRequest": { + "properties": { + "conversation_history": { + "anyOf": [ + { + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Conversation History" + }, + "dotprompt_content": { + "title": "Dotprompt Content", + "type": "string" + }, + "prompt_variables": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Prompt Variables" + } + }, + "required": [ + "dotprompt_content" + ], + "title": "TestPromptRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/prompts": { + "post": { + "description": "Create a new prompt\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/prompts\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt_id\": \"my_prompt\",\n \"litellm_params\": {\n \"prompt_id\": \"json_prompt\",\n \"prompt_integration\": \"dotprompt\",\n ### EITHER prompt_directory OR prompt_data MUST BE PROVIDED\n \"prompt_directory\": \"/path/to/dotprompt/folder\",\n \"prompt_data\": {\"json_prompt\": {\"content\": \"This is a prompt\", \"metadata\": {\"model\": \"gpt-4\"}}}\n },\n \"prompt_info\": {\n \"prompt_type\": \"config\"\n }\n }'\n```", + "operationId": "create_prompt_prompts_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Prompt", + "tags": [ + "prompts" + ] + } + }, + "/prompts/list": { + "get": { + "description": "List the prompts that are available on the proxy server\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/prompts/list\" -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"prompts\": [\n {\n \"prompt_id\": \"my_prompt_id\",\n \"litellm_params\": {\n \"prompt_id\": \"my_prompt_id\",\n \"prompt_integration\": \"dotprompt\",\n \"prompt_directory\": \"/path/to/prompts\"\n },\n \"prompt_info\": {\n \"prompt_type\": \"config\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n }\n ]\n}\n```", + "operationId": "list_prompts_prompts_list_get", + "parameters": [ + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Prompts", + "tags": [ + "prompts" + ] + } + }, + "/prompts/test": { + "post": { + "description": "Test a prompt by rendering it with variables and executing an LLM call.\n\nThis endpoint allows testing prompts before saving them to the database.\nThe response is always streamed.\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/prompts/test\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"dotprompt_content\": \"---\\nmodel: gpt-4o\\ntemperature: 0.7\\n---\\n\\nUser: Hello {{name}}\",\n \"prompt_variables\": {\n \"name\": \"World\"\n }\n }'\n```", + "operationId": "test_prompt_prompts_test_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestPromptRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Prompt", + "tags": [ + "prompts" + ] + } + }, + "/prompts/{prompt_id}": { + "delete": { + "description": "Delete a prompt\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/prompts/my_prompt_id\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Prompt my_prompt_id deleted successfully\"\n}\n```", + "operationId": "delete_prompt_prompts__prompt_id__delete", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + }, + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Prompt", + "tags": [ + "prompts" + ] + }, + "get": { + "description": "Get detailed information about a specific prompt by ID, including prompt content\n\n \ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\n Example Request:\n ```bash\n curl -X GET \"http://localhost:4000/prompts/my_prompt_id/info\" \\\n -H \"Authorization: Bearer \"\n ```\n\n Example Response:\n ```json\n {\n \"prompt_id\": \"my_prompt_id\",\n \"litellm_params\": {\n \"prompt_id\": \"my_prompt_id\",\n \"prompt_integration\": \"dotprompt\",\n \"prompt_directory\": \"/path/to/prompts\"\n },\n \"prompt_info\": {\n \"prompt_type\": \"config\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\",\n \"content\": \"System: You are a helpful assistant.\n\nUser: {{user_message}}\"\n }\n ```", + "operationId": "get_prompt_info_prompts__prompt_id__get", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + }, + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PromptInfoResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Prompt Info", + "tags": [ + "prompts" + ] + }, + "patch": { + "description": "Partially update an existing prompt\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nThis endpoint allows updating specific fields of a prompt without sending the entire object.\nOnly the following fields can be updated:\n- litellm_params: LiteLLM parameters for the prompt\n- prompt_info: Additional information about the prompt\n\nExample Request:\n```bash\ncurl -X PATCH \"http://localhost:4000/prompts/my_prompt_id\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt_info\": {\n \"prompt_type\": \"db\"\n }\n }'\n```", + "operationId": "patch_prompt_prompts__prompt_id__patch", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + }, + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatchPromptRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Patch Prompt", + "tags": [ + "prompts" + ] + }, + "put": { + "description": "Update an existing prompt\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/prompts/my_prompt_id\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"prompt_id\": \"my_prompt\",\n \"litellm_params\": {\n \"prompt_id\": \"my_prompt\",\n \"prompt_integration\": \"dotprompt\",\n \"prompt_directory\": \"/path/to/prompts\"\n },\n \"prompt_info\": {\n \"prompt_type\": \"config\"\n }\n }\n }'\n```", + "operationId": "update_prompt_prompts__prompt_id__put", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Prompt" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Prompt", + "tags": [ + "prompts" + ] + } + }, + "/prompts/{prompt_id}/info": { + "get": { + "description": "Get detailed information about a specific prompt by ID, including prompt content\n\n \ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\n Example Request:\n ```bash\n curl -X GET \"http://localhost:4000/prompts/my_prompt_id/info\" \\\n -H \"Authorization: Bearer \"\n ```\n\n Example Response:\n ```json\n {\n \"prompt_id\": \"my_prompt_id\",\n \"litellm_params\": {\n \"prompt_id\": \"my_prompt_id\",\n \"prompt_integration\": \"dotprompt\",\n \"prompt_directory\": \"/path/to/prompts\"\n },\n \"prompt_info\": {\n \"prompt_type\": \"config\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\",\n \"content\": \"System: You are a helpful assistant.\n\nUser: {{user_message}}\"\n }\n ```", + "operationId": "get_prompt_info_prompts__prompt_id__info_get", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + }, + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PromptInfoResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Prompt Info", + "tags": [ + "prompts" + ] + } + }, + "/prompts/{prompt_id}/versions": { + "get": { + "description": "Get all versions of a specific prompt by base prompt ID\n\n\ud83d\udc49 [Prompt docs](https://docs.litellm.ai/docs/proxy/prompt_management)\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/prompts/jack_success/versions\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"prompts\": [\n {\n \"prompt_id\": \"jack_success.v1\",\n \"litellm_params\": {...},\n \"prompt_info\": {\"prompt_type\": \"db\"},\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n },\n {\n \"prompt_id\": \"jack_success.v2\",\n \"litellm_params\": {...},\n \"prompt_info\": {\"prompt_type\": \"db\"},\n \"created_at\": \"2023-11-09T13:45:12.345Z\",\n \"updated_at\": \"2023-11-09T13:45:12.345Z\"\n }\n ]\n}\n```", + "operationId": "get_prompt_versions_prompts__prompt_id__versions_get", + "parameters": [ + { + "in": "path", + "name": "prompt_id", + "required": true, + "schema": { + "title": "Prompt Id", + "type": "string" + } + }, + { + "in": "query", + "name": "environment", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Environment" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPromptsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Prompt Versions", + "tags": [ + "prompts" + ] + } + }, + "/utils/dotprompt_json_converter": { + "post": { + "description": "Convert a .prompt file to JSON format.\n\nThis endpoint accepts a .prompt file upload and returns the equivalent JSON representation\nthat can be stored in a database or used programmatically.\n\nReturns the JSON structure with 'content' and 'metadata' fields.", + "operationId": "convert_prompt_file_to_json_utils_dotprompt_json_converter_post", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/Body_convert_prompt_file_to_json_utils_dotprompt_json_converter_post" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": true, + "title": "Response Convert Prompt File To Json Utils Dotprompt Json Converter Post", + "type": "object" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Convert Prompt File To Json", + "tags": [ + "prompts" + ] + } + } + } + }, + "realtime": { + "components": { + "schemas": { + "RealtimeClientSecretResponse": { + "description": "Response from POST /v1/realtime/client_secrets.\n\nBoth the top-level `value` and `session.client_secret.value`\nwill contain the encrypted token instead of the raw ephemeral key.\nThe `session` field is kept as a raw dict so unknown fields pass through.", + "properties": { + "expires_at": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "session": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Session" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "value" + ], + "title": "RealtimeClientSecretResponse", + "type": "object" + } + } + }, + "paths": { + "/openai/v1/realtime/calls": { + "post": { + "operationId": "proxy_realtime_calls_openai_v1_realtime_calls_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Proxy Realtime Calls", + "tags": [ + "realtime" + ] + } + }, + "/openai/v1/realtime/client_secrets": { + "post": { + "operationId": "create_realtime_client_secret_openai_v1_realtime_client_secrets_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RealtimeClientSecretResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Realtime Client Secret", + "tags": [ + "realtime" + ] + } + }, + "/realtime/calls": { + "post": { + "operationId": "proxy_realtime_calls_realtime_calls_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Proxy Realtime Calls", + "tags": [ + "realtime" + ] + } + }, + "/realtime/client_secrets": { + "post": { + "operationId": "create_realtime_client_secret_realtime_client_secrets_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RealtimeClientSecretResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Realtime Client Secret", + "tags": [ + "realtime" + ] + } + }, + "/v1/realtime/calls": { + "post": { + "operationId": "proxy_realtime_calls_v1_realtime_calls_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "summary": "Proxy Realtime Calls", + "tags": [ + "realtime" + ] + } + }, + "/v1/realtime/client_secrets": { + "post": { + "operationId": "create_realtime_client_secret_v1_realtime_client_secrets_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RealtimeClientSecretResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Realtime Client Secret", + "tags": [ + "realtime" + ] + } + } + } + }, + "scim": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "SCIMFeature": { + "properties": { + "maxOperations": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Maxoperations" + }, + "maxPayloadSize": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Maxpayloadsize" + }, + "maxResults": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Maxresults" + }, + "supported": { + "title": "Supported", + "type": "boolean" + } + }, + "required": [ + "supported" + ], + "title": "SCIMFeature", + "type": "object" + }, + "SCIMGroup": { + "properties": { + "displayName": { + "title": "Displayname", + "type": "string" + }, + "externalId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Externalid" + }, + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "members": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/SCIMMember" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Members" + }, + "meta": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Meta" + }, + "schemas": { + "items": { + "type": "string" + }, + "title": "Schemas", + "type": "array" + } + }, + "required": [ + "schemas", + "displayName" + ], + "title": "SCIMGroup", + "type": "object" + }, + "SCIMListResponse": { + "properties": { + "Resources": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/SCIMUser" + }, + "type": "array" + }, + { + "items": { + "$ref": "#/components/schemas/SCIMGroup" + }, + "type": "array" + } + ], + "title": "Resources" + }, + "itemsPerPage": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 10, + "title": "Itemsperpage" + }, + "schemas": { + "default": [ + "urn:ietf:params:scim:api:messages:2.0:ListResponse" + ], + "items": { + "type": "string" + }, + "title": "Schemas", + "type": "array" + }, + "startIndex": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 1, + "title": "Startindex" + }, + "totalResults": { + "title": "Totalresults", + "type": "integer" + } + }, + "required": [ + "totalResults", + "Resources" + ], + "title": "SCIMListResponse", + "type": "object" + }, + "SCIMMember": { + "properties": { + "display": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Display" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "value" + ], + "title": "SCIMMember", + "type": "object" + }, + "SCIMPatchOp": { + "properties": { + "Operations": { + "items": { + "$ref": "#/components/schemas/SCIMPatchOperation" + }, + "title": "Operations", + "type": "array" + }, + "schemas": { + "default": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "items": { + "type": "string" + }, + "title": "Schemas", + "type": "array" + } + }, + "required": [ + "Operations" + ], + "title": "SCIMPatchOp", + "type": "object" + }, + "SCIMPatchOperation": { + "properties": { + "op": { + "title": "Op", + "type": "string" + }, + "path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Path" + }, + "value": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "title": "Value" + } + }, + "required": [ + "op" + ], + "title": "SCIMPatchOperation", + "type": "object" + }, + "SCIMServiceProviderConfig": { + "properties": { + "authenticationSchemes": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Authenticationschemes" + }, + "bulk": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": false + } + }, + "changePassword": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": false + } + }, + "etag": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": false + } + }, + "filter": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": false + } + }, + "meta": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Meta" + }, + "patch": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": true + } + }, + "schemas": { + "default": [ + "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig" + ], + "items": { + "type": "string" + }, + "title": "Schemas", + "type": "array" + }, + "sort": { + "$ref": "#/components/schemas/SCIMFeature", + "default": { + "supported": false + } + } + }, + "title": "SCIMServiceProviderConfig", + "type": "object" + }, + "SCIMUser": { + "properties": { + "active": { + "default": true, + "title": "Active", + "type": "boolean" + }, + "displayName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Displayname" + }, + "emails": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/SCIMUserEmail" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Emails" + }, + "externalId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Externalid" + }, + "groups": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/SCIMUserGroup" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Groups" + }, + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id" + }, + "meta": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Meta" + }, + "name": { + "anyOf": [ + { + "$ref": "#/components/schemas/SCIMUserName" + }, + { + "type": "null" + } + ] + }, + "schemas": { + "items": { + "type": "string" + }, + "title": "Schemas", + "type": "array" + }, + "userName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Username" + } + }, + "required": [ + "schemas" + ], + "title": "SCIMUser", + "type": "object" + }, + "SCIMUserEmail": { + "properties": { + "primary": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Primary" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Type" + }, + "value": { + "format": "email", + "title": "Value", + "type": "string" + } + }, + "required": [ + "value" + ], + "title": "SCIMUserEmail", + "type": "object" + }, + "SCIMUserGroup": { + "properties": { + "display": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Display" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "direct", + "title": "Type" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "value" + ], + "title": "SCIMUserGroup", + "type": "object" + }, + "SCIMUserName": { + "properties": { + "familyName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Familyname" + }, + "formatted": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Formatted" + }, + "givenName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Givenname" + }, + "honorificPrefix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Honorificprefix" + }, + "honorificSuffix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Honorificsuffix" + }, + "middleName": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Middlename" + } + }, + "title": "SCIMUserName", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/scim/v2": { + "get": { + "description": "Base SCIM v2 endpoint for resource discovery per RFC 7644 Section 4.\n\nReturns a ListResponse of ResourceTypes supported by this SCIM service provider.\nIdentity providers (Okta, Azure AD, etc.) use this endpoint for resource discovery.", + "operationId": "get_scim_base_scim_v2_get", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Scim Base", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Groups": { + "get": { + "description": "Get a list of groups according to SCIM v2 protocol", + "operationId": "get_groups_scim_v2_Groups_get", + "parameters": [ + { + "in": "query", + "name": "startIndex", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "title": "Startindex", + "type": "integer" + } + }, + { + "in": "query", + "name": "count", + "required": false, + "schema": { + "default": 10, + "maximum": 100, + "minimum": 1, + "title": "Count", + "type": "integer" + } + }, + { + "in": "query", + "name": "filter", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Filter" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Groups", + "tags": [ + "scim" + ] + }, + "post": { + "description": "Create a group according to SCIM v2 protocol", + "operationId": "create_group_scim_v2_Groups_post", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Group", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Groups/{group_id}": { + "delete": { + "description": "Delete a group according to SCIM v2 protocol", + "operationId": "delete_group_scim_v2_Groups__group_id__delete", + "parameters": [ + { + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "title": "Group ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Group", + "tags": [ + "scim" + ] + }, + "get": { + "description": "Get a single group by ID according to SCIM v2 protocol", + "operationId": "get_group_scim_v2_Groups__group_id__get", + "parameters": [ + { + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "title": "Group ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Group", + "tags": [ + "scim" + ] + }, + "patch": { + "description": "Patch a group according to SCIM v2 protocol", + "operationId": "patch_group_scim_v2_Groups__group_id__patch", + "parameters": [ + { + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "title": "Group ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMPatchOp" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Patch Group", + "tags": [ + "scim" + ] + }, + "put": { + "description": "Update a group according to SCIM v2 protocol", + "operationId": "update_group_scim_v2_Groups__group_id__put", + "parameters": [ + { + "in": "path", + "name": "group_id", + "required": true, + "schema": { + "title": "Group ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMGroup" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Group", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/ResourceTypes": { + "get": { + "description": "SCIM ResourceTypes endpoint per RFC 7644 Section 4.\n\nReturns a ListResponse of all resource types supported by this service provider.", + "operationId": "get_resource_types_scim_v2_ResourceTypes_get", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Resource Types", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/ResourceTypes/{resource_type_id}": { + "get": { + "description": "Get a single ResourceType by ID per RFC 7644.", + "operationId": "get_resource_type_scim_v2_ResourceTypes__resource_type_id__get", + "parameters": [ + { + "in": "path", + "name": "resource_type_id", + "required": true, + "schema": { + "title": "ResourceType ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Resource Type", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Schemas": { + "get": { + "description": "SCIM Schemas endpoint per RFC 7643 Section 7.\n\nReturns a ListResponse of all schemas supported by this service provider.", + "operationId": "get_schemas_scim_v2_Schemas_get", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Schemas", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Schemas/{schema_id}": { + "get": { + "description": "Get a single Schema by its URI per RFC 7643 Section 7.", + "operationId": "get_schema_scim_v2_Schemas__schema_id__get", + "parameters": [ + { + "in": "path", + "name": "schema_id", + "required": true, + "schema": { + "title": "Schema URI", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Schema", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/ServiceProviderConfig": { + "get": { + "description": "Return SCIM Service Provider Configuration.", + "operationId": "get_service_provider_config_scim_v2_ServiceProviderConfig_get", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMServiceProviderConfig" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Service Provider Config", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Users": { + "get": { + "description": "Get a list of users according to SCIM v2 protocol", + "operationId": "get_users_scim_v2_Users_get", + "parameters": [ + { + "in": "query", + "name": "startIndex", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "title": "Startindex", + "type": "integer" + } + }, + { + "in": "query", + "name": "count", + "required": false, + "schema": { + "default": 10, + "maximum": 100, + "minimum": 1, + "title": "Count", + "type": "integer" + } + }, + { + "in": "query", + "name": "filter", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Filter" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Users", + "tags": [ + "scim" + ] + }, + "post": { + "description": "Create a user according to SCIM v2 protocol", + "operationId": "create_user_scim_v2_Users_post", + "parameters": [ + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create User", + "tags": [ + "scim" + ] + } + }, + "/scim/v2/Users/{user_id}": { + "delete": { + "description": "Delete a user according to SCIM v2 protocol", + "operationId": "delete_user_scim_v2_Users__user_id__delete", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "title": "User ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "204": { + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete User", + "tags": [ + "scim" + ] + }, + "get": { + "description": "Get a single user by ID according to SCIM v2 protocol", + "operationId": "get_user_scim_v2_Users__user_id__get", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "title": "User ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get User", + "tags": [ + "scim" + ] + }, + "patch": { + "description": "Patch a user according to SCIM v2 protocol", + "operationId": "patch_user_scim_v2_Users__user_id__patch", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "title": "User ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMPatchOp" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Patch User", + "tags": [ + "scim" + ] + }, + "put": { + "description": "Update a user according to SCIM v2 protocol (full replacement)", + "operationId": "update_user_scim_v2_Users__user_id__put", + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "schema": { + "title": "User ID", + "type": "string" + } + }, + { + "in": "query", + "name": "feature", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Feature" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SCIMUser" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update User", + "tags": [ + "scim" + ] + } + } + } + }, + "search_tools": { + "components": { + "schemas": { + "CreateSearchToolRequest": { + "properties": { + "search_tool": { + "$ref": "#/components/schemas/SearchTool" + } + }, + "required": [ + "search_tool" + ], + "title": "CreateSearchToolRequest", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ListSearchToolsResponse": { + "description": "Response model for listing search tools.", + "properties": { + "search_tools": { + "items": { + "$ref": "#/components/schemas/SearchToolInfoResponse" + }, + "title": "Search Tools", + "type": "array" + } + }, + "required": [ + "search_tools" + ], + "title": "ListSearchToolsResponse", + "type": "object" + }, + "SearchTool": { + "description": "Search tool configuration.\n\nExample:\n {\n \"search_tool_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"search_tool_name\": \"litellm-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-...\"\n },\n \"search_tool_info\": {\n \"description\": \"Perplexity search tool\"\n }\n }", + "properties": { + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "litellm_params": { + "$ref": "#/components/schemas/SearchToolLiteLLMParams" + }, + "search_tool_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Search Tool Id" + }, + "search_tool_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Search Tool Info" + }, + "search_tool_name": { + "title": "Search Tool Name", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "search_tool_name", + "litellm_params" + ], + "title": "SearchTool", + "type": "object" + }, + "SearchToolInfoResponse": { + "description": "Response model for search tool information.", + "properties": { + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "is_from_config": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Is From Config" + }, + "litellm_params": { + "additionalProperties": true, + "title": "Litellm Params", + "type": "object" + }, + "search_tool_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Search Tool Id" + }, + "search_tool_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Search Tool Info" + }, + "search_tool_name": { + "title": "Search Tool Name", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "title": "SearchToolInfoResponse", + "type": "object" + }, + "SearchToolLiteLLMParams": { + "description": "LiteLLM params for search tools configuration.", + "properties": { + "api_base": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Api Base" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Api Key" + }, + "max_retries": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Max Retries" + }, + "search_provider": { + "title": "Search Provider", + "type": "string" + }, + "timeout": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Timeout" + } + }, + "required": [ + "search_provider" + ], + "title": "SearchToolLiteLLMParams", + "type": "object" + }, + "TestSearchToolConnectionRequest": { + "properties": { + "litellm_params": { + "additionalProperties": true, + "title": "Litellm Params", + "type": "object" + } + }, + "required": [ + "litellm_params" + ], + "title": "TestSearchToolConnectionRequest", + "type": "object" + }, + "UpdateSearchToolRequest": { + "properties": { + "search_tool": { + "$ref": "#/components/schemas/SearchTool" + } + }, + "required": [ + "search_tool" + ], + "title": "UpdateSearchToolRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/search_tools": { + "post": { + "description": "Create a new search tool.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/search_tools\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"search_tool\": {\n \"search_tool_name\": \"litellm-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-...\"\n },\n \"search_tool_info\": {\n \"description\": \"Perplexity search tool\"\n }\n }\n }'\n```\n\nExample Response:\n```json\n{\n \"search_tool_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"search_tool_name\": \"litellm-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-...\"\n },\n \"search_tool_info\": {\n \"description\": \"Perplexity search tool\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n}\n```", + "operationId": "create_search_tool_search_tools_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSearchToolRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Create Search Tool", + "tags": [ + "search_tools" + ] + } + }, + "/search_tools/list": { + "get": { + "description": "List all search tools that are available in the database and config file.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/search_tools/list\" -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"search_tools\": [\n {\n \"search_tool_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"search_tool_name\": \"litellm-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-***\",\n \"api_base\": \"https://api.perplexity.ai\"\n },\n \"search_tool_info\": {\n \"description\": \"Perplexity search tool\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\",\n \"is_from_config\": false\n },\n {\n \"search_tool_name\": \"config-search-tool\",\n \"litellm_params\": {\n \"search_provider\": \"tavily\",\n \"api_key\": \"tvly-***\"\n },\n \"is_from_config\": true\n }\n ]\n}\n```", + "operationId": "list_search_tools_search_tools_list_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSearchToolsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Search Tools", + "tags": [ + "search_tools" + ] + } + }, + "/search_tools/test_connection": { + "post": { + "description": "Test connection to a search provider with the given configuration.\n\nMakes a simple test search query to verify the API key and configuration are valid.\n\nExample Request:\n```bash\ncurl -X POST \"http://localhost:4000/search_tools/test_connection\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-...\"\n }\n }'\n```\n\nExample Response (Success):\n```json\n{\n \"status\": \"success\",\n \"message\": \"Successfully connected to perplexity search provider\",\n \"test_query\": \"test\",\n \"results_count\": 5\n}\n```\n\nExample Response (Failure):\n```json\n{\n \"status\": \"error\",\n \"message\": \"Authentication failed: Invalid API key\",\n \"error_type\": \"AuthenticationError\"\n}\n```", + "operationId": "test_search_tool_connection_search_tools_test_connection_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestSearchToolConnectionRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Test Search Tool Connection", + "tags": [ + "search_tools" + ] + } + }, + "/search_tools/ui/available_providers": { + "get": { + "description": "Get the list of available search providers with their configuration fields.\n\nAuto-discovers search providers and their UI-friendly names from transformation configs.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/search_tools/ui/available_providers\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"providers\": [\n {\n \"provider_name\": \"perplexity\",\n \"ui_friendly_name\": \"Perplexity\"\n },\n {\n \"provider_name\": \"tavily\",\n \"ui_friendly_name\": \"Tavily\"\n }\n ]\n}\n```", + "operationId": "get_available_search_providers_search_tools_ui_available_providers_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Available Search Providers", + "tags": [ + "search_tools" + ] + } + }, + "/search_tools/{search_tool_id}": { + "delete": { + "description": "Delete a search tool.\n\nExample Request:\n```bash\ncurl -X DELETE \"http://localhost:4000/search_tools/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"message\": \"Search tool 123e4567-e89b-12d3-a456-426614174000 deleted successfully\",\n \"search_tool_name\": \"litellm-search\"\n}\n```", + "operationId": "delete_search_tool_search_tools__search_tool_id__delete", + "parameters": [ + { + "in": "path", + "name": "search_tool_id", + "required": true, + "schema": { + "title": "Search Tool Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Search Tool", + "tags": [ + "search_tools" + ] + }, + "get": { + "description": "Get detailed information about a specific search tool by ID.\n\nExample Request:\n```bash\ncurl -X GET \"http://localhost:4000/search_tools/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \"\n```\n\nExample Response:\n```json\n{\n \"search_tool_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"search_tool_name\": \"litellm-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-***\"\n },\n \"search_tool_info\": {\n \"description\": \"Perplexity search tool\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T12:34:56.789Z\"\n}\n```", + "operationId": "get_search_tool_info_search_tools__search_tool_id__get", + "parameters": [ + { + "in": "path", + "name": "search_tool_id", + "required": true, + "schema": { + "title": "Search Tool Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Search Tool Info", + "tags": [ + "search_tools" + ] + }, + "put": { + "description": "Update an existing search tool.\n\nExample Request:\n```bash\ncurl -X PUT \"http://localhost:4000/search_tools/123e4567-e89b-12d3-a456-426614174000\" \\\n -H \"Authorization: Bearer \" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"search_tool\": {\n \"search_tool_name\": \"updated-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-new-key\"\n },\n \"search_tool_info\": {\n \"description\": \"Updated search tool\"\n }\n }\n }'\n```\n\nExample Response:\n```json\n{\n \"search_tool_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"search_tool_name\": \"updated-search\",\n \"litellm_params\": {\n \"search_provider\": \"perplexity\",\n \"api_key\": \"sk-new-key\"\n },\n \"search_tool_info\": {\n \"description\": \"Updated search tool\"\n },\n \"created_at\": \"2023-11-09T12:34:56.789Z\",\n \"updated_at\": \"2023-11-09T13:45:12.345Z\"\n}\n```", + "operationId": "update_search_tool_search_tools__search_tool_id__put", + "parameters": [ + { + "in": "path", + "name": "search_tool_id", + "required": true, + "schema": { + "title": "Search Tool Id", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSearchToolRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Search Tool", + "tags": [ + "search_tools" + ] + } + } + } + }, + "tools": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "LiteLLM_ToolTableRow": { + "properties": { + "assignments": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Assignments" + }, + "call_count": { + "default": 0, + "title": "Call Count", + "type": "integer" + }, + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" + }, + "input_policy": { + "default": "untrusted", + "enum": [ + "trusted", + "untrusted", + "blocked" + ], + "title": "Input Policy", + "type": "string" + }, + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Alias" + }, + "key_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Hash" + }, + "last_used_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Used At" + }, + "origin": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Origin" + }, + "output_policy": { + "default": "untrusted", + "enum": [ + "trusted", + "untrusted" + ], + "title": "Output Policy", + "type": "string" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "tool_id": { + "title": "Tool Id", + "type": "string" + }, + "tool_name": { + "title": "Tool Name", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + }, + "user_agent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Agent" + } + }, + "required": [ + "tool_id", + "tool_name" + ], + "title": "LiteLLM_ToolTableRow", + "type": "object" + }, + "ToolDetailResponse": { + "properties": { + "overrides": { + "items": { + "$ref": "#/components/schemas/ToolPolicyOverrideRow" + }, + "title": "Overrides", + "type": "array" + }, + "tool": { + "$ref": "#/components/schemas/LiteLLM_ToolTableRow" + } + }, + "required": [ + "tool" + ], + "title": "ToolDetailResponse", + "type": "object" + }, + "ToolListResponse": { + "properties": { + "tools": { + "items": { + "$ref": "#/components/schemas/LiteLLM_ToolTableRow" + }, + "title": "Tools", + "type": "array" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "tools", + "total" + ], + "title": "ToolListResponse", + "type": "object" + }, + "ToolPolicyOption": { + "properties": { + "description": { + "title": "Description", + "type": "string" + }, + "label": { + "title": "Label", + "type": "string" + }, + "value": { + "title": "Value", + "type": "string" + } + }, + "required": [ + "value", + "label", + "description" + ], + "title": "ToolPolicyOption", + "type": "object" + }, + "ToolPolicyOptionsResponse": { + "properties": { + "input_policies": { + "items": { + "$ref": "#/components/schemas/ToolPolicyOption" + }, + "title": "Input Policies", + "type": "array" + }, + "output_policies": { + "items": { + "$ref": "#/components/schemas/ToolPolicyOption" + }, + "title": "Output Policies", + "type": "array" + } + }, + "required": [ + "input_policies", + "output_policies" + ], + "title": "ToolPolicyOptionsResponse", + "type": "object" + }, + "ToolPolicyOverrideRow": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "input_policy": { + "default": "blocked", + "enum": [ + "trusted", + "untrusted", + "blocked" + ], + "title": "Input Policy", + "type": "string" + }, + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Alias" + }, + "key_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Hash" + }, + "override_id": { + "title": "Override Id", + "type": "string" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "tool_name": { + "title": "Tool Name", + "type": "string" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + } + }, + "required": [ + "override_id", + "tool_name" + ], + "title": "ToolPolicyOverrideRow", + "type": "object" + }, + "ToolPolicyUpdateRequest": { + "properties": { + "input_policy": { + "anyOf": [ + { + "enum": [ + "trusted", + "untrusted", + "blocked" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Input Policy" + }, + "key_alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Alias" + }, + "key_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Hash" + }, + "output_policy": { + "anyOf": [ + { + "enum": [ + "trusted", + "untrusted" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Output Policy" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "tool_name": { + "title": "Tool Name", + "type": "string" + } + }, + "required": [ + "tool_name" + ], + "title": "ToolPolicyUpdateRequest", + "type": "object" + }, + "ToolPolicyUpdateResponse": { + "properties": { + "input_policy": { + "anyOf": [ + { + "enum": [ + "trusted", + "untrusted", + "blocked" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Input Policy" + }, + "key_hash": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key Hash" + }, + "output_policy": { + "anyOf": [ + { + "enum": [ + "trusted", + "untrusted" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Output Policy" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "tool_name": { + "title": "Tool Name", + "type": "string" + }, + "updated": { + "title": "Updated", + "type": "boolean" + } + }, + "required": [ + "tool_name", + "updated" + ], + "title": "ToolPolicyUpdateResponse", + "type": "object" + }, + "ToolUsageLogEntry": { + "description": "One spend log row for a tool call (for UI \"recent logs\" table).", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "input_snippet": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Input Snippet" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "spend": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Spend" + }, + "timestamp": { + "title": "Timestamp", + "type": "string" + }, + "total_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Total Tokens" + } + }, + "required": [ + "id", + "timestamp" + ], + "title": "ToolUsageLogEntry", + "type": "object" + }, + "ToolUsageLogsResponse": { + "properties": { + "logs": { + "items": { + "$ref": "#/components/schemas/ToolUsageLogEntry" + }, + "title": "Logs", + "type": "array" + }, + "page": { + "title": "Page", + "type": "integer" + }, + "page_size": { + "title": "Page Size", + "type": "integer" + }, + "total": { + "title": "Total", + "type": "integer" + } + }, + "required": [ + "logs", + "total", + "page", + "page_size" + ], + "title": "ToolUsageLogsResponse", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/toolset/{toolset_name}/mcp": { + "delete": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "get": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "head": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "options": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "patch": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "post": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + }, + "put": { + "description": "Namespace a toolset as its own MCP endpoint.\n\nConnecting to /toolset//mcp exposes exactly the tools defined in\nthe toolset. Access is enforced: non-admin API keys must have the toolset\nlisted in their object_permission.mcp_toolsets grant list, or the request\nwill be rejected with a 403.", + "operationId": "toolset_mcp_route_toolset__toolset_name__mcp_put", + "parameters": [ + { + "in": "path", + "name": "toolset_name", + "required": true, + "schema": { + "title": "Toolset Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "summary": "Toolset Mcp Route", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/list": { + "get": { + "description": "List all auto-discovered tools and their policies.\n\nParameters:\n- input_policy: Optional filter \u2014 one of \"trusted\", \"untrusted\", \"blocked\"", + "operationId": "list_tools_v1_tool_list_get", + "parameters": [ + { + "in": "query", + "name": "input_policy", + "required": false, + "schema": { + "anyOf": [ + { + "enum": [ + "trusted", + "untrusted", + "blocked" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Input Policy" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Tools", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/policy": { + "post": { + "description": "Set the input_policy and/or output_policy for a tool (global), or block for a specific team/key (override).\n\nParameters:\n- tool_name: str - The tool to update\n- input_policy: optional - \"trusted\" | \"untrusted\" | \"blocked\"\n- output_policy: optional - \"trusted\" | \"untrusted\"\n- team_id: optional - if set, create/update override for this team only\n- key_hash: optional - if set, create/update override for this key only", + "operationId": "update_tool_policy_v1_tool_policy_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolPolicyUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolPolicyUpdateResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Tool Policy", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/policy/options": { + "get": { + "description": "Return the available input and output policy options with descriptions.\nStatic data \u2014 no DB call.", + "operationId": "get_tool_policy_options_v1_tool_policy_options_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolPolicyOptionsResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Tool Policy Options", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/{tool_name}": { + "get": { + "description": "Get details for a single tool.", + "operationId": "get_tool_v1_tool__tool_name__get", + "parameters": [ + { + "in": "path", + "name": "tool_name", + "required": true, + "schema": { + "title": "Tool Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_ToolTableRow" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Tool", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/{tool_name}/detail": { + "get": { + "description": "Get a single tool with its policy overrides (for UI detail view).", + "operationId": "get_tool_detail_v1_tool__tool_name__detail_get", + "parameters": [ + { + "in": "path", + "name": "tool_name", + "required": true, + "schema": { + "title": "Tool Name", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolDetailResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Tool Detail", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/{tool_name}/logs": { + "get": { + "description": "Return paginated spend logs for requests that used this tool (from SpendLogToolIndex).", + "operationId": "get_tool_usage_logs_v1_tool__tool_name__logs_get", + "parameters": [ + { + "in": "path", + "name": "tool_name", + "required": true, + "schema": { + "title": "Tool Name", + "type": "string" + } + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 100, + "minimum": 1, + "title": "Page Size", + "type": "integer" + } + }, + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "Start Date" + } + }, + { + "description": "YYYY-MM-DD", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "YYYY-MM-DD", + "title": "End Date" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ToolUsageLogsResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Tool Usage Logs", + "tags": [ + "tools" + ] + } + }, + "/v1/tool/{tool_name}/overrides": { + "delete": { + "description": "Remove a policy override for a tool. Specify the override by team_id or key_hash\n(exactly one required).", + "operationId": "delete_tool_policy_override_v1_tool__tool_name__overrides_delete", + "parameters": [ + { + "in": "path", + "name": "tool_name", + "required": true, + "schema": { + "title": "Tool Name", + "type": "string" + } + }, + { + "description": "Team ID of the override to remove", + "in": "query", + "name": "team_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Team ID of the override to remove", + "title": "Team Id" + } + }, + { + "description": "Key hash of the override to remove", + "in": "query", + "name": "key_hash", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Key hash of the override to remove", + "title": "Key Hash" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Tool Policy Override", + "tags": [ + "tools" + ] + } + } + } + }, + "usage_ai": { + "components": { + "schemas": { + "ChatMessage": { + "properties": { + "content": { + "title": "Content", + "type": "string" + }, + "role": { + "enum": [ + "user", + "assistant" + ], + "title": "Role", + "type": "string" + } + }, + "required": [ + "role", + "content" + ], + "title": "ChatMessage", + "type": "object" + }, + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "UsageAIChatRequest": { + "properties": { + "messages": { + "description": "Chat messages (user/assistant history)", + "items": { + "$ref": "#/components/schemas/ChatMessage" + }, + "title": "Messages", + "type": "array" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model to use for AI chat", + "title": "Model" + } + }, + "required": [ + "messages" + ], + "title": "UsageAIChatRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/usage/ai/chat": { + "post": { + "description": "AI chat about usage data. Streams SSE events with the AI response.\nThe AI agent has access to tools that query aggregated daily activity data.", + "operationId": "usage_ai_chat_usage_ai_chat_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageAIChatRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Usage Ai Chat", + "tags": [ + "usage_ai" + ] + } + } + } + }, + "vantage": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + }, + "VantageDryRunRequest": { + "description": "Request model for Vantage dry-run operations (capped for preview)", + "properties": { + "limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 500, + "description": "Limit on number of records to preview (default: 500)", + "title": "Limit" + } + }, + "title": "VantageDryRunRequest", + "type": "object" + }, + "VantageExportRequest": { + "description": "Request model for Vantage export operations (actual export, no default limit)", + "properties": { + "end_time_utc": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "End time for data export in UTC", + "title": "End Time Utc" + }, + "limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Optional limit on number of records to export (default: no limit)", + "title": "Limit" + }, + "start_time_utc": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Start time for data export in UTC", + "title": "Start Time Utc" + } + }, + "title": "VantageExportRequest", + "type": "object" + }, + "VantageExportResponse": { + "description": "Response model for Vantage export operations", + "properties": { + "dry_run_data": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Dry run data including usage data and FOCUS transformed data", + "title": "Dry Run Data" + }, + "message": { + "title": "Message", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + }, + "summary": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "Summary statistics for dry run", + "title": "Summary" + } + }, + "required": [ + "message", + "status" + ], + "title": "VantageExportResponse", + "type": "object" + }, + "VantageInitRequest": { + "description": "Request model for initializing Vantage settings", + "properties": { + "api_key": { + "description": "Vantage API key for authentication", + "title": "Api Key", + "type": "string" + }, + "base_url": { + "default": "https://api.vantage.sh", + "description": "Vantage API base URL (default: https://api.vantage.sh)", + "title": "Base Url", + "type": "string" + }, + "integration_token": { + "description": "Vantage integration token for the cost-import endpoint", + "title": "Integration Token", + "type": "string" + } + }, + "required": [ + "api_key", + "integration_token" + ], + "title": "VantageInitRequest", + "type": "object" + }, + "VantageInitResponse": { + "description": "Response model for Vantage initialization", + "properties": { + "message": { + "title": "Message", + "type": "string" + }, + "status": { + "title": "Status", + "type": "string" + } + }, + "required": [ + "message", + "status" + ], + "title": "VantageInitResponse", + "type": "object" + }, + "VantageSettingsUpdate": { + "description": "Request model for updating Vantage settings", + "properties": { + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New Vantage API key for authentication", + "title": "Api Key" + }, + "base_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New Vantage API base URL", + "title": "Base Url" + }, + "integration_token": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "New Vantage integration token", + "title": "Integration Token" + } + }, + "title": "VantageSettingsUpdate", + "type": "object" + }, + "VantageSettingsView": { + "description": "Response model for viewing Vantage settings with masked API key", + "properties": { + "api_key_masked": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Masked API key showing only first 4 and last 4 characters", + "title": "Api Key Masked" + }, + "base_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Vantage API base URL", + "title": "Base Url" + }, + "integration_token_masked": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Masked integration token showing only first 4 and last 4 characters", + "title": "Integration Token Masked" + }, + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Configuration status", + "title": "Status" + } + }, + "title": "VantageSettingsView", + "type": "object" + } + } + }, + "paths": { + "/vantage/delete": { + "delete": { + "description": "Delete Vantage settings from the database.\n\nOnly admin users can delete Vantage settings.", + "operationId": "delete_vantage_settings_vantage_delete_delete", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageInitResponse" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Vantage Settings", + "tags": [ + "vantage" + ] + } + }, + "/vantage/dry-run": { + "post": { + "description": "Perform a dry run export using the Vantage logger.\n\nReturns the data that would be exported without actually sending it to Vantage.\n\nParameters:\n- limit: Limit on number of records to preview (default: 500)\n\nOnly admin users can perform Vantage exports.", + "operationId": "vantage_dry_run_export_vantage_dry_run_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageDryRunRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageExportResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vantage Dry Run Export", + "tags": [ + "vantage" + ] + } + }, + "/vantage/export": { + "post": { + "description": "Perform an actual export using the Vantage logger.\n\nExports usage data in FOCUS CSV format to the Vantage API.\n\nParameters:\n- limit: Optional limit on number of records to export\n- start_time_utc: Optional start time for data export\n- end_time_utc: Optional end time for data export\n\nOnly admin users can perform Vantage exports.", + "operationId": "vantage_export_vantage_export_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageExportRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageExportResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vantage Export", + "tags": [ + "vantage" + ] + } + }, + "/vantage/init": { + "post": { + "description": "Initialize Vantage settings and store in the database.\n\nParameters:\n- api_key: Vantage API key for authentication\n- integration_token: Vantage integration token for the cost-import endpoint\n- base_url: Vantage API base URL (default: https://api.vantage.sh)\n\nOnly admin users can configure Vantage settings.", + "operationId": "init_vantage_settings_vantage_init_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageInitRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageInitResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Init Vantage Settings", + "tags": [ + "vantage" + ] + } + }, + "/vantage/settings": { + "get": { + "description": "View current Vantage settings.\n\nReturns the current Vantage configuration with the API key masked for security.\nOnly admin users can view Vantage settings.", + "operationId": "get_vantage_settings_vantage_settings_get", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageSettingsView" + } + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Vantage Settings", + "tags": [ + "vantage" + ] + }, + "put": { + "description": "Update existing Vantage settings.\n\nAllows updating individual Vantage configuration fields without requiring all fields.\nOnly admin users can update Vantage settings.", + "operationId": "update_vantage_settings_vantage_settings_put", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageSettingsUpdate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VantageInitResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Vantage Settings", + "tags": [ + "vantage" + ] + } + } + } + }, + "vector_store_files": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/v1/vector_stores": { + "get": { + "description": "List vector stores.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/list", + "operationId": "vector_store_list_v1_vector_stores_get", + "parameters": [ + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store List", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "description": "Create a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/create\n\nSupports target_model_names parameter for creating vector stores across multiple models:\n```json\n{\n \"name\": \"my-vector-store\",\n \"target_model_names\": \"gpt-4,gemini-2.0\"\n}\n```", + "operationId": "vector_store_create_v1_vector_stores_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Create", + "tags": [ + "vector_store_files" + ] + } + }, + "/v1/vector_stores/{vector_store_id}": { + "delete": { + "description": "Delete a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/delete", + "operationId": "vector_store_delete_v1_vector_stores__vector_store_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Delete", + "tags": [ + "vector_store_files" + ] + }, + "get": { + "description": "Retrieve a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/retrieve", + "operationId": "vector_store_retrieve_v1_vector_stores__vector_store_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Retrieve", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "description": "Update a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/modify", + "operationId": "vector_store_update_v1_vector_stores__vector_store_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Update", + "tags": [ + "vector_store_files" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files": { + "get": { + "operationId": "vector_store_file_list_v1_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File List", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "operationId": "vector_store_file_create_v1_vector_stores__vector_store_id__files_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Create", + "tags": [ + "vector_store_files" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "operationId": "vector_store_file_delete_v1_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Delete", + "tags": [ + "vector_store_files" + ] + }, + "get": { + "operationId": "vector_store_file_retrieve_v1_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Retrieve", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "operationId": "vector_store_file_update_v1_vector_stores__vector_store_id__files__file_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Update", + "tags": [ + "vector_store_files" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "vector_store_file_content_v1_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Content", + "tags": [ + "vector_store_files" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/search": { + "post": { + "description": "Search a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/search", + "operationId": "vector_store_search_v1_vector_stores__vector_store_id__search_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Search", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores": { + "get": { + "description": "List vector stores.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/list", + "operationId": "vector_store_list_vector_stores_get", + "parameters": [ + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store List", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "description": "Create a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/create\n\nSupports target_model_names parameter for creating vector stores across multiple models:\n```json\n{\n \"name\": \"my-vector-store\",\n \"target_model_names\": \"gpt-4,gemini-2.0\"\n}\n```", + "operationId": "vector_store_create_vector_stores_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Create", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores/{vector_store_id}": { + "delete": { + "description": "Delete a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/delete", + "operationId": "vector_store_delete_vector_stores__vector_store_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Delete", + "tags": [ + "vector_store_files" + ] + }, + "get": { + "description": "Retrieve a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/retrieve", + "operationId": "vector_store_retrieve_vector_stores__vector_store_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Retrieve", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "description": "Update a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/modify", + "operationId": "vector_store_update_vector_stores__vector_store_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Update", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores/{vector_store_id}/files": { + "get": { + "operationId": "vector_store_file_list_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File List", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "operationId": "vector_store_file_create_vector_stores__vector_store_id__files_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Create", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "operationId": "vector_store_file_delete_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Delete", + "tags": [ + "vector_store_files" + ] + }, + "get": { + "operationId": "vector_store_file_retrieve_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Retrieve", + "tags": [ + "vector_store_files" + ] + }, + "post": { + "operationId": "vector_store_file_update_vector_stores__vector_store_id__files__file_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Update", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "vector_store_file_content_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Content", + "tags": [ + "vector_store_files" + ] + } + }, + "/vector_stores/{vector_store_id}/search": { + "post": { + "description": "Search a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/search", + "operationId": "vector_store_search_vector_stores__vector_store_id__search_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Search", + "tags": [ + "vector_store_files" + ] + } + } + } + }, + "vector_store_management": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "LiteLLM_ManagedVectorStore": { + "description": "LiteLLM managed vector store object - this is is the object stored in the database", + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "custom_llm_provider": { + "title": "Custom Llm Provider", + "type": "string" + }, + "litellm_credential_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Litellm Credential Name" + }, + "litellm_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Litellm Params" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "vector_store_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Description" + }, + "vector_store_id": { + "title": "Vector Store Id", + "type": "string" + }, + "vector_store_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Metadata" + }, + "vector_store_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Name" + } + }, + "title": "LiteLLM_ManagedVectorStore", + "type": "object" + }, + "LiteLLM_ManagedVectorStoreListResponse": { + "description": "Response format for listing vector stores", + "properties": { + "current_page": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Current Page" + }, + "data": { + "items": { + "$ref": "#/components/schemas/LiteLLM_ManagedVectorStore" + }, + "title": "Data", + "type": "array" + }, + "object": { + "const": "list", + "title": "Object", + "type": "string" + }, + "total_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Total Count" + }, + "total_pages": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Total Pages" + } + }, + "title": "LiteLLM_ManagedVectorStoreListResponse", + "type": "object" + }, + "LiteLLM_ManagedVectorStoresTable": { + "properties": { + "created_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" + }, + "custom_llm_provider": { + "title": "Custom Llm Provider", + "type": "string" + }, + "litellm_credential_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Litellm Credential Name" + }, + "litellm_params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Litellm Params" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Team Id" + }, + "updated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "user_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "User Id" + }, + "vector_store_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Description" + }, + "vector_store_id": { + "title": "Vector Store Id", + "type": "string" + }, + "vector_store_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Vector Store Metadata" + }, + "vector_store_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Name" + } + }, + "required": [ + "vector_store_id", + "custom_llm_provider", + "vector_store_name", + "vector_store_description", + "vector_store_metadata", + "created_at", + "updated_at", + "litellm_credential_name", + "litellm_params", + "team_id", + "user_id" + ], + "title": "LiteLLM_ManagedVectorStoresTable", + "type": "object" + }, + "ResponseLiteLLM_ManagedVectorStore": { + "properties": { + "vector_store": { + "$ref": "#/components/schemas/LiteLLM_ManagedVectorStoresTable" + } + }, + "title": "ResponseLiteLLM_ManagedVectorStore", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + }, + "VectorStoreDeleteRequest": { + "properties": { + "vector_store_id": { + "title": "Vector Store Id", + "type": "string" + } + }, + "required": [ + "vector_store_id" + ], + "title": "VectorStoreDeleteRequest", + "type": "object" + }, + "VectorStoreInfoRequest": { + "properties": { + "vector_store_id": { + "title": "Vector Store Id", + "type": "string" + } + }, + "required": [ + "vector_store_id" + ], + "title": "VectorStoreInfoRequest", + "type": "object" + }, + "VectorStoreUpdateRequest": { + "properties": { + "custom_llm_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Custom Llm Provider" + }, + "vector_store_description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Description" + }, + "vector_store_id": { + "title": "Vector Store Id", + "type": "string" + }, + "vector_store_metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Vector Store Metadata" + }, + "vector_store_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Vector Store Name" + } + }, + "required": [ + "vector_store_id" + ], + "title": "VectorStoreUpdateRequest", + "type": "object" + } + } + }, + "paths": { + "/v1/vector_store/list": { + "get": { + "description": "List all available vector stores with optional filtering and pagination.\nCombines both in-memory vector stores and those stored in the database.\nDatabase is the source of truth - deleted stores are removed from memory, updated stores sync to memory.\n\nParameters:\n- page: int - Page number for pagination (default: 1)\n- page_size: int - Number of items per page (default: 100)", + "operationId": "list_vector_stores_v1_vector_store_list_get", + "parameters": [ + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 100, + "title": "Page Size", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_ManagedVectorStoreListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Vector Stores", + "tags": [ + "vector_store_management" + ] + } + }, + "/vector_store/delete": { + "post": { + "description": "Delete a vector store from both database and in-memory registry.\n\nParameters:\n- vector_store_id: str - ID of the vector store to delete", + "operationId": "delete_vector_store_vector_store_delete_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreDeleteRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Delete Vector Store", + "tags": [ + "vector_store_management" + ] + } + }, + "/vector_store/info": { + "post": { + "description": "Return a single vector store's details", + "operationId": "get_vector_store_info_vector_store_info_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreInfoRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResponseLiteLLM_ManagedVectorStore" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Get Vector Store Info", + "tags": [ + "vector_store_management" + ] + } + }, + "/vector_store/list": { + "get": { + "description": "List all available vector stores with optional filtering and pagination.\nCombines both in-memory vector stores and those stored in the database.\nDatabase is the source of truth - deleted stores are removed from memory, updated stores sync to memory.\n\nParameters:\n- page: int - Page number for pagination (default: 1)\n- page_size: int - Number of items per page (default: 100)", + "operationId": "list_vector_stores_vector_store_list_get", + "parameters": [ + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "title": "Page", + "type": "integer" + } + }, + { + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 100, + "title": "Page Size", + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_ManagedVectorStoreListResponse" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "List Vector Stores", + "tags": [ + "vector_store_management" + ] + } + }, + "/vector_store/new": { + "post": { + "description": "Create a new vector store.\n\nParameters:\n- vector_store_id: str - Unique identifier for the vector store\n- custom_llm_provider: str - Provider of the vector store\n- vector_store_name: Optional[str] - Name of the vector store\n- vector_store_description: Optional[str] - Description of the vector store\n- vector_store_metadata: Optional[Dict] - Additional metadata for the vector store", + "operationId": "new_vector_store_vector_store_new_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LiteLLM_ManagedVectorStore" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "New Vector Store", + "tags": [ + "vector_store_management" + ] + } + }, + "/vector_store/update": { + "post": { + "description": "Update vector store details in both database and in-memory registry.\nThe updated data is immediately synchronized to the in-memory registry.", + "operationId": "update_vector_store_vector_store_update_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VectorStoreUpdateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Update Vector Store", + "tags": [ + "vector_store_management" + ] + } + } + } + }, + "vector_stores": { + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "title": "Detail", + "type": "array" + } + }, + "title": "HTTPValidationError", + "type": "object" + }, + "IndexCreateLiteLLMParams": { + "properties": { + "vector_store_index": { + "title": "Vector Store Index", + "type": "string" + }, + "vector_store_name": { + "title": "Vector Store Name", + "type": "string" + } + }, + "required": [ + "vector_store_index", + "vector_store_name" + ], + "title": "IndexCreateLiteLLMParams", + "type": "object" + }, + "IndexCreateRequest": { + "properties": { + "index_info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Index Info" + }, + "index_name": { + "title": "Index Name", + "type": "string" + }, + "litellm_params": { + "$ref": "#/components/schemas/IndexCreateLiteLLMParams" + } + }, + "required": [ + "index_name", + "litellm_params" + ], + "title": "IndexCreateRequest", + "type": "object" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "title": "Location", + "type": "array" + }, + "msg": { + "title": "Message", + "type": "string" + }, + "type": { + "title": "Error Type", + "type": "string" + } + }, + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError", + "type": "object" + } + } + }, + "paths": { + "/v1/indexes": { + "post": { + "description": "Create an index. Just writes the index to the database.\n\n```bash\ncurl -L -X POST 'http://0.0.0.0:4000/indexes/create' -H 'Content-Type: application/json' -H 'Authorization: Bearer sk-1234' -H 'LiteLLM-Beta: indexes_beta=v1' -d '{ \n \"index_name\": \"dall-e-3\",\n \"vector_store_index\": \"real-index-name\",\n \"vector_store_name\": \"azure-ai-search\"\n }'\n```", + "operationId": "index_create_v1_indexes_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IndexCreateRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Index Create", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores": { + "get": { + "description": "List vector stores.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/list", + "operationId": "vector_store_list_v1_vector_stores_get", + "parameters": [ + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store List", + "tags": [ + "vector_stores" + ] + }, + "post": { + "description": "Create a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/create\n\nSupports target_model_names parameter for creating vector stores across multiple models:\n```json\n{\n \"name\": \"my-vector-store\",\n \"target_model_names\": \"gpt-4,gemini-2.0\"\n}\n```", + "operationId": "vector_store_create_v1_vector_stores_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Create", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores/{vector_store_id}": { + "delete": { + "description": "Delete a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/delete", + "operationId": "vector_store_delete_v1_vector_stores__vector_store_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Delete", + "tags": [ + "vector_stores" + ] + }, + "get": { + "description": "Retrieve a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/retrieve", + "operationId": "vector_store_retrieve_v1_vector_stores__vector_store_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Retrieve", + "tags": [ + "vector_stores" + ] + }, + "post": { + "description": "Update a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/modify", + "operationId": "vector_store_update_v1_vector_stores__vector_store_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Update", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files": { + "get": { + "operationId": "vector_store_file_list_v1_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File List", + "tags": [ + "vector_stores" + ] + }, + "post": { + "operationId": "vector_store_file_create_v1_vector_stores__vector_store_id__files_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Create", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "operationId": "vector_store_file_delete_v1_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Delete", + "tags": [ + "vector_stores" + ] + }, + "get": { + "operationId": "vector_store_file_retrieve_v1_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Retrieve", + "tags": [ + "vector_stores" + ] + }, + "post": { + "operationId": "vector_store_file_update_v1_vector_stores__vector_store_id__files__file_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Update", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "vector_store_file_content_v1_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Content", + "tags": [ + "vector_stores" + ] + } + }, + "/v1/vector_stores/{vector_store_id}/search": { + "post": { + "description": "Search a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/search", + "operationId": "vector_store_search_v1_vector_stores__vector_store_id__search_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Search", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores": { + "get": { + "description": "List vector stores.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/list", + "operationId": "vector_store_list_vector_stores_get", + "parameters": [ + { + "in": "query", + "name": "after", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "After" + } + }, + { + "in": "query", + "name": "before", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Before" + } + }, + { + "in": "query", + "name": "limit", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 20, + "title": "Limit" + } + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "desc", + "title": "Order" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store List", + "tags": [ + "vector_stores" + ] + }, + "post": { + "description": "Create a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/create\n\nSupports target_model_names parameter for creating vector stores across multiple models:\n```json\n{\n \"name\": \"my-vector-store\",\n \"target_model_names\": \"gpt-4,gemini-2.0\"\n}\n```", + "operationId": "vector_store_create_vector_stores_post", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Create", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores/{vector_store_id}": { + "delete": { + "description": "Delete a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/delete", + "operationId": "vector_store_delete_vector_stores__vector_store_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Delete", + "tags": [ + "vector_stores" + ] + }, + "get": { + "description": "Retrieve a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/retrieve", + "operationId": "vector_store_retrieve_vector_stores__vector_store_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Retrieve", + "tags": [ + "vector_stores" + ] + }, + "post": { + "description": "Update a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/modify", + "operationId": "vector_store_update_vector_stores__vector_store_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Update", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores/{vector_store_id}/files": { + "get": { + "operationId": "vector_store_file_list_vector_stores__vector_store_id__files_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File List", + "tags": [ + "vector_stores" + ] + }, + "post": { + "operationId": "vector_store_file_create_vector_stores__vector_store_id__files_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Create", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}": { + "delete": { + "operationId": "vector_store_file_delete_vector_stores__vector_store_id__files__file_id__delete", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Delete", + "tags": [ + "vector_stores" + ] + }, + "get": { + "operationId": "vector_store_file_retrieve_vector_stores__vector_store_id__files__file_id__get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Retrieve", + "tags": [ + "vector_stores" + ] + }, + "post": { + "operationId": "vector_store_file_update_vector_stores__vector_store_id__files__file_id__post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Update", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "vector_store_file_content_vector_stores__vector_store_id__files__file_id__content_get", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + }, + { + "in": "path", + "name": "file_id", + "required": true, + "schema": { + "title": "File Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store File Content", + "tags": [ + "vector_stores" + ] + } + }, + "/vector_stores/{vector_store_id}/search": { + "post": { + "description": "Search a vector store.\n\nAPI Reference:\nhttps://platform.openai.com/docs/api-reference/vector-stores/search", + "operationId": "vector_store_search_vector_stores__vector_store_id__search_post", + "parameters": [ + { + "in": "path", + "name": "vector_store_id", + "required": true, + "schema": { + "title": "Vector Store Id", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "APIKeyHeader": [] + } + ], + "summary": "Vector Store Search", + "tags": [ + "vector_stores" + ] + } + } + } + } +} diff --git a/litellm/proxy/_lazy_openapi_snapshot.py b/litellm/proxy/_lazy_openapi_snapshot.py new file mode 100644 index 0000000000..78028319e3 --- /dev/null +++ b/litellm/proxy/_lazy_openapi_snapshot.py @@ -0,0 +1,70 @@ +""" +Per-feature OpenAPI snapshot for lazy-loaded routers. + +The committed JSON is generated by `python -m litellm.proxy._lazy_openapi_snapshot` +and consumed at runtime so /openapi.json can show full route info for unloaded +features without importing them. CI verifies the file is current and surfaces +any drift as a neutral check. +""" + +import json +import sys +from pathlib import Path +from typing import Dict, Optional + +SNAPSHOT_FILE = Path(__file__).parent / "_lazy_openapi_snapshot.json" + + +def load_snapshot() -> Optional[Dict[str, Dict]]: + if not SNAPSHOT_FILE.exists(): + return None + try: + with SNAPSHOT_FILE.open() as f: + return json.load(f) + except (json.JSONDecodeError, OSError): + return None + + +def generate_snapshot() -> Dict[str, Dict]: + import importlib + + from fastapi.openapi.utils import get_openapi + + from litellm.proxy._lazy_features import LAZY_FEATURES + from litellm.proxy.proxy_server import app + + for feat in LAZY_FEATURES: + if feat.module_path in sys.modules: + continue + try: + module = importlib.import_module(feat.module_path) + feat.register_fn(app, module) + except Exception as exc: + print(f"warning: skip {feat.name}: {exc}", file=sys.stderr) + + fragments: Dict[str, Dict] = {} + for feat in LAZY_FEATURES: + feat_routes = [ + r + for r in app.routes + if any(getattr(r, "path", "").startswith(p) for p in feat.path_prefixes) + ] + if not feat_routes: + continue + full = get_openapi(title=app.title, version=app.version, routes=feat_routes) + # Group all of a feature's routes under one tag. + for path_ops in full.get("paths", {}).values(): + for op in path_ops.values(): + if isinstance(op, dict): + op["tags"] = [feat.name] + fragments[feat.name] = { + "paths": full.get("paths", {}), + "components": {"schemas": full.get("components", {}).get("schemas", {})}, + } + return fragments + + +if __name__ == "__main__": + fragments = generate_snapshot() + SNAPSHOT_FILE.write_text(json.dumps(fragments, indent=2, sort_keys=True) + "\n") + print(f"wrote {len(fragments)} feature fragments to {SNAPSHOT_FILE}") diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index c305644db3..337862e3b7 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -1504,14 +1504,51 @@ def mount_swagger_ui(): from litellm.proxy._lazy_features import lazy_tag_to_prefix _lazy_plugin_js = ( - "const TAG_TO_PREFIX = " - + json.dumps(lazy_tag_to_prefix()) - + ";const warmedTags = new Set();const LazyLoadPlugin = () => ({" + "const TAG_TO_PREFIX = " + json.dumps(lazy_tag_to_prefix()) + ";" + "const warmedTags = new Set();" + "const LAZY_TAGS = new Set(Object.keys(TAG_TO_PREFIX));" + "const hideStubRows = () => {" + "document.querySelectorAll('.opblock').forEach(op => {" + "const d = op.querySelector('.opblock-summary-description');" + "if (d && LAZY_TAGS.has(d.textContent.trim())) op.style.display = 'none';" + "});};" + "const annotateLazyHeaders = () => {" + "document.querySelectorAll('.opblock-tag').forEach(tagEl => {" + "const m = (tagEl.id || '').match(/^operations-tag-(.+)$/);" + "if (!m || !LAZY_TAGS.has(m[1])) return;" + "const existing = tagEl.querySelector('.lazy-load-hint');" + "if (warmedTags.has(m[1])) { if (existing) existing.remove(); return; }" + "if (existing) return;" + "const hint = document.createElement('small');" + "hint.className = 'lazy-load-hint';" + "hint.textContent = ' (expand to load routes)';" + "hint.style.opacity = '0.6';" + "hint.style.marginLeft = '6px';" + "const target = tagEl.querySelector('a span') || tagEl.querySelector('span') || tagEl;" + "target.appendChild(hint);" + "});};" + "setInterval(() => { hideStubRows(); annotateLazyHeaders(); }, 200);" + "const LazyLoadPlugin = () => ({" + "afterLoad:function(system){setTimeout(()=>{" + "for(const tag of LAZY_TAGS)system.layoutActions.show(['operations-tag',tag],false);" + "},200);}," "statePlugins:{layout:{wrapActions:{show:(ori,sys)=>(...args)=>{" - "const thing=args[0];let tag=null;" + "const thing=args[0];const shown=args[1];let tag=null;" "if(Array.isArray(thing)){for(const t of thing)if(TAG_TO_PREFIX[t])tag=t;}" - "if(tag&&!warmedTags.has(tag)){warmedTags.add(tag);" - "fetch(TAG_TO_PREFIX[tag]).finally(()=>setTimeout(()=>sys.specActions.download(),800));}" + "if(shown!==false&&tag&&!warmedTags.has(tag)){warmedTags.add(tag);" + "fetch('/lazy/warm/'+tag,{method:'POST'}).then(r=>r.json()).then(d=>{" + "if(!d.paths||Object.keys(d.paths).length===0)return;" + "const cur=sys.specSelectors.specJson().toJS();" + "const merged={};let inserted=false;" + "for(const k in (cur.paths||{})){" + "if(k===d.stub_path){for(const nk in d.paths)merged[nk]=d.paths[nk];inserted=true;}" + "else{merged[k]=cur.paths[k];}}" + "if(!inserted)Object.assign(merged,d.paths);" + "cur.paths=merged;" + "cur.components=cur.components||{};" + "cur.components.schemas=Object.assign(cur.components.schemas||{},(d.components||{}).schemas||{});" + "sys.specActions.updateSpec(JSON.stringify(cur));" + "}).catch(()=>{});}" "return ori(...args);}}}}});" ) @@ -1526,7 +1563,8 @@ def mount_swagger_ui(): body = response.body.decode("utf-8") body = body.replace( "const ui = SwaggerUIBundle({", - _lazy_plugin_js + "const ui = SwaggerUIBundle({plugins:[LazyLoadPlugin],", + _lazy_plugin_js + + 'const ui = SwaggerUIBundle({plugins:[LazyLoadPlugin],tagsSorter:"alpha",', 1, ) return HTMLResponse(content=body)