{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bookmyhost/json-schema/bookmyhost-pass-through-generic-endpoint-schema.json",
  "title": "PassThroughGenericEndpoint",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookmyhost-config-api-openapi.yml#/components/schemas/PassThroughGenericEndpoint",
  "properties": {
    "id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Id",
      "description": "Optional unique identifier for the pass-through endpoint. If not provided, endpoints will be identified by path for backwards compatibility."
    },
    "path": {
      "type": "string",
      "title": "Path",
      "description": "The route to be added to the LiteLLM Proxy Server."
    },
    "target": {
      "type": "string",
      "title": "Target",
      "description": "The URL to which requests for this path should be forwarded."
    },
    "headers": {
      "additionalProperties": true,
      "type": "object",
      "title": "Headers",
      "description": "Key-value pairs of headers to be forwarded with the request. You can set any key value pair here and it will be forwarded to your target endpoint",
      "default": {}
    },
    "default_query_params": {
      "additionalProperties": true,
      "type": "object",
      "title": "Default Query Params",
      "description": "Key-value pairs of default query parameters to be sent with every request to this endpoint. These can be overridden by client-provided query parameters. For example: {'key': 'default_value', 'api_version': '2023-01'}",
      "default": {}
    },
    "include_subpath": {
      "type": "boolean",
      "title": "Include Subpath",
      "description": "If True, requests to subpaths of the path will be forwarded to the target endpoint. For example, if the path is /bria and include_subpath is True, requests to /bria/v1/text-to-image/base/2.3 will be forwarded to the target endpoint.",
      "default": false
    },
    "cost_per_request": {
      "type": "number",
      "title": "Cost Per Request",
      "description": "The USD cost per request to the target endpoint. This is used to calculate the cost of the request to the target endpoint.",
      "default": 0.0
    },
    "timeout": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timeout",
      "description": "Upstream request timeout in seconds for this pass-through endpoint. If unset, uses general_settings.pass_through_request_timeout (default 600)."
    },
    "auth": {
      "type": "boolean",
      "title": "Auth",
      "description": "Whether authentication is required for the pass-through endpoint. Defaults to True so a pass-through silently created without an explicit value still requires a valid LiteLLM API key — set to False only if the endpoint is meant to be a public forwarder (e.g. an unauthenticated webhook target).",
      "default": true
    },
    "guardrails": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "$ref": "#/$defs/PassThroughGuardrailSettings"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Guardrails",
      "description": "Guardrails configuration for this passthrough endpoint. Dict keys are guardrail names, values are optional settings for field targeting. When set, all org/team/key level guardrails will also execute. Defaults to None (no guardrails execute)."
    },
    "is_from_config": {
      "type": "boolean",
      "title": "Is From Config",
      "description": "True if this endpoint is defined in the config file, False if from DB. Config-defined endpoints cannot be edited via the UI.",
      "default": false
    },
    "methods": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Methods",
      "description": "List of HTTP methods this endpoint handles (e.g., ['GET', 'POST']). If None or empty, all methods (GET, POST, PUT, DELETE, PATCH) are supported for backward compatibility. This allows the same path to have different targets for different HTTP methods."
    }
  },
  "type": "object",
  "required": [
    "path",
    "target"
  ],
  "$defs": {
    "PassThroughGuardrailSettings": {
      "properties": {
        "request_fields": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Fields",
          "description": "JSONPath expressions for input field targeting (pre_call). Examples: 'query', 'documents[*].text', 'messages[*].content'. If not specified, guardrail runs on entire request payload."
        },
        "response_fields": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Response Fields",
          "description": "JSONPath expressions for output field targeting (post_call). Examples: 'results[*].text', 'output'. If not specified, guardrail runs on entire response payload."
        }
      },
      "type": "object",
      "title": "PassThroughGuardrailSettings",
      "description": "Settings for a specific guardrail on a passthrough endpoint.\n\nAllows field-level targeting for guardrail execution."
    }
  }
}