{
  "openapi": "3.1.0",
  "info": {
    "title": "AutoGPT Agent Server",
    "summary": "AutoGPT Agent Server",
    "description": "This server is used to execute agents that are created by the AutoGPT system.",
    "version": "0.1"
  },
  "paths": {
    "/api/admin/blocks/cost-estimates": {
      "get": {
        "tags": ["v2", "admin", "admin", "blocks"],
        "summary": "Export Block Cost Estimates",
        "description": "Aggregate per-block average credits-per-execution over [start, end].\n\nCapped at ANALYTICS_MAX_DAYS days. Returns only blocks whose current cost\ntype is dynamic (SECOND/ITEMS/COST_USD) — static-cost blocks already\ncharge correctly pre-flight and don't need an estimate override. TOKENS\nis excluded because `compute_token_credits` already supplies a per-model\nfloor at pre-flight; a per-block historical mean would lose that\ngranularity.",
        "operationId": "getV2Export block cost estimates",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "Start"
            },
            "description": "ISO timestamp (inclusive)"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "End"
            },
            "description": "ISO timestamp (inclusive)"
          },
          {
            "name": "min_samples",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Minimum executions per block to include",
              "default": 10,
              "title": "Min Samples"
            },
            "description": "Minimum executions per block to include"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockCostEstimatesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/agents": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Get Agent Diagnostics",
        "description": "Get diagnostic information about agents.\n\nReturns:\n    - agents_with_active_executions: Number of unique agents with running/queued executions\n    - timestamp: Current timestamp",
        "operationId": "getV2Get agent diagnostics",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentDiagnosticsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Get Execution Diagnostics",
        "description": "Get comprehensive diagnostic information about execution status.\n\nReturns all execution metrics including:\n- Current state (running, queued)\n- Orphaned executions (>24h old, likely not in executor)\n- Failure metrics (1h, 24h, rate)\n- Long-running detection (stuck >1h, >24h)\n- Stuck queued detection\n- Throughput metrics (completions/hour)\n- RabbitMQ queue depths",
        "operationId": "getV2Get execution diagnostics",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionDiagnosticsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/cleanup-all-orphaned": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Cleanup ALL Orphaned Executions",
        "description": "Cleanup ALL orphaned executions (>24h old) by directly updating DB status.\nOperates on all executions, not just paginated results.\n\nReturns:\n    Number of executions cleaned up and success message",
        "operationId": "postV2Cleanup all orphaned executions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/cleanup-all-stuck-queued": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Cleanup ALL Stuck Queued Executions",
        "description": "Cleanup ALL stuck queued executions (QUEUED >1h) by updating DB status (admin only).\nOperates on entire dataset, not limited to pagination.\n\nReturns:\n    Number of executions cleaned up and success message",
        "operationId": "postV2Cleanup all stuck queued executions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/cleanup-orphaned": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Cleanup Orphaned Executions",
        "description": "Cleanup orphaned executions by directly updating DB status (admin only).\nFor executions in DB but not actually running in executor (old/stale records).\n\nArgs:\n    request: Contains list of execution_ids to cleanup\n\nReturns:\n    Number of executions cleaned up and success message",
        "operationId": "postV2Cleanup orphaned executions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StopExecutionsRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/failed": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Failed Executions",
        "description": "Get detailed list of failed executions.\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n    hours: Number of hours to look back (default 24)\n\nReturns:\n    List of failed executions with error details",
        "operationId": "getV2List failed executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 24, "title": "Hours" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FailedExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/executions/invalid": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Invalid Executions",
        "description": "Get detailed list of executions in invalid states (READ-ONLY).\n\nInvalid states indicate data corruption and require manual investigation:\n- QUEUED but has startedAt (impossible - can't start while queued)\n- RUNNING but no startedAt (impossible - can't run without starting)\n\n⚠️ NO BULK ACTIONS PROVIDED - These need case-by-case investigation.\n\nEach invalid execution likely has a different root cause (crashes, race conditions,\nDB corruption). Investigate the execution history and logs to determine appropriate\naction (manual cleanup, status fix, or leave as-is if system recovered).\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n\nReturns:\n    List of invalid state executions with details",
        "operationId": "getV2List invalid executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunningExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/executions/long-running": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Long-Running Executions",
        "description": "Get detailed list of long-running executions (RUNNING status >24h).\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n\nReturns:\n    List of long-running executions with details",
        "operationId": "getV2List long-running executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunningExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/executions/orphaned": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Orphaned Executions",
        "description": "Get detailed list of orphaned executions (>24h old, likely not in executor).\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n\nReturns:\n    List of orphaned executions with details",
        "operationId": "getV2List orphaned executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunningExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/executions/requeue": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Requeue Stuck Execution",
        "description": "Requeue a stuck QUEUED execution (admin only).\n\nUses add_graph_execution with existing graph_exec_id to requeue.\n\n⚠️ WARNING: Only use for stuck executions. This will re-execute and may cost credits.\n\nArgs:\n    request: Contains execution_id to requeue\n\nReturns:\n    Success status and message",
        "operationId": "postV2Requeue stuck execution",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StopExecutionRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequeueExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/requeue-all-stuck": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Requeue ALL Stuck Queued Executions",
        "description": "Requeue ALL stuck queued executions (QUEUED >1h) by publishing to RabbitMQ.\nOperates on all executions, not just paginated results.\n\nUses add_graph_execution with existing graph_exec_id to requeue.\n\n⚠️ WARNING: This will re-execute ALL stuck executions and may cost significant credits.\n\nReturns:\n    Number of executions requeued and success message",
        "operationId": "postV2Requeue all stuck queued executions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequeueExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/requeue-bulk": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Requeue Multiple Stuck Executions",
        "description": "Requeue multiple stuck QUEUED executions (admin only).\n\nUses add_graph_execution with existing graph_exec_id to requeue.\n\n⚠️ WARNING: Only use for stuck executions. This will re-execute and may cost credits.\n\nArgs:\n    request: Contains list of execution_ids to requeue\n\nReturns:\n    Number of executions requeued and success message",
        "operationId": "postV2Requeue multiple stuck executions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StopExecutionsRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequeueExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/running": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Running Executions",
        "description": "Get detailed list of running and queued executions (recent, likely active).\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n\nReturns:\n    List of running executions with details",
        "operationId": "getV2List running executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunningExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/executions/stop": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Stop Single Execution",
        "description": "Stop a single execution (admin only).\n\nUses robust stop_graph_execution which cascades to children and waits for termination.\n\nArgs:\n    request: Contains execution_id to stop\n\nReturns:\n    Success status and message",
        "operationId": "postV2Stop single execution",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StopExecutionRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/stop-all-long-running": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Stop ALL Long-Running Executions",
        "description": "Stop ALL long-running executions (RUNNING >24h) by sending cancel signals (admin only).\nOperates on entire dataset, not limited to pagination.\n\nReturns:\n    Number of executions stopped and success message",
        "operationId": "postV2Stop all long-running executions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/stop-bulk": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Stop Multiple Executions",
        "description": "Stop multiple active executions (admin only).\n\nUses robust stop_graph_execution which cascades to children and waits for termination.\n\nArgs:\n    request: Contains list of execution_ids to stop\n\nReturns:\n    Number of executions stopped and success message",
        "operationId": "postV2Stop multiple executions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StopExecutionsRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopExecutionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/executions/stuck-queued": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Stuck Queued Executions",
        "description": "Get detailed list of stuck queued executions (QUEUED >1h, never started).\n\nArgs:\n    limit: Maximum number of executions to return (default 100)\n    offset: Number of executions to skip (default 0)\n\nReturns:\n    List of stuck queued executions with details",
        "operationId": "getV2List stuck queued executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunningExecutionsListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/schedules": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Get Schedule Diagnostics",
        "description": "Get comprehensive diagnostic information about schedule health.\n\nReturns schedule metrics including:\n- Total schedules (user vs system)\n- Orphaned schedules by category\n- Upcoming executions",
        "operationId": "getV2Get schedule diagnostics",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleHealthMetrics"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/schedules/all": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List All User Schedules",
        "description": "Get detailed list of all user schedules (excludes system monitoring jobs).\n\nArgs:\n    limit: Maximum number of schedules to return (default 100)\n    offset: Number of schedules to skip (default 0)\n\nReturns:\n    List of schedules with details",
        "operationId": "getV2List all user schedules",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 100, "title": "Limit" }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 0, "title": "Offset" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulesListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/diagnostics/schedules/cleanup-orphaned": {
      "post": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "Cleanup Orphaned Schedules",
        "description": "Cleanup orphaned schedules by deleting from scheduler (admin only).\n\nArgs:\n    request: Contains list of schedule_ids to delete\n\nReturns:\n    Number of schedules deleted and success message",
        "operationId": "postV2Cleanup orphaned schedules",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCleanupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleCleanupResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/diagnostics/schedules/orphaned": {
      "get": {
        "tags": ["v2", "admin", "diagnostics", "admin"],
        "summary": "List Orphaned Schedules",
        "description": "Get detailed list of orphaned schedules with orphan reasons.\n\nReturns:\n    List of orphaned schedules categorized by orphan type",
        "operationId": "getV2List orphaned schedules",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrphanedSchedulesListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/admin/platform-costs/dashboard": {
      "get": {
        "tags": ["v2", "admin", "platform-cost", "admin"],
        "summary": "Get Platform Cost Dashboard",
        "operationId": "getV2Get platform cost dashboard",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "End"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Provider"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Model"
            }
          },
          {
            "name": "block_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Block Name"
            }
          },
          {
            "name": "tracking_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Tracking Type"
            }
          },
          {
            "name": "graph_exec_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Graph Exec Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformCostDashboard"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/platform-costs/logs": {
      "get": {
        "tags": ["v2", "admin", "platform-cost", "admin"],
        "summary": "Get Platform Cost Logs",
        "operationId": "getV2Get platform cost logs",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "End"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Provider"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Page Size"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Model"
            }
          },
          {
            "name": "block_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Block Name"
            }
          },
          {
            "name": "tracking_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Tracking Type"
            }
          },
          {
            "name": "graph_exec_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Graph Exec Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformCostLogsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/admin/platform-costs/logs/export": {
      "get": {
        "tags": ["v2", "admin", "platform-cost", "admin"],
        "summary": "Export Platform Cost Logs",
        "operationId": "getV2Export platform cost logs",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "End"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Provider"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Model"
            }
          },
          {
            "name": "block_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Block Name"
            }
          },
          {
            "name": "tracking_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Tracking Type"
            }
          },
          {
            "name": "graph_exec_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Graph Exec Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformCostExportResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/analytics/log_raw_analytics": {
      "post": {
        "tags": ["analytics"],
        "summary": "Log Raw Analytics",
        "operationId": "postAnalyticsLogRawAnalytics",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postAnalyticsLogRawAnalytics"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/analytics/log_raw_metric": {
      "post": {
        "tags": ["analytics"],
        "summary": "Log Raw Metric",
        "operationId": "postAnalyticsLogRawMetric",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/LogRawMetricRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/api-keys": {
      "get": {
        "tags": ["v1", "api-keys"],
        "summary": "List user API keys",
        "description": "List all API keys for the user",
        "operationId": "getV1List user api keys",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/APIKeyInfo" },
                  "type": "array",
                  "title": "Response Getv1List User Api Keys"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "api-keys"],
        "summary": "Create new API key",
        "description": "Create a new API key",
        "operationId": "postV1Create new api key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CreateAPIKeyRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeyResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/api-keys/{key_id}": {
      "delete": {
        "tags": ["v1", "api-keys"],
        "summary": "Revoke API key",
        "description": "Revoke an API key",
        "operationId": "deleteV1Revoke api key",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Key Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/APIKeyInfo" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v1", "api-keys"],
        "summary": "Get specific API key",
        "description": "Get a specific API key",
        "operationId": "getV1Get specific api key",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Key Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/APIKeyInfo" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/api-keys/{key_id}/permissions": {
      "put": {
        "tags": ["v1", "api-keys"],
        "summary": "Update key permissions",
        "description": "Update API key permissions",
        "operationId": "putV1Update key permissions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Key Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePermissionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/APIKeyInfo" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/api-keys/{key_id}/suspend": {
      "post": {
        "tags": ["v1", "api-keys"],
        "summary": "Suspend API key",
        "description": "Suspend an API key",
        "operationId": "postV1Suspend api key",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Key Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/APIKeyInfo" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/auth/user": {
      "post": {
        "tags": ["v1", "auth"],
        "summary": "Get or create user",
        "operationId": "postV1Get or create user",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/auth/user/email": {
      "post": {
        "tags": ["v1", "auth"],
        "summary": "Update user email",
        "operationId": "postV1Update user email",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "type": "string", "title": "Email" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": { "type": "string" },
                  "type": "object",
                  "title": "Response Postv1Update User Email"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/auth/user/preferences": {
      "get": {
        "tags": ["v1", "auth"],
        "summary": "Get notification preferences",
        "operationId": "getV1Get notification preferences",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreference"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "auth"],
        "summary": "Update notification preferences",
        "operationId": "postV1Update notification preferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationPreferenceDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreference"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/auth/user/timezone": {
      "get": {
        "tags": ["v1", "auth"],
        "summary": "Get user timezone",
        "description": "Get user timezone setting.",
        "operationId": "getV1Get user timezone",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/TimezoneResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "auth"],
        "summary": "Update user timezone",
        "description": "Update user timezone. The timezone should be a valid IANA timezone identifier.",
        "operationId": "postV1Update user timezone",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/UpdateTimezoneRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/TimezoneResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/blocks": {
      "get": {
        "tags": ["v1", "blocks"],
        "summary": "List available blocks",
        "operationId": "getV1List available blocks",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "additionalProperties": true, "type": "object" },
                  "type": "array",
                  "title": "Response Getv1List Available Blocks"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/blocks/{block_id}/execute": {
      "post": {
        "tags": ["v1", "blocks"],
        "summary": "Execute graph block",
        "operationId": "postV1Execute graph block",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "block_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Block Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Data"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": { "type": "array", "items": {} },
                  "title": "Response Postv1Execute Graph Block"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "402": {
            "description": "Subscription required (NO_TIER user, paywall on)"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/blocks": {
      "get": {
        "tags": ["v2"],
        "summary": "Get Builder blocks",
        "description": "Get blocks based on either category, type, or provider.",
        "operationId": "getV2Get builder blocks",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Category"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": ["all", "input", "action", "output"],
                  "type": "string"
                },
                { "type": "null" }
              ],
              "title": "Type"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "Provider name for integrations. Can be any string value, including custom provider names."
                },
                { "type": "null" }
              ],
              "title": "Provider"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1, "title": "Page" }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 50, "title": "Page Size" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/BlockResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/blocks/batch": {
      "get": {
        "tags": ["v2"],
        "summary": "Get specific blocks",
        "description": "Get specific blocks by their IDs.",
        "operationId": "getV2Get specific blocks",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "block_ids",
            "in": "query",
            "required": true,
            "schema": {
              "type": "array",
              "items": { "type": "string" },
              "title": "Block Ids"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/BlockInfo" },
                  "title": "Response Getv2Get Specific Blocks"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/categories": {
      "get": {
        "tags": ["v2"],
        "summary": "Get Builder block categories",
        "description": "Get all block categories with a specified number of blocks per category.",
        "operationId": "getV2Get builder block categories",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "blocks_per_category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 3,
              "title": "Blocks Per Category"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BlockCategoryResponse"
                  },
                  "title": "Response Getv2Get Builder Block Categories"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/counts": {
      "get": {
        "tags": ["v2"],
        "summary": "Get Builder item counts",
        "description": "Get item counts for the menu categories in the Blocks Menu.",
        "operationId": "getV2Get builder item counts",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CountResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/builder/providers": {
      "get": {
        "tags": ["v2"],
        "summary": "Get Builder integration providers",
        "description": "Get all integration providers with their block counts.",
        "operationId": "getV2Get builder integration providers",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1, "title": "Page" }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 50, "title": "Page Size" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProviderResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/search": {
      "get": {
        "tags": ["v2", "store", "private"],
        "summary": "Builder search",
        "description": "Search for blocks (including integrations), marketplace agents, and user library agents.",
        "operationId": "getV2Builder search",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "search_query",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Search Query"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Filter"
            }
          },
          {
            "name": "search_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Search Id"
            }
          },
          {
            "name": "by_creator",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "array", "items": { "type": "string" } },
                { "type": "null" }
              ],
              "title": "By Creator"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1, "title": "Page" }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 50, "title": "Page Size" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SearchResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/builder/suggestions": {
      "get": {
        "tags": ["v2"],
        "summary": "Get Builder suggestions",
        "description": "Get all suggestions for the Blocks Menu.",
        "operationId": "getV2Get builder suggestions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SuggestionsResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/chat/config/ttl": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Get Ttl Config",
        "description": "Get the stream TTL configuration.\n\nReturns the Time-To-Live settings for chat streams, which determines\nhow long clients can reconnect to an active stream.\n\nReturns:\n    dict: TTL configuration with seconds and milliseconds values.",
        "operationId": "getV2GetTtlConfig",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Getv2Getttlconfig"
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/health": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Health Check",
        "description": "Health check endpoint for the chat service.\n\nPerforms a full cycle test of session creation and retrieval. Should always return healthy\nif the service and data layer are operational.\n\nReturns:\n    dict: A status dictionary indicating health, service name, and API version.",
        "operationId": "getV2HealthCheck",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Getv2Healthcheck"
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/schema/tool-responses": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "[Dummy] Tool response type export for codegen",
        "description": "This endpoint is not meant to be called. It exists solely to expose tool response models in the OpenAPI schema for frontend codegen.",
        "operationId": "getV2[dummy] tool response type export for codegen",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    { "$ref": "#/components/schemas/AgentsFoundResponse" },
                    { "$ref": "#/components/schemas/NoResultsResponse" },
                    { "$ref": "#/components/schemas/AgentDetailsResponse" },
                    {
                      "$ref": "#/components/schemas/SetupRequirementsResponse"
                    },
                    { "$ref": "#/components/schemas/ExecutionStartedResponse" },
                    { "$ref": "#/components/schemas/NeedLoginResponse" },
                    { "$ref": "#/components/schemas/ErrorResponse" },
                    {
                      "$ref": "#/components/schemas/InputValidationErrorResponse"
                    },
                    { "$ref": "#/components/schemas/AgentOutputResponse" },
                    {
                      "$ref": "#/components/schemas/UnderstandingUpdatedResponse"
                    },
                    { "$ref": "#/components/schemas/AgentPreviewResponse" },
                    { "$ref": "#/components/schemas/AgentSavedResponse" },
                    {
                      "$ref": "#/components/schemas/ClarificationNeededResponse"
                    },
                    { "$ref": "#/components/schemas/SuggestedGoalResponse" },
                    { "$ref": "#/components/schemas/BlockListResponse" },
                    { "$ref": "#/components/schemas/BlockDetailsResponse" },
                    { "$ref": "#/components/schemas/BlockOutputResponse" },
                    { "$ref": "#/components/schemas/DocSearchResultsResponse" },
                    { "$ref": "#/components/schemas/DocPageResponse" },
                    {
                      "$ref": "#/components/schemas/MCPToolsDiscoveredResponse"
                    },
                    { "$ref": "#/components/schemas/MCPToolOutputResponse" },
                    { "$ref": "#/components/schemas/ScheduleListResponse" },
                    { "$ref": "#/components/schemas/ScheduleDeletedResponse" },
                    { "$ref": "#/components/schemas/MemoryStoreResponse" },
                    { "$ref": "#/components/schemas/MemorySearchResponse" },
                    {
                      "$ref": "#/components/schemas/MemoryForgetCandidatesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MemoryForgetConfirmResponse"
                    },
                    { "$ref": "#/components/schemas/TodoWriteResponse" }
                  ],
                  "title": "Response Getv2[Dummy] Tool Response Type Export For Codegen"
                }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "List Sessions",
        "description": "List chat sessions for the authenticated user.\n\nReturns a paginated list of chat sessions belonging to the current user,\nordered by most recently updated.\n\nArgs:\n    user_id: The authenticated user's ID.\n    limit: Maximum number of sessions to return (1-100).\n    offset: Number of sessions to skip for pagination.\n\nReturns:\n    ListSessionsResponse: List of session summaries and total count.",
        "operationId": "getV2ListSessions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSessionsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Create Session",
        "description": "Create (or get-or-create) a chat session.\n\nTwo modes, selected by the request body:\n\n- Default: create a fresh session for the user. ``dry_run=True`` forces\n  run_block and run_agent calls to use dry-run simulation.\n- Builder-bound: when ``builder_graph_id`` is set, get-or-create keyed\n  on ``(user_id, builder_graph_id)``. Returns the existing session for\n  that graph or creates one locked to it.  Graph ownership is validated\n  inside :func:`get_or_create_builder_session`; raises 404 on\n  unauthorized access.  Write-side scope is enforced per-tool\n  (``edit_agent`` / ``run_agent`` reject any ``agent_id`` other than\n  the bound graph) and a small blacklist hides tools that conflict\n  with the panel's scope (see :data:`BUILDER_BLOCKED_TOOLS`).\n\nArgs:\n    user_id: The authenticated user ID parsed from the JWT (required).\n    request: Optional request body with ``dry_run`` and/or\n        ``builder_graph_id``.\n\nReturns:\n    CreateSessionResponse: Details of the resulting session.",
        "operationId": "postV2CreateSession",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  { "$ref": "#/components/schemas/CreateSessionRequest" },
                  { "type": "null" }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSessionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}": {
      "delete": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Delete Session",
        "description": "Delete a chat session.\n\nPermanently removes a chat session and all its messages.\nOnly the owner can delete their sessions.\n\nArgs:\n    session_id: The session ID to delete.\n    user_id: The authenticated user's ID.\n\nReturns:\n    204 No Content on success.\n\nRaises:\n    HTTPException: 404 if session not found or not owned by user.",
        "operationId": "deleteV2DeleteSession",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Session not found or access denied" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Get Session",
        "description": "Retrieve the details of a specific chat session.\n\nSupports cursor-based pagination via ``limit`` and ``before_sequence``.\nWhen no pagination params are provided, returns the most recent messages.",
        "operationId": "getV2GetSession",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "before_sequence",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "integer", "minimum": 0 },
                { "type": "null" }
              ],
              "title": "Before Sequence"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionDetailResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/assign-user": {
      "patch": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Session Assign User",
        "description": "Assign an authenticated user to a chat session.\n\nUsed (typically post-login) to claim an existing anonymous session as the current authenticated user.\n\nArgs:\n    session_id: The identifier for the (previously anonymous) session.\n    user_id: The authenticated user's ID to associate with the session.\n\nReturns:\n    dict: Status of the assignment.",
        "operationId": "patchV2SessionAssignUser",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Patchv2Sessionassignuser"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/cancel": {
      "post": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Cancel Session Task",
        "description": "Cancel an in-flight task for a session.\n\nHandles both lifecycle states uniformly:\n\n* **Queued** (``chatStatus='queued'``) — the dispatcher hasn't\n  claimed the row yet.  Flip the session back to ``idle`` and\n  return; no executor cancel event needed.\n* **Running** (``chatStatus='running'``) — publish a cancel event\n  to the executor via RabbitMQ FANOUT, then poll Redis until the\n  task status flips out of ``running`` or a 5 s timeout is hit.",
        "operationId": "postV2CancelSessionTask",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSessionResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/messages/pending": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Get Pending Messages",
        "description": "Peek at the pending-message buffer without consuming it.\n\nReturns the current contents of the session's pending message buffer\nso the frontend can restore the queued-message indicator after a page\nrefresh and clear it correctly once a turn drains the buffer.",
        "operationId": "getV2GetPendingMessages",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PeekPendingMessagesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Session not found or access denied" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Queue Pending Message",
        "description": "Queue a follow-up message while the session has an active turn.",
        "operationId": "postV2QueuePendingMessage",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueuePendingMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuePendingMessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Session not found or access denied" },
          "409": {
            "description": "Session has no active turn to receive pending messages"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "429": { "description": "Call-frequency cap exceeded" },
          "503": {
            "description": "Chat service degraded (Redis unavailable); client should honour the Retry-After header before retrying."
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/share": {
      "delete": {
        "tags": ["v2", "chat", "share", "chat", "share"],
        "summary": "Disable Chat Sharing",
        "description": "Revoke sharing for a chat session.\n\nCascade-revokes linked executions whose share originated here\n(``sharedVia == CHAT_LINK``).  User-initiated execution shares\nsurvive — see :func:`backend.copilot.sharing.db.disable_chat_session_share`.",
        "operationId": "deleteV2DisableChatSharing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "chat", "share", "chat", "share"],
        "summary": "Enable Chat Sharing",
        "description": "Enable sharing for a chat session.\n\nFlag-gated: refuses with 403 when ``chat-sharing`` is off so a stale\nfrontend cannot enable shares post-rollback.",
        "operationId": "postV2EnableChatSharing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/EnableShareRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/backend__api__features__chat__share__ShareResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "403": { "description": "Chat sharing is not enabled for this user" },
          "404": { "description": "Chat session not found for user" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/share/state": {
      "get": {
        "tags": ["v2", "chat", "share", "chat", "share"],
        "summary": "Get Chat Share State",
        "description": "Return the chat's current share state.\n\nThe share modal calls this on open so it can render in the right\nmode (share-vs-revoke) and pre-select the auto-share toggle.",
        "operationId": "getV2GetChatShareState",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatShareStateResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/stream": {
      "delete": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Disconnect Session Stream",
        "description": "Disconnect all active SSE listeners for a session.\n\nCalled by the frontend when the user switches away from a chat so the\nbackend releases XREAD listeners immediately rather than waiting for\nthe 5-10 s timeout.",
        "operationId": "deleteV2DisconnectSessionStream",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Resume Session Stream",
        "description": "Resume an active stream for a session.\n\nCalled by the AI SDK's ``useChat(resume: true)`` on page load.\nChecks for an active (in-progress) task on the session and either replays\nthe full SSE stream or returns 204 No Content if nothing is running.\n\nAlways replays the active turn from ``0-0``. The AI SDK UI-message parser\nkeeps text/reasoning part state inside a single parser instance; resuming\nfrom a Redis cursor can skip the ``*-start`` events required by later\n``*-delta`` chunks.",
        "operationId": "getV2ResumeSessionStream",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Stream Chat Post",
        "description": "Start a new turn and return an AI SDK UI message stream.\n\nReturns an SSE stream (``text/event-stream``) with Vercel AI SDK chunks\n(text fragments, tool-call UI, tool results). The generation runs in a\nbackground task that survives client disconnects; reconnect via\n``GET /sessions/{session_id}/stream`` to resume.\n\nFollow-up messages typed while a turn is already running should use\n``POST /sessions/{session_id}/messages/pending``. If an older client still\nposts that follow-up here, we queue it defensively but still return a valid\nempty UI-message stream so AI SDK transports never receive a JSON body from\nthe stream endpoint.\n\nArgs:\n    session_id: The chat session identifier.\n    request: Request body with message, is_user_message, and optional context.\n    user_id: Authenticated user ID.",
        "operationId": "postV2StreamChatPost",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StreamChatRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "402": {
            "description": "Subscription required (NO_TIER user, paywall on)"
          },
          "404": { "description": "Session not found or access denied" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "429": {
            "description": "Cost rate-limit, call-frequency cap, or per-user concurrent-turn limit exceeded"
          },
          "503": {
            "description": "Chat service degraded (Redis unavailable for rate limit or stream registry); client should honour the Retry-After header before retrying."
          }
        }
      }
    },
    "/api/chat/sessions/{session_id}/title": {
      "patch": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Update session title",
        "description": "Update the title of a chat session.\n\nAllows the user to rename their chat session.\n\nArgs:\n    session_id: The session ID to update.\n    request: Request body containing the new title.\n    user_id: The authenticated user's ID.\n\nReturns:\n    dict: Status of the update.\n\nRaises:\n    HTTPException: 404 if session not found or not owned by user.",
        "operationId": "patchV2Update session title",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Session Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionTitleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Patchv2Update Session Title"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Session not found or access denied" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/chat/suggested-prompts": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Get Suggested Prompts",
        "description": "Get LLM-generated suggested prompts grouped by theme.\n\nReturns personalized quick-action prompts based on the user's\nbusiness understanding. Returns empty themes list if no custom\nprompts are available.",
        "operationId": "getV2GetSuggestedPrompts",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestedPromptsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/chat/usage": {
      "get": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Get Copilot Usage",
        "description": "Get CoPilot usage status for the authenticated user.\n\nReturns the percentage of the daily/weekly allowance used — not the\nraw spend or cap — so clients cannot derive per-turn cost or platform\nmargins. Global defaults sourced from LaunchDarkly (falling back to\nconfig). Includes the user's rate-limit tier.",
        "operationId": "getV2GetCopilotUsage",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CoPilotUsagePublic" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/chat/usage/reset": {
      "post": {
        "tags": ["v2", "chat", "chat"],
        "summary": "Reset Copilot Usage",
        "description": "Reset the daily CoPilot rate limit by spending credits.\n\nAllows users who have hit their daily cost limit to spend credits\nto reset their daily usage counter and continue working.\nReturns 400 if the feature is disabled or the user is not over the limit.\nReturns 402 if the user has insufficient credits.",
        "operationId": "postV2ResetCopilotUsage",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitResetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request (feature disabled or daily limit not reached)"
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "402": { "description": "Payment Required (insufficient credits)" },
          "429": {
            "description": "Too Many Requests (max daily resets exceeded or reset in progress)"
          },
          "503": {
            "description": "Service Unavailable (Redis reset failed; credits refunded or support needed)"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/copilot/admin/rate_limit": {
      "get": {
        "tags": ["v2", "admin", "copilot", "admin"],
        "summary": "Get User Rate Limit",
        "description": "Get a user's current usage and effective rate limits. Admin-only.\n\nAccepts either ``user_id`` or ``email`` as a query parameter.\nWhen ``email`` is provided the user is looked up by email first.",
        "operationId": "getV2Get user rate limit",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Email"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRateLimitResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/copilot/admin/rate_limit/reset": {
      "post": {
        "tags": ["v2", "admin", "copilot", "admin"],
        "summary": "Reset User Rate Limit Usage",
        "description": "Reset a user's daily usage counter (and optionally weekly). Admin-only.",
        "operationId": "postV2Reset user rate limit usage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV2Reset_user_rate_limit_usage"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRateLimitResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/copilot/admin/rate_limit/search_users": {
      "get": {
        "tags": ["v2", "admin", "copilot", "admin"],
        "summary": "Search Users by Name or Email",
        "description": "Search users by partial email or name. Admin-only.\n\nQueries the User table directly — returns results even for users\nwithout credit transaction history.",
        "operationId": "getV2Search users by name or email",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "Query" }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 20, "title": "Limit" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/UserSearchResult" },
                  "title": "Response Getv2Search Users By Name Or Email"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/copilot/admin/rate_limit/tier": {
      "get": {
        "tags": ["v2", "admin", "copilot", "admin"],
        "summary": "Get User Rate Limit Tier",
        "description": "Get a user's current rate-limit tier. Admin-only.\n\nReturns 404 if the user does not exist in the database.",
        "operationId": "getV2Get user rate limit tier",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "user_id",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "User Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserTierResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "admin", "copilot", "admin"],
        "summary": "Set User Rate Limit Tier",
        "description": "Set a user's rate-limit tier. Admin-only.\n\nReturns 404 if the user does not exist in the database.",
        "operationId": "postV2Set user rate limit tier",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SetUserTierRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserTierResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Get user credits",
        "operationId": "getV1Get user credits",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": { "type": "integer" },
                  "type": "object",
                  "title": "Response Getv1Get User Credits"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "patch": {
        "tags": ["v1", "credits"],
        "summary": "Fulfill checkout session",
        "operationId": "patchV1Fulfill checkout session",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "credits"],
        "summary": "Request credit top up",
        "operationId": "postV1Request credit top up",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/RequestTopUp" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/admin/add_credits": {
      "post": {
        "tags": ["v2", "admin", "credits", "admin"],
        "summary": "Add Credits to User",
        "operationId": "postV2Add credits to user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV2Add_credits_to_user"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddUserCreditsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/admin/copilot-usage/export": {
      "get": {
        "tags": ["v2", "admin", "credits", "admin"],
        "summary": "Export Copilot Weekly Usage vs Rate Limit",
        "description": "Export per-(user, ISO week) copilot spend with the user's tier limit.\n\nUses the same 90-day window cap and 100k row cap as the credit export.",
        "operationId": "getV2Export copilot weekly usage vs rate limit",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "Start"
            },
            "description": "ISO timestamp (inclusive)"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "End"
            },
            "description": "ISO timestamp (inclusive)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopilotUsageExportResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits/admin/transactions/export": {
      "get": {
        "tags": ["v2", "admin", "credits", "admin"],
        "summary": "Export Credit Transactions",
        "description": "Export CreditTransaction rows in [start, end].\n\nCapped at CREDIT_EXPORT_MAX_DAYS days and CREDIT_EXPORT_MAX_ROWS rows;\nover-cap requests fail fast with 400 so callers narrow the window\ninstead of receiving silently truncated data.",
        "operationId": "getV2Export credit transactions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "Start"
            },
            "description": "ISO timestamp (inclusive)"
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "ISO timestamp (inclusive)",
              "title": "End"
            },
            "description": "ISO timestamp (inclusive)"
          },
          {
            "name": "transaction_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "$ref": "#/components/schemas/CreditTransactionType" },
                { "type": "null" }
              ],
              "title": "Transaction Type"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include inactive rows (e.g. abandoned Stripe checkouts). Off by default so phantom rows aren't surfaced in normal exports.",
              "default": false,
              "title": "Include Inactive"
            },
            "description": "Include inactive rows (e.g. abandoned Stripe checkouts). Off by default so phantom rows aren't surfaced in normal exports."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditTransactionsExportResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits/admin/users_history": {
      "get": {
        "tags": ["v2", "admin", "credits", "admin"],
        "summary": "Get All Users History",
        "operationId": "getV2Get all users history",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Search"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1, "title": "Page" }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 20, "title": "Page Size" }
          },
          {
            "name": "transaction_filter",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "$ref": "#/components/schemas/CreditTransactionType" },
                { "type": "null" }
              ],
              "title": "Transaction Filter"
            }
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Inactive"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserHistoryResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits/auto-top-up": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Get auto top up",
        "operationId": "getV1Get auto top up",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/AutoTopUpConfig" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "credits"],
        "summary": "Configure auto top up",
        "description": "Configure auto top-up settings and perform an immediate top-up if needed.\n\nRaises HTTPException(422) if the request parameters are invalid or if\nthe credit top-up fails.",
        "operationId": "postV1Configure auto top up",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/AutoTopUpConfig" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "title": "Response Postv1Configure Auto Top Up"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/invoices": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "List Stripe invoices",
        "description": "Recent Stripe invoices for the current user.\n\nEach item includes ``hosted_invoice_url`` (Stripe-hosted view) and\n``invoice_pdf_url`` (direct PDF download). Returns an empty list when\nthe credit system is disabled or the user has no Stripe customer yet.",
        "operationId": "getV1List stripe invoices",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 24,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/InvoiceListItem" },
                  "title": "Response Getv1List Stripe Invoices"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits/manage": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Manage payment methods",
        "operationId": "getV1Manage payment methods",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": { "type": "string" },
                  "type": "object",
                  "title": "Response Getv1Manage Payment Methods"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/refunds": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Get refund requests",
        "operationId": "getV1Get refund requests",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/RefundRequest" },
                  "type": "array",
                  "title": "Response Getv1Get Refund Requests"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/stripe_webhook": {
      "post": {
        "tags": ["v1", "credits"],
        "summary": "Handle Stripe webhooks",
        "operationId": "postV1Handle stripe webhooks",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          }
        }
      }
    },
    "/api/credits/subscription": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Get subscription tier, current cost, and all tier costs",
        "operationId": "getSubscriptionStatus",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "credits"],
        "summary": "Update subscription tier or start a Stripe Checkout session",
        "operationId": "updateSubscriptionTier",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubscriptionTierRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/credits/transactions": {
      "get": {
        "tags": ["v1", "credits"],
        "summary": "Get credit history",
        "operationId": "getV1Get credit history",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "transaction_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "title": "Transaction Time"
            }
          },
          {
            "name": "transaction_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Transaction Type"
            }
          },
          {
            "name": "transaction_count_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "title": "Transaction Count Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/TransactionHistory" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/credits/{transaction_key}/refund": {
      "post": {
        "tags": ["v1", "credits"],
        "summary": "Refund credit transaction",
        "operationId": "postV1Refund credit transaction",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "transaction_key",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Transaction Key" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": { "type": "string" },
                "title": "Metadata"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer",
                  "title": "Response Postv1Refund Credit Transaction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/email/": {
      "post": {
        "tags": ["v1", "email"],
        "summary": "Handle Postmark Email Webhooks",
        "operationId": "postV1Handle postmark email webhooks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  { "$ref": "#/components/schemas/PostmarkDeliveryWebhook" },
                  { "$ref": "#/components/schemas/PostmarkBounceWebhook" },
                  {
                    "$ref": "#/components/schemas/PostmarkSpamComplaintWebhook"
                  },
                  { "$ref": "#/components/schemas/PostmarkOpenWebhook" },
                  { "$ref": "#/components/schemas/PostmarkClickWebhook" },
                  {
                    "$ref": "#/components/schemas/PostmarkSubscriptionChangeWebhook"
                  }
                ],
                "title": "Webhook",
                "discriminator": {
                  "propertyName": "RecordType",
                  "mapping": {
                    "Delivery": "#/components/schemas/PostmarkDeliveryWebhook",
                    "Bounce": "#/components/schemas/PostmarkBounceWebhook",
                    "SpamComplaint": "#/components/schemas/PostmarkSpamComplaintWebhook",
                    "Open": "#/components/schemas/PostmarkOpenWebhook",
                    "Click": "#/components/schemas/PostmarkClickWebhook",
                    "SubscriptionChange": "#/components/schemas/PostmarkSubscriptionChangeWebhook"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "APIKeyAuthenticator-X-Postmark-Webhook-Token": [] }]
      }
    },
    "/api/email/unsubscribe": {
      "post": {
        "tags": ["v1", "email"],
        "summary": "One Click Email Unsubscribe",
        "operationId": "postV1One click email unsubscribe",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "Token" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/executions": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "List all executions",
        "operationId": "getV1List all executions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GraphExecutionMeta"
                  },
                  "type": "array",
                  "title": "Response Getv1List All Executions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/executions/admin/execution_accuracy_trends": {
      "get": {
        "tags": ["v2", "admin", "admin", "execution_analytics"],
        "summary": "Get Execution Accuracy Trends and Alerts",
        "description": "Get execution accuracy trends with moving averages and alert detection.\nSimple single-query approach.",
        "operationId": "getV2Get execution accuracy trends and alerts",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "User Id"
            }
          },
          {
            "name": "days_back",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 30, "title": "Days Back" }
          },
          {
            "name": "drop_threshold",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 10.0,
              "title": "Drop Threshold"
            }
          },
          {
            "name": "include_historical",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Historical"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccuracyTrendsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/executions/admin/execution_analytics": {
      "post": {
        "tags": ["v2", "admin", "admin", "execution_analytics"],
        "summary": "Generate Execution Analytics",
        "description": "Generate activity summaries and correctness scores for graph executions.\n\nThis endpoint:\n1. Fetches all completed executions matching the criteria\n2. Identifies executions missing activity_status or correctness_score\n3. Generates missing data using AI in batches\n4. Updates the database with new stats\n5. Returns a detailed report of the analytics operation",
        "operationId": "postV2Generate execution analytics",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutionAnalyticsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionAnalyticsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/executions/admin/execution_analytics/config": {
      "get": {
        "tags": ["v2", "admin", "admin", "execution_analytics"],
        "summary": "Get Execution Analytics Configuration",
        "description": "Get the configuration for execution analytics including:\n- Available AI models with metadata\n- Default system and user prompts\n- Recommended model selection",
        "operationId": "getV2Get execution analytics configuration",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutionAnalyticsConfig"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/executions/cost-summary": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "User cost summary",
        "description": "Aggregated cost breakdown for the calling user's graph executions.",
        "operationId": "getV1User cost summary",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "Window start (UTC). Defaults to start of current calendar month.",
              "title": "Since"
            },
            "description": "Window start (UTC). Defaults to start of current calendar month."
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "type": "string", "format": "date-time" },
                { "type": "null" }
              ],
              "description": "Window end (UTC). Defaults to now.",
              "title": "Until"
            },
            "description": "Window end (UTC). Defaults to now."
          },
          {
            "name": "top_runs_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Maximum number of top-cost runs to return.",
              "default": 10,
              "title": "Top Runs Limit"
            },
            "description": "Maximum number of top-cost runs to return."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserExecutionCostSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/executions/{graph_exec_id}": {
      "delete": {
        "tags": ["v1", "graphs"],
        "summary": "Delete graph execution",
        "operationId": "deleteV1Delete graph execution",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/files/upload": {
      "post": {
        "tags": ["v1", "files"],
        "summary": "Upload file to cloud storage",
        "description": "Upload a file to cloud storage and return a storage key that can be used\nwith FileStoreBlock and AgentFileInputBlock.\n\nArgs:\n    file: The file to upload\n    user_id: The user ID\n    provider: Cloud storage provider (\"gcs\", \"s3\", \"azure\")\n    expiration_hours: Hours until file expires (1-48)\n\nReturns:\n    Dict containing the cloud storage path and signed URL",
        "operationId": "postV1Upload file to cloud storage",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "expiration_hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 24,
              "title": "Expiration Hours"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV1Upload_file_to_cloud_storage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/backend__api__model__UploadFileResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "List user graphs",
        "operationId": "getV1List user graphs",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/GraphMeta" },
                  "type": "array",
                  "title": "Response Getv1List User Graphs"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v1", "graphs"],
        "summary": "Create new graph",
        "operationId": "postV1Create new graph",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CreateGraph" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphModel" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/graphs/{graph_id}": {
      "delete": {
        "tags": ["v1", "graphs"],
        "summary": "Delete graph permanently",
        "operationId": "deleteV1Delete graph permanently",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DeleteGraphResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "Get specific graph",
        "operationId": "getV1Get specific graph",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "integer" }, { "type": "null" }],
              "title": "Version"
            }
          },
          {
            "name": "for_export",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "For Export"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphModel" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["v1", "graphs"],
        "summary": "Update graph version",
        "operationId": "putV1Update graph version",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Graph" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphModel" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/execute/{graph_version}": {
      "post": {
        "tags": ["v1", "graphs"],
        "summary": "Execute graph agent",
        "operationId": "postV1Execute graph agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "graph_version",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [{ "type": "integer" }, { "type": "null" }],
              "title": "Graph Version"
            }
          },
          {
            "name": "preset_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Preset Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV1Execute_graph_agent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphExecutionMeta" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "402": {
            "description": "Payment required: NO_TIER paywall, or insufficient credit balance"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "503": { "description": "Subscription state temporarily unavailable" }
        }
      }
    },
    "/api/graphs/{graph_id}/executions": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "List graph executions",
        "operationId": "getV1List graph executions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number (1-indexed)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number (1-indexed)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of executions per page",
              "default": 25,
              "title": "Page Size"
            },
            "description": "Number of executions per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphExecutionsPaginated"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/executions/{graph_exec_id}": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "Get execution details",
        "operationId": "getV1Get execution details",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    { "$ref": "#/components/schemas/GraphExecution" },
                    { "$ref": "#/components/schemas/GraphExecutionWithNodes" }
                  ],
                  "title": "Response Getv1Get Execution Details"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/executions/{graph_exec_id}/share": {
      "delete": {
        "tags": ["v1"],
        "summary": "Disable Execution Sharing",
        "description": "Disable sharing for a graph execution.",
        "operationId": "deleteV1DisableExecutionSharing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v1"],
        "summary": "Enable Execution Sharing",
        "description": "Enable sharing for a graph execution.",
        "operationId": "postV1EnableExecutionSharing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareRequest",
                "default": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/backend__api__features__v1__ShareResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/executions/{graph_exec_id}/stop": {
      "post": {
        "tags": ["v1", "graphs"],
        "summary": "Stop graph execution",
        "operationId": "postV1Stop graph execution",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    { "$ref": "#/components/schemas/GraphExecutionMeta" },
                    { "type": "null" }
                  ],
                  "title": "Response Postv1Stop Graph Execution"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/schedules": {
      "get": {
        "tags": ["v1", "schedules"],
        "summary": "List execution schedules for a graph",
        "operationId": "getV1List execution schedules for a graph",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GraphExecutionJobInfo"
                  },
                  "title": "Response Getv1List Execution Schedules For A Graph"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v1", "schedules"],
        "summary": "Create execution schedule",
        "operationId": "postV1Create execution schedule",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the graph to schedule",
              "title": "Graph Id"
            },
            "description": "ID of the graph to schedule"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCreationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphExecutionJobInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/settings": {
      "patch": {
        "tags": ["v1", "graphs"],
        "summary": "Update graph settings",
        "description": "Update graph settings for the user's library agent.",
        "operationId": "patchV1Update graph settings",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/GraphSettings" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphSettings" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/versions": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "Get all graph versions",
        "operationId": "getV1Get all graph versions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/GraphModel" },
                  "title": "Response Getv1Get All Graph Versions"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/versions/active": {
      "put": {
        "tags": ["v1", "graphs"],
        "summary": "Set active graph version",
        "operationId": "putV1Set active graph version",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SetGraphActiveVersion" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/graphs/{graph_id}/versions/{version}": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "Get graph version",
        "operationId": "getV1Get graph version",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "anyOf": [{ "type": "integer" }, { "type": "null" }],
              "title": "Version"
            }
          },
          {
            "name": "for_export",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "For Export"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphModel" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/ayrshare/sso_url": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Get Ayrshare Sso Url",
        "description": "Generate a JWT SSO URL so the user can link their social accounts.\n\nThe per-user Ayrshare profile key is provisioned and persisted as a\nstandard ``is_managed=True`` credential by\n:class:`~backend.integrations.managed_providers.ayrshare.AyrshareManagedProvider`.\nThis endpoint only signs a short-lived JWT pointing at the Ayrshare-\nhosted social-linking page; all profile lifecycle logic lives with the\nmanaged provider.",
        "operationId": "getV1GetAyrshareSsoUrl",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/AyrshareSSOResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/integrations/credentials": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "List Credentials",
        "operationId": "getV1List credentials",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CredentialsMetaResponse"
                  },
                  "type": "array",
                  "title": "Response Getv1List Credentials"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/integrations/providers": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "List Providers",
        "description": "Get metadata for every available provider.\n\nReturns both statically defined providers (from ``ProviderName`` enum) and\ndynamically registered providers (from SDK decorators). Each entry includes\na ``description`` declared via ``ProviderBuilder.with_description(...)`` in\nthe provider's ``_config.py``.\n\nNote: The complete list of provider names is also available as a constant\nin the generated TypeScript client via PROVIDER_NAMES.",
        "operationId": "getV1ListProviders",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/ProviderMetadata" },
                  "type": "array",
                  "title": "Response Getv1Listproviders"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/providers/constants": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Get Provider Constants",
        "description": "Get provider names as constants.\n\nThis endpoint returns a model with provider names as constants,\nspecifically designed for OpenAPI code generation tools to create\nTypeScript constants.",
        "operationId": "getV1GetProviderConstants",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProviderConstants" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/providers/enum-example": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Get Provider Enum Example",
        "description": "Example endpoint that uses the CompleteProviderNames enum.\n\nThis endpoint exists to ensure that the CompleteProviderNames enum is included\nin the OpenAPI schema, which will cause Orval to generate it as a\nTypeScript enum/constant.",
        "operationId": "getV1GetProviderEnumExample",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderEnumResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/providers/names": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Get Provider Names",
        "description": "Get all provider names in a structured format.\n\nThis endpoint is specifically designed to expose the provider names\nin the OpenAPI schema so that code generators like Orval can create\nappropriate TypeScript constants.",
        "operationId": "getV1GetProviderNames",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderNamesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/providers/system": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "List System Providers",
        "description": "Get a list of providers that have platform credits (system credentials) available.\n\nThese providers can be used without the user providing their own API keys.",
        "operationId": "getV1ListSystemProviders",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "type": "string" },
                  "type": "array",
                  "title": "Response Getv1Listsystemproviders"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/webhooks/{webhook_id}/ping": {
      "post": {
        "tags": ["v1", "integrations"],
        "summary": "Webhook Ping",
        "operationId": "postV1WebhookPing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Our ID for the webhook" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/callback": {
      "post": {
        "tags": ["v1", "integrations"],
        "summary": "Exchange OAuth code for tokens",
        "operationId": "postV1Exchange oauth code for tokens",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The target provider for this OAuth exchange",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV1Exchange_oauth_code_for_tokens"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsMetaResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/credentials": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "List Credentials By Provider",
        "operationId": "getV1ListCredentialsByProvider",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider to list credentials for",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CredentialsMetaResponse"
                  },
                  "title": "Response Getv1Listcredentialsbyprovider"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v1", "integrations"],
        "summary": "Create Credentials",
        "operationId": "postV1Create credentials",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider to create credentials for",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  { "$ref": "#/components/schemas/OAuth2Credentials" },
                  { "$ref": "#/components/schemas/APIKeyCredentials" },
                  { "$ref": "#/components/schemas/UserPasswordCredentials" },
                  { "$ref": "#/components/schemas/HostScopedCredentials" }
                ],
                "discriminator": {
                  "propertyName": "type",
                  "mapping": {
                    "oauth2": "#/components/schemas/OAuth2Credentials",
                    "api_key": "#/components/schemas/APIKeyCredentials",
                    "user_password": "#/components/schemas/UserPasswordCredentials",
                    "host_scoped": "#/components/schemas/HostScopedCredentials"
                  }
                },
                "title": "Credentials"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsMetaResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/credentials/{cred_id}": {
      "delete": {
        "tags": ["v1", "integrations"],
        "summary": "Delete Credentials",
        "operationId": "deleteV1DeleteCredentials",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider to delete credentials for",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          },
          {
            "name": "cred_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The ID of the credentials to delete"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "title": "Whether to proceed if any linked webhooks are still in use",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/CredentialsDeletionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CredentialsDeletionNeedsConfirmationResponse"
                    }
                  ],
                  "title": "Response Deletev1Deletecredentials"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Get Specific Credential By ID",
        "operationId": "getV1Get specific credential by id",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider to retrieve credentials for",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          },
          {
            "name": "cred_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The ID of the credentials to retrieve"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsMetaResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/credentials/{cred_id}/picker-token": {
      "post": {
        "tags": ["v1", "integrations"],
        "summary": "Issue a short-lived access token for a provider-hosted picker",
        "description": "Return the raw access token for an OAuth2 credential so the frontend\ncan initialize a provider-hosted picker (e.g. Google Drive Picker).\n\n`GET /{provider}/credentials/{cred_id}` deliberately strips secrets (see\n`CredentialsMetaResponse` + `TestGetCredentialReturnsMetaOnly` in\n`router_test.py`). That hardening broke the Drive picker, which needs the\nraw access token to call `google.picker.Builder.setOAuthToken(...)`. This\nendpoint carves a narrow, explicit hole: the caller must own the\ncredential, it must be OAuth2, and the endpoint returns only the access\ntoken + its expiry — nothing else about the credential. SDK-default\ncredentials are excluded for the same reason as `get_credential`.",
        "operationId": "postV1GetPickerToken",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider that owns the credentials",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          },
          {
            "name": "cred_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The ID of the OAuth2 credentials to mint a token from"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PickerTokenResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/login": {
      "get": {
        "tags": ["v1", "integrations"],
        "summary": "Initiate OAuth flow",
        "operationId": "getV1Initiate oauth flow",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "The provider to initiate an OAuth flow for",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          },
          {
            "name": "scopes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "title": "Comma-separated list of authorization scopes",
              "default": ""
            }
          },
          {
            "name": "credential_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "ID of existing credential to upgrade scopes for"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LoginResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/integrations/{provider}/webhooks/{webhook_id}/ingress": {
      "post": {
        "tags": ["v1", "integrations"],
        "summary": "Webhook Ingress Generic",
        "operationId": "postV1WebhookIngressGeneric",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider where the webhook was registered",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            }
          },
          {
            "name": "webhook_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Our ID for the webhook" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents": {
      "get": {
        "tags": ["v2", "library", "private"],
        "summary": "List Library Agents",
        "description": "Get all agents in the user's library (both created and saved).",
        "operationId": "getV2List library agents",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "search_term",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Search term to filter agents",
              "title": "Search Term"
            },
            "description": "Search term to filter agents"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LibraryAgentSort",
              "description": "Criteria to sort results by",
              "default": "updatedAt"
            },
            "description": "Criteria to sort results by"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number to retrieve (must be >= 1)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number to retrieve (must be >= 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Number of agents per page (must be >= 1)",
              "default": 15,
              "title": "Page Size"
            },
            "description": "Number of agents per page (must be >= 1)"
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Filter by folder ID",
              "title": "Folder Id"
            },
            "description": "Filter by folder ID"
          },
          {
            "name": "include_root_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only return agents without a folder (root-level agents)",
              "default": false,
              "title": "Include Root Only"
            },
            "description": "Only return agents without a folder (root-level agents)"
          },
          {
            "name": "is_hidden",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "boolean" }, { "type": "null" }],
              "description": "Filter by hidden status. True = only hidden, False = only non-hidden, omit = all agents.",
              "title": "Is Hidden"
            },
            "description": "Filter by hidden status. True = only hidden, False = only non-hidden, omit = all agents."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAgentResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "library", "private"],
        "summary": "Add Marketplace Agent",
        "description": "Add an agent from the marketplace to the user's library.",
        "operationId": "postV2Add marketplace agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV2Add_marketplace_agent"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/by-graph/{graph_id}": {
      "get": {
        "tags": ["v2", "library", "private"],
        "summary": "Get Library Agent By Graph Id",
        "operationId": "getV2GetLibraryAgentByGraphId",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "integer" }, { "type": "null" }],
              "title": "Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/favorites": {
      "get": {
        "tags": ["v2", "library", "private"],
        "summary": "List Favorite Library Agents",
        "description": "Get all favorite agents in the user's library.",
        "operationId": "getV2List favorite library agents",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number to retrieve (must be >= 1)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number to retrieve (must be >= 1)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Number of agents per page (must be >= 1)",
              "default": 15,
              "title": "Page Size"
            },
            "description": "Number of agents per page (must be >= 1)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAgentResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/marketplace/{store_listing_version_id}": {
      "get": {
        "tags": ["v2", "library", "private", "store", "library"],
        "summary": "Get Agent By Store ID",
        "description": "Get Library Agent from Store Listing Version ID.",
        "operationId": "getV2Get agent by store id",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    { "$ref": "#/components/schemas/LibraryAgent" },
                    { "type": "null" }
                  ],
                  "title": "Response Getv2Get Agent By Store Id"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/{library_agent_id}": {
      "delete": {
        "tags": ["v2", "library", "private"],
        "summary": "Delete Library Agent",
        "description": "Soft-delete the specified library agent.",
        "operationId": "deleteV2Delete library agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "library_agent_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Library Agent Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v2", "library", "private"],
        "summary": "Get Library Agent",
        "operationId": "getV2Get library agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "library_agent_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Library Agent Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["v2", "library", "private"],
        "summary": "Update Library Agent",
        "description": "Update the library agent with the given fields.",
        "operationId": "patchV2Update library agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "library_agent_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Library Agent Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAgentUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/{library_agent_id}/fork": {
      "post": {
        "tags": ["v2", "library", "private"],
        "summary": "Fork Library Agent",
        "operationId": "postV2Fork library agent",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "library_agent_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Library Agent Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/agents/{library_agent_id}/triggers": {
      "get": {
        "tags": ["v2", "library", "private"],
        "summary": "List Trigger Agents",
        "description": "List trigger agents linked to the given parent agent.",
        "operationId": "getV2List trigger agents",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "library_agent_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Library Agent Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/LibraryAgent" },
                  "title": "Response Getv2List Trigger Agents"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/folders": {
      "get": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "List Library Folders",
        "description": "List folders for the authenticated user.\n\nArgs:\n    user_id: ID of the authenticated user.\n    parent_id: Optional parent folder ID to filter by.\n    include_relations: Whether to include agent and subfolder relations for counts.\n\nReturns:\n    A FolderListResponse containing folders.",
        "operationId": "getV2List library folders",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "parent_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Filter by parent folder ID. If not provided, returns root-level folders.",
              "title": "Parent Id"
            },
            "description": "Filter by parent folder ID. If not provided, returns root-level folders."
          },
          {
            "name": "include_relations",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include agent and subfolder relations (for counts)",
              "default": true,
              "title": "Include Relations"
            },
            "description": "Include agent and subfolder relations (for counts)"
          }
        ],
        "responses": {
          "200": {
            "description": "List of folders",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FolderListResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      },
      "post": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Create Folder",
        "description": "Create a new folder.\n\nArgs:\n    payload: The folder creation request.\n    user_id: ID of the authenticated user.\n\nReturns:\n    The created LibraryFolder.",
        "operationId": "postV2Create folder",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/FolderCreateRequest" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Folder created successfully",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryFolder" }
              }
            }
          },
          "400": { "description": "Validation error" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Parent folder not found" },
          "409": { "description": "Folder name conflict" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      }
    },
    "/api/library/folders/agents/bulk-move": {
      "post": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Bulk Move Agents",
        "description": "Move multiple agents to a folder.\n\nArgs:\n    payload: The bulk move request with agent IDs and target folder.\n    user_id: ID of the authenticated user.\n\nReturns:\n    The updated LibraryAgents.",
        "operationId": "postV2Bulk move agents",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/BulkMoveAgentsRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Agents moved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/LibraryAgent" },
                  "type": "array",
                  "title": "Response Postv2Bulk Move Agents"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Folder not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/library/folders/tree": {
      "get": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Get Folder Tree",
        "description": "Get the full folder tree for the authenticated user.\n\nArgs:\n    user_id: ID of the authenticated user.\n\nReturns:\n    A FolderTreeResponse containing the nested folder structure.",
        "operationId": "getV2Get folder tree",
        "responses": {
          "200": {
            "description": "Folder tree structure",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/FolderTreeResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "500": { "description": "Server error" }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/library/folders/{folder_id}": {
      "delete": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Delete Folder",
        "description": "Soft-delete a folder and all its contents.\n\nArgs:\n    folder_id: ID of the folder to delete.\n    user_id: ID of the authenticated user.\n\nReturns:\n    204 No Content if successful.",
        "operationId": "deleteV2Delete folder",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Folder Id" }
          }
        ],
        "responses": {
          "204": { "description": "Folder deleted successfully" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Folder not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      },
      "get": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Get Folder",
        "description": "Get a specific folder.\n\nArgs:\n    folder_id: ID of the folder to retrieve.\n    user_id: ID of the authenticated user.\n\nReturns:\n    The requested LibraryFolder.",
        "operationId": "getV2Get folder",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Folder Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Folder details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryFolder" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Folder not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      },
      "patch": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Update Folder",
        "description": "Update a folder's properties.\n\nArgs:\n    folder_id: ID of the folder to update.\n    payload: The folder update request.\n    user_id: ID of the authenticated user.\n\nReturns:\n    The updated LibraryFolder.",
        "operationId": "patchV2Update folder",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Folder Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/FolderUpdateRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Folder updated successfully",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryFolder" }
              }
            }
          },
          "400": { "description": "Validation error" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Folder not found" },
          "409": { "description": "Folder name conflict" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      }
    },
    "/api/library/folders/{folder_id}/move": {
      "post": {
        "tags": ["v2", "library", "folders", "private"],
        "summary": "Move Folder",
        "description": "Move a folder to a new parent.\n\nArgs:\n    folder_id: ID of the folder to move.\n    payload: The move request with target parent.\n    user_id: ID of the authenticated user.\n\nReturns:\n    The moved LibraryFolder.",
        "operationId": "postV2Move folder",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "folder_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Folder Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/FolderMoveRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Folder moved successfully",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryFolder" }
              }
            }
          },
          "400": { "description": "Validation error (circular reference)" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Folder or target parent not found" },
          "409": { "description": "Folder name conflict in target location" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": { "description": "Server error" }
        }
      }
    },
    "/api/library/presets": {
      "get": {
        "tags": ["v2", "presets"],
        "summary": "List presets",
        "description": "Retrieve a paginated list of presets for the current user.",
        "operationId": "getV2List presets",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 10,
              "title": "Page Size"
            }
          },
          {
            "name": "graph_id",
            "in": "query",
            "required": true,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Allows to filter presets by a specific agent graph",
              "title": "Graph Id"
            },
            "description": "Allows to filter presets by a specific agent graph"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAgentPresetResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "presets"],
        "summary": "Create a new preset",
        "description": "Create a new preset for the current user.",
        "operationId": "postV2Create a new preset",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LibraryAgentPresetCreatable"
                  },
                  {
                    "$ref": "#/components/schemas/LibraryAgentPresetCreatableFromGraphExecution"
                  }
                ],
                "title": "Preset"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/presets/setup-trigger": {
      "post": {
        "tags": ["v2", "presets"],
        "summary": "Setup Trigger",
        "description": "Sets up a webhook-triggered `LibraryAgentPreset` for a `LibraryAgent`.\nReturns the correspondingly created `LibraryAgentPreset` with `webhook_id` set.",
        "operationId": "postV2SetupTrigger",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggeredPresetSetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/library/presets/{preset_id}": {
      "delete": {
        "tags": ["v2", "presets"],
        "summary": "Delete a preset",
        "description": "Delete an existing preset by its ID.",
        "operationId": "deleteV2Delete a preset",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Preset Id" }
          }
        ],
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v2", "presets"],
        "summary": "Get a specific preset",
        "description": "Retrieve details for a specific preset by its ID.",
        "operationId": "getV2Get a specific preset",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Preset Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["v2", "presets"],
        "summary": "Update an existing preset",
        "description": "Update an existing preset by its ID.",
        "operationId": "patchV2Update an existing preset",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Preset Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryAgentPresetUpdatable"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgentPreset" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/library/presets/{preset_id}/execute": {
      "post": {
        "tags": ["v2", "presets", "presets"],
        "summary": "Execute a preset",
        "description": "Execute a preset with the given graph and node input for the current user.",
        "operationId": "postV2Execute a preset",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "preset_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Preset Id" }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV2Execute_a_preset"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/GraphExecutionMeta" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "402": {
            "description": "Subscription required (NO_TIER user, paywall on)"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "503": { "description": "Subscription state temporarily unavailable" }
        }
      }
    },
    "/api/mcp/discover-tools": {
      "post": {
        "tags": ["v2", "mcp", "mcp"],
        "summary": "Discover available tools on an MCP server",
        "description": "Connect to an MCP server and return its available tools.\n\nIf the user has a stored MCP credential for this server URL, it will be\nused automatically — no need to pass an explicit auth token.",
        "operationId": "postV2Discover available tools on an mcp server",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/DiscoverToolsRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverToolsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/mcp/oauth/callback": {
      "post": {
        "tags": ["v2", "mcp", "mcp"],
        "summary": "Exchange OAuth code for MCP tokens",
        "description": "Exchange the authorization code for tokens and store the credential.\n\nThe frontend calls this after receiving the OAuth code from the popup.\nOn success, subsequent ``/discover-tools`` calls for the same server URL\nwill automatically use the stored credential.",
        "operationId": "postV2Exchange oauth code for mcp tokens",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPOAuthCallbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsMetaResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/mcp/oauth/login": {
      "post": {
        "tags": ["v2", "mcp", "mcp"],
        "summary": "Initiate OAuth login for an MCP server",
        "description": "Discover OAuth metadata from the MCP server and return a login URL.\n\n1. Discovers the protected-resource metadata (RFC 9728)\n2. Fetches the authorization server metadata (RFC 8414)\n3. Performs Dynamic Client Registration (RFC 7591) if available\n4. Returns the authorization URL for the frontend to open in a popup",
        "operationId": "postV2Initiate oauth login for an mcp server",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MCPOAuthLoginRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPOAuthLoginResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/mcp/token": {
      "post": {
        "tags": ["v2", "mcp", "mcp"],
        "summary": "Store a bearer token for an MCP server",
        "description": "Store a manually provided bearer token as an MCP credential.\n\nUsed by the Copilot MCPSetupCard when the server doesn't support the MCP\nOAuth discovery flow (returns 400 from /oauth/login).  Subsequent\n``run_mcp_tool`` calls will automatically pick up the token via\n``_auto_lookup_credential``.",
        "operationId": "postV2Store a bearer token for an mcp server",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MCPStoreTokenRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialsMetaResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/oauth/app/{client_id}": {
      "get": {
        "tags": ["oauth"],
        "summary": "Get Oauth App Info",
        "description": "Get public information about an OAuth application.\n\nThis endpoint is used by the consent screen to display application details\nto the user before they authorize access.\n\nReturns:\n- name: Application name\n- description: Application description (if provided)\n- scopes: List of scopes the application is allowed to request",
        "operationId": "getOauthGetOauthAppInfo",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Client Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthApplicationPublicInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Application not found or disabled" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/apps/mine": {
      "get": {
        "tags": ["oauth"],
        "summary": "List My Oauth Apps",
        "description": "List all OAuth applications owned by the current user.\n\nReturns a list of OAuth applications with their details including:\n- id, name, description, logo_url\n- client_id (public identifier)\n- redirect_uris, grant_types, scopes\n- is_active status\n- created_at, updated_at timestamps\n\nNote: client_secret is never returned for security reasons.",
        "operationId": "getOauthListMyOauthApps",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OAuthApplicationInfo"
                  },
                  "type": "array",
                  "title": "Response Getoauthlistmyoauthapps"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/oauth/apps/{app_id}/logo": {
      "patch": {
        "tags": ["oauth"],
        "summary": "Update App Logo",
        "description": "Update the logo URL for an OAuth application.\n\nOnly the application owner can update the logo.\nThe logo should be uploaded first using the media upload endpoint,\nthen this endpoint is called with the resulting URL.\n\nLogo requirements:\n- Must be square (1:1 aspect ratio)\n- Minimum 512x512 pixels\n- Maximum 2048x2048 pixels\n\nReturns the updated application info.",
        "operationId": "patchOauthUpdateAppLogo",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "App Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/UpdateAppLogoRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthApplicationInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/apps/{app_id}/logo/upload": {
      "post": {
        "tags": ["oauth"],
        "summary": "Upload App Logo",
        "description": "Upload a logo image for an OAuth application.\n\nRequirements:\n- Image must be square (1:1 aspect ratio)\n- Minimum 512x512 pixels\n- Maximum 2048x2048 pixels\n- Allowed formats: JPEG, PNG, WebP\n- Maximum file size: 3MB\n\nThe image is uploaded to cloud storage and the app's logoUrl is updated.\nReturns the updated application info.",
        "operationId": "postOauthUploadAppLogo",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "App Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_postOauthUploadAppLogo"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthApplicationInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/apps/{app_id}/status": {
      "patch": {
        "tags": ["oauth"],
        "summary": "Update App Status",
        "description": "Enable or disable an OAuth application.\n\nOnly the application owner can update the status.\nWhen disabled, the application cannot be used for new authorizations\nand existing access tokens will fail validation.\n\nReturns the updated application info.",
        "operationId": "patchOauthUpdateAppStatus",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "App Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_patchOauthUpdateAppStatus"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthApplicationInfo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/authorize": {
      "post": {
        "tags": ["oauth"],
        "summary": "Authorize",
        "description": "OAuth 2.0 Authorization Endpoint\n\nUser must be logged in (authenticated with Supabase JWT).\nThis endpoint creates an authorization code and returns a redirect URL.\n\nPKCE (Proof Key for Code Exchange) is REQUIRED for all authorization requests.\n\nThe frontend consent screen should call this endpoint after the user approves,\nthen redirect the user to the returned `redirect_url`.\n\nRequest Body:\n- client_id: The OAuth application's client ID\n- redirect_uri: Where to redirect after authorization (must match registered URI)\n- scopes: List of permissions (e.g., \"EXECUTE_GRAPH READ_GRAPH\")\n- state: Anti-CSRF token provided by client (will be returned in redirect)\n- response_type: Must be \"code\" (for authorization code flow)\n- code_challenge: PKCE code challenge (required)\n- code_challenge_method: \"S256\" (recommended) or \"plain\"\n\nReturns:\n- redirect_url: The URL to redirect the user to (includes authorization code)\n\nError cases return a redirect_url with error parameters, or raise HTTPException\nfor critical errors (like invalid redirect_uri).",
        "operationId": "postOauthAuthorize",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/AuthorizeRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/AuthorizeResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/oauth/introspect": {
      "post": {
        "tags": ["oauth"],
        "summary": "Introspect",
        "description": "OAuth 2.0 Token Introspection Endpoint (RFC 7662)\n\nAllows clients to check if a token is valid and get its metadata.\n\nReturns:\n- active: Whether the token is currently active\n- scopes: List of authorized scopes (if active)\n- client_id: The client the token was issued to (if active)\n- user_id: The user the token represents (if active)\n- exp: Expiration timestamp (if active)\n- token_type: \"access_token\" or \"refresh_token\" (if active)",
        "operationId": "postOauthIntrospect",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_postOauthIntrospect"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenIntrospectionResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/revoke": {
      "post": {
        "tags": ["oauth"],
        "summary": "Revoke",
        "description": "OAuth 2.0 Token Revocation Endpoint (RFC 7009)\n\nAllows clients to revoke an access or refresh token.\n\nNote: Revoking a refresh token does NOT revoke associated access tokens.\nRevoking an access token does NOT revoke the associated refresh token.",
        "operationId": "postOauthRevoke",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Body_postOauthRevoke" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/oauth/token": {
      "post": {
        "tags": ["oauth"],
        "summary": "Token",
        "description": "OAuth 2.0 Token Endpoint\n\nExchanges authorization code or refresh token for access token.\n\nGrant Types:\n1. authorization_code: Exchange authorization code for tokens\n   - Required: grant_type, code, redirect_uri, client_id, client_secret\n   - Optional: code_verifier (required if PKCE was used)\n\n2. refresh_token: Exchange refresh token for new access token\n   - Required: grant_type, refresh_token, client_id, client_secret\n\nReturns:\n- access_token: Bearer token for API access (1 hour TTL)\n- token_type: \"Bearer\"\n- expires_in: Seconds until access token expires\n- refresh_token: Token for refreshing access (30 days TTL)\n- scopes: List of scopes",
        "operationId": "postOauthToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  { "$ref": "#/components/schemas/TokenRequestByCode" },
                  { "$ref": "#/components/schemas/TokenRequestByRefreshToken" }
                ],
                "title": "Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/TokenResponse" }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/onboarding": {
      "get": {
        "tags": ["v1", "onboarding"],
        "summary": "Onboarding state",
        "operationId": "getV1Onboarding state",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserOnboarding" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "patch": {
        "tags": ["v1", "onboarding"],
        "summary": "Update onboarding state",
        "operationId": "patchV1Update onboarding state",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/UserOnboardingUpdate" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserOnboarding" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/onboarding/agents": {
      "get": {
        "tags": ["v1", "onboarding"],
        "summary": "Recommended onboarding agents",
        "operationId": "getV1Recommended onboarding agents",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/StoreAgentDetails" },
                  "type": "array",
                  "title": "Response Getv1Recommended Onboarding Agents"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/onboarding/completed": {
      "get": {
        "tags": ["v1", "onboarding", "public"],
        "summary": "Check if onboarding is completed",
        "operationId": "getV1Check if onboarding is completed",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingStatusResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/onboarding/profile": {
      "post": {
        "tags": ["v1", "onboarding"],
        "summary": "Submit onboarding profile",
        "operationId": "postV1Submit onboarding profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingProfileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/onboarding/reset": {
      "post": {
        "tags": ["v1", "onboarding"],
        "summary": "Reset onboarding progress",
        "operationId": "postV1Reset onboarding progress",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/UserOnboarding" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/onboarding/step": {
      "post": {
        "tags": ["v1", "onboarding"],
        "summary": "Complete onboarding step",
        "operationId": "postV1Complete onboarding step",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "step",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "WELCOME",
                "USAGE_REASON",
                "INTEGRATIONS",
                "AGENT_CHOICE",
                "AGENT_NEW_RUN",
                "AGENT_INPUT",
                "CONGRATS",
                "VISIT_COPILOT",
                "BUILDER_OPEN"
              ],
              "type": "string",
              "title": "Step"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/otto/ask": {
      "post": {
        "tags": ["v2", "otto"],
        "summary": "Proxy Otto Chat Request",
        "description": "Proxy requests to Otto API while adding necessary security headers and logging.\nRequires an authenticated user.",
        "operationId": "postV2Proxy otto chat request",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ChatRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ApiResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/platform-linking/links": {
      "get": {
        "tags": ["platform-linking"],
        "summary": "List all platform servers linked to the authenticated user",
        "operationId": "getPlatform-linkingList all platform servers linked to the authenticated user",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/PlatformLinkInfo" },
                  "type": "array",
                  "title": "Response Getplatform-Linkinglist All Platform Servers Linked To The Authenticated User"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/platform-linking/links/{link_id}": {
      "delete": {
        "tags": ["platform-linking"],
        "summary": "Unlink a platform server",
        "operationId": "deletePlatform-linkingUnlink a platform server",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Link Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DeleteLinkResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/platform-linking/platforms": {
      "get": {
        "tags": ["platform-linking"],
        "summary": "List bot platforms enabled on this deployment plus the caller's links",
        "operationId": "list_bot_platforms",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/BotPlatformInfo" },
                  "type": "array",
                  "title": "Response List Bot Platforms"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/platform-linking/tokens/{token}/confirm": {
      "post": {
        "tags": ["platform-linking"],
        "summary": "Confirm a SERVER link token (user must be authenticated)",
        "operationId": "postPlatform-linkingConfirm a server link token (user must be authenticated)",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ConfirmLinkResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/platform-linking/tokens/{token}/info": {
      "get": {
        "tags": ["platform-linking"],
        "summary": "Get display info for a link token",
        "operationId": "getPlatform-linkingGet display info for a link token",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkTokenInfoResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/platform-linking/user-links": {
      "get": {
        "tags": ["platform-linking"],
        "summary": "List all DM links for the authenticated user",
        "operationId": "getPlatform-linkingList all dm links for the authenticated user",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PlatformUserLinkInfo"
                  },
                  "type": "array",
                  "title": "Response Getplatform-Linkinglist All Dm Links For The Authenticated User"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/platform-linking/user-links/{link_id}": {
      "delete": {
        "tags": ["platform-linking"],
        "summary": "Unlink a DM / user link",
        "operationId": "deletePlatform-linkingUnlink a dm / user link",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Link Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DeleteLinkResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/platform-linking/user-tokens/{token}/confirm": {
      "post": {
        "tags": ["platform-linking"],
        "summary": "Confirm a USER link token (user must be authenticated)",
        "operationId": "postPlatform-linkingConfirm a user link token (user must be authenticated)",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfirmUserLinkResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/public/shared/chats/{share_token}": {
      "get": {
        "tags": ["v2", "chat", "share", "public", "chat", "share", "public"],
        "summary": "Get Shared Chat",
        "operationId": "getV2GetSharedChat",
        "parameters": [
          {
            "name": "share_token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "Share Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SharedChatSession" }
              }
            }
          },
          "404": { "description": "Shared chat not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/public/shared/chats/{share_token}/files/{file_id}/download": {
      "get": {
        "tags": ["v2", "chat", "share", "public", "chat", "share", "public"],
        "summary": "Download a file from a shared chat",
        "description": "Download a workspace file allowlisted by a shared chat (no auth).\n\nReturns uniform 404 for every failure mode to prevent enumeration —\nindistinguishable from \"unknown token\" or \"wrong file id\".",
        "operationId": "download_shared_chat_file",
        "parameters": [
          {
            "name": "share_token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "Share Token"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "404": {
            "description": "Uniform 404 for every failure mode (unknown token, wrong file id, file no longer present) — prevents enumeration."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/public/shared/chats/{share_token}/messages": {
      "get": {
        "tags": ["v2", "chat", "share", "public", "chat", "share", "public"],
        "summary": "Get Shared Chat Messages",
        "operationId": "getV2GetSharedChatMessages",
        "parameters": [
          {
            "name": "share_token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "Share Token"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 50, "title": "Limit" }
          },
          {
            "name": "before_sequence",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "integer" }, { "type": "null" }],
              "title": "Before Sequence"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedChatMessagesPage"
                }
              }
            }
          },
          "400": { "description": "Invalid limit (must be 1..200)" },
          "404": { "description": "Shared chat not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/public/shared/{share_token}": {
      "get": {
        "tags": ["v1"],
        "summary": "Get Shared Execution",
        "description": "Get a shared graph execution by share token (no auth required).",
        "operationId": "getV1GetSharedExecution",
        "parameters": [
          {
            "name": "share_token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "Share Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedExecutionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/public/shared/{share_token}/files/{file_id}/download": {
      "get": {
        "tags": ["v1", "graphs"],
        "summary": "Download a file from a shared execution",
        "description": "Download a workspace file from a shared execution (no auth required).\n\nValidates that the file was explicitly exposed when sharing was enabled.\nReturns a uniform 404 for all failure modes to prevent enumeration attacks.",
        "operationId": "download_shared_file",
        "parameters": [
          {
            "name": "share_token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "Share Token"
            }
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
              "title": "File Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/push/subscribe": {
      "post": {
        "tags": ["push"],
        "summary": "Register a push subscription for the current user",
        "operationId": "postPushRegister a push subscription for the current user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/PushSubscribeRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/push/unsubscribe": {
      "post": {
        "tags": ["push"],
        "summary": "Remove a push subscription",
        "operationId": "postPushRemove a push subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PushUnsubscribeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": { "description": "Successful Response" },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/push/vapid-key": {
      "get": {
        "tags": ["push"],
        "summary": "Get VAPID public key for push subscription",
        "operationId": "getPushGet vapid public key for push subscription",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VapidPublicKeyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/review/action": {
      "post": {
        "tags": ["v2", "executions", "review", "v2", "executions", "review"],
        "summary": "Process Review Action",
        "description": "Process reviews with approve or reject actions.",
        "operationId": "postV2ProcessReviewAction",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ReviewRequest" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ReviewResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/review/execution/{graph_exec_id}": {
      "get": {
        "tags": ["v2", "executions", "review", "v2", "executions", "review"],
        "summary": "Get Pending Reviews for Execution",
        "description": "Get all pending reviews for a specific graph execution.\n\nRetrieves all reviews with status \"WAITING\" for the specified graph execution\nthat belong to the authenticated user. Results are ordered by creation time\n(oldest first) to preserve review order within the execution.\n\nArgs:\n    graph_exec_id: ID of the graph execution to get reviews for\n    user_id: Authenticated user ID from security dependency\n\nReturns:\n    List of pending review objects for the specified execution\n\nRaises:\n    HTTPException:\n        - 404: If the graph execution doesn't exist or isn't owned by this user\n        - 500: If authentication fails or database error occurs\n\nNote:\n    Only returns reviews owned by the authenticated user for security.\n    Reviews with invalid status are excluded with warning logs.",
        "operationId": "getV2Get pending reviews for execution",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_exec_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Graph Exec Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "List of pending reviews for the execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingHumanReviewModel"
                  },
                  "title": "Response Getv2Get Pending Reviews For Execution"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Graph execution not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": { "application/json": {} }
          }
        }
      }
    },
    "/api/review/pending": {
      "get": {
        "tags": ["v2", "executions", "review", "v2", "executions", "review"],
        "summary": "Get Pending Reviews",
        "description": "Get all pending reviews for the current user.\n\nRetrieves all reviews with status \"WAITING\" that belong to the authenticated user.\nResults are ordered by creation time (newest first).\n\nArgs:\n    user_id: Authenticated user ID from security dependency\n\nReturns:\n    List of pending review objects with status converted to typed literals\n\nRaises:\n    HTTPException: If authentication fails or database error occurs\n\nNote:\n    Reviews with invalid status values are logged as warnings but excluded\n    from results rather than failing the entire request.",
        "operationId": "getV2Get pending reviews",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number (1-indexed)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number (1-indexed)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of reviews per page",
              "default": 25,
              "title": "Page Size"
            },
            "description": "Number of reviews per page"
          }
        ],
        "responses": {
          "200": {
            "description": "List of pending reviews",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PendingHumanReviewModel"
                  },
                  "title": "Response Getv2Get Pending Reviews"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": { "application/json": {} }
          }
        }
      }
    },
    "/api/schedules": {
      "get": {
        "tags": ["v1", "schedules"],
        "summary": "List execution schedules for a user",
        "operationId": "getV1List execution schedules for a user",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GraphExecutionJobInfo"
                  },
                  "type": "array",
                  "title": "Response Getv1List Execution Schedules For A User"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/schedules/followups": {
      "get": {
        "tags": ["v1", "schedules"],
        "summary": "List copilot follow-up schedules for a user",
        "description": "Return only copilot-turn schedules for the current user.\n\nSibling of :func:`list_all_graphs_execution_schedules`; one route per kind\nkeeps the generated frontend client typed to a single concrete return type\ninstead of a discriminated union.",
        "operationId": "listCopilotFollowupSchedules",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CopilotTurnJobInfo"
                  },
                  "type": "array",
                  "title": "Response Listcopilotfollowupschedules"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/schedules/{schedule_id}": {
      "delete": {
        "tags": ["v1", "schedules"],
        "summary": "Delete execution schedule",
        "operationId": "deleteV1Delete execution schedule",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "ID of the schedule to delete",
              "title": "Schedule Id"
            },
            "description": "ID of the schedule to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Deletev1Delete Execution Schedule"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/skills": {
      "get": {
        "tags": ["v1", "skills"],
        "summary": "List user-distilled copilot skills",
        "description": "Return user-stored skills for the current user.\n\nReuses :func:`backend.copilot.tools.skills.list_user_skills` so the\nlibrary UI sees the exact same set the copilot ``<available_skills>``\nblock surfaces, minus the built-in defaults (which are read-only and\nhandled separately by the copilot runtime).",
        "operationId": "listCopilotSkills",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": { "$ref": "#/components/schemas/CopilotSkillInfo" },
                  "type": "array",
                  "title": "Response Listcopilotskills"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/skills/{name}": {
      "delete": {
        "tags": ["v1", "skills"],
        "summary": "Delete a user-distilled copilot skill",
        "description": "Delete a user-distilled skill by slug.\n\nBuilt-in defaults are not user-deletable — attempting to delete one\nreturns 400.  Missing skills return 404 so the UI can reconcile a\nstale list.",
        "operationId": "deleteCopilotSkill",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Slug of the skill to delete",
              "title": "Name"
            },
            "description": "Slug of the skill to delete"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": { "type": "string" },
                  "title": "Response Deletecopilotskill"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "get": {
        "tags": ["v1", "skills"],
        "summary": "Read a single copilot skill with its full SKILL.md body",
        "description": "Return full SKILL.md content (name, description, triggers, body)\nfor the library UI's expand-to-view dialog.\n\nBuilt-in default skills are returned with ``is_default=True`` so the\nUI can hide destructive affordances; missing user skills return 404.",
        "operationId": "readCopilotSkill",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Slug of the skill to read",
              "title": "Name"
            },
            "description": "Slug of the skill to read"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CopilotSkillDetail" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "404": { "description": "Skill not found" },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/admin/listings": {
      "get": {
        "tags": ["v2", "admin", "store", "admin"],
        "summary": "Get Admin Listings History",
        "description": "Get store listings with their version history for admins.\n\nThis provides a consolidated view of listings with their versions,\nallowing for an expandable UI in the admin dashboard.\n\nArgs:\n    status: Filter by submission status (PENDING, APPROVED, REJECTED)\n    search: Search by name, description, or user email\n    page: Page number for pagination\n    page_size: Number of items per page\n\nReturns:\n    Paginated listings with their versions",
        "operationId": "getV2Get admin listings history",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "$ref": "#/components/schemas/SubmissionStatus" },
                { "type": "null" }
              ],
              "title": "Status"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Search"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1, "title": "Page" }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 20, "title": "Page Size" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreListingsWithVersionsAdminViewResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/admin/submissions/download/{store_listing_version_id}": {
      "get": {
        "tags": ["v2", "admin", "store", "admin", "store", "admin"],
        "summary": "Admin Download Agent File",
        "description": "Download the agent file by streaming its content.\n\nArgs:\n    store_listing_version_id (str): The ID of the agent to download\n\nReturns:\n    StreamingResponse: A streaming response containing the agent's graph data.\n\nRaises:\n    HTTPException: If the agent is not found or an unexpected error occurs.",
        "operationId": "getV2Admin download agent file",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The ID of the agent to download",
              "title": "Store Listing Version Id"
            },
            "description": "The ID of the agent to download"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/admin/submissions/{store_listing_version_id}/add-to-library": {
      "post": {
        "tags": ["v2", "admin", "store", "admin"],
        "summary": "Admin Add Pending Agent to Library",
        "description": "Add a pending marketplace agent to the admin's library for review.\nUses admin-level access to bypass marketplace APPROVED-only checks.\n\nThe builder can load the graph because get_graph() checks library\nmembership as a fallback: \"you added it, you keep it.\"",
        "operationId": "postV2Admin add pending agent to library",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/LibraryAgent" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/admin/submissions/{store_listing_version_id}/preview": {
      "get": {
        "tags": ["v2", "admin", "store", "admin"],
        "summary": "Admin Preview Submission Listing",
        "description": "Preview a marketplace submission as it would appear on the listing page.\nBypasses the APPROVED-only StoreAgent view so admins can preview pending\nsubmissions before approving.",
        "operationId": "getV2Admin preview submission listing",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreAgentDetails" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/admin/submissions/{store_listing_version_id}/review": {
      "post": {
        "tags": ["v2", "admin", "store", "admin"],
        "summary": "Review Store Submission",
        "description": "Review a store listing submission.\n\nArgs:\n    store_listing_version_id: ID of the submission to review\n    request: Review details including approval status and comments\n    user_id: Authenticated admin user performing the review\n\nReturns:\n    StoreSubmissionAdminView with updated review information",
        "operationId": "postV2Review store submission",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewSubmissionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSubmissionAdminView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/agents": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "List store agents",
        "description": "Get a paginated list of agents from the marketplace,\nwith optional filtering and sorting.\n\nUsed for:\n- Home Page Featured Agents\n- Home Page Top Agents\n- Search Results\n- Agent Details - Other Agents By Creator\n- Agent Details - Similar Agents\n- Creator Details - Agents By Creator",
        "operationId": "getV2List store agents",
        "parameters": [
          {
            "name": "featured",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Filter to only show featured agents",
              "default": false,
              "title": "Featured"
            },
            "description": "Filter to only show featured agents"
          },
          {
            "name": "creator",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Filter agents by creator username",
              "title": "Creator"
            },
            "description": "Filter agents by creator username"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Filter agents by category",
              "title": "Category"
            },
            "description": "Filter agents by category"
          },
          {
            "name": "search_query",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Literal + semantic search on names and descriptions",
              "title": "Search Query"
            },
            "description": "Literal + semantic search on names and descriptions"
          },
          {
            "name": "sorted_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "$ref": "#/components/schemas/StoreAgentsSortOptions" },
                { "type": "null" }
              ],
              "description": "Property to sort results by. Ignored if search_query is provided.",
              "title": "Sorted By"
            },
            "description": "Property to sort results by. Ignored if search_query is provided."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreAgentsResponse" }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/agents/{username}/{agent_name}": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "Get specific agent",
        "description": "Get details of a marketplace agent",
        "operationId": "getV2Get specific agent",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Username" }
          },
          {
            "name": "agent_name",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Agent Name" }
          },
          {
            "name": "include_changelog",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Include Changelog"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreAgentDetails" }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/agents/{username}/{agent_name}/review": {
      "post": {
        "tags": ["v2", "store"],
        "summary": "Create agent review",
        "description": "Post a user review on a marketplace agent listing",
        "operationId": "postV2Create agent review",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Username" }
          },
          {
            "name": "agent_name",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Agent Name" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/StoreReviewCreate" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreReview" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/creators": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "List store creators",
        "description": "List or search marketplace creators",
        "operationId": "getV2List store creators",
        "parameters": [
          {
            "name": "featured",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Filter to only show featured creators",
              "default": false,
              "title": "Featured"
            },
            "description": "Filter to only show featured creators"
          },
          {
            "name": "search_query",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "description": "Literal + semantic search on names and descriptions",
              "title": "Search Query"
            },
            "description": "Literal + semantic search on names and descriptions"
          },
          {
            "name": "sorted_by",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                { "$ref": "#/components/schemas/StoreCreatorsSortOptions" },
                { "type": "null" }
              ],
              "title": "Sorted By"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CreatorsResponse" }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/creators/{username}": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "Get creator details",
        "description": "Get details on a marketplace creator",
        "operationId": "getV2Get creator details",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Username" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/CreatorDetails" }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/listings/versions/{store_listing_version_id}": {
      "get": {
        "tags": ["v2", "store"],
        "summary": "Get agent by version",
        "operationId": "getV2Get agent by version",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreAgentDetails" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/listings/versions/{store_listing_version_id}/graph": {
      "get": {
        "tags": ["v2", "store"],
        "summary": "Get agent graph",
        "description": "Get outline of graph belonging to a specific marketplace listing version",
        "operationId": "getV2Get agent graph",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphModelWithoutNodes"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/listings/versions/{store_listing_version_id}/graph/download": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "Download agent file",
        "description": "Download agent graph file for a specific marketplace listing version",
        "operationId": "getV2Download agent file",
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/metrics/cache": {
      "get": {
        "tags": ["v2", "store", "metrics"],
        "summary": "Get cache metrics in Prometheus format",
        "description": "Get cache metrics in Prometheus text format.\n\nReturns Prometheus-compatible metrics for monitoring cache performance.\nMetrics include size, maxsize, TTL, and hit rate for each cache.\n\nReturns:\n    str: Prometheus-formatted metrics text",
        "operationId": "getV2Get cache metrics in prometheus format",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "text/plain": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/api/store/my-unpublished-agents": {
      "get": {
        "tags": ["v2", "store", "private"],
        "summary": "Get my agents",
        "description": "List the authenticated user's unpublished agents",
        "operationId": "getV2Get my agents",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MyAgentsSortBy",
              "default": "most_recent"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyUnpublishedAgentsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/profile": {
      "get": {
        "tags": ["v2", "store", "private"],
        "summary": "Get user profile",
        "description": "Get the profile details for the authenticated user.",
        "operationId": "getV2Get user profile",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProfileDetails" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      },
      "post": {
        "tags": ["v2", "store", "private"],
        "summary": "Update user profile",
        "description": "Update the store profile for the authenticated user.",
        "operationId": "postV2Update user profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Profile" }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ProfileDetails" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/store/search": {
      "get": {
        "tags": ["v2", "store", "public"],
        "summary": "Unified search across all content types",
        "description": "Search across all content types (marketplace agents, blocks, documentation)\nusing hybrid search.\n\nCombines semantic (embedding-based) and lexical (text-based) search for best results.",
        "operationId": "getV2Unified search across all content types",
        "security": [{ "HTTPBearer": [] }],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "Query" }
          },
          {
            "name": "content_types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/ContentType" }
                },
                { "type": "null" }
              ],
              "description": "Content types to search. If not specified, searches all.",
              "title": "Content Types"
            },
            "description": "Content types to search. If not specified, searches all."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnifiedSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/submissions": {
      "get": {
        "tags": ["v2", "store", "private"],
        "summary": "List my submissions",
        "description": "List the authenticated user's marketplace listing submissions",
        "operationId": "getV2List my submissions",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSubmissionsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["v2", "store", "private"],
        "summary": "Create store submission",
        "description": "Submit a new marketplace listing for review",
        "operationId": "postV2Create store submission",
        "security": [{ "HTTPBearerJWT": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSubmissionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreSubmission" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/submissions/generate_image": {
      "post": {
        "tags": ["v2", "store", "private"],
        "summary": "Generate submission image",
        "description": "Generate an image for a marketplace listing submission based on the properties\nof a given graph.",
        "operationId": "postV2Generate submission image",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "graph_id",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "title": "Graph Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ImageURLResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/submissions/media": {
      "post": {
        "tags": ["v2", "store", "private"],
        "summary": "Upload submission media",
        "description": "Upload media for a marketplace listing submission",
        "operationId": "postV2Upload submission media",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_postV2Upload_submission_media"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "title": "Response Postv2Upload Submission Media"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/api/store/submissions/{store_listing_version_id}": {
      "put": {
        "tags": ["v2", "store", "private"],
        "summary": "Edit store submission",
        "description": "Update a pending marketplace listing submission",
        "operationId": "putV2Edit store submission",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "store_listing_version_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Store Listing Version Id" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreSubmissionEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/StoreSubmission" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/store/submissions/{submission_id}": {
      "delete": {
        "tags": ["v2", "store", "private"],
        "summary": "Delete store submission",
        "description": "Delete a marketplace listing submission",
        "operationId": "deleteV2Delete store submission",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "submission_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "Submission Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "boolean",
                  "title": "Response Deletev2Delete Store Submission"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/workspace/files": {
      "get": {
        "tags": ["workspace"],
        "summary": "List workspace files",
        "description": "List files in the user's workspace.\n\nWhen session_id is provided, only files for that session are returned.\nOtherwise, all files across sessions are listed. Results are paginated\nvia `limit`/`offset`; `has_more` indicates whether additional pages exist.",
        "operationId": "listWorkspaceFiles",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Session Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ListFilesResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/workspace/files/upload": {
      "post": {
        "tags": ["workspace"],
        "summary": "Upload file to workspace",
        "description": "Upload a file to the user's workspace.\n\nFiles are stored in session-scoped paths when session_id is provided,\nso the agent's session-scoped tools can discover them automatically.",
        "operationId": "uploadWorkspaceFile",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [{ "type": "string" }, { "type": "null" }],
              "title": "Session Id"
            }
          },
          {
            "name": "overwrite",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Overwrite"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_uploadWorkspaceFile"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/backend__api__features__workspace__routes__UploadFileResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/workspace/files/{file_id}": {
      "delete": {
        "tags": ["workspace"],
        "summary": "Delete a workspace file",
        "description": "Soft-delete a workspace file and attempt to remove it from storage.\n\nUsed when a user clears a file input in the builder.",
        "operationId": "deleteWorkspaceFile",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "File Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/DeleteFileResponse" }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/workspace/files/{file_id}/download": {
      "get": {
        "tags": ["workspace"],
        "summary": "Download file by ID",
        "description": "Download a file by its ID.\n\nReturns the file content directly or redirects to a signed URL for GCS.",
        "operationId": "getWorkspaceDownloadFileById",
        "security": [{ "HTTPBearerJWT": [] }],
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "title": "File Id" }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
              }
            }
          }
        }
      }
    },
    "/api/workspace/storage/usage": {
      "get": {
        "tags": ["workspace"],
        "summary": "Get workspace storage usage",
        "description": "Get storage usage information for the user's workspace.",
        "operationId": "getWorkspaceStorageUsage",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageUsageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
          }
        },
        "security": [{ "HTTPBearerJWT": [] }]
      }
    },
    "/health": {
      "get": {
        "tags": ["health"],
        "summary": "Health",
        "operationId": "getHealthHealth",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": { "application/json": { "schema": {} } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "APIKeyCredentials": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "provider": { "type": "string", "title": "Provider" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "is_managed": {
            "type": "boolean",
            "title": "Is Managed",
            "default": false
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "type": {
            "type": "string",
            "const": "api_key",
            "title": "Type",
            "default": "api_key"
          },
          "api_key": {
            "type": "string",
            "format": "password",
            "title": "Api Key",
            "writeOnly": true
          },
          "expires_at": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Expires At",
            "description": "Unix timestamp (seconds) indicating when the API key expires (if at all)"
          }
        },
        "type": "object",
        "required": ["provider", "api_key"],
        "title": "APIKeyCredentials"
      },
      "APIKeyInfo": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "scopes": {
            "items": { "$ref": "#/components/schemas/APIKeyPermission" },
            "type": "array",
            "title": "Scopes"
          },
          "type": {
            "type": "string",
            "const": "api_key",
            "title": "Type",
            "default": "api_key"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "expires_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Expires At"
          },
          "last_used_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Last Used At"
          },
          "revoked_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Revoked At"
          },
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "head": {
            "type": "string",
            "title": "Head",
            "description": "The first 8 characters of the key"
          },
          "tail": {
            "type": "string",
            "title": "Tail",
            "description": "The last 8 characters of the key"
          },
          "status": { "$ref": "#/components/schemas/APIKeyStatus" },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "scopes",
          "created_at",
          "id",
          "name",
          "head",
          "tail",
          "status"
        ],
        "title": "APIKeyInfo"
      },
      "APIKeyPermission": {
        "type": "string",
        "enum": [
          "IDENTITY",
          "EXECUTE_GRAPH",
          "READ_GRAPH",
          "WRITE_GRAPH",
          "EXECUTE_BLOCK",
          "READ_BLOCK",
          "READ_STORE",
          "WRITE_LIBRARY",
          "USE_TOOLS",
          "MANAGE_INTEGRATIONS",
          "READ_INTEGRATIONS",
          "DELETE_INTEGRATIONS"
        ],
        "title": "APIKeyPermission"
      },
      "APIKeyStatus": {
        "type": "string",
        "enum": ["ACTIVE", "REVOKED", "SUSPENDED"],
        "title": "APIKeyStatus"
      },
      "AccuracyAlertData": {
        "properties": {
          "graph_id": { "type": "string", "title": "Graph Id" },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "drop_percent": { "type": "number", "title": "Drop Percent" },
          "three_day_avg": { "type": "number", "title": "Three Day Avg" },
          "seven_day_avg": { "type": "number", "title": "Seven Day Avg" },
          "detected_at": {
            "type": "string",
            "format": "date-time",
            "title": "Detected At"
          }
        },
        "type": "object",
        "required": [
          "graph_id",
          "user_id",
          "drop_percent",
          "three_day_avg",
          "seven_day_avg",
          "detected_at"
        ],
        "title": "AccuracyAlertData",
        "description": "Alert data when accuracy drops significantly."
      },
      "AccuracyLatestData": {
        "properties": {
          "date": { "type": "string", "format": "date-time", "title": "Date" },
          "daily_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Daily Score"
          },
          "three_day_avg": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Three Day Avg"
          },
          "seven_day_avg": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Seven Day Avg"
          },
          "fourteen_day_avg": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Fourteen Day Avg"
          }
        },
        "type": "object",
        "required": [
          "date",
          "daily_score",
          "three_day_avg",
          "seven_day_avg",
          "fourteen_day_avg"
        ],
        "title": "AccuracyLatestData",
        "description": "Latest execution accuracy data point."
      },
      "AccuracyTrendsResponse": {
        "properties": {
          "latest_data": { "$ref": "#/components/schemas/AccuracyLatestData" },
          "alert": {
            "anyOf": [
              { "$ref": "#/components/schemas/AccuracyAlertData" },
              { "type": "null" }
            ]
          },
          "historical_data": {
            "anyOf": [
              {
                "items": { "$ref": "#/components/schemas/AccuracyLatestData" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Historical Data"
          }
        },
        "type": "object",
        "required": ["latest_data", "alert"],
        "title": "AccuracyTrendsResponse",
        "description": "Response model for accuracy trends and alerts."
      },
      "ActiveStreamInfo": {
        "properties": {
          "turn_id": { "type": "string", "title": "Turn Id" },
          "last_message_id": { "type": "string", "title": "Last Message Id" },
          "started_at": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Started At"
          }
        },
        "type": "object",
        "required": ["turn_id", "last_message_id"],
        "title": "ActiveStreamInfo",
        "description": "Information about an active stream for reconnection."
      },
      "AddUserCreditsResponse": {
        "properties": {
          "new_balance": { "type": "integer", "title": "New Balance" },
          "transaction_key": { "type": "string", "title": "Transaction Key" }
        },
        "type": "object",
        "required": ["new_balance", "transaction_key"],
        "title": "AddUserCreditsResponse"
      },
      "AgentDetails": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "in_library": {
            "type": "boolean",
            "title": "In Library",
            "default": false
          },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs",
            "default": {}
          },
          "credentials": {
            "items": { "$ref": "#/components/schemas/CredentialsMetaInput" },
            "type": "array",
            "title": "Credentials",
            "default": []
          },
          "execution_options": {
            "$ref": "#/components/schemas/ExecutionOptions"
          },
          "trigger_info": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Trigger Info"
          }
        },
        "type": "object",
        "required": ["id", "name", "description"],
        "title": "AgentDetails",
        "description": "Detailed agent information."
      },
      "AgentDetailsResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agent_details"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "agent": { "$ref": "#/components/schemas/AgentDetails" },
          "user_authenticated": {
            "type": "boolean",
            "title": "User Authenticated",
            "default": false
          },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          }
        },
        "type": "object",
        "required": ["message", "agent"],
        "title": "AgentDetailsResponse",
        "description": "Response for get_details action."
      },
      "AgentDiagnosticsResponse": {
        "properties": {
          "agents_with_active_executions": {
            "type": "integer",
            "title": "Agents With Active Executions"
          },
          "timestamp": { "type": "string", "title": "Timestamp" }
        },
        "type": "object",
        "required": ["agents_with_active_executions", "timestamp"],
        "title": "AgentDiagnosticsResponse",
        "description": "Response model for agent diagnostics"
      },
      "AgentExecutionStatus": {
        "type": "string",
        "enum": [
          "INCOMPLETE",
          "QUEUED",
          "RUNNING",
          "COMPLETED",
          "TERMINATED",
          "FAILED",
          "REVIEW"
        ],
        "title": "AgentExecutionStatus"
      },
      "AgentInfo": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "marketplace or library"
          },
          "in_library": {
            "type": "boolean",
            "title": "In Library",
            "default": false
          },
          "creator": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Creator"
          },
          "category": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Category"
          },
          "rating": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Rating"
          },
          "runs": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Runs"
          },
          "is_featured": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Featured"
          },
          "status": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Status"
          },
          "can_access_graph": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Can Access Graph"
          },
          "has_external_trigger": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Has External Trigger"
          },
          "new_output": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "New Output"
          },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          },
          "match_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Match Score",
            "description": "Combined relevance score in [0, 1] when this agent was returned from a similarity search (e.g. the create-time library check). Null for non-similarity sources."
          },
          "input_schema": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Input Schema",
            "description": "JSON Schema for the agent's inputs (for AgentExecutorBlock)"
          },
          "output_schema": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Output Schema",
            "description": "JSON Schema for the agent's outputs (for AgentExecutorBlock)"
          },
          "inputs": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Inputs",
            "description": "Input schema for the agent, including field names, types, and defaults"
          },
          "graph": {
            "anyOf": [
              { "$ref": "#/components/schemas/BaseGraph-Output" },
              { "type": "null" }
            ],
            "description": "Full graph structure (nodes + links) when include_graph is requested"
          }
        },
        "type": "object",
        "required": ["id", "name", "description", "source"],
        "title": "AgentInfo",
        "description": "Information about an agent."
      },
      "AgentOutputResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agent_output"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "agent_id": { "type": "string", "title": "Agent Id" },
          "library_agent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Library Agent Id"
          },
          "library_agent_link": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Library Agent Link"
          },
          "execution": {
            "anyOf": [
              { "$ref": "#/components/schemas/ExecutionOutputInfo" },
              { "type": "null" }
            ]
          },
          "available_executions": {
            "anyOf": [
              {
                "items": { "additionalProperties": true, "type": "object" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Available Executions"
          },
          "total_executions": {
            "type": "integer",
            "title": "Total Executions",
            "default": 0
          }
        },
        "type": "object",
        "required": ["message", "agent_name", "agent_id"],
        "title": "AgentOutputResponse",
        "description": "Response for agent_output tool."
      },
      "AgentPreviewResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agent_builder_preview"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "agent_json": {
            "additionalProperties": true,
            "type": "object",
            "title": "Agent Json"
          },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "description": { "type": "string", "title": "Description" },
          "node_count": { "type": "integer", "title": "Node Count" },
          "link_count": {
            "type": "integer",
            "title": "Link Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "message",
          "agent_json",
          "agent_name",
          "description",
          "node_count"
        ],
        "title": "AgentPreviewResponse",
        "description": "Response for previewing a generated agent before saving."
      },
      "AgentSavedResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agent_builder_saved"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "agent_id": { "type": "string", "title": "Agent Id" },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          },
          "library_agent_id": { "type": "string", "title": "Library Agent Id" },
          "library_agent_link": {
            "type": "string",
            "title": "Library Agent Link"
          },
          "agent_page_link": { "type": "string", "title": "Agent Page Link" }
        },
        "type": "object",
        "required": [
          "message",
          "agent_id",
          "agent_name",
          "library_agent_id",
          "library_agent_link",
          "agent_page_link"
        ],
        "title": "AgentSavedResponse",
        "description": "Response when an agent is saved to the library."
      },
      "AgentsFoundResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agents_found"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "default": "Available Agents"
          },
          "agents": {
            "items": { "$ref": "#/components/schemas/AgentInfo" },
            "type": "array",
            "title": "Agents"
          },
          "count": { "type": "integer", "title": "Count" },
          "name": {
            "type": "string",
            "title": "Name",
            "default": "agents_found"
          }
        },
        "type": "object",
        "required": ["message", "agents", "count"],
        "title": "AgentsFoundResponse",
        "description": "Response for find_agent tool."
      },
      "ApiResponse": {
        "properties": {
          "answer": { "type": "string", "title": "Answer" },
          "documents": {
            "items": { "$ref": "#/components/schemas/Document" },
            "type": "array",
            "title": "Documents"
          },
          "success": { "type": "boolean", "title": "Success" }
        },
        "type": "object",
        "required": ["answer", "documents", "success"],
        "title": "ApiResponse"
      },
      "AuthorizeRequest": {
        "properties": {
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "Client identifier"
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri",
            "description": "Redirect URI"
          },
          "scopes": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Scopes",
            "description": "List of scopes"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "Anti-CSRF token from client"
          },
          "response_type": {
            "type": "string",
            "title": "Response Type",
            "description": "Must be 'code' for authorization code flow",
            "default": "code"
          },
          "code_challenge": {
            "type": "string",
            "title": "Code Challenge",
            "description": "PKCE code challenge (required)"
          },
          "code_challenge_method": {
            "type": "string",
            "enum": ["S256", "plain"],
            "title": "Code Challenge Method",
            "description": "PKCE code challenge method (S256 recommended)",
            "default": "S256"
          }
        },
        "type": "object",
        "required": [
          "client_id",
          "redirect_uri",
          "scopes",
          "state",
          "code_challenge"
        ],
        "title": "AuthorizeRequest",
        "description": "OAuth 2.0 authorization request"
      },
      "AuthorizeResponse": {
        "properties": {
          "redirect_url": {
            "type": "string",
            "title": "Redirect Url",
            "description": "URL to redirect the user to"
          }
        },
        "type": "object",
        "required": ["redirect_url"],
        "title": "AuthorizeResponse",
        "description": "OAuth 2.0 authorization response with redirect URL"
      },
      "AutoTopUpConfig": {
        "properties": {
          "amount": { "type": "integer", "title": "Amount" },
          "threshold": { "type": "integer", "title": "Threshold" }
        },
        "type": "object",
        "required": ["amount", "threshold"],
        "title": "AutoTopUpConfig"
      },
      "AyrshareSSOResponse": {
        "properties": {
          "sso_url": {
            "type": "string",
            "title": "Sso Url",
            "description": "The SSO URL for Ayrshare integration"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "ISO timestamp when the URL expires"
          }
        },
        "type": "object",
        "required": ["sso_url", "expires_at"],
        "title": "AyrshareSSOResponse"
      },
      "BaseGraph-Input": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version", "default": 1 },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "nodes": {
            "items": { "$ref": "#/components/schemas/Node" },
            "type": "array",
            "title": "Nodes"
          },
          "links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Links"
          }
        },
        "type": "object",
        "required": ["name", "description"],
        "title": "BaseGraph",
        "description": "Graph with nodes, links, and computed I/O schema fields.\n\nUsed to represent sub-graphs within a `Graph`. Contains the full graph\nstructure including nodes and links, plus computed fields for schemas\nand trigger info. Does NOT include user_id or created_at (see GraphModel)."
      },
      "BaseGraph-Output": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version", "default": 1 },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "nodes": {
            "items": { "$ref": "#/components/schemas/Node" },
            "type": "array",
            "title": "Nodes"
          },
          "links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Links"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema",
            "readOnly": true
          },
          "output_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output Schema",
            "readOnly": true
          },
          "has_external_trigger": {
            "type": "boolean",
            "title": "Has External Trigger",
            "readOnly": true
          },
          "has_human_in_the_loop": {
            "type": "boolean",
            "title": "Has Human In The Loop",
            "readOnly": true
          },
          "has_sensitive_action": {
            "type": "boolean",
            "title": "Has Sensitive Action",
            "readOnly": true
          },
          "trigger_setup_info": {
            "anyOf": [
              { "$ref": "#/components/schemas/GraphTriggerInfo" },
              { "type": "null" }
            ],
            "readOnly": true
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "input_schema",
          "output_schema",
          "has_external_trigger",
          "has_human_in_the_loop",
          "has_sensitive_action",
          "trigger_setup_info"
        ],
        "title": "BaseGraph",
        "description": "Graph with nodes, links, and computed I/O schema fields.\n\nUsed to represent sub-graphs within a `Graph`. Contains the full graph\nstructure including nodes and links, plus computed fields for schemas\nand trigger info. Does NOT include user_id or created_at (see GraphModel)."
      },
      "BlockCategoryResponse": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "total_blocks": { "type": "integer", "title": "Total Blocks" },
          "blocks": {
            "items": { "$ref": "#/components/schemas/BlockInfo" },
            "type": "array",
            "title": "Blocks"
          }
        },
        "type": "object",
        "required": ["name", "total_blocks", "blocks"],
        "title": "BlockCategoryResponse"
      },
      "BlockCost": {
        "properties": {
          "cost_amount": { "type": "integer", "title": "Cost Amount" },
          "cost_filter": {
            "additionalProperties": true,
            "type": "object",
            "title": "Cost Filter"
          },
          "cost_type": { "$ref": "#/components/schemas/BlockCostType" },
          "cost_divisor": {
            "type": "integer",
            "title": "Cost Divisor",
            "default": 1
          },
          "token_rate": {
            "anyOf": [
              { "$ref": "#/components/schemas/TokenRateDisplay" },
              { "type": "null" }
            ]
          }
        },
        "type": "object",
        "required": ["cost_amount", "cost_filter", "cost_type"],
        "title": "BlockCost"
      },
      "BlockCostEstimateRow": {
        "properties": {
          "block_id": { "type": "string", "title": "Block Id" },
          "block_name": { "type": "string", "title": "Block Name" },
          "cost_type": { "type": "string", "title": "Cost Type" },
          "samples": { "type": "integer", "title": "Samples" },
          "mean_credits": { "type": "integer", "title": "Mean Credits" },
          "p50_credits": { "type": "integer", "title": "P50 Credits" },
          "p95_credits": { "type": "integer", "title": "P95 Credits" }
        },
        "type": "object",
        "required": [
          "block_id",
          "block_name",
          "cost_type",
          "samples",
          "mean_credits",
          "p50_credits",
          "p95_credits"
        ],
        "title": "BlockCostEstimateRow"
      },
      "BlockCostEstimatesResponse": {
        "properties": {
          "estimates": {
            "items": { "$ref": "#/components/schemas/BlockCostEstimateRow" },
            "type": "array",
            "title": "Estimates"
          },
          "total_rows": { "type": "integer", "title": "Total Rows" },
          "window_days": { "type": "integer", "title": "Window Days" },
          "max_window_days": { "type": "integer", "title": "Max Window Days" },
          "min_samples": { "type": "integer", "title": "Min Samples" },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At"
          }
        },
        "type": "object",
        "required": [
          "estimates",
          "total_rows",
          "window_days",
          "max_window_days",
          "min_samples",
          "generated_at"
        ],
        "title": "BlockCostEstimatesResponse"
      },
      "BlockCostType": {
        "type": "string",
        "enum": ["run", "byte", "second", "items", "cost_usd", "tokens"],
        "title": "BlockCostType"
      },
      "BlockDetails": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs",
            "default": {}
          },
          "outputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Outputs",
            "default": {}
          },
          "credentials": {
            "items": { "$ref": "#/components/schemas/CredentialsMetaInput" },
            "type": "array",
            "title": "Credentials",
            "default": []
          }
        },
        "type": "object",
        "required": ["id", "name", "description"],
        "title": "BlockDetails",
        "description": "Detailed block information."
      },
      "BlockDetailsResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "block_details"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "block": { "$ref": "#/components/schemas/BlockDetails" },
          "user_authenticated": {
            "type": "boolean",
            "title": "User Authenticated",
            "default": false
          }
        },
        "type": "object",
        "required": ["message", "block"],
        "title": "BlockDetailsResponse",
        "description": "Response for block details (first run_block attempt)."
      },
      "BlockInfo": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "inputSchema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputschema"
          },
          "outputSchema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Outputschema"
          },
          "costs": {
            "items": { "$ref": "#/components/schemas/BlockCost" },
            "type": "array",
            "title": "Costs"
          },
          "description": { "type": "string", "title": "Description" },
          "categories": {
            "items": {
              "additionalProperties": { "type": "string" },
              "type": "object"
            },
            "type": "array",
            "title": "Categories"
          },
          "contributors": {
            "items": { "additionalProperties": true, "type": "object" },
            "type": "array",
            "title": "Contributors"
          },
          "staticOutput": { "type": "boolean", "title": "Staticoutput" },
          "uiType": { "type": "string", "title": "Uitype" }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "inputSchema",
          "outputSchema",
          "costs",
          "description",
          "categories",
          "contributors",
          "staticOutput",
          "uiType"
        ],
        "title": "BlockInfo"
      },
      "BlockInfoSummary": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema",
            "description": "Full JSON schema for block inputs"
          },
          "output_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output Schema",
            "description": "Full JSON schema for block outputs"
          },
          "static_output": {
            "type": "boolean",
            "title": "Static Output",
            "description": "Whether the block produces output without needing input",
            "default": false
          },
          "required_inputs": {
            "items": { "$ref": "#/components/schemas/BlockInputFieldInfo" },
            "type": "array",
            "title": "Required Inputs",
            "description": "List of input fields for this block"
          }
        },
        "type": "object",
        "required": ["id", "name", "description", "categories"],
        "title": "BlockInfoSummary",
        "description": "Summary of a block for search results."
      },
      "BlockInputFieldInfo": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "type": { "type": "string", "title": "Type" },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "default": false
          },
          "default": { "anyOf": [{}, { "type": "null" }], "title": "Default" }
        },
        "type": "object",
        "required": ["name", "type"],
        "title": "BlockInputFieldInfo",
        "description": "Information about a block input field."
      },
      "BlockListResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "block_list"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "blocks": {
            "items": { "$ref": "#/components/schemas/BlockInfoSummary" },
            "type": "array",
            "title": "Blocks"
          },
          "count": { "type": "integer", "title": "Count" },
          "query": { "type": "string", "title": "Query" },
          "usage_hint": {
            "type": "string",
            "title": "Usage Hint",
            "default": "To execute a block, call run_block with block_id set to the block's 'id' field and input_data containing the fields listed in required_inputs."
          }
        },
        "type": "object",
        "required": ["message", "blocks", "count", "query"],
        "title": "BlockListResponse",
        "description": "Response for find_block tool."
      },
      "BlockOutputResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "block_output"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "block_id": { "type": "string", "title": "Block Id" },
          "block_name": { "type": "string", "title": "Block Name" },
          "outputs": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Outputs"
          },
          "success": { "type": "boolean", "title": "Success", "default": true },
          "is_dry_run": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Dry Run"
          }
        },
        "type": "object",
        "required": ["message", "block_id", "block_name", "outputs"],
        "title": "BlockOutputResponse",
        "description": "Response for run_block tool."
      },
      "BlockResponse": {
        "properties": {
          "blocks": {
            "items": { "$ref": "#/components/schemas/BlockInfo" },
            "type": "array",
            "title": "Blocks"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["blocks", "pagination"],
        "title": "BlockResponse"
      },
      "Body_patchOauthUpdateAppStatus": {
        "properties": {
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Whether the app should be active"
          }
        },
        "type": "object",
        "required": ["is_active"],
        "title": "Body_patchOauthUpdateAppStatus"
      },
      "Body_postAnalyticsLogRawAnalytics": {
        "properties": {
          "type": { "type": "string", "title": "Type" },
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data",
            "description": "The data to log"
          },
          "data_index": {
            "type": "string",
            "title": "Data Index",
            "description": "Indexable field for any count based analytical measures like page order clicking, tutorial step completion, etc."
          }
        },
        "type": "object",
        "required": ["type", "data", "data_index"],
        "title": "Body_postAnalyticsLogRawAnalytics"
      },
      "Body_postOauthIntrospect": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token",
            "description": "Token to introspect"
          },
          "token_type_hint": {
            "anyOf": [
              { "type": "string", "enum": ["access_token", "refresh_token"] },
              { "type": "null" }
            ],
            "title": "Token Type Hint",
            "description": "Hint about token type ('access_token' or 'refresh_token')"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "Client identifier"
          },
          "client_secret": {
            "type": "string",
            "title": "Client Secret",
            "description": "Client secret"
          }
        },
        "type": "object",
        "required": ["token", "client_id", "client_secret"],
        "title": "Body_postOauthIntrospect"
      },
      "Body_postOauthRevoke": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token",
            "description": "Token to revoke"
          },
          "token_type_hint": {
            "anyOf": [
              { "type": "string", "enum": ["access_token", "refresh_token"] },
              { "type": "null" }
            ],
            "title": "Token Type Hint",
            "description": "Hint about token type ('access_token' or 'refresh_token')"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "Client identifier"
          },
          "client_secret": {
            "type": "string",
            "title": "Client Secret",
            "description": "Client secret"
          }
        },
        "type": "object",
        "required": ["token", "client_id", "client_secret"],
        "title": "Body_postOauthRevoke"
      },
      "Body_postOauthUploadAppLogo": {
        "properties": {
          "file": { "type": "string", "format": "binary", "title": "File" }
        },
        "type": "object",
        "required": ["file"],
        "title": "Body_postOauthUploadAppLogo"
      },
      "Body_postV1Exchange_oauth_code_for_tokens": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Authorization code acquired by user login"
          },
          "state_token": { "type": "string", "title": "Anti-CSRF nonce" }
        },
        "type": "object",
        "required": ["code", "state_token"],
        "title": "Body_postV1Exchange oauth code for tokens"
      },
      "Body_postV1Execute_graph_agent": {
        "properties": {
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credentials_inputs": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Credentials Inputs"
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["builder", "library", "onboarding"]
              },
              { "type": "null" }
            ],
            "title": "Source"
          },
          "dry_run": { "type": "boolean", "title": "Dry Run", "default": false }
        },
        "type": "object",
        "title": "Body_postV1Execute graph agent"
      },
      "Body_postV1Upload_file_to_cloud_storage": {
        "properties": {
          "file": { "type": "string", "format": "binary", "title": "File" }
        },
        "type": "object",
        "required": ["file"],
        "title": "Body_postV1Upload file to cloud storage"
      },
      "Body_postV2Add_credits_to_user": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "amount": { "type": "integer", "title": "Amount" },
          "comments": { "type": "string", "title": "Comments" }
        },
        "type": "object",
        "required": ["user_id", "amount", "comments"],
        "title": "Body_postV2Add credits to user"
      },
      "Body_postV2Add_marketplace_agent": {
        "properties": {
          "store_listing_version_id": {
            "type": "string",
            "title": "Store Listing Version Id"
          },
          "source": {
            "type": "string",
            "enum": ["onboarding", "marketplace"],
            "title": "Source",
            "default": "marketplace"
          }
        },
        "type": "object",
        "required": ["store_listing_version_id"],
        "title": "Body_postV2Add marketplace agent"
      },
      "Body_postV2Execute_a_preset": {
        "properties": {
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credential_inputs": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Credential Inputs"
          }
        },
        "type": "object",
        "title": "Body_postV2Execute a preset"
      },
      "Body_postV2Reset_user_rate_limit_usage": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "reset_weekly": {
            "type": "boolean",
            "title": "Reset Weekly",
            "default": false
          }
        },
        "type": "object",
        "required": ["user_id"],
        "title": "Body_postV2Reset user rate limit usage"
      },
      "Body_postV2Upload_submission_media": {
        "properties": {
          "file": { "type": "string", "format": "binary", "title": "File" }
        },
        "type": "object",
        "required": ["file"],
        "title": "Body_postV2Upload submission media"
      },
      "Body_uploadWorkspaceFile": {
        "properties": {
          "file": { "type": "string", "format": "binary", "title": "File" }
        },
        "type": "object",
        "required": ["file"],
        "title": "Body_uploadWorkspaceFile"
      },
      "BotPlatformInfo": {
        "properties": {
          "platform": { "type": "string", "title": "Platform" },
          "display_name": { "type": "string", "title": "Display Name" },
          "icon": { "type": "string", "title": "Icon" },
          "add_bot_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Add Bot Url"
          },
          "dm_link": {
            "anyOf": [
              { "$ref": "#/components/schemas/PlatformUserLinkInfo" },
              { "type": "null" }
            ]
          },
          "server_links": {
            "items": { "$ref": "#/components/schemas/PlatformLinkInfo" },
            "type": "array",
            "title": "Server Links"
          }
        },
        "type": "object",
        "required": ["platform", "display_name", "icon"],
        "title": "BotPlatformInfo",
        "description": "A bot platform enabled on this deployment plus the caller's links to it.\n\nPlatforms whose adapter isn't configured (missing token/credentials) are\nomitted from the response entirely — the Bots settings page hides them."
      },
      "BulkMoveAgentsRequest": {
        "properties": {
          "agent_ids": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Agent Ids"
          },
          "folder_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Folder Id"
          }
        },
        "type": "object",
        "required": ["agent_ids"],
        "title": "BulkMoveAgentsRequest",
        "description": "Request model for moving multiple agents to a folder."
      },
      "CancelSessionResponse": {
        "properties": {
          "cancelled": { "type": "boolean", "title": "Cancelled" },
          "reason": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": ["cancelled"],
        "title": "CancelSessionResponse",
        "description": "Response model for the cancel session endpoint."
      },
      "ChangelogEntry": {
        "properties": {
          "version": { "type": "string", "title": "Version" },
          "changes_summary": { "type": "string", "title": "Changes Summary" },
          "date": { "type": "string", "format": "date-time", "title": "Date" }
        },
        "type": "object",
        "required": ["version", "changes_summary", "date"],
        "title": "ChangelogEntry"
      },
      "ChatRequest": {
        "properties": {
          "query": { "type": "string", "title": "Query" },
          "conversation_history": {
            "items": { "$ref": "#/components/schemas/Message" },
            "type": "array",
            "title": "Conversation History"
          },
          "message_id": { "type": "string", "title": "Message Id" },
          "include_graph_data": {
            "type": "boolean",
            "title": "Include Graph Data",
            "default": false
          },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          }
        },
        "type": "object",
        "required": ["query", "conversation_history", "message_id"],
        "title": "ChatRequest"
      },
      "ChatSessionMetadata": {
        "properties": {
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          },
          "builder_graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Builder Graph Id"
          },
          "source_platform": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Source Platform"
          }
        },
        "type": "object",
        "title": "ChatSessionMetadata",
        "description": "Typed metadata stored in the ``metadata`` JSON column of ChatSession.\n\nAdd new session-level flags here instead of adding DB columns —\nno migration required for new fields as long as a default is provided."
      },
      "ChatShareStateResponse": {
        "properties": {
          "is_shared": {
            "type": "boolean",
            "title": "Is Shared",
            "default": false
          },
          "share_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Share Token"
          },
          "auto_share_executions": {
            "type": "boolean",
            "title": "Auto Share Executions",
            "default": false
          },
          "message_count": {
            "type": "integer",
            "title": "Message Count",
            "default": 0
          },
          "linked_run_count": {
            "type": "integer",
            "title": "Linked Run Count",
            "default": 0
          },
          "file_count": {
            "type": "integer",
            "title": "File Count",
            "default": 0
          }
        },
        "type": "object",
        "title": "ChatShareStateResponse",
        "description": "Surfaces the chat's current share state so the modal can open\nin the right mode (share-vs-revoke) without an extra round-trip.\n\nThe three counts power the consent-disclosure block above the\ntoggle so the owner sees exactly what they're about to expose.\nThey reflect live state — sharing is live (not snapshot-at-enable),\nso these numbers are also a lower bound for what subsequent\nviewers will see if more messages / runs / files land before\nrevocation."
      },
      "ClarificationNeededResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "agent_builder_clarification_needed"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "questions": {
            "items": { "$ref": "#/components/schemas/ClarifyingQuestion" },
            "type": "array",
            "title": "Questions"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "ClarificationNeededResponse",
        "description": "Response when the LLM needs more information from the user."
      },
      "ClarifyingQuestion": {
        "properties": {
          "question": { "type": "string", "title": "Question" },
          "keyword": { "type": "string", "title": "Keyword" },
          "example": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Example"
          }
        },
        "type": "object",
        "required": ["question", "keyword"],
        "title": "ClarifyingQuestion",
        "description": "A question that needs user clarification."
      },
      "CoPilotUsagePublic": {
        "properties": {
          "daily": {
            "anyOf": [
              { "$ref": "#/components/schemas/UsageWindowPublic" },
              { "type": "null" }
            ],
            "description": "Null when no daily cap is configured (unlimited)."
          },
          "weekly": {
            "anyOf": [
              { "$ref": "#/components/schemas/UsageWindowPublic" },
              { "type": "null" }
            ],
            "description": "Null when no weekly cap is configured (unlimited)."
          },
          "tier": {
            "$ref": "#/components/schemas/SubscriptionTier",
            "default": "NO_TIER"
          },
          "reset_cost": {
            "type": "integer",
            "title": "Reset Cost",
            "description": "Credit cost (in cents) to reset the daily limit. 0 = feature disabled.",
            "default": 0
          }
        },
        "type": "object",
        "title": "CoPilotUsagePublic",
        "description": "Current usage status for a user — public (client-safe) shape."
      },
      "ConfirmLinkResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "link_type": {
            "$ref": "#/components/schemas/LinkType",
            "default": "SERVER"
          },
          "platform": { "type": "string", "title": "Platform" },
          "platform_server_id": {
            "type": "string",
            "title": "Platform Server Id"
          },
          "server_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Server Name"
          }
        },
        "type": "object",
        "required": [
          "success",
          "platform",
          "platform_server_id",
          "server_name"
        ],
        "title": "ConfirmLinkResponse"
      },
      "ConfirmUserLinkResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "link_type": {
            "$ref": "#/components/schemas/LinkType",
            "default": "USER"
          },
          "platform": { "type": "string", "title": "Platform" },
          "platform_user_id": { "type": "string", "title": "Platform User Id" }
        },
        "type": "object",
        "required": ["success", "platform", "platform_user_id"],
        "title": "ConfirmUserLinkResponse"
      },
      "ContentType": {
        "type": "string",
        "enum": [
          "STORE_AGENT",
          "BLOCK",
          "INTEGRATION",
          "DOCUMENTATION",
          "LIBRARY_AGENT"
        ],
        "title": "ContentType"
      },
      "CopilotSkillDetail": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "triggers": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Triggers",
            "default": []
          },
          "body": { "type": "string", "title": "Body" },
          "version": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Version"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "sibling_files": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Sibling Files",
            "default": []
          }
        },
        "type": "object",
        "required": ["name", "description", "body"],
        "title": "CopilotSkillDetail",
        "description": "Full SKILL.md content surfaced to the library expand-to-view UI."
      },
      "CopilotSkillInfo": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "triggers": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Triggers",
            "default": []
          }
        },
        "type": "object",
        "required": ["name", "description"],
        "title": "CopilotSkillInfo",
        "description": "User-distilled copilot skill metadata for the library UI.\n\nDefaults (built-in agent-building / MCP-tool guides) are intentionally\nexcluded — they cannot be edited or deleted, so surfacing them in the\nuser-facing list would add noise without affordances."
      },
      "CopilotTurnJobInfo": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "copilot_turn",
            "title": "Kind",
            "default": "copilot_turn"
          },
          "schedule_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Schedule Id"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "message": { "type": "string", "title": "Message" },
          "cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Cron"
          },
          "run_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Run At"
          },
          "cap_retry_count": {
            "type": "integer",
            "title": "Cap Retry Count",
            "default": 0
          },
          "user_timezone": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Timezone"
          },
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "next_run_time": { "type": "string", "title": "Next Run Time" },
          "timezone": {
            "type": "string",
            "title": "Timezone",
            "description": "Timezone used for scheduling",
            "default": "UTC"
          }
        },
        "type": "object",
        "required": ["user_id", "message", "id", "name", "next_run_time"],
        "title": "CopilotTurnJobInfo"
      },
      "CopilotUsageExportResponse": {
        "properties": {
          "rows": {
            "items": { "$ref": "#/components/schemas/CopilotWeeklyUsageRow" },
            "type": "array",
            "title": "Rows"
          },
          "total_rows": { "type": "integer", "title": "Total Rows" },
          "window_days": { "type": "integer", "title": "Window Days" },
          "max_window_days": { "type": "integer", "title": "Max Window Days" }
        },
        "type": "object",
        "required": ["rows", "total_rows", "window_days", "max_window_days"],
        "title": "CopilotUsageExportResponse"
      },
      "CopilotWeeklyUsageRow": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "week_start": {
            "type": "string",
            "format": "date-time",
            "title": "Week Start"
          },
          "week_end": {
            "type": "string",
            "format": "date-time",
            "title": "Week End"
          },
          "copilot_cost_microdollars": {
            "type": "integer",
            "title": "Copilot Cost Microdollars"
          },
          "tier": { "type": "string", "title": "Tier" },
          "weekly_limit_microdollars": {
            "type": "integer",
            "title": "Weekly Limit Microdollars"
          },
          "percent_used": { "type": "number", "title": "Percent Used" }
        },
        "type": "object",
        "required": [
          "user_id",
          "week_start",
          "week_end",
          "copilot_cost_microdollars",
          "tier",
          "weekly_limit_microdollars",
          "percent_used"
        ],
        "title": "CopilotWeeklyUsageRow"
      },
      "CostBucket": {
        "properties": {
          "bucket": { "type": "string", "title": "Bucket" },
          "count": { "type": "integer", "title": "Count" }
        },
        "type": "object",
        "required": ["bucket", "count"],
        "title": "CostBucket"
      },
      "CostLogRow": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Email"
          },
          "graph_exec_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Exec Id"
          },
          "node_exec_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Node Exec Id"
          },
          "block_name": { "type": "string", "title": "Block Name" },
          "provider": { "type": "string", "title": "Provider" },
          "tracking_type": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Tracking Type"
          },
          "cost_microdollars": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Cost Microdollars"
          },
          "input_tokens": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Input Tokens"
          },
          "output_tokens": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Output Tokens"
          },
          "duration": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Duration"
          },
          "model": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Model"
          },
          "cache_read_tokens": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Cache Read Tokens"
          },
          "cache_creation_tokens": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Cache Creation Tokens"
          }
        },
        "type": "object",
        "required": ["id", "created_at", "block_name", "provider"],
        "title": "CostLogRow"
      },
      "CountResponse": {
        "properties": {
          "all_blocks": { "type": "integer", "title": "All Blocks" },
          "input_blocks": { "type": "integer", "title": "Input Blocks" },
          "action_blocks": { "type": "integer", "title": "Action Blocks" },
          "output_blocks": { "type": "integer", "title": "Output Blocks" },
          "integrations": { "type": "integer", "title": "Integrations" },
          "marketplace_agents": {
            "type": "integer",
            "title": "Marketplace Agents"
          },
          "my_agents": { "type": "integer", "title": "My Agents" }
        },
        "type": "object",
        "required": [
          "all_blocks",
          "input_blocks",
          "action_blocks",
          "output_blocks",
          "integrations",
          "marketplace_agents",
          "my_agents"
        ],
        "title": "CountResponse"
      },
      "CreateAPIKeyRequest": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "permissions": {
            "items": { "$ref": "#/components/schemas/APIKeyPermission" },
            "type": "array",
            "title": "Permissions"
          },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          }
        },
        "type": "object",
        "required": ["name", "permissions"],
        "title": "CreateAPIKeyRequest"
      },
      "CreateAPIKeyResponse": {
        "properties": {
          "api_key": { "$ref": "#/components/schemas/APIKeyInfo" },
          "plain_text_key": { "type": "string", "title": "Plain Text Key" }
        },
        "type": "object",
        "required": ["api_key", "plain_text_key"],
        "title": "CreateAPIKeyResponse"
      },
      "CreateGraph": {
        "properties": {
          "graph": { "$ref": "#/components/schemas/Graph" },
          "source": {
            "anyOf": [
              { "type": "string", "enum": ["builder", "upload"] },
              { "type": "null" }
            ],
            "title": "Source"
          }
        },
        "type": "object",
        "required": ["graph"],
        "title": "CreateGraph"
      },
      "CreateSessionRequest": {
        "properties": {
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          },
          "builder_graph_id": {
            "anyOf": [
              { "type": "string", "maxLength": 128 },
              { "type": "null" }
            ],
            "title": "Builder Graph Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "CreateSessionRequest",
        "description": "Request model for creating (or get-or-creating) a chat session.\n\nTwo modes, selected by the body:\n\n- Default: create a fresh session. ``dry_run`` is a **top-level**\n  field — do not nest it inside ``metadata``.\n- Builder-bound: when ``builder_graph_id`` is set, the endpoint\n  switches to **get-or-create** keyed on\n  ``(user_id, builder_graph_id)``.  The builder panel calls this on\n  mount so the chat persists across refreshes.  Graph ownership is\n  validated inside :func:`get_or_create_builder_session`. Write-side\n  scope is enforced per-tool (``edit_agent`` / ``run_agent`` reject\n  any ``agent_id`` other than the bound graph) and a small blacklist\n  hides tools that conflict with the panel's scope\n  (``create_agent`` / ``customize_agent`` / ``get_agent_building_guide``\n  — see :data:`BUILDER_BLOCKED_TOOLS`). Read-side lookups\n  (``find_block``, ``find_agent``, ``search_docs``, …) stay open.\n\nExtra/unknown fields are rejected (422) to prevent silent mis-use."
      },
      "CreateSessionResponse": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "created_at": { "type": "string", "title": "Created At" },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "metadata": {
            "$ref": "#/components/schemas/ChatSessionMetadata",
            "default": { "dry_run": false }
          }
        },
        "type": "object",
        "required": ["id", "created_at", "user_id"],
        "title": "CreateSessionResponse",
        "description": "Response model containing information on a newly created chat session."
      },
      "CreatorDetails": {
        "properties": {
          "username": { "type": "string", "title": "Username" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "avatar_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Avatar Url"
          },
          "links": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Links"
          },
          "is_featured": { "type": "boolean", "title": "Is Featured" },
          "num_agents": { "type": "integer", "title": "Num Agents" },
          "agent_runs": { "type": "integer", "title": "Agent Runs" },
          "agent_rating": { "type": "number", "title": "Agent Rating" },
          "top_categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Top Categories"
          }
        },
        "type": "object",
        "required": [
          "username",
          "name",
          "description",
          "avatar_url",
          "links",
          "is_featured",
          "num_agents",
          "agent_runs",
          "agent_rating",
          "top_categories"
        ],
        "title": "CreatorDetails",
        "description": "Marketplace creator profile details, including aggregated stats"
      },
      "CreatorsResponse": {
        "properties": {
          "creators": {
            "items": { "$ref": "#/components/schemas/CreatorDetails" },
            "type": "array",
            "title": "Creators"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["creators", "pagination"],
        "title": "CreatorsResponse"
      },
      "CredentialsDeletionNeedsConfirmationResponse": {
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": false,
            "title": "Deleted",
            "default": false
          },
          "need_confirmation": {
            "type": "boolean",
            "const": true,
            "title": "Need Confirmation",
            "default": true
          },
          "message": { "type": "string", "title": "Message" }
        },
        "type": "object",
        "required": ["message"],
        "title": "CredentialsDeletionNeedsConfirmationResponse"
      },
      "CredentialsDeletionResponse": {
        "properties": {
          "deleted": {
            "type": "boolean",
            "const": true,
            "title": "Deleted",
            "default": true
          },
          "revoked": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Revoked",
            "description": "Indicates whether the credentials were also revoked by their provider. `None`/`null` if not applicable, e.g. when deleting non-revocable credentials such as API keys."
          }
        },
        "type": "object",
        "required": ["revoked"],
        "title": "CredentialsDeletionResponse"
      },
      "CredentialsMetaInput": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider name for integrations. Can be any string value, including custom provider names."
          },
          "type": {
            "type": "string",
            "enum": ["api_key", "oauth2", "user_password", "host_scoped"],
            "title": "Type"
          }
        },
        "type": "object",
        "required": ["id", "provider", "type"],
        "title": "CredentialsMetaInput",
        "credentials_provider": [],
        "credentials_types": []
      },
      "CredentialsMetaResponse": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "provider": { "type": "string", "title": "Provider" },
          "type": {
            "type": "string",
            "enum": ["api_key", "oauth2", "user_password", "host_scoped"],
            "title": "Type"
          },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "scopes": {
            "anyOf": [
              { "items": { "type": "string" }, "type": "array" },
              { "type": "null" }
            ],
            "title": "Scopes"
          },
          "username": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Username"
          },
          "host": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Host",
            "description": "Host pattern for host-scoped or MCP server URL for MCP credentials"
          },
          "is_managed": {
            "type": "boolean",
            "title": "Is Managed",
            "default": false
          }
        },
        "type": "object",
        "required": ["id", "provider", "type", "title", "scopes", "username"],
        "title": "CredentialsMetaResponse"
      },
      "CreditTransactionType": {
        "type": "string",
        "enum": [
          "TOP_UP",
          "USAGE",
          "GRANT",
          "REFUND",
          "CARD_CHECK",
          "SUBSCRIPTION"
        ],
        "title": "CreditTransactionType"
      },
      "CreditTransactionsExportResponse": {
        "properties": {
          "transactions": {
            "items": { "$ref": "#/components/schemas/UserTransaction" },
            "type": "array",
            "title": "Transactions"
          },
          "total_rows": { "type": "integer", "title": "Total Rows" },
          "window_days": { "type": "integer", "title": "Window Days" },
          "max_window_days": { "type": "integer", "title": "Max Window Days" }
        },
        "type": "object",
        "required": [
          "transactions",
          "total_rows",
          "window_days",
          "max_window_days"
        ],
        "title": "CreditTransactionsExportResponse"
      },
      "DeleteFileResponse": {
        "properties": { "deleted": { "type": "boolean", "title": "Deleted" } },
        "type": "object",
        "required": ["deleted"],
        "title": "DeleteFileResponse"
      },
      "DeleteGraphResponse": {
        "properties": {
          "version_counts": { "type": "integer", "title": "Version Counts" }
        },
        "type": "object",
        "required": ["version_counts"],
        "title": "DeleteGraphResponse"
      },
      "DeleteLinkResponse": {
        "properties": { "success": { "type": "boolean", "title": "Success" } },
        "type": "object",
        "required": ["success"],
        "title": "DeleteLinkResponse"
      },
      "DiscoverToolsRequest": {
        "properties": {
          "server_url": {
            "type": "string",
            "title": "Server Url",
            "description": "URL of the MCP server"
          },
          "auth_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Auth Token",
            "description": "Optional Bearer token for authenticated MCP servers"
          }
        },
        "type": "object",
        "required": ["server_url"],
        "title": "DiscoverToolsRequest",
        "description": "Request to discover tools on an MCP server."
      },
      "DiscoverToolsResponse": {
        "properties": {
          "tools": {
            "items": { "$ref": "#/components/schemas/MCPToolResponse" },
            "type": "array",
            "title": "Tools"
          },
          "server_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Server Name"
          },
          "protocol_version": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Protocol Version"
          }
        },
        "type": "object",
        "required": ["tools"],
        "title": "DiscoverToolsResponse",
        "description": "Response containing the list of tools available on an MCP server."
      },
      "DocPageResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "doc_page"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "title": { "type": "string", "title": "Title" },
          "path": { "type": "string", "title": "Path" },
          "content": { "type": "string", "title": "Content" },
          "doc_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Doc Url"
          }
        },
        "type": "object",
        "required": ["message", "title", "path", "content"],
        "title": "DocPageResponse",
        "description": "Response for get_doc_page tool."
      },
      "DocSearchResult": {
        "properties": {
          "title": { "type": "string", "title": "Title" },
          "path": { "type": "string", "title": "Path" },
          "section": { "type": "string", "title": "Section" },
          "snippet": { "type": "string", "title": "Snippet" },
          "score": { "type": "number", "title": "Score" },
          "doc_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Doc Url"
          }
        },
        "type": "object",
        "required": ["title", "path", "section", "snippet", "score"],
        "title": "DocSearchResult",
        "description": "A single documentation search result."
      },
      "DocSearchResultsResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "doc_search_results"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "results": {
            "items": { "$ref": "#/components/schemas/DocSearchResult" },
            "type": "array",
            "title": "Results"
          },
          "count": { "type": "integer", "title": "Count" },
          "query": { "type": "string", "title": "Query" }
        },
        "type": "object",
        "required": ["message", "results", "count", "query"],
        "title": "DocSearchResultsResponse",
        "description": "Response for search_docs tool."
      },
      "Document": {
        "properties": {
          "url": { "type": "string", "title": "Url" },
          "relevance_score": { "type": "number", "title": "Relevance Score" }
        },
        "type": "object",
        "required": ["url", "relevance_score"],
        "title": "Document"
      },
      "EnableShareRequest": {
        "properties": {
          "auto_share_executions": {
            "type": "boolean",
            "title": "Auto Share Executions",
            "default": false
          }
        },
        "type": "object",
        "title": "EnableShareRequest",
        "description": "Whether to auto-link every ``run_agent`` execution in this chat.\n\nWhen true, the backend creates ``ChatLinkedShare`` rows for every\nexisting agent run AND auto-links any new runs that land while the\nshare is active.  When false, only the chat messages are shared\n(cards in the viewer render in their \"execution not shared\" state)."
      },
      "ErrorResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "error"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "execution_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Execution Id"
          },
          "error": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error"
          },
          "details": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Details"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "ErrorResponse",
        "description": "Response for errors."
      },
      "ExecutionAnalyticsConfig": {
        "properties": {
          "available_models": {
            "items": { "$ref": "#/components/schemas/ModelInfo" },
            "type": "array",
            "title": "Available Models"
          },
          "default_system_prompt": {
            "type": "string",
            "title": "Default System Prompt"
          },
          "default_user_prompt": {
            "type": "string",
            "title": "Default User Prompt"
          },
          "recommended_model": {
            "type": "string",
            "title": "Recommended Model"
          }
        },
        "type": "object",
        "required": [
          "available_models",
          "default_system_prompt",
          "default_user_prompt",
          "recommended_model"
        ],
        "title": "ExecutionAnalyticsConfig"
      },
      "ExecutionAnalyticsRequest": {
        "properties": {
          "graph_id": {
            "type": "string",
            "title": "Graph Id",
            "description": "Graph ID to analyze"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version",
            "description": "Optional graph version"
          },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id",
            "description": "Optional user ID filter"
          },
          "created_after": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Created After",
            "description": "Optional created date lower bound"
          },
          "model_name": {
            "type": "string",
            "title": "Model Name",
            "description": "Model to use for generation",
            "default": "gpt-4o-mini"
          },
          "batch_size": {
            "type": "integer",
            "maximum": 25.0,
            "minimum": 1.0,
            "title": "Batch Size",
            "description": "Batch size for concurrent processing",
            "default": 10
          },
          "system_prompt": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "System Prompt",
            "description": "Custom system prompt (default: built-in prompt)"
          },
          "user_prompt": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Prompt",
            "description": "Custom user prompt with {{GRAPH_NAME}} and {{EXECUTION_DATA}} placeholders (default: built-in prompt)"
          },
          "skip_existing": {
            "type": "boolean",
            "title": "Skip Existing",
            "description": "Whether to skip executions that already have activity status and correctness score",
            "default": true
          }
        },
        "type": "object",
        "required": ["graph_id"],
        "title": "ExecutionAnalyticsRequest"
      },
      "ExecutionAnalyticsResponse": {
        "properties": {
          "total_executions": {
            "type": "integer",
            "title": "Total Executions"
          },
          "processed_executions": {
            "type": "integer",
            "title": "Processed Executions"
          },
          "successful_analytics": {
            "type": "integer",
            "title": "Successful Analytics"
          },
          "failed_analytics": {
            "type": "integer",
            "title": "Failed Analytics"
          },
          "skipped_executions": {
            "type": "integer",
            "title": "Skipped Executions"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ExecutionAnalyticsResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "total_executions",
          "processed_executions",
          "successful_analytics",
          "failed_analytics",
          "skipped_executions",
          "results"
        ],
        "title": "ExecutionAnalyticsResponse"
      },
      "ExecutionAnalyticsResult": {
        "properties": {
          "agent_id": { "type": "string", "title": "Agent Id" },
          "version_id": { "type": "integer", "title": "Version Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "exec_id": { "type": "string", "title": "Exec Id" },
          "summary_text": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Summary Text"
          },
          "score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Score"
          },
          "status": { "type": "string", "title": "Status" },
          "error_message": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error Message"
          },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Ended At"
          }
        },
        "type": "object",
        "required": [
          "agent_id",
          "version_id",
          "user_id",
          "exec_id",
          "summary_text",
          "score",
          "status"
        ],
        "title": "ExecutionAnalyticsResult"
      },
      "ExecutionDiagnosticsResponse": {
        "properties": {
          "running_executions": {
            "type": "integer",
            "title": "Running Executions"
          },
          "queued_executions_db": {
            "type": "integer",
            "title": "Queued Executions Db"
          },
          "queued_executions_rabbitmq": {
            "type": "integer",
            "title": "Queued Executions Rabbitmq"
          },
          "cancel_queue_depth": {
            "type": "integer",
            "title": "Cancel Queue Depth"
          },
          "orphaned_running": {
            "type": "integer",
            "title": "Orphaned Running"
          },
          "orphaned_queued": { "type": "integer", "title": "Orphaned Queued" },
          "failed_count_1h": { "type": "integer", "title": "Failed Count 1H" },
          "failed_count_24h": {
            "type": "integer",
            "title": "Failed Count 24H"
          },
          "failure_rate_24h": { "type": "number", "title": "Failure Rate 24H" },
          "stuck_running_24h": {
            "type": "integer",
            "title": "Stuck Running 24H"
          },
          "stuck_running_1h": {
            "type": "integer",
            "title": "Stuck Running 1H"
          },
          "oldest_running_hours": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Oldest Running Hours"
          },
          "stuck_queued_1h": { "type": "integer", "title": "Stuck Queued 1H" },
          "queued_never_started": {
            "type": "integer",
            "title": "Queued Never Started"
          },
          "invalid_queued_with_start": {
            "type": "integer",
            "title": "Invalid Queued With Start"
          },
          "invalid_running_without_start": {
            "type": "integer",
            "title": "Invalid Running Without Start"
          },
          "completed_1h": { "type": "integer", "title": "Completed 1H" },
          "completed_24h": { "type": "integer", "title": "Completed 24H" },
          "throughput_per_hour": {
            "type": "number",
            "title": "Throughput Per Hour"
          },
          "timestamp": { "type": "string", "title": "Timestamp" }
        },
        "type": "object",
        "required": [
          "running_executions",
          "queued_executions_db",
          "queued_executions_rabbitmq",
          "cancel_queue_depth",
          "orphaned_running",
          "orphaned_queued",
          "failed_count_1h",
          "failed_count_24h",
          "failure_rate_24h",
          "stuck_running_24h",
          "stuck_running_1h",
          "oldest_running_hours",
          "stuck_queued_1h",
          "queued_never_started",
          "invalid_queued_with_start",
          "invalid_running_without_start",
          "completed_1h",
          "completed_24h",
          "throughput_per_hour",
          "timestamp"
        ],
        "title": "ExecutionDiagnosticsResponse",
        "description": "Response model for execution diagnostics"
      },
      "ExecutionOptions": {
        "properties": {
          "manual": { "type": "boolean", "title": "Manual", "default": true },
          "scheduled": {
            "type": "boolean",
            "title": "Scheduled",
            "default": true
          },
          "webhook": { "type": "boolean", "title": "Webhook", "default": false }
        },
        "type": "object",
        "title": "ExecutionOptions",
        "description": "Available execution options for an agent."
      },
      "ExecutionOutputInfo": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" },
          "status": { "type": "string", "title": "Status" },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At"
          },
          "ended_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Ended At"
          },
          "outputs": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Outputs"
          },
          "inputs_summary": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Inputs Summary"
          },
          "node_executions": {
            "anyOf": [
              {
                "items": { "additionalProperties": true, "type": "object" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Node Executions"
          }
        },
        "type": "object",
        "required": ["execution_id", "status", "outputs"],
        "title": "ExecutionOutputInfo",
        "description": "Summary of a single execution's outputs."
      },
      "ExecutionStartedResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "execution_started"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "execution_id": { "type": "string", "title": "Execution Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_name": { "type": "string", "title": "Graph Name" },
          "library_agent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Library Agent Id"
          },
          "library_agent_link": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Library Agent Link"
          },
          "status": { "type": "string", "title": "Status", "default": "QUEUED" }
        },
        "type": "object",
        "required": ["message", "execution_id", "graph_id", "graph_name"],
        "title": "ExecutionStartedResponse",
        "description": "Response for run/schedule actions."
      },
      "FailedExecutionDetail": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_name": { "type": "string", "title": "Graph Name" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "status": { "type": "string", "title": "Status" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At"
          },
          "failed_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Failed At"
          },
          "error_message": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error Message"
          }
        },
        "type": "object",
        "required": [
          "execution_id",
          "graph_id",
          "graph_name",
          "graph_version",
          "user_id",
          "user_email",
          "status",
          "created_at",
          "started_at",
          "failed_at",
          "error_message"
        ],
        "title": "FailedExecutionDetail",
        "description": "Details about a failed execution for admin view"
      },
      "FailedExecutionsListResponse": {
        "properties": {
          "executions": {
            "items": { "$ref": "#/components/schemas/FailedExecutionDetail" },
            "type": "array",
            "title": "Executions"
          },
          "total": { "type": "integer", "title": "Total" }
        },
        "type": "object",
        "required": ["executions", "total"],
        "title": "FailedExecutionsListResponse",
        "description": "Response model for list of failed executions"
      },
      "FolderCreateRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name"
          },
          "icon": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Icon"
          },
          "color": {
            "anyOf": [
              { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
              { "type": "null" }
            ],
            "title": "Color",
            "description": "Hex color code (#RRGGBB)"
          },
          "parent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Parent Id"
          }
        },
        "type": "object",
        "required": ["name"],
        "title": "FolderCreateRequest",
        "description": "Request model for creating a folder."
      },
      "FolderListResponse": {
        "properties": {
          "folders": {
            "items": { "$ref": "#/components/schemas/LibraryFolder" },
            "type": "array",
            "title": "Folders"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["folders", "pagination"],
        "title": "FolderListResponse",
        "description": "Response schema for a list of folders."
      },
      "FolderMoveRequest": {
        "properties": {
          "target_parent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Target Parent Id"
          }
        },
        "type": "object",
        "title": "FolderMoveRequest",
        "description": "Request model for moving a folder to a new parent."
      },
      "FolderTreeResponse": {
        "properties": {
          "tree": {
            "items": { "$ref": "#/components/schemas/LibraryFolderTree" },
            "type": "array",
            "title": "Tree"
          }
        },
        "type": "object",
        "required": ["tree"],
        "title": "FolderTreeResponse",
        "description": "Response schema for folder tree structure."
      },
      "FolderUpdateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              { "type": "string", "maxLength": 100, "minLength": 1 },
              { "type": "null" }
            ],
            "title": "Name"
          },
          "icon": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Icon"
          },
          "color": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Color"
          }
        },
        "type": "object",
        "title": "FolderUpdateRequest",
        "description": "Request model for updating a folder."
      },
      "Graph": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version", "default": 1 },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "nodes": {
            "items": { "$ref": "#/components/schemas/Node" },
            "type": "array",
            "title": "Nodes"
          },
          "links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Links"
          },
          "sub_graphs": {
            "items": { "$ref": "#/components/schemas/BaseGraph-Input" },
            "type": "array",
            "title": "Sub Graphs"
          }
        },
        "type": "object",
        "required": ["name", "description"],
        "title": "Graph",
        "description": "Creatable graph model used in API create/update endpoints."
      },
      "GraphExecution": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credential_inputs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CredentialsMetaInput"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Credential Inputs"
          },
          "nodes_input_masks": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Nodes Input Masks"
          },
          "preset_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Preset Id"
          },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At",
            "description": "When execution started running. Null if not yet started (QUEUED)."
          },
          "ended_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Ended At",
            "description": "When execution finished. Null if not yet completed (QUEUED, RUNNING, INCOMPLETE, REVIEW)."
          },
          "is_shared": {
            "type": "boolean",
            "title": "Is Shared",
            "default": false
          },
          "share_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Share Token"
          },
          "is_dry_run": {
            "type": "boolean",
            "title": "Is Dry Run",
            "default": false
          },
          "stats": {
            "anyOf": [
              { "$ref": "#/components/schemas/Stats" },
              { "type": "null" }
            ]
          },
          "outputs": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Outputs"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "graph_id",
          "graph_version",
          "inputs",
          "credential_inputs",
          "nodes_input_masks",
          "preset_id",
          "status",
          "stats",
          "outputs"
        ],
        "title": "GraphExecution"
      },
      "GraphExecutionJobInfo": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "graph",
            "title": "Kind",
            "default": "graph"
          },
          "schedule_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Schedule Id"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "agent_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Name"
          },
          "cron": { "type": "string", "title": "Cron" },
          "input_data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Data"
          },
          "input_credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Input Credentials"
          },
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "next_run_time": { "type": "string", "title": "Next Run Time" },
          "timezone": {
            "type": "string",
            "title": "Timezone",
            "description": "Timezone used for scheduling",
            "default": "UTC"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "graph_id",
          "graph_version",
          "cron",
          "input_data",
          "id",
          "name",
          "next_run_time"
        ],
        "title": "GraphExecutionJobInfo"
      },
      "GraphExecutionMeta": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "inputs": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Inputs"
          },
          "credential_inputs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CredentialsMetaInput"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Credential Inputs"
          },
          "nodes_input_masks": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Nodes Input Masks"
          },
          "preset_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Preset Id"
          },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At",
            "description": "When execution started running. Null if not yet started (QUEUED)."
          },
          "ended_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Ended At",
            "description": "When execution finished. Null if not yet completed (QUEUED, RUNNING, INCOMPLETE, REVIEW)."
          },
          "is_shared": {
            "type": "boolean",
            "title": "Is Shared",
            "default": false
          },
          "share_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Share Token"
          },
          "is_dry_run": {
            "type": "boolean",
            "title": "Is Dry Run",
            "default": false
          },
          "stats": {
            "anyOf": [
              { "$ref": "#/components/schemas/Stats" },
              { "type": "null" }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "graph_id",
          "graph_version",
          "inputs",
          "credential_inputs",
          "nodes_input_masks",
          "preset_id",
          "status",
          "stats"
        ],
        "title": "GraphExecutionMeta"
      },
      "GraphExecutionWithNodes": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credential_inputs": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CredentialsMetaInput"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Credential Inputs"
          },
          "nodes_input_masks": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Nodes Input Masks"
          },
          "preset_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Preset Id"
          },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At",
            "description": "When execution started running. Null if not yet started (QUEUED)."
          },
          "ended_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Ended At",
            "description": "When execution finished. Null if not yet completed (QUEUED, RUNNING, INCOMPLETE, REVIEW)."
          },
          "is_shared": {
            "type": "boolean",
            "title": "Is Shared",
            "default": false
          },
          "share_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Share Token"
          },
          "is_dry_run": {
            "type": "boolean",
            "title": "Is Dry Run",
            "default": false
          },
          "stats": {
            "anyOf": [
              { "$ref": "#/components/schemas/Stats" },
              { "type": "null" }
            ]
          },
          "outputs": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Outputs"
          },
          "node_executions": {
            "items": { "$ref": "#/components/schemas/NodeExecutionResult" },
            "type": "array",
            "title": "Node Executions"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "graph_id",
          "graph_version",
          "inputs",
          "credential_inputs",
          "nodes_input_masks",
          "preset_id",
          "status",
          "stats",
          "outputs",
          "node_executions"
        ],
        "title": "GraphExecutionWithNodes"
      },
      "GraphExecutionsPaginated": {
        "properties": {
          "executions": {
            "items": { "$ref": "#/components/schemas/GraphExecutionMeta" },
            "type": "array",
            "title": "Executions"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["executions", "pagination"],
        "title": "GraphExecutionsPaginated",
        "description": "Response schema for paginated graph executions."
      },
      "GraphMeta": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version" },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "version",
          "name",
          "description",
          "user_id",
          "created_at"
        ],
        "title": "GraphMeta",
        "description": "Lightweight graph metadata model representing an existing graph from the database,\nfor use in listings and summaries.\n\nLacks `GraphModel`'s nodes, links, and expensive computed fields.\nUse for list endpoints where full graph data is not needed and performance matters."
      },
      "GraphModel": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version", "default": 1 },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "nodes": {
            "items": { "$ref": "#/components/schemas/NodeModel" },
            "type": "array",
            "title": "Nodes"
          },
          "links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Links"
          },
          "sub_graphs": {
            "items": { "$ref": "#/components/schemas/BaseGraph-Output" },
            "type": "array",
            "title": "Sub Graphs"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema",
            "readOnly": true
          },
          "output_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output Schema",
            "readOnly": true
          },
          "has_external_trigger": {
            "type": "boolean",
            "title": "Has External Trigger",
            "readOnly": true
          },
          "has_human_in_the_loop": {
            "type": "boolean",
            "title": "Has Human In The Loop",
            "readOnly": true
          },
          "has_sensitive_action": {
            "type": "boolean",
            "title": "Has Sensitive Action",
            "readOnly": true
          },
          "trigger_setup_info": {
            "anyOf": [
              { "$ref": "#/components/schemas/GraphTriggerInfo" },
              { "type": "null" }
            ],
            "readOnly": true
          },
          "credentials_input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Credentials Input Schema",
            "readOnly": true
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "user_id",
          "created_at",
          "input_schema",
          "output_schema",
          "has_external_trigger",
          "has_human_in_the_loop",
          "has_sensitive_action",
          "trigger_setup_info",
          "credentials_input_schema"
        ],
        "title": "GraphModel",
        "description": "Full graph model representing an existing graph from the database.\n\nThis is the primary model for working with persisted graphs. Includes all\ngraph data (nodes, links, sub_graphs) plus user ownership and timestamps.\nProvides computed fields (input_schema, output_schema, etc.) used during\nset-up (frontend) and execution (backend).\n\nInherits from:\n- `Graph`: provides structure (nodes, links, sub_graphs) and computed schemas\n- `GraphMeta`: provides user_id, created_at for database records"
      },
      "GraphModelWithoutNodes": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "version": { "type": "integer", "title": "Version", "default": 1 },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "forked_from_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Forked From Id"
          },
          "forked_from_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Forked From Version"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema",
            "readOnly": true
          },
          "output_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output Schema",
            "readOnly": true
          },
          "has_external_trigger": {
            "type": "boolean",
            "title": "Has External Trigger",
            "readOnly": true
          },
          "has_human_in_the_loop": {
            "type": "boolean",
            "title": "Has Human In The Loop",
            "readOnly": true
          },
          "has_sensitive_action": {
            "type": "boolean",
            "title": "Has Sensitive Action",
            "readOnly": true
          },
          "trigger_setup_info": {
            "anyOf": [
              { "$ref": "#/components/schemas/GraphTriggerInfo" },
              { "type": "null" }
            ],
            "readOnly": true
          },
          "credentials_input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Credentials Input Schema",
            "readOnly": true
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "user_id",
          "created_at",
          "input_schema",
          "output_schema",
          "has_external_trigger",
          "has_human_in_the_loop",
          "has_sensitive_action",
          "trigger_setup_info",
          "credentials_input_schema"
        ],
        "title": "GraphModelWithoutNodes",
        "description": "GraphModel variant that excludes nodes, links, and sub-graphs from serialization.\n\nUsed in contexts like the store where exposing internal graph structure\nis not desired. Inherits all computed fields from GraphModel but marks\nnodes and links as excluded from JSON output."
      },
      "GraphSettings": {
        "properties": {
          "human_in_the_loop_safe_mode": {
            "type": "boolean",
            "title": "Human In The Loop Safe Mode",
            "default": true
          },
          "sensitive_action_safe_mode": {
            "type": "boolean",
            "title": "Sensitive Action Safe Mode",
            "default": false
          },
          "builder_chat_session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Builder Chat Session Id"
          }
        },
        "type": "object",
        "title": "GraphSettings"
      },
      "GraphTriggerInfo": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider name for integrations. Can be any string value, including custom provider names."
          },
          "config_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config Schema",
            "description": "Input schema for the trigger block"
          },
          "credentials_input_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Credentials Input Name"
          }
        },
        "type": "object",
        "required": ["provider", "config_schema", "credentials_input_name"],
        "title": "GraphTriggerInfo"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": { "$ref": "#/components/schemas/ValidationError" },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HostScopedCredentials": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "provider": { "type": "string", "title": "Provider" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "is_managed": {
            "type": "boolean",
            "title": "Is Managed",
            "default": false
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "type": {
            "type": "string",
            "const": "host_scoped",
            "title": "Type",
            "default": "host_scoped"
          },
          "host": {
            "type": "string",
            "title": "Host",
            "description": "The host/URI pattern to match against request URLs"
          },
          "headers": {
            "additionalProperties": {
              "type": "string",
              "format": "password",
              "writeOnly": true
            },
            "type": "object",
            "title": "Headers",
            "description": "Key-value header map to add to matching requests"
          }
        },
        "type": "object",
        "required": ["provider", "host"],
        "title": "HostScopedCredentials"
      },
      "ImageURLResponse": {
        "properties": {
          "image_url": { "type": "string", "title": "Image Url" }
        },
        "type": "object",
        "required": ["image_url"],
        "title": "ImageURLResponse"
      },
      "InputValidationErrorResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "input_validation_error"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "unrecognized_fields": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Unrecognized Fields",
            "description": "List of input field names that were not recognized"
          },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs",
            "description": "The agent's valid input schema for reference"
          },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          }
        },
        "type": "object",
        "required": ["message", "unrecognized_fields", "inputs"],
        "title": "InputValidationErrorResponse",
        "description": "Response when run_agent receives unknown input fields."
      },
      "InvoiceListItem": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "number": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "total_cents": { "type": "integer", "title": "Total Cents" },
          "amount_paid_cents": {
            "type": "integer",
            "title": "Amount Paid Cents"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "usd"
          },
          "status": { "type": "string", "title": "Status" },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          },
          "hosted_invoice_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Hosted Invoice Url"
          },
          "invoice_pdf_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Invoice Pdf Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "total_cents",
          "amount_paid_cents",
          "status"
        ],
        "title": "InvoiceListItem",
        "description": "A single invoice surfaced from Stripe for the billing UI.\n\nMirrors the subset of `stripe.Invoice` we expose to the client. ``hosted_invoice_url``\nopens the Stripe-hosted view; ``invoice_pdf_url`` lets users download the PDF directly.\n\n``total_cents`` is the invoice total (what the user owes / will be charged); use it\nfor the displayed amount. ``amount_paid_cents`` is what Stripe has actually settled\nso far — `0` for ``open``/``draft`` invoices — and is kept for callers that need to\nshow outstanding balances separately."
      },
      "LibraryAgent": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "image_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Image Url"
          },
          "creator_name": { "type": "string", "title": "Creator Name" },
          "creator_image_url": {
            "type": "string",
            "title": "Creator Image Url"
          },
          "status": { "$ref": "#/components/schemas/LibraryAgentStatus" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          },
          "output_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Output Schema"
          },
          "credentials_input_schema": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Credentials Input Schema",
            "description": "Input schema for credentials required by the agent"
          },
          "has_external_trigger": {
            "type": "boolean",
            "title": "Has External Trigger",
            "description": "Whether the agent has an external trigger (e.g. webhook) node"
          },
          "has_human_in_the_loop": {
            "type": "boolean",
            "title": "Has Human In The Loop",
            "description": "Whether the agent has human-in-the-loop blocks"
          },
          "has_sensitive_action": {
            "type": "boolean",
            "title": "Has Sensitive Action",
            "description": "Whether the agent has sensitive action blocks"
          },
          "trigger_setup_info": {
            "anyOf": [
              { "$ref": "#/components/schemas/GraphTriggerInfo" },
              { "type": "null" }
            ]
          },
          "new_output": { "type": "boolean", "title": "New Output" },
          "execution_count": {
            "type": "integer",
            "title": "Execution Count",
            "default": 0
          },
          "success_rate": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Success Rate"
          },
          "avg_correctness_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Avg Correctness Score"
          },
          "recent_executions": {
            "items": { "$ref": "#/components/schemas/RecentExecution" },
            "type": "array",
            "title": "Recent Executions",
            "description": "List of recent executions with status, score, and summary"
          },
          "can_access_graph": {
            "type": "boolean",
            "title": "Can Access Graph",
            "description": "Indicates whether the same user owns the corresponding graph"
          },
          "is_latest_version": {
            "type": "boolean",
            "title": "Is Latest Version"
          },
          "is_favorite": { "type": "boolean", "title": "Is Favorite" },
          "folder_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Folder Id"
          },
          "folder_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Folder Name"
          },
          "is_hidden": {
            "type": "boolean",
            "title": "Is Hidden",
            "default": false
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "is_scheduled": {
            "type": "boolean",
            "title": "Is Scheduled",
            "description": "Whether this agent has active execution schedules",
            "default": false
          },
          "next_scheduled_run": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Next Scheduled Run",
            "description": "ISO 8601 timestamp of the next scheduled run, if any"
          },
          "settings": { "$ref": "#/components/schemas/GraphSettings" },
          "marketplace_listing": {
            "anyOf": [
              { "$ref": "#/components/schemas/MarketplaceListing" },
              { "type": "null" }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "graph_id",
          "graph_version",
          "image_url",
          "creator_name",
          "creator_image_url",
          "status",
          "created_at",
          "updated_at",
          "name",
          "description",
          "input_schema",
          "output_schema",
          "credentials_input_schema",
          "has_external_trigger",
          "has_human_in_the_loop",
          "has_sensitive_action",
          "new_output",
          "can_access_graph",
          "is_latest_version",
          "is_favorite"
        ],
        "title": "LibraryAgent",
        "description": "Represents an agent in the library, including metadata for display and\nuser interaction within the system."
      },
      "LibraryAgentPreset": {
        "properties": {
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Credentials"
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "webhook_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Webhook Id"
          },
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "webhook": {
            "anyOf": [
              { "$ref": "#/components/schemas/Webhook" },
              { "type": "null" }
            ]
          }
        },
        "type": "object",
        "required": [
          "graph_id",
          "graph_version",
          "inputs",
          "credentials",
          "name",
          "description",
          "id",
          "user_id",
          "created_at",
          "updated_at",
          "webhook"
        ],
        "title": "LibraryAgentPreset",
        "description": "Represents a preset configuration for a library agent."
      },
      "LibraryAgentPresetCreatable": {
        "properties": {
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Credentials"
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "webhook_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Webhook Id"
          }
        },
        "type": "object",
        "required": [
          "graph_id",
          "graph_version",
          "inputs",
          "credentials",
          "name",
          "description"
        ],
        "title": "LibraryAgentPresetCreatable",
        "description": "Request model used when creating a new preset for a library agent."
      },
      "LibraryAgentPresetCreatableFromGraphExecution": {
        "properties": {
          "graph_execution_id": {
            "type": "string",
            "title": "Graph Execution Id"
          },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          }
        },
        "type": "object",
        "required": ["graph_execution_id", "name", "description"],
        "title": "LibraryAgentPresetCreatableFromGraphExecution",
        "description": "Request model used when creating a new preset for a library agent."
      },
      "LibraryAgentPresetResponse": {
        "properties": {
          "presets": {
            "items": { "$ref": "#/components/schemas/LibraryAgentPreset" },
            "type": "array",
            "title": "Presets"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["presets", "pagination"],
        "title": "LibraryAgentPresetResponse",
        "description": "Response schema for a list of agent presets and pagination info."
      },
      "LibraryAgentPresetUpdatable": {
        "properties": {
          "inputs": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Inputs"
          },
          "credentials": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CredentialsMetaInput"
                },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Credentials"
          },
          "name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Name"
          },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "LibraryAgentPresetUpdatable",
        "description": "Request model used when updating a preset for a library agent."
      },
      "LibraryAgentResponse": {
        "properties": {
          "agents": {
            "items": { "$ref": "#/components/schemas/LibraryAgent" },
            "type": "array",
            "title": "Agents"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["agents", "pagination"],
        "title": "LibraryAgentResponse",
        "description": "Response schema for a list of library agents and pagination info."
      },
      "LibraryAgentSort": {
        "type": "string",
        "enum": ["createdAt", "updatedAt"],
        "title": "LibraryAgentSort",
        "description": "Possible sort options for sorting library agents."
      },
      "LibraryAgentStatus": {
        "type": "string",
        "enum": ["COMPLETED", "HEALTHY", "WAITING", "ERROR"],
        "title": "LibraryAgentStatus"
      },
      "LibraryAgentUpdateRequest": {
        "properties": {
          "auto_update_version": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Auto Update Version",
            "description": "Auto-update the agent version"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version",
            "description": "Specific graph version to update to"
          },
          "is_favorite": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Favorite",
            "description": "Mark the agent as a favorite"
          },
          "is_archived": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Archived",
            "description": "Archive the agent"
          },
          "is_hidden": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Is Hidden",
            "description": "Whether to hide the agent from the library listing"
          },
          "settings": {
            "anyOf": [
              { "$ref": "#/components/schemas/GraphSettings" },
              { "type": "null" }
            ],
            "description": "User-specific settings for this library agent"
          },
          "folder_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Folder Id",
            "description": "Folder ID to move agent to (None to move to root)"
          }
        },
        "type": "object",
        "title": "LibraryAgentUpdateRequest",
        "description": "Schema for updating a library agent via PUT.\n\nIncludes flags for auto-updating version, marking as favorite,\narchiving, or deleting."
      },
      "LibraryFolder": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "name": { "type": "string", "title": "Name" },
          "icon": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Icon"
          },
          "color": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Color"
          },
          "parent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Parent Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "agent_count": {
            "type": "integer",
            "title": "Agent Count",
            "default": 0
          },
          "subfolder_count": {
            "type": "integer",
            "title": "Subfolder Count",
            "default": 0
          }
        },
        "type": "object",
        "required": ["id", "user_id", "name", "created_at", "updated_at"],
        "title": "LibraryFolder",
        "description": "Represents a folder for organizing library agents."
      },
      "LibraryFolderTree": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "name": { "type": "string", "title": "Name" },
          "icon": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Icon"
          },
          "color": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Color"
          },
          "parent_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Parent Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "agent_count": {
            "type": "integer",
            "title": "Agent Count",
            "default": 0
          },
          "subfolder_count": {
            "type": "integer",
            "title": "Subfolder Count",
            "default": 0
          },
          "children": {
            "items": { "$ref": "#/components/schemas/LibraryFolderTree" },
            "type": "array",
            "title": "Children",
            "default": []
          }
        },
        "type": "object",
        "required": ["id", "user_id", "name", "created_at", "updated_at"],
        "title": "LibraryFolderTree",
        "description": "Folder with nested children for tree view."
      },
      "Link": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "source_id": { "type": "string", "title": "Source Id" },
          "sink_id": { "type": "string", "title": "Sink Id" },
          "source_name": { "type": "string", "title": "Source Name" },
          "sink_name": { "type": "string", "title": "Sink Name" },
          "is_static": {
            "type": "boolean",
            "title": "Is Static",
            "default": false
          }
        },
        "type": "object",
        "required": ["source_id", "sink_id", "source_name", "sink_name"],
        "title": "Link"
      },
      "LinkTokenInfoResponse": {
        "properties": {
          "platform": { "type": "string", "title": "Platform" },
          "link_type": { "$ref": "#/components/schemas/LinkType" },
          "server_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Server Name"
          }
        },
        "type": "object",
        "required": ["platform", "link_type"],
        "title": "LinkTokenInfoResponse"
      },
      "LinkType": {
        "type": "string",
        "enum": ["SERVER", "USER"],
        "title": "LinkType"
      },
      "ListFilesResponse": {
        "properties": {
          "files": {
            "items": { "$ref": "#/components/schemas/WorkspaceFileItem" },
            "type": "array",
            "title": "Files"
          },
          "offset": { "type": "integer", "title": "Offset", "default": 0 },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          }
        },
        "type": "object",
        "required": ["files"],
        "title": "ListFilesResponse"
      },
      "ListSessionsResponse": {
        "properties": {
          "sessions": {
            "items": { "$ref": "#/components/schemas/SessionSummaryResponse" },
            "type": "array",
            "title": "Sessions"
          },
          "total": { "type": "integer", "title": "Total" }
        },
        "type": "object",
        "required": ["sessions", "total"],
        "title": "ListSessionsResponse",
        "description": "Response model for listing chat sessions."
      },
      "LogRawMetricRequest": {
        "properties": {
          "metric_name": {
            "type": "string",
            "minLength": 1,
            "title": "Metric Name"
          },
          "metric_value": { "type": "number", "title": "Metric Value" },
          "data_string": {
            "type": "string",
            "minLength": 1,
            "title": "Data String"
          }
        },
        "type": "object",
        "required": ["metric_name", "metric_value", "data_string"],
        "title": "LogRawMetricRequest"
      },
      "LoginResponse": {
        "properties": {
          "login_url": { "type": "string", "title": "Login Url" },
          "state_token": { "type": "string", "title": "State Token" }
        },
        "type": "object",
        "required": ["login_url", "state_token"],
        "title": "LoginResponse"
      },
      "MCPOAuthCallbackRequest": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "description": "Authorization code from OAuth callback"
          },
          "state_token": {
            "type": "string",
            "title": "State Token",
            "description": "State token for CSRF verification"
          }
        },
        "type": "object",
        "required": ["code", "state_token"],
        "title": "MCPOAuthCallbackRequest",
        "description": "Request to exchange an OAuth code for tokens."
      },
      "MCPOAuthLoginRequest": {
        "properties": {
          "server_url": {
            "type": "string",
            "title": "Server Url",
            "description": "URL of the MCP server that requires OAuth"
          }
        },
        "type": "object",
        "required": ["server_url"],
        "title": "MCPOAuthLoginRequest",
        "description": "Request to start an OAuth flow for an MCP server."
      },
      "MCPOAuthLoginResponse": {
        "properties": {
          "login_url": { "type": "string", "title": "Login Url" },
          "state_token": { "type": "string", "title": "State Token" }
        },
        "type": "object",
        "required": ["login_url", "state_token"],
        "title": "MCPOAuthLoginResponse",
        "description": "Response with the OAuth login URL for the user to authenticate."
      },
      "MCPStoreTokenRequest": {
        "properties": {
          "server_url": {
            "type": "string",
            "title": "Server Url",
            "description": "MCP server URL the token authenticates against"
          },
          "token": {
            "type": "string",
            "minLength": 1,
            "format": "password",
            "title": "Token",
            "description": "Bearer token / API key for the MCP server",
            "writeOnly": true
          }
        },
        "type": "object",
        "required": ["server_url", "token"],
        "title": "MCPStoreTokenRequest",
        "description": "Request to store a bearer token for an MCP server that doesn't support OAuth."
      },
      "MCPToolInfo": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          }
        },
        "type": "object",
        "required": ["name", "description", "input_schema"],
        "title": "MCPToolInfo",
        "description": "Information about a single MCP tool discovered from a server."
      },
      "MCPToolOutputResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "mcp_tool_output"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "server_url": { "type": "string", "title": "Server Url" },
          "tool_name": { "type": "string", "title": "Tool Name" },
          "result": { "title": "Result" },
          "success": { "type": "boolean", "title": "Success", "default": true }
        },
        "type": "object",
        "required": ["message", "server_url", "tool_name"],
        "title": "MCPToolOutputResponse",
        "description": "Response after executing an MCP tool."
      },
      "MCPToolResponse": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          }
        },
        "type": "object",
        "required": ["name", "description", "input_schema"],
        "title": "MCPToolResponse",
        "description": "A single MCP tool returned by discovery."
      },
      "MCPToolsDiscoveredResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "mcp_tools_discovered"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "server_url": { "type": "string", "title": "Server Url" },
          "tools": {
            "items": { "$ref": "#/components/schemas/MCPToolInfo" },
            "type": "array",
            "title": "Tools"
          }
        },
        "type": "object",
        "required": ["message", "server_url", "tools"],
        "title": "MCPToolsDiscoveredResponse",
        "description": "Response when MCP tools are discovered from a server (agent-internal)."
      },
      "MarketplaceListing": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "slug": { "type": "string", "title": "Slug" },
          "creator": {
            "$ref": "#/components/schemas/MarketplaceListingCreator"
          }
        },
        "type": "object",
        "required": ["id", "name", "slug", "creator"],
        "title": "MarketplaceListing",
        "description": "Marketplace listing information for a library agent."
      },
      "MarketplaceListingCreator": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "id": { "type": "string", "title": "Id" },
          "slug": { "type": "string", "title": "Slug" }
        },
        "type": "object",
        "required": ["name", "id", "slug"],
        "title": "MarketplaceListingCreator",
        "description": "Creator information for a marketplace listing."
      },
      "MemoryForgetCandidatesResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "memory_forget_candidates"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "candidates": {
            "items": {
              "additionalProperties": { "type": "string" },
              "type": "object"
            },
            "type": "array",
            "title": "Candidates"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "MemoryForgetCandidatesResponse",
        "description": "Response with candidate memories to forget."
      },
      "MemoryForgetConfirmResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "memory_forget_confirm"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "deleted_uuids": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Deleted Uuids"
          },
          "failed_uuids": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Failed Uuids"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "MemoryForgetConfirmResponse",
        "description": "Response after deleting specific memory edges."
      },
      "MemorySearchResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "memory_search"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "facts": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Facts"
          },
          "recent_episodes": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Recent Episodes"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "MemorySearchResponse",
        "description": "Response when memories are searched."
      },
      "MemoryStoreResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "memory_store"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "memory_name": { "type": "string", "title": "Memory Name" }
        },
        "type": "object",
        "required": ["message", "memory_name"],
        "title": "MemoryStoreResponse",
        "description": "Response when a memory is stored."
      },
      "Message": {
        "properties": {
          "query": { "type": "string", "title": "Query" },
          "response": { "type": "string", "title": "Response" }
        },
        "type": "object",
        "required": ["query", "response"],
        "title": "Message"
      },
      "ModelInfo": {
        "properties": {
          "value": { "type": "string", "title": "Value" },
          "label": { "type": "string", "title": "Label" },
          "provider": { "type": "string", "title": "Provider" }
        },
        "type": "object",
        "required": ["value", "label", "provider"],
        "title": "ModelInfo"
      },
      "MyAgentsSortBy": {
        "type": "string",
        "enum": ["most_recent", "name"],
        "title": "MyAgentsSortBy"
      },
      "MyUnpublishedAgent": {
        "properties": {
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "agent_image": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Image"
          },
          "description": { "type": "string", "title": "Description" },
          "last_edited": {
            "type": "string",
            "format": "date-time",
            "title": "Last Edited"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          }
        },
        "type": "object",
        "required": [
          "graph_id",
          "graph_version",
          "agent_name",
          "description",
          "last_edited"
        ],
        "title": "MyUnpublishedAgent"
      },
      "MyUnpublishedAgentsResponse": {
        "properties": {
          "agents": {
            "items": { "$ref": "#/components/schemas/MyUnpublishedAgent" },
            "type": "array",
            "title": "Agents"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["agents", "pagination"],
        "title": "MyUnpublishedAgentsResponse"
      },
      "NeedLoginResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "need_login"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "agent_info": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Agent Info"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "NeedLoginResponse",
        "description": "Response when login is needed."
      },
      "NoResultsResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "no_results"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "suggestions": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Suggestions",
            "default": []
          },
          "name": { "type": "string", "title": "Name", "default": "no_results" }
        },
        "type": "object",
        "required": ["message"],
        "title": "NoResultsResponse",
        "description": "Response when no agents found."
      },
      "Node": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "block_id": { "type": "string", "title": "Block Id" },
          "input_default": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Default"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "input_links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Input Links"
          },
          "output_links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Output Links"
          }
        },
        "type": "object",
        "required": ["block_id"],
        "title": "Node"
      },
      "NodeExecutionResult": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "graph_exec_id": { "type": "string", "title": "Graph Exec Id" },
          "node_exec_id": { "type": "string", "title": "Node Exec Id" },
          "node_id": { "type": "string", "title": "Node Id" },
          "block_id": { "type": "string", "title": "Block Id" },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "input_data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Data"
          },
          "output_data": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Output Data"
          },
          "add_time": {
            "type": "string",
            "format": "date-time",
            "title": "Add Time"
          },
          "queue_time": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Queue Time"
          },
          "start_time": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Start Time"
          },
          "end_time": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "End Time"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "graph_id",
          "graph_version",
          "graph_exec_id",
          "node_exec_id",
          "node_id",
          "block_id",
          "status",
          "input_data",
          "output_data",
          "add_time",
          "queue_time",
          "start_time",
          "end_time"
        ],
        "title": "NodeExecutionResult"
      },
      "NodeModel": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "block_id": { "type": "string", "title": "Block Id" },
          "input_default": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Default"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "input_links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Input Links"
          },
          "output_links": {
            "items": { "$ref": "#/components/schemas/Link" },
            "type": "array",
            "title": "Output Links"
          },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "webhook_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Webhook Id"
          }
        },
        "type": "object",
        "required": ["block_id", "graph_id", "graph_version"],
        "title": "NodeModel"
      },
      "NotificationPreference": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "email": { "type": "string", "format": "email", "title": "Email" },
          "preferences": {
            "additionalProperties": { "type": "boolean" },
            "propertyNames": {
              "$ref": "#/components/schemas/NotificationType"
            },
            "type": "object",
            "title": "Preferences",
            "description": "Which notifications the user wants"
          },
          "daily_limit": {
            "type": "integer",
            "title": "Daily Limit",
            "default": 10
          },
          "emails_sent_today": {
            "type": "integer",
            "title": "Emails Sent Today",
            "default": 0
          },
          "last_reset_date": {
            "type": "string",
            "format": "date-time",
            "title": "Last Reset Date"
          }
        },
        "type": "object",
        "required": ["user_id", "email"],
        "title": "NotificationPreference"
      },
      "NotificationPreferenceDTO": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "User's email address"
          },
          "preferences": {
            "additionalProperties": { "type": "boolean" },
            "propertyNames": {
              "$ref": "#/components/schemas/NotificationType"
            },
            "type": "object",
            "title": "Preferences",
            "description": "Which notifications the user wants"
          },
          "daily_limit": {
            "type": "integer",
            "title": "Daily Limit",
            "description": "Max emails per day"
          }
        },
        "type": "object",
        "required": ["email", "preferences", "daily_limit"],
        "title": "NotificationPreferenceDTO"
      },
      "NotificationType": {
        "type": "string",
        "enum": [
          "AGENT_RUN",
          "ZERO_BALANCE",
          "LOW_BALANCE",
          "BLOCK_EXECUTION_FAILED",
          "CONTINUOUS_AGENT_ERROR",
          "DAILY_SUMMARY",
          "WEEKLY_SUMMARY",
          "MONTHLY_SUMMARY",
          "REFUND_REQUEST",
          "REFUND_PROCESSED",
          "AGENT_APPROVED",
          "AGENT_REJECTED"
        ],
        "title": "NotificationType"
      },
      "OAuth2Credentials": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "provider": { "type": "string", "title": "Provider" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "is_managed": {
            "type": "boolean",
            "title": "Is Managed",
            "default": false
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "type": {
            "type": "string",
            "const": "oauth2",
            "title": "Type",
            "default": "oauth2"
          },
          "username": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Username"
          },
          "access_token": {
            "type": "string",
            "format": "password",
            "title": "Access Token",
            "writeOnly": true
          },
          "access_token_expires_at": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Access Token Expires At"
          },
          "refresh_token": {
            "anyOf": [
              { "type": "string", "format": "password", "writeOnly": true },
              { "type": "null" }
            ],
            "title": "Refresh Token"
          },
          "refresh_token_expires_at": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Refresh Token Expires At"
          },
          "scopes": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": ["provider", "access_token", "scopes"],
        "title": "OAuth2Credentials"
      },
      "OAuthApplicationInfo": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          },
          "logo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Logo Url"
          },
          "client_id": { "type": "string", "title": "Client Id" },
          "redirect_uris": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Redirect Uris"
          },
          "grant_types": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Grant Types"
          },
          "scopes": {
            "items": { "$ref": "#/components/schemas/APIKeyPermission" },
            "type": "array",
            "title": "Scopes"
          },
          "owner_id": { "type": "string", "title": "Owner Id" },
          "is_active": { "type": "boolean", "title": "Is Active" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "client_id",
          "redirect_uris",
          "grant_types",
          "scopes",
          "owner_id",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "OAuthApplicationInfo",
        "description": "OAuth application information (without client secret hash)"
      },
      "OAuthApplicationPublicInfo": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          },
          "logo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Logo Url"
          },
          "scopes": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": ["name", "scopes"],
        "title": "OAuthApplicationPublicInfo",
        "description": "Public information about an OAuth application (for consent screen)"
      },
      "OnboardingProfileRequest": {
        "properties": {
          "user_name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "User Name"
          },
          "user_role": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "User Role"
          },
          "pain_points": {
            "items": { "type": "string" },
            "type": "array",
            "maxItems": 20,
            "title": "Pain Points"
          }
        },
        "type": "object",
        "required": ["user_name", "user_role"],
        "title": "OnboardingProfileRequest",
        "description": "Request body for onboarding profile submission."
      },
      "OnboardingStatusResponse": {
        "properties": {
          "is_completed": { "type": "boolean", "title": "Is Completed" }
        },
        "type": "object",
        "required": ["is_completed"],
        "title": "OnboardingStatusResponse",
        "description": "Response for onboarding completion check."
      },
      "OnboardingStep": {
        "type": "string",
        "enum": [
          "WELCOME",
          "USAGE_REASON",
          "INTEGRATIONS",
          "AGENT_CHOICE",
          "AGENT_NEW_RUN",
          "AGENT_INPUT",
          "CONGRATS",
          "VISIT_COPILOT",
          "GET_RESULTS",
          "MARKETPLACE_VISIT",
          "MARKETPLACE_ADD_AGENT",
          "MARKETPLACE_RUN_AGENT",
          "BUILDER_SAVE_AGENT",
          "RE_RUN_AGENT",
          "SCHEDULE_AGENT",
          "RUN_AGENTS",
          "RUN_3_DAYS",
          "TRIGGER_WEBHOOK",
          "RUN_14_DAYS",
          "RUN_AGENTS_100",
          "BUILDER_OPEN",
          "BUILDER_RUN_AGENT"
        ],
        "title": "OnboardingStep"
      },
      "OrphanedScheduleDetail": {
        "properties": {
          "schedule_id": { "type": "string", "title": "Schedule Id" },
          "schedule_name": { "type": "string", "title": "Schedule Name" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "user_id": { "type": "string", "title": "User Id" },
          "orphan_reason": { "type": "string", "title": "Orphan Reason" },
          "error_detail": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error Detail"
          },
          "next_run_time": { "type": "string", "title": "Next Run Time" }
        },
        "type": "object",
        "required": [
          "schedule_id",
          "schedule_name",
          "graph_id",
          "graph_version",
          "user_id",
          "orphan_reason",
          "error_detail",
          "next_run_time"
        ],
        "title": "OrphanedScheduleDetail",
        "description": "Details about an orphaned schedule"
      },
      "OrphanedSchedulesListResponse": {
        "properties": {
          "schedules": {
            "items": { "$ref": "#/components/schemas/OrphanedScheduleDetail" },
            "type": "array",
            "title": "Schedules"
          },
          "total": { "type": "integer", "title": "Total" }
        },
        "type": "object",
        "required": ["schedules", "total"],
        "title": "OrphanedSchedulesListResponse",
        "description": "Response model for list of orphaned schedules"
      },
      "Pagination": {
        "properties": {
          "total_items": {
            "type": "integer",
            "title": "Total Items",
            "description": "Total number of items.",
            "examples": [42]
          },
          "total_pages": {
            "type": "integer",
            "title": "Total Pages",
            "description": "Total number of pages.",
            "examples": [2]
          },
          "current_page": {
            "type": "integer",
            "title": "Current Page",
            "description": "Current_page page number.",
            "examples": [1]
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "description": "Number of items per page.",
            "examples": [25]
          }
        },
        "type": "object",
        "required": ["total_items", "total_pages", "current_page", "page_size"],
        "title": "Pagination"
      },
      "PeekPendingMessagesResponse": {
        "properties": {
          "messages": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Messages"
          },
          "count": { "type": "integer", "title": "Count" }
        },
        "type": "object",
        "required": ["messages", "count"],
        "title": "PeekPendingMessagesResponse",
        "description": "Response for the pending-message peek (GET) endpoint.\n\nReturns a read-only view of the pending buffer — messages are NOT\nconsumed.  The frontend uses this to restore the queued-message\nindicator after a page refresh and to decide when to clear it once\na turn has ended."
      },
      "PendingHumanReviewModel": {
        "properties": {
          "node_exec_id": {
            "type": "string",
            "title": "Node Exec Id",
            "description": "Node execution ID (primary key)"
          },
          "node_id": {
            "type": "string",
            "title": "Node Id",
            "description": "Node definition ID (for grouping)",
            "default": ""
          },
          "user_id": {
            "type": "string",
            "title": "User Id",
            "description": "User ID associated with the review"
          },
          "graph_exec_id": {
            "type": "string",
            "title": "Graph Exec Id",
            "description": "Graph execution ID"
          },
          "graph_id": {
            "type": "string",
            "title": "Graph Id",
            "description": "Graph ID"
          },
          "graph_version": {
            "type": "integer",
            "title": "Graph Version",
            "description": "Graph version"
          },
          "payload": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "items": {}, "type": "array" },
              { "type": "string" },
              { "type": "integer" },
              { "type": "number" },
              { "type": "boolean" },
              { "type": "null" }
            ],
            "title": "Payload",
            "description": "The actual data payload awaiting review"
          },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions",
            "description": "Instructions or message for the reviewer"
          },
          "editable": {
            "type": "boolean",
            "title": "Editable",
            "description": "Whether the reviewer can edit the data"
          },
          "status": {
            "$ref": "#/components/schemas/ReviewStatus",
            "description": "Review status"
          },
          "review_message": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Review Message",
            "description": "Optional message from the reviewer"
          },
          "was_edited": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Was Edited",
            "description": "Whether the data was modified during review"
          },
          "processed": {
            "type": "boolean",
            "title": "Processed",
            "description": "Whether the review result has been processed by the execution engine",
            "default": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the review was created"
          },
          "updated_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Updated At",
            "description": "When the review was last updated"
          },
          "reviewed_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Reviewed At",
            "description": "When the review was completed"
          }
        },
        "type": "object",
        "required": [
          "node_exec_id",
          "user_id",
          "graph_exec_id",
          "graph_id",
          "graph_version",
          "payload",
          "editable",
          "status",
          "created_at"
        ],
        "title": "PendingHumanReviewModel",
        "description": "Response model for pending human review data.\n\nRepresents a human review request that is awaiting user action.\nContains all necessary information for a user to review and approve\nor reject data from a Human-in-the-Loop block execution.\n\nAttributes:\n    id: Unique identifier for the review record\n    user_id: ID of the user who must perform the review\n    node_exec_id: ID of the node execution that created this review\n    node_id: ID of the node definition (for grouping reviews from same node)\n    graph_exec_id: ID of the graph execution containing the node\n    graph_id: ID of the graph template being executed\n    graph_version: Version number of the graph template\n    payload: The actual data payload awaiting review\n    instructions: Instructions or message for the reviewer\n    editable: Whether the reviewer can edit the data\n    status: Current review status (WAITING, APPROVED, or REJECTED)\n    review_message: Optional message from the reviewer\n    created_at: Timestamp when review was created\n    updated_at: Timestamp when review was last modified\n    reviewed_at: Timestamp when review was completed (if applicable)"
      },
      "PickerTokenResponse": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token",
            "description": "OAuth access token suitable for the picker SDK call."
          },
          "access_token_expires_at": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Access Token Expires At",
            "description": "Unix timestamp at which the access token expires, if known."
          }
        },
        "type": "object",
        "required": ["access_token"],
        "title": "PickerTokenResponse",
        "description": "Short-lived OAuth access token shipped to the browser for rendering a\nprovider-hosted picker UI (e.g. Google Drive Picker). Deliberately narrow:\nonly the fields the client needs to initialize the picker widget. Issued\nfrom the user's own stored credential so ownership and scope gating are\nenforced by the credential lookup."
      },
      "PlatformCostDashboard": {
        "properties": {
          "by_provider": {
            "items": { "$ref": "#/components/schemas/ProviderCostSummary" },
            "type": "array",
            "title": "By Provider"
          },
          "by_user": {
            "items": { "$ref": "#/components/schemas/UserCostSummary" },
            "type": "array",
            "title": "By User"
          },
          "total_cost_microdollars": {
            "type": "integer",
            "title": "Total Cost Microdollars"
          },
          "total_requests": { "type": "integer", "title": "Total Requests" },
          "total_users": { "type": "integer", "title": "Total Users" },
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens",
            "default": 0
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens",
            "default": 0
          },
          "avg_input_tokens_per_request": {
            "type": "number",
            "title": "Avg Input Tokens Per Request",
            "default": 0.0
          },
          "avg_output_tokens_per_request": {
            "type": "number",
            "title": "Avg Output Tokens Per Request",
            "default": 0.0
          },
          "avg_cost_microdollars_per_request": {
            "type": "number",
            "title": "Avg Cost Microdollars Per Request",
            "default": 0.0
          },
          "cost_p50_microdollars": {
            "type": "number",
            "title": "Cost P50 Microdollars",
            "default": 0.0
          },
          "cost_p75_microdollars": {
            "type": "number",
            "title": "Cost P75 Microdollars",
            "default": 0.0
          },
          "cost_p95_microdollars": {
            "type": "number",
            "title": "Cost P95 Microdollars",
            "default": 0.0
          },
          "cost_p99_microdollars": {
            "type": "number",
            "title": "Cost P99 Microdollars",
            "default": 0.0
          },
          "cost_buckets": {
            "items": { "$ref": "#/components/schemas/CostBucket" },
            "type": "array",
            "title": "Cost Buckets",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "by_provider",
          "by_user",
          "total_cost_microdollars",
          "total_requests",
          "total_users"
        ],
        "title": "PlatformCostDashboard"
      },
      "PlatformCostExportResponse": {
        "properties": {
          "logs": {
            "items": { "$ref": "#/components/schemas/CostLogRow" },
            "type": "array",
            "title": "Logs"
          },
          "total_rows": { "type": "integer", "title": "Total Rows" },
          "truncated": { "type": "boolean", "title": "Truncated" }
        },
        "type": "object",
        "required": ["logs", "total_rows", "truncated"],
        "title": "PlatformCostExportResponse"
      },
      "PlatformCostLogsResponse": {
        "properties": {
          "logs": {
            "items": { "$ref": "#/components/schemas/CostLogRow" },
            "type": "array",
            "title": "Logs"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["logs", "pagination"],
        "title": "PlatformCostLogsResponse"
      },
      "PlatformLinkInfo": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "platform": { "type": "string", "title": "Platform" },
          "platform_server_id": {
            "type": "string",
            "title": "Platform Server Id"
          },
          "owner_platform_user_id": {
            "type": "string",
            "title": "Owner Platform User Id"
          },
          "server_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Server Name"
          },
          "linked_at": {
            "type": "string",
            "format": "date-time",
            "title": "Linked At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "platform",
          "platform_server_id",
          "owner_platform_user_id",
          "server_name",
          "linked_at"
        ],
        "title": "PlatformLinkInfo"
      },
      "PlatformUserLinkInfo": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "platform": { "type": "string", "title": "Platform" },
          "platform_user_id": { "type": "string", "title": "Platform User Id" },
          "platform_username": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Platform Username"
          },
          "linked_at": {
            "type": "string",
            "format": "date-time",
            "title": "Linked At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "platform",
          "platform_user_id",
          "platform_username",
          "linked_at"
        ],
        "title": "PlatformUserLinkInfo"
      },
      "PostmarkBounceEnum": {
        "type": "integer",
        "enum": [
          1, 2, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384,
          100000, 100001, 100002, 100003, 100006, 100007, 100008, 100009, 100010
        ],
        "title": "PostmarkBounceEnum"
      },
      "PostmarkBounceWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "Bounce",
            "title": "Recordtype",
            "default": "Bounce"
          },
          "ID": { "type": "integer", "title": "Id" },
          "Type": { "type": "string", "title": "Type" },
          "TypeCode": { "$ref": "#/components/schemas/PostmarkBounceEnum" },
          "Tag": { "type": "string", "title": "Tag" },
          "MessageID": { "type": "string", "title": "Messageid" },
          "Details": { "type": "string", "title": "Details" },
          "Email": { "type": "string", "title": "Email" },
          "From": { "type": "string", "title": "From" },
          "BouncedAt": { "type": "string", "title": "Bouncedat" },
          "Inactive": { "type": "boolean", "title": "Inactive" },
          "DumpAvailable": { "type": "boolean", "title": "Dumpavailable" },
          "CanActivate": { "type": "boolean", "title": "Canactivate" },
          "Subject": { "type": "string", "title": "Subject" },
          "ServerID": { "type": "integer", "title": "Serverid" },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "Content": { "type": "string", "title": "Content" },
          "Name": { "type": "string", "title": "Name" },
          "Description": { "type": "string", "title": "Description" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "ID",
          "Type",
          "TypeCode",
          "Tag",
          "MessageID",
          "Details",
          "Email",
          "From",
          "BouncedAt",
          "Inactive",
          "DumpAvailable",
          "CanActivate",
          "Subject",
          "ServerID",
          "MessageStream",
          "Content",
          "Name",
          "Description",
          "Metadata"
        ],
        "title": "PostmarkBounceWebhook"
      },
      "PostmarkClickWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "Click",
            "title": "Recordtype",
            "default": "Click"
          },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          },
          "Recipient": { "type": "string", "title": "Recipient" },
          "MessageID": { "type": "string", "title": "Messageid" },
          "ReceivedAt": { "type": "string", "title": "Receivedat" },
          "Platform": { "type": "string", "title": "Platform" },
          "ClickLocation": { "type": "string", "title": "Clicklocation" },
          "OriginalLink": { "type": "string", "title": "Originallink" },
          "Tag": { "type": "string", "title": "Tag" },
          "UserAgent": { "type": "string", "title": "Useragent" },
          "OS": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Os"
          },
          "Client": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Client"
          },
          "Geo": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Geo"
          }
        },
        "type": "object",
        "required": [
          "MessageStream",
          "Metadata",
          "Recipient",
          "MessageID",
          "ReceivedAt",
          "Platform",
          "ClickLocation",
          "OriginalLink",
          "Tag",
          "UserAgent",
          "OS",
          "Client",
          "Geo"
        ],
        "title": "PostmarkClickWebhook"
      },
      "PostmarkDeliveryWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "Delivery",
            "title": "Recordtype",
            "default": "Delivery"
          },
          "ServerID": { "type": "integer", "title": "Serverid" },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "MessageID": { "type": "string", "title": "Messageid" },
          "Recipient": { "type": "string", "title": "Recipient" },
          "Tag": { "type": "string", "title": "Tag" },
          "DeliveredAt": { "type": "string", "title": "Deliveredat" },
          "Details": { "type": "string", "title": "Details" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "ServerID",
          "MessageStream",
          "MessageID",
          "Recipient",
          "Tag",
          "DeliveredAt",
          "Details",
          "Metadata"
        ],
        "title": "PostmarkDeliveryWebhook"
      },
      "PostmarkOpenWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "Open",
            "title": "Recordtype",
            "default": "Open"
          },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          },
          "FirstOpen": { "type": "boolean", "title": "Firstopen" },
          "Recipient": { "type": "string", "title": "Recipient" },
          "MessageID": { "type": "string", "title": "Messageid" },
          "ReceivedAt": { "type": "string", "title": "Receivedat" },
          "Platform": { "type": "string", "title": "Platform" },
          "ReadSeconds": { "type": "integer", "title": "Readseconds" },
          "Tag": { "type": "string", "title": "Tag" },
          "UserAgent": { "type": "string", "title": "Useragent" },
          "OS": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Os"
          },
          "Client": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Client"
          },
          "Geo": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Geo"
          }
        },
        "type": "object",
        "required": [
          "MessageStream",
          "Metadata",
          "FirstOpen",
          "Recipient",
          "MessageID",
          "ReceivedAt",
          "Platform",
          "ReadSeconds",
          "Tag",
          "UserAgent",
          "OS",
          "Client",
          "Geo"
        ],
        "title": "PostmarkOpenWebhook"
      },
      "PostmarkSpamComplaintWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "SpamComplaint",
            "title": "Recordtype",
            "default": "SpamComplaint"
          },
          "ID": { "type": "integer", "title": "Id" },
          "Type": { "type": "string", "title": "Type" },
          "TypeCode": { "type": "integer", "title": "Typecode" },
          "Tag": { "type": "string", "title": "Tag" },
          "MessageID": { "type": "string", "title": "Messageid" },
          "Details": { "type": "string", "title": "Details" },
          "Email": { "type": "string", "title": "Email" },
          "From": { "type": "string", "title": "From" },
          "BouncedAt": { "type": "string", "title": "Bouncedat" },
          "Inactive": { "type": "boolean", "title": "Inactive" },
          "DumpAvailable": { "type": "boolean", "title": "Dumpavailable" },
          "CanActivate": { "type": "boolean", "title": "Canactivate" },
          "Subject": { "type": "string", "title": "Subject" },
          "ServerID": { "type": "integer", "title": "Serverid" },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "Content": { "type": "string", "title": "Content" },
          "Name": { "type": "string", "title": "Name" },
          "Description": { "type": "string", "title": "Description" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "ID",
          "Type",
          "TypeCode",
          "Tag",
          "MessageID",
          "Details",
          "Email",
          "From",
          "BouncedAt",
          "Inactive",
          "DumpAvailable",
          "CanActivate",
          "Subject",
          "ServerID",
          "MessageStream",
          "Content",
          "Name",
          "Description",
          "Metadata"
        ],
        "title": "PostmarkSpamComplaintWebhook"
      },
      "PostmarkSubscriptionChangeWebhook": {
        "properties": {
          "RecordType": {
            "type": "string",
            "const": "SubscriptionChange",
            "title": "Recordtype",
            "default": "SubscriptionChange"
          },
          "MessageID": { "type": "string", "title": "Messageid" },
          "ServerID": { "type": "integer", "title": "Serverid" },
          "MessageStream": { "type": "string", "title": "Messagestream" },
          "ChangedAt": { "type": "string", "title": "Changedat" },
          "Recipient": { "type": "string", "title": "Recipient" },
          "Origin": { "type": "string", "title": "Origin" },
          "SuppressSending": { "type": "boolean", "title": "Suppresssending" },
          "SuppressionReason": {
            "type": "string",
            "title": "Suppressionreason"
          },
          "Tag": { "type": "string", "title": "Tag" },
          "Metadata": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "MessageID",
          "ServerID",
          "MessageStream",
          "ChangedAt",
          "Recipient",
          "Origin",
          "SuppressSending",
          "SuppressionReason",
          "Tag",
          "Metadata"
        ],
        "title": "PostmarkSubscriptionChangeWebhook"
      },
      "Profile": {
        "properties": {
          "username": { "type": "string", "title": "Username" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "avatar_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Avatar Url"
          },
          "links": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Links"
          }
        },
        "type": "object",
        "required": ["username", "name", "description", "avatar_url", "links"],
        "title": "Profile",
        "description": "Marketplace user profile (only attributes that the user can update)"
      },
      "ProfileDetails": {
        "properties": {
          "username": { "type": "string", "title": "Username" },
          "name": { "type": "string", "title": "Name" },
          "description": { "type": "string", "title": "Description" },
          "avatar_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Avatar Url"
          },
          "links": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Links"
          },
          "is_featured": { "type": "boolean", "title": "Is Featured" }
        },
        "type": "object",
        "required": [
          "username",
          "name",
          "description",
          "avatar_url",
          "links",
          "is_featured"
        ],
        "title": "ProfileDetails",
        "description": "Marketplace user profile (including read-only fields)"
      },
      "Provider": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Provider name for integrations. Can be any string value, including custom provider names."
          },
          "description": { "type": "string", "title": "Description" },
          "integration_count": {
            "type": "integer",
            "title": "Integration Count"
          }
        },
        "type": "object",
        "required": ["name", "description", "integration_count"],
        "title": "Provider"
      },
      "ProviderConstants": {
        "properties": {
          "PROVIDER_NAMES": {
            "additionalProperties": { "type": "string" },
            "type": "object",
            "title": "Provider Names",
            "description": "All available provider names as a constant mapping",
            "examples": [
              {
                "ANTHROPIC": "anthropic",
                "EXA": "exa",
                "EXAMPLE_SERVICE": "example-service",
                "GEM": "gem",
                "OPENAI": "openai"
              }
            ]
          }
        },
        "type": "object",
        "title": "ProviderConstants",
        "description": "Model that exposes all provider names as a constant in the OpenAPI schema.\nThis is designed to be converted by Orval into a TypeScript constant."
      },
      "ProviderCostSummary": {
        "properties": {
          "provider": { "type": "string", "title": "Provider" },
          "tracking_type": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Tracking Type"
          },
          "model": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Model"
          },
          "total_cost_microdollars": {
            "type": "integer",
            "title": "Total Cost Microdollars"
          },
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens"
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens"
          },
          "total_cache_read_tokens": {
            "type": "integer",
            "title": "Total Cache Read Tokens",
            "default": 0
          },
          "total_cache_creation_tokens": {
            "type": "integer",
            "title": "Total Cache Creation Tokens",
            "default": 0
          },
          "total_duration_seconds": {
            "type": "number",
            "title": "Total Duration Seconds",
            "default": 0.0
          },
          "total_tracking_amount": {
            "type": "number",
            "title": "Total Tracking Amount",
            "default": 0.0
          },
          "request_count": { "type": "integer", "title": "Request Count" }
        },
        "type": "object",
        "required": [
          "provider",
          "total_cost_microdollars",
          "total_input_tokens",
          "total_output_tokens",
          "request_count"
        ],
        "title": "ProviderCostSummary"
      },
      "ProviderEnumResponse": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "A provider name from the complete list of providers"
          }
        },
        "type": "object",
        "required": ["provider"],
        "title": "ProviderEnumResponse",
        "description": "Response containing a provider from the enum."
      },
      "ProviderMetadata": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Provider slug (e.g. ``github``)"
          },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description",
            "description": "One-line human-readable summary of what the provider does. Declared via ``ProviderBuilder.with_description(...)`` in the provider's ``_config.py``. ``None`` if not set."
          },
          "supported_auth_types": {
            "items": {
              "type": "string",
              "enum": ["api_key", "oauth2", "user_password", "host_scoped"]
            },
            "type": "array",
            "title": "Supported Auth Types",
            "description": "Credential types this provider accepts. Drives which connection tabs the settings UI renders for the provider. Empty list means no auth types declared."
          }
        },
        "type": "object",
        "required": ["name"],
        "title": "ProviderMetadata",
        "description": "Display metadata for a provider, shown in the settings integrations UI."
      },
      "ProviderNamesResponse": {
        "properties": {
          "providers": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Providers",
            "description": "List of all available provider names"
          }
        },
        "type": "object",
        "title": "ProviderNamesResponse",
        "description": "Response containing list of all provider names."
      },
      "ProviderResponse": {
        "properties": {
          "providers": {
            "items": { "$ref": "#/components/schemas/Provider" },
            "type": "array",
            "title": "Providers"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["providers", "pagination"],
        "title": "ProviderResponse"
      },
      "PushSubscribeRequest": {
        "properties": {
          "endpoint": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Endpoint"
          },
          "keys": { "$ref": "#/components/schemas/PushSubscriptionKeys" },
          "user_agent": {
            "anyOf": [
              { "type": "string", "maxLength": 512 },
              { "type": "null" }
            ],
            "title": "User Agent"
          }
        },
        "type": "object",
        "required": ["endpoint", "keys"],
        "title": "PushSubscribeRequest"
      },
      "PushSubscriptionKeys": {
        "properties": {
          "p256dh": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "P256Dh"
          },
          "auth": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Auth"
          }
        },
        "type": "object",
        "required": ["p256dh", "auth"],
        "title": "PushSubscriptionKeys"
      },
      "PushUnsubscribeRequest": {
        "properties": {
          "endpoint": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 1,
            "title": "Endpoint"
          }
        },
        "type": "object",
        "required": ["endpoint"],
        "title": "PushUnsubscribeRequest"
      },
      "QueuePendingMessageRequest": {
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 64000,
            "title": "Message"
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": { "type": "string" },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Context"
          },
          "file_ids": {
            "anyOf": [
              {
                "items": { "type": "string" },
                "type": "array",
                "maxItems": 20
              },
              { "type": "null" }
            ],
            "title": "File Ids"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "QueuePendingMessageRequest",
        "description": "Request model for queueing a follow-up while a turn is running."
      },
      "QueuePendingMessageResponse": {
        "properties": {
          "buffer_length": { "type": "integer", "title": "Buffer Length" },
          "max_buffer_length": {
            "type": "integer",
            "title": "Max Buffer Length"
          },
          "turn_in_flight": { "type": "boolean", "title": "Turn In Flight" }
        },
        "type": "object",
        "required": ["buffer_length", "max_buffer_length", "turn_in_flight"],
        "title": "QueuePendingMessageResponse",
        "description": "Response returned when a message is queued because the session already\nhas a turn in flight.\n\n- ``buffer_length``: how many messages are now in the session's\n  pending buffer (after this push)\n- ``max_buffer_length``: the per-session cap (server-side constant)\n- ``turn_in_flight``: ``True`` if a copilot turn was running when\n  we checked — purely informational for UX feedback."
      },
      "RateLimitResetResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "credits_charged": {
            "type": "integer",
            "title": "Credits Charged",
            "description": "Credits charged (in cents)"
          },
          "remaining_balance": {
            "type": "integer",
            "title": "Remaining Balance",
            "description": "Credit balance after charge (in cents)"
          },
          "usage": {
            "$ref": "#/components/schemas/CoPilotUsagePublic",
            "description": "Updated usage status after reset (percentages only)"
          }
        },
        "type": "object",
        "required": [
          "success",
          "credits_charged",
          "remaining_balance",
          "usage"
        ],
        "title": "RateLimitResetResponse",
        "description": "Response from resetting the daily rate limit."
      },
      "RecentExecution": {
        "properties": {
          "status": { "type": "string", "title": "Status" },
          "correctness_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Correctness Score"
          },
          "activity_summary": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Activity Summary"
          }
        },
        "type": "object",
        "required": ["status"],
        "title": "RecentExecution",
        "description": "Summary of a recent execution for quality assessment.\n\nUsed by the LLM to understand the agent's recent performance with specific examples\nrather than just aggregate statistics."
      },
      "RefundRequest": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "transaction_key": { "type": "string", "title": "Transaction Key" },
          "amount": { "type": "integer", "title": "Amount" },
          "reason": { "type": "string", "title": "Reason" },
          "result": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Result"
          },
          "status": { "type": "string", "title": "Status" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "transaction_key",
          "amount",
          "reason",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "RefundRequest"
      },
      "RequestTopUp": {
        "properties": {
          "credit_amount": { "type": "integer", "title": "Credit Amount" }
        },
        "type": "object",
        "required": ["credit_amount"],
        "title": "RequestTopUp"
      },
      "RequeueExecutionResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "requeued_count": {
            "type": "integer",
            "title": "Requeued Count",
            "default": 0
          },
          "message": { "type": "string", "title": "Message" }
        },
        "type": "object",
        "required": ["success", "message"],
        "title": "RequeueExecutionResponse",
        "description": "Response model for requeue execution operations"
      },
      "ResponseType": {
        "type": "string",
        "enum": [
          "error",
          "no_results",
          "need_login",
          "agents_found",
          "agent_details",
          "setup_requirements",
          "input_validation_error",
          "execution_started",
          "agent_output",
          "understanding_updated",
          "suggested_goal",
          "agent_builder_guide",
          "agent_builder_preview",
          "agent_builder_saved",
          "agent_builder_clarification_needed",
          "agent_builder_validation_result",
          "agent_builder_fix_result",
          "block_list",
          "block_details",
          "block_output",
          "review_required",
          "schedule_list",
          "schedule_deleted",
          "schedule_created",
          "agent_trigger_list",
          "mcp_guide",
          "mcp_tools_discovered",
          "mcp_tool_output",
          "doc_search_results",
          "doc_page",
          "workspace_file_list",
          "workspace_file_content",
          "workspace_file_metadata",
          "workspace_file_written",
          "workspace_file_deleted",
          "folder_created",
          "folder_list",
          "folder_updated",
          "folder_moved",
          "folder_deleted",
          "agents_moved_to_folder",
          "browser_navigate",
          "browser_act",
          "browser_screenshot",
          "bash_exec",
          "web_fetch",
          "web_search",
          "feature_request_search",
          "feature_request_created",
          "memory_store",
          "memory_search",
          "memory_forget_candidates",
          "memory_forget_confirm",
          "todo_write",
          "platform_info",
          "skill_stored",
          "skill_loaded",
          "skill_deleted",
          "skill_list"
        ],
        "title": "ResponseType",
        "description": "Types of tool responses."
      },
      "ReviewItem": {
        "properties": {
          "node_exec_id": {
            "type": "string",
            "title": "Node Exec Id",
            "description": "Node execution ID to review"
          },
          "approved": {
            "type": "boolean",
            "title": "Approved",
            "description": "Whether this review is approved (True) or rejected (False)"
          },
          "message": {
            "anyOf": [
              { "type": "string", "maxLength": 2000 },
              { "type": "null" }
            ],
            "title": "Message",
            "description": "Optional review message"
          },
          "reviewed_data": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "items": {}, "type": "array" },
              { "type": "string" },
              { "type": "integer" },
              { "type": "number" },
              { "type": "boolean" },
              { "type": "null" }
            ],
            "title": "Reviewed Data",
            "description": "Optional edited data (ignored if approved=False)"
          },
          "auto_approve_future": {
            "type": "boolean",
            "title": "Auto Approve Future",
            "description": "If true and this review is approved, future executions of this same block (node) will be automatically approved. This only affects approved reviews.",
            "default": false
          }
        },
        "type": "object",
        "required": ["node_exec_id", "approved"],
        "title": "ReviewItem",
        "description": "Single review item for processing."
      },
      "ReviewRequest": {
        "properties": {
          "reviews": {
            "items": { "$ref": "#/components/schemas/ReviewItem" },
            "type": "array",
            "title": "Reviews",
            "description": "All reviews with their approval status, data, and messages"
          }
        },
        "type": "object",
        "required": ["reviews"],
        "title": "ReviewRequest",
        "description": "Request model for processing ALL pending reviews for an execution.\n\nThis request must include ALL pending reviews for a graph execution.\nEach review will be either approved (with optional data modifications)\nor rejected (data ignored). The execution will resume only after ALL reviews are processed.\n\nEach review item can individually specify whether to auto-approve future executions\nof the same block via the `auto_approve_future` field on ReviewItem."
      },
      "ReviewResponse": {
        "properties": {
          "approved_count": {
            "type": "integer",
            "title": "Approved Count",
            "description": "Number of reviews successfully approved"
          },
          "rejected_count": {
            "type": "integer",
            "title": "Rejected Count",
            "description": "Number of reviews successfully rejected"
          },
          "failed_count": {
            "type": "integer",
            "title": "Failed Count",
            "description": "Number of reviews that failed processing"
          },
          "error": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error",
            "description": "Error message if operation failed"
          }
        },
        "type": "object",
        "required": ["approved_count", "rejected_count", "failed_count"],
        "title": "ReviewResponse",
        "description": "Response from review endpoint."
      },
      "ReviewStatus": {
        "type": "string",
        "enum": ["WAITING", "APPROVED", "REJECTED"],
        "title": "ReviewStatus"
      },
      "ReviewSubmissionRequest": {
        "properties": {
          "store_listing_version_id": {
            "type": "string",
            "title": "Store Listing Version Id"
          },
          "is_approved": { "type": "boolean", "title": "Is Approved" },
          "comments": { "type": "string", "title": "Comments" },
          "internal_comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Internal Comments"
          }
        },
        "type": "object",
        "required": ["store_listing_version_id", "is_approved", "comments"],
        "title": "ReviewSubmissionRequest"
      },
      "RunningExecutionDetail": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_name": { "type": "string", "title": "Graph Name" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "status": { "type": "string", "title": "Status" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Started At"
          },
          "queue_status": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Queue Status"
          }
        },
        "type": "object",
        "required": [
          "execution_id",
          "graph_id",
          "graph_name",
          "graph_version",
          "user_id",
          "user_email",
          "status",
          "created_at",
          "started_at"
        ],
        "title": "RunningExecutionDetail",
        "description": "Details about a running execution for admin view"
      },
      "RunningExecutionsListResponse": {
        "properties": {
          "executions": {
            "items": { "$ref": "#/components/schemas/RunningExecutionDetail" },
            "type": "array",
            "title": "Executions"
          },
          "total": { "type": "integer", "title": "Total" }
        },
        "type": "object",
        "required": ["executions", "total"],
        "title": "RunningExecutionsListResponse",
        "description": "Response model for list of running executions"
      },
      "ScheduleCleanupRequest": {
        "properties": {
          "schedule_ids": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Schedule Ids"
          }
        },
        "type": "object",
        "required": ["schedule_ids"],
        "title": "ScheduleCleanupRequest",
        "description": "Request model for cleaning up schedules"
      },
      "ScheduleCleanupResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "deleted_count": {
            "type": "integer",
            "title": "Deleted Count",
            "default": 0
          },
          "message": { "type": "string", "title": "Message" }
        },
        "type": "object",
        "required": ["success", "message"],
        "title": "ScheduleCleanupResponse",
        "description": "Response model for schedule cleanup operations"
      },
      "ScheduleCreationRequest": {
        "properties": {
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          },
          "name": { "type": "string", "title": "Name" },
          "cron": { "type": "string", "title": "Cron" },
          "inputs": {
            "additionalProperties": true,
            "type": "object",
            "title": "Inputs"
          },
          "credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Credentials"
          },
          "timezone": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Timezone",
            "description": "User's timezone for scheduling (e.g., 'America/New_York'). If not provided, will use user's saved timezone or UTC."
          }
        },
        "type": "object",
        "required": ["name", "cron", "inputs"],
        "title": "ScheduleCreationRequest"
      },
      "ScheduleDeletedResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "schedule_deleted"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "schedule_id": { "type": "string", "title": "Schedule Id" }
        },
        "type": "object",
        "required": ["message", "schedule_id"],
        "title": "ScheduleDeletedResponse",
        "description": "Response confirming a schedule was deleted."
      },
      "ScheduleDetail": {
        "properties": {
          "schedule_id": { "type": "string", "title": "Schedule Id" },
          "schedule_name": { "type": "string", "title": "Schedule Name" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_name": { "type": "string", "title": "Graph Name" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "cron": { "type": "string", "title": "Cron" },
          "timezone": { "type": "string", "title": "Timezone" },
          "next_run_time": { "type": "string", "title": "Next Run Time" },
          "created_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "schedule_id",
          "schedule_name",
          "graph_id",
          "graph_name",
          "graph_version",
          "user_id",
          "user_email",
          "cron",
          "timezone",
          "next_run_time"
        ],
        "title": "ScheduleDetail",
        "description": "Details about a schedule for admin view"
      },
      "ScheduleHealthMetrics": {
        "properties": {
          "total_schedules": { "type": "integer", "title": "Total Schedules" },
          "user_schedules": { "type": "integer", "title": "User Schedules" },
          "system_schedules": {
            "type": "integer",
            "title": "System Schedules"
          },
          "orphaned_deleted_graph": {
            "type": "integer",
            "title": "Orphaned Deleted Graph"
          },
          "orphaned_no_library_access": {
            "type": "integer",
            "title": "Orphaned No Library Access"
          },
          "orphaned_invalid_credentials": {
            "type": "integer",
            "title": "Orphaned Invalid Credentials"
          },
          "orphaned_validation_failed": {
            "type": "integer",
            "title": "Orphaned Validation Failed"
          },
          "total_orphaned": { "type": "integer", "title": "Total Orphaned" },
          "schedules_next_hour": {
            "type": "integer",
            "title": "Schedules Next Hour"
          },
          "schedules_next_24h": {
            "type": "integer",
            "title": "Schedules Next 24H"
          },
          "total_runs_next_hour": {
            "type": "integer",
            "title": "Total Runs Next Hour"
          },
          "total_runs_next_24h": {
            "type": "integer",
            "title": "Total Runs Next 24H"
          },
          "timestamp": { "type": "string", "title": "Timestamp" }
        },
        "type": "object",
        "required": [
          "total_schedules",
          "user_schedules",
          "system_schedules",
          "orphaned_deleted_graph",
          "orphaned_no_library_access",
          "orphaned_invalid_credentials",
          "orphaned_validation_failed",
          "total_orphaned",
          "schedules_next_hour",
          "schedules_next_24h",
          "total_runs_next_hour",
          "total_runs_next_24h",
          "timestamp"
        ],
        "title": "ScheduleHealthMetrics",
        "description": "Summary of schedule health diagnostics"
      },
      "ScheduleListResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "schedule_list"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "schedules": {
            "items": { "$ref": "#/components/schemas/ScheduleSummary" },
            "type": "array",
            "title": "Schedules"
          }
        },
        "type": "object",
        "required": ["message", "schedules"],
        "title": "ScheduleListResponse",
        "description": "Response containing a list of schedules."
      },
      "ScheduleSummary": {
        "properties": {
          "schedule_id": { "type": "string", "title": "Schedule Id" },
          "kind": {
            "type": "string",
            "enum": ["graph", "copilot_turn"],
            "title": "Kind"
          },
          "name": { "type": "string", "title": "Name" },
          "timezone": { "type": "string", "title": "Timezone" },
          "next_run_time": { "type": "string", "title": "Next Run Time" },
          "cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Cron"
          },
          "run_at": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Run At"
          },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "message": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "schedule_id",
          "kind",
          "name",
          "timezone",
          "next_run_time"
        ],
        "title": "ScheduleSummary",
        "description": "Summary of a single schedule (either a graph run or copilot turn)."
      },
      "SchedulesListResponse": {
        "properties": {
          "schedules": {
            "items": { "$ref": "#/components/schemas/ScheduleDetail" },
            "type": "array",
            "title": "Schedules"
          },
          "total": { "type": "integer", "title": "Total" }
        },
        "type": "object",
        "required": ["schedules", "total"],
        "title": "SchedulesListResponse",
        "description": "Response model for list of schedules"
      },
      "SearchEntry": {
        "properties": {
          "search_query": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Search Query"
          },
          "filter": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "blocks",
                    "integrations",
                    "marketplace_agents",
                    "my_agents"
                  ]
                },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Filter"
          },
          "by_creator": {
            "anyOf": [
              { "items": { "type": "string" }, "type": "array" },
              { "type": "null" }
            ],
            "title": "By Creator"
          },
          "search_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Search Id"
          }
        },
        "type": "object",
        "title": "SearchEntry"
      },
      "SearchResponse": {
        "properties": {
          "items": {
            "items": {
              "anyOf": [
                { "$ref": "#/components/schemas/BlockInfo" },
                { "$ref": "#/components/schemas/LibraryAgent" },
                { "$ref": "#/components/schemas/StoreAgent" }
              ]
            },
            "type": "array",
            "title": "Items"
          },
          "search_id": { "type": "string", "title": "Search Id" },
          "total_items": {
            "additionalProperties": { "type": "integer" },
            "propertyNames": {
              "enum": [
                "blocks",
                "integrations",
                "marketplace_agents",
                "my_agents"
              ]
            },
            "type": "object",
            "title": "Total Items"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["items", "search_id", "total_items", "pagination"],
        "title": "SearchResponse"
      },
      "SessionDetailResponse": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "created_at": { "type": "string", "title": "Created At" },
          "updated_at": { "type": "string", "title": "Updated At" },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "chat_status": {
            "type": "string",
            "title": "Chat Status",
            "default": "idle"
          },
          "messages": {
            "items": { "additionalProperties": true, "type": "object" },
            "type": "array",
            "title": "Messages"
          },
          "active_stream": {
            "anyOf": [
              { "$ref": "#/components/schemas/ActiveStreamInfo" },
              { "type": "null" }
            ]
          },
          "has_more_messages": {
            "type": "boolean",
            "title": "Has More Messages",
            "default": false
          },
          "oldest_sequence": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Oldest Sequence"
          },
          "total_prompt_tokens": {
            "type": "integer",
            "title": "Total Prompt Tokens",
            "default": 0
          },
          "total_completion_tokens": {
            "type": "integer",
            "title": "Total Completion Tokens",
            "default": 0
          },
          "metadata": {
            "$ref": "#/components/schemas/ChatSessionMetadata",
            "default": { "dry_run": false }
          }
        },
        "type": "object",
        "required": ["id", "created_at", "updated_at", "user_id", "messages"],
        "title": "SessionDetailResponse",
        "description": "Response model providing complete details for a chat session, including messages."
      },
      "SessionSummaryResponse": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "created_at": { "type": "string", "title": "Created At" },
          "updated_at": { "type": "string", "title": "Updated At" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "chat_status": {
            "type": "string",
            "title": "Chat Status",
            "default": "idle"
          },
          "is_processing": { "type": "boolean", "title": "Is Processing" },
          "source_platform": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Source Platform"
          }
        },
        "type": "object",
        "required": ["id", "created_at", "updated_at", "is_processing"],
        "title": "SessionSummaryResponse",
        "description": "Response model for a session summary (without messages)."
      },
      "SetGraphActiveVersion": {
        "properties": {
          "active_graph_version": {
            "type": "integer",
            "title": "Active Graph Version"
          }
        },
        "type": "object",
        "required": ["active_graph_version"],
        "title": "SetGraphActiveVersion"
      },
      "SetUserTierRequest": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "tier": { "$ref": "#/components/schemas/SubscriptionTier" }
        },
        "type": "object",
        "required": ["user_id", "tier"],
        "title": "SetUserTierRequest"
      },
      "SetupInfo": {
        "properties": {
          "agent_id": { "type": "string", "title": "Agent Id" },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "requirements": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Requirements"
          },
          "user_readiness": { "$ref": "#/components/schemas/UserReadiness" }
        },
        "type": "object",
        "required": ["agent_id", "agent_name"],
        "title": "SetupInfo",
        "description": "Complete setup information."
      },
      "SetupRequirementsResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "setup_requirements"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "setup_info": { "$ref": "#/components/schemas/SetupInfo" },
          "graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Id"
          },
          "graph_version": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Graph Version"
          }
        },
        "type": "object",
        "required": ["message", "setup_info"],
        "title": "SetupRequirementsResponse",
        "description": "Response for validate action."
      },
      "ShareRequest": {
        "properties": {},
        "type": "object",
        "title": "ShareRequest",
        "description": "Optional request body for share endpoint."
      },
      "SharedChatLinkedExecution": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Name"
          },
          "share_token": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Share Token"
          }
        },
        "type": "object",
        "required": ["execution_id", "graph_id", "graph_name", "share_token"],
        "title": "SharedChatLinkedExecution",
        "description": "Drill-in pointer for an AgentGraphExecution shared alongside a chat."
      },
      "SharedChatMessage": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "role": { "type": "string", "title": "Role" },
          "content": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Content"
          },
          "name": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Name"
          },
          "tool_call_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Tool Call Id"
          },
          "tool_calls": {
            "anyOf": [
              {
                "items": { "additionalProperties": true, "type": "object" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Tool Calls"
          },
          "function_call": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Function Call"
          },
          "sequence": { "type": "integer", "title": "Sequence" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "role",
          "content",
          "name",
          "tool_call_id",
          "tool_calls",
          "function_call",
          "sequence",
          "created_at"
        ],
        "title": "SharedChatMessage",
        "description": "Public-safe projection of a single chat message."
      },
      "SharedChatMessagesPage": {
        "properties": {
          "messages": {
            "items": { "$ref": "#/components/schemas/SharedChatMessage" },
            "type": "array",
            "title": "Messages"
          },
          "has_more": { "type": "boolean", "title": "Has More" },
          "oldest_sequence": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Oldest Sequence"
          }
        },
        "type": "object",
        "required": ["messages", "has_more", "oldest_sequence"],
        "title": "SharedChatMessagesPage",
        "description": "Paginated message window for the public viewer."
      },
      "SharedChatSession": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "shared_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Shared At"
          },
          "linked_executions": {
            "items": {
              "$ref": "#/components/schemas/SharedChatLinkedExecution"
            },
            "type": "array",
            "title": "Linked Executions"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at",
          "shared_at",
          "linked_executions"
        ],
        "title": "SharedChatSession",
        "description": "Public-safe projection of a chat session (header only)."
      },
      "SharedExecutionResponse": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "graph_name": { "type": "string", "title": "Graph Name" },
          "graph_description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Graph Description"
          },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "outputs": {
            "additionalProperties": { "items": {}, "type": "array" },
            "type": "object",
            "title": "Outputs"
          }
        },
        "type": "object",
        "required": [
          "id",
          "graph_name",
          "graph_description",
          "status",
          "created_at",
          "outputs"
        ],
        "title": "SharedExecutionResponse",
        "description": "Public-safe response for shared executions"
      },
      "Stats": {
        "properties": {
          "cost": {
            "type": "integer",
            "title": "Cost",
            "description": "Execution cost (cents)",
            "default": 0
          },
          "duration": {
            "type": "number",
            "title": "Duration",
            "description": "Seconds from start to end of run",
            "default": 0
          },
          "duration_cpu_only": {
            "type": "number",
            "title": "Duration Cpu Only",
            "description": "CPU sec of duration",
            "default": 0
          },
          "node_exec_time": {
            "type": "number",
            "title": "Node Exec Time",
            "description": "Seconds of total node runtime",
            "default": 0
          },
          "node_exec_time_cpu_only": {
            "type": "number",
            "title": "Node Exec Time Cpu Only",
            "description": "CPU sec of node_exec_time",
            "default": 0
          },
          "node_exec_count": {
            "type": "integer",
            "title": "Node Exec Count",
            "description": "Number of node executions",
            "default": 0
          },
          "node_error_count": {
            "type": "integer",
            "title": "Node Error Count",
            "description": "Number of node errors",
            "default": 0
          },
          "error": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Error",
            "description": "Error message if any"
          },
          "activity_status": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Activity Status",
            "description": "AI-generated summary of what the agent did"
          },
          "correctness_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Correctness Score",
            "description": "AI-generated score (0.0-1.0) indicating how well the execution achieved its intended purpose"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "title": "Stats"
      },
      "StopExecutionRequest": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" }
        },
        "type": "object",
        "required": ["execution_id"],
        "title": "StopExecutionRequest",
        "description": "Request model for stopping a single execution"
      },
      "StopExecutionResponse": {
        "properties": {
          "success": { "type": "boolean", "title": "Success" },
          "stopped_count": {
            "type": "integer",
            "title": "Stopped Count",
            "default": 0
          },
          "message": { "type": "string", "title": "Message" }
        },
        "type": "object",
        "required": ["success", "message"],
        "title": "StopExecutionResponse",
        "description": "Response model for stop execution operations"
      },
      "StopExecutionsRequest": {
        "properties": {
          "execution_ids": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Execution Ids"
          }
        },
        "type": "object",
        "required": ["execution_ids"],
        "title": "StopExecutionsRequest",
        "description": "Request model for stopping multiple executions"
      },
      "StorageUsageResponse": {
        "properties": {
          "used_bytes": { "type": "integer", "title": "Used Bytes" },
          "limit_bytes": { "type": "integer", "title": "Limit Bytes" },
          "used_percent": { "type": "number", "title": "Used Percent" },
          "file_count": { "type": "integer", "title": "File Count" }
        },
        "type": "object",
        "required": ["used_bytes", "limit_bytes", "used_percent", "file_count"],
        "title": "StorageUsageResponse"
      },
      "StoreAgent": {
        "properties": {
          "slug": { "type": "string", "title": "Slug" },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "agent_image": { "type": "string", "title": "Agent Image" },
          "creator": { "type": "string", "title": "Creator" },
          "creator_avatar": { "type": "string", "title": "Creator Avatar" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "description": { "type": "string", "title": "Description" },
          "runs": { "type": "integer", "title": "Runs" },
          "rating": { "type": "number", "title": "Rating" },
          "agent_graph_id": { "type": "string", "title": "Agent Graph Id" }
        },
        "type": "object",
        "required": [
          "slug",
          "agent_name",
          "agent_image",
          "creator",
          "creator_avatar",
          "sub_heading",
          "description",
          "runs",
          "rating",
          "agent_graph_id"
        ],
        "title": "StoreAgent"
      },
      "StoreAgentDetails": {
        "properties": {
          "store_listing_version_id": {
            "type": "string",
            "title": "Store Listing Version Id"
          },
          "slug": { "type": "string", "title": "Slug" },
          "agent_name": { "type": "string", "title": "Agent Name" },
          "agent_video": { "type": "string", "title": "Agent Video" },
          "agent_output_demo": {
            "type": "string",
            "title": "Agent Output Demo"
          },
          "agent_image": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Agent Image"
          },
          "creator": { "type": "string", "title": "Creator" },
          "creator_avatar": { "type": "string", "title": "Creator Avatar" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories"
          },
          "runs": { "type": "integer", "title": "Runs" },
          "rating": { "type": "number", "title": "Rating" },
          "versions": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Versions"
          },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_versions": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Graph Versions"
          },
          "last_updated": {
            "type": "string",
            "format": "date-time",
            "title": "Last Updated"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          },
          "active_version_id": {
            "type": "string",
            "title": "Active Version Id"
          },
          "has_approved_version": {
            "type": "boolean",
            "title": "Has Approved Version"
          },
          "changelog": {
            "anyOf": [
              {
                "items": { "$ref": "#/components/schemas/ChangelogEntry" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Changelog"
          }
        },
        "type": "object",
        "required": [
          "store_listing_version_id",
          "slug",
          "agent_name",
          "agent_video",
          "agent_output_demo",
          "agent_image",
          "creator",
          "creator_avatar",
          "sub_heading",
          "description",
          "categories",
          "runs",
          "rating",
          "versions",
          "graph_id",
          "graph_versions",
          "last_updated",
          "active_version_id",
          "has_approved_version"
        ],
        "title": "StoreAgentDetails"
      },
      "StoreAgentsResponse": {
        "properties": {
          "agents": {
            "items": { "$ref": "#/components/schemas/StoreAgent" },
            "type": "array",
            "title": "Agents"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["agents", "pagination"],
        "title": "StoreAgentsResponse"
      },
      "StoreAgentsSortOptions": {
        "type": "string",
        "enum": ["rating", "runs", "name", "updated_at"],
        "title": "StoreAgentsSortOptions"
      },
      "StoreCreatorsSortOptions": {
        "type": "string",
        "enum": ["agent_rating", "agent_runs", "num_agents"],
        "title": "StoreCreatorsSortOptions"
      },
      "StoreListingWithVersionsAdminView": {
        "properties": {
          "listing_id": { "type": "string", "title": "Listing Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "slug": { "type": "string", "title": "Slug" },
          "active_listing_version_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Active Listing Version Id"
          },
          "has_approved_version": {
            "type": "boolean",
            "title": "Has Approved Version",
            "default": false
          },
          "creator_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Creator Email"
          },
          "latest_version": {
            "anyOf": [
              { "$ref": "#/components/schemas/StoreSubmissionAdminView" },
              { "type": "null" }
            ]
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/StoreSubmissionAdminView"
            },
            "type": "array",
            "title": "Versions",
            "default": []
          }
        },
        "type": "object",
        "required": ["listing_id", "graph_id", "slug"],
        "title": "StoreListingWithVersionsAdminView",
        "description": "A store listing with its version history"
      },
      "StoreListingsWithVersionsAdminViewResponse": {
        "properties": {
          "listings": {
            "items": {
              "$ref": "#/components/schemas/StoreListingWithVersionsAdminView"
            },
            "type": "array",
            "title": "Listings"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["listings", "pagination"],
        "title": "StoreListingsWithVersionsAdminViewResponse",
        "description": "Response model for listings with version history"
      },
      "StoreReview": {
        "properties": {
          "score": { "type": "integer", "title": "Score" },
          "comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Comments"
          }
        },
        "type": "object",
        "required": ["score"],
        "title": "StoreReview"
      },
      "StoreReviewCreate": {
        "properties": {
          "store_listing_version_id": {
            "type": "string",
            "title": "Store Listing Version Id"
          },
          "score": { "type": "integer", "title": "Score" },
          "comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Comments"
          }
        },
        "type": "object",
        "required": ["store_listing_version_id", "score"],
        "title": "StoreReviewCreate"
      },
      "StoreSubmission": {
        "properties": {
          "listing_id": { "type": "string", "title": "Listing Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "slug": { "type": "string", "title": "Slug" },
          "listing_version_id": {
            "type": "string",
            "title": "Listing Version Id"
          },
          "listing_version": { "type": "integer", "title": "Listing Version" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "name": { "type": "string", "title": "Name" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories"
          },
          "image_urls": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Image Urls"
          },
          "video_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Video Url"
          },
          "agent_output_demo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Output Demo Url"
          },
          "submitted_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Submitted At"
          },
          "changes_summary": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Changes Summary"
          },
          "status": { "$ref": "#/components/schemas/SubmissionStatus" },
          "reviewed_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Reviewed At"
          },
          "reviewer_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Reviewer Id"
          },
          "review_comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Review Comments"
          },
          "run_count": {
            "type": "integer",
            "title": "Run Count",
            "default": 0
          },
          "review_count": {
            "type": "integer",
            "title": "Review Count",
            "default": 0
          },
          "review_avg_rating": {
            "type": "number",
            "title": "Review Avg Rating",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "listing_id",
          "user_id",
          "slug",
          "listing_version_id",
          "listing_version",
          "graph_id",
          "graph_version",
          "name",
          "sub_heading",
          "description",
          "instructions",
          "categories",
          "image_urls",
          "video_url",
          "agent_output_demo_url",
          "submitted_at",
          "changes_summary",
          "status"
        ],
        "title": "StoreSubmission"
      },
      "StoreSubmissionAdminView": {
        "properties": {
          "listing_id": { "type": "string", "title": "Listing Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "slug": { "type": "string", "title": "Slug" },
          "listing_version_id": {
            "type": "string",
            "title": "Listing Version Id"
          },
          "listing_version": { "type": "integer", "title": "Listing Version" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "name": { "type": "string", "title": "Name" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "description": { "type": "string", "title": "Description" },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories"
          },
          "image_urls": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Image Urls"
          },
          "video_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Video Url"
          },
          "agent_output_demo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Output Demo Url"
          },
          "submitted_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Submitted At"
          },
          "changes_summary": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Changes Summary"
          },
          "status": { "$ref": "#/components/schemas/SubmissionStatus" },
          "reviewed_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Reviewed At"
          },
          "reviewer_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Reviewer Id"
          },
          "review_comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Review Comments"
          },
          "run_count": {
            "type": "integer",
            "title": "Run Count",
            "default": 0
          },
          "review_count": {
            "type": "integer",
            "title": "Review Count",
            "default": 0
          },
          "review_avg_rating": {
            "type": "number",
            "title": "Review Avg Rating",
            "default": 0.0
          },
          "internal_comments": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Internal Comments"
          }
        },
        "type": "object",
        "required": [
          "listing_id",
          "user_id",
          "slug",
          "listing_version_id",
          "listing_version",
          "graph_id",
          "graph_version",
          "name",
          "sub_heading",
          "description",
          "instructions",
          "categories",
          "image_urls",
          "video_url",
          "agent_output_demo_url",
          "submitted_at",
          "changes_summary",
          "status",
          "internal_comments"
        ],
        "title": "StoreSubmissionAdminView"
      },
      "StoreSubmissionEditRequest": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "video_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Video Url"
          },
          "agent_output_demo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Output Demo Url"
          },
          "image_urls": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Image Urls",
            "default": []
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories",
            "default": []
          },
          "changes_summary": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Changes Summary"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          }
        },
        "type": "object",
        "required": ["name", "sub_heading"],
        "title": "StoreSubmissionEditRequest"
      },
      "StoreSubmissionRequest": {
        "properties": {
          "graph_id": {
            "type": "string",
            "minLength": 1,
            "title": "Graph Id",
            "description": "Graph ID cannot be empty"
          },
          "graph_version": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Graph Version",
            "description": "Graph version must be greater than 0"
          },
          "slug": { "type": "string", "title": "Slug" },
          "name": { "type": "string", "title": "Name" },
          "sub_heading": { "type": "string", "title": "Sub Heading" },
          "video_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Video Url"
          },
          "agent_output_demo_url": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Agent Output Demo Url"
          },
          "image_urls": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Image Urls",
            "default": []
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "instructions": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Instructions"
          },
          "categories": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Categories",
            "default": []
          },
          "changes_summary": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Changes Summary"
          },
          "recommended_schedule_cron": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Recommended Schedule Cron"
          }
        },
        "type": "object",
        "required": [
          "graph_id",
          "graph_version",
          "slug",
          "name",
          "sub_heading"
        ],
        "title": "StoreSubmissionRequest"
      },
      "StoreSubmissionsResponse": {
        "properties": {
          "submissions": {
            "items": { "$ref": "#/components/schemas/StoreSubmission" },
            "type": "array",
            "title": "Submissions"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" },
          "stats": { "$ref": "#/components/schemas/SubmissionStats" }
        },
        "type": "object",
        "required": ["submissions", "pagination", "stats"],
        "title": "StoreSubmissionsResponse"
      },
      "StreamChatRequest": {
        "properties": {
          "message": {
            "type": "string",
            "maxLength": 64000,
            "title": "Message"
          },
          "is_user_message": {
            "type": "boolean",
            "title": "Is User Message",
            "default": true
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": { "type": "string" },
                "type": "object"
              },
              { "type": "null" }
            ],
            "title": "Context"
          },
          "file_ids": {
            "anyOf": [
              {
                "items": { "type": "string" },
                "type": "array",
                "maxItems": 20
              },
              { "type": "null" }
            ],
            "title": "File Ids"
          },
          "mode": {
            "anyOf": [
              { "type": "string", "enum": ["fast", "extended_thinking"] },
              { "type": "null" }
            ],
            "title": "Mode",
            "description": "Autopilot mode: 'fast' for baseline LLM, 'extended_thinking' for Claude Agent SDK. If None, uses the server default (extended_thinking)."
          },
          "model": {
            "anyOf": [
              { "type": "string", "enum": ["standard", "advanced"] },
              { "type": "null" }
            ],
            "title": "Model",
            "description": "Model tier: 'standard' for the default model, 'advanced' for the highest-capability model. If None, the server applies per-user LD targeting then falls back to config."
          },
          "message_id": {
            "anyOf": [
              { "type": "string", "maxLength": 64 },
              { "type": "null" }
            ],
            "title": "Message Id",
            "description": "Optional per-click UUID generated by the frontend.  Becomes the persisted ``ChatMessage.id`` (PK).  Frontend / network / RMQ-redelivery retransmits of the same logical send reuse the id, so the Postgres unique-constraint on the PK is the atomic dedup primitive: a duplicate INSERT returns a subscribe-only response without creating a parallel turn.  Distinct user clicks (even with identical text) MUST send different ids — the frontend's per-click ``crypto.randomUUID()`` guarantees that."
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "StreamChatRequest",
        "description": "Request model for streaming chat with optional context."
      },
      "SubmissionStats": {
        "properties": {
          "total": { "type": "integer", "title": "Total" },
          "approved": { "type": "integer", "title": "Approved" },
          "pending": { "type": "integer", "title": "Pending" },
          "total_runs": { "type": "integer", "title": "Total Runs" },
          "average_rating": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Average Rating"
          }
        },
        "type": "object",
        "required": [
          "total",
          "approved",
          "pending",
          "total_runs",
          "average_rating"
        ],
        "title": "SubmissionStats",
        "description": "Creator-wide aggregates over a user's non-deleted submissions.\n\nComputed server-side so values stay accurate regardless of pagination —\nsumming client-side over the current page silently undercounts once the\ncreator has more submissions than fit on one page."
      },
      "SubmissionStatus": {
        "type": "string",
        "enum": ["DRAFT", "PENDING", "APPROVED", "REJECTED"],
        "title": "SubmissionStatus"
      },
      "SubscriptionStatusResponse": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "NO_TIER",
              "BASIC",
              "PRO",
              "MAX",
              "BUSINESS",
              "ENTERPRISE"
            ],
            "title": "Tier"
          },
          "monthly_cost": { "type": "integer", "title": "Monthly Cost" },
          "tier_costs": {
            "additionalProperties": { "type": "integer" },
            "type": "object",
            "title": "Tier Costs"
          },
          "tier_costs_yearly": {
            "additionalProperties": { "type": "integer" },
            "type": "object",
            "title": "Tier Costs Yearly",
            "description": "Tier → yearly amount in cents. Populated only for tiers with a yearly Stripe price configured in LaunchDarkly. Empty for monthly-only configurations."
          },
          "billing_cycle": {
            "type": "string",
            "enum": ["monthly", "yearly"],
            "title": "Billing Cycle",
            "description": "Billing cycle of the user's active Stripe subscription. Defaults to ``monthly`` for users without an active sub. ``monthly_cost`` above reflects this cycle's actual price (so a yearly subscriber sees their yearly amount, not the monthly equivalent).",
            "default": "monthly"
          },
          "tier_multipliers": {
            "additionalProperties": { "type": "number" },
            "type": "object",
            "title": "Tier Multipliers",
            "description": "Tier → rate-limit multiplier. Covers the same tiers listed in ``tier_costs`` so the frontend can render rate-limit badges relative to the lowest visible tier without knowing backend defaults."
          },
          "proration_credit_cents": {
            "type": "integer",
            "title": "Proration Credit Cents"
          },
          "has_active_stripe_subscription": {
            "type": "boolean",
            "title": "Has Active Stripe Subscription",
            "description": "True when the user has an active/trialing Stripe subscription. The frontend uses this to branch upgrade UX: modify-in-place + saved-card auto-charge when True, redirect to Stripe Checkout when False.",
            "default": false
          },
          "current_period_end": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Current Period End",
            "description": "Unix timestamp of the active subscription's current_period_end. Used to show the date Stripe will issue the next invoice (with prorated upgrade charges, if any). None when no active sub."
          },
          "pending_tier": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["NO_TIER", "BASIC", "PRO", "MAX", "BUSINESS"]
              },
              { "type": "null" }
            ],
            "title": "Pending Tier"
          },
          "pending_tier_effective_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Pending Tier Effective At"
          },
          "pending_billing_cycle": {
            "anyOf": [
              { "type": "string", "enum": ["monthly", "yearly"] },
              { "type": "null" }
            ],
            "title": "Pending Billing Cycle",
            "description": "Billing cycle of the queued change, when resolvable. Set alongside ``pending_tier`` for tier downgrades and same-tier cycle switches (yearly→monthly). The frontend uses this to differentiate a cycle-only schedule (``pending_tier == current tier``) from a real tier downgrade so the UI copy can describe the actual change. ``None`` for cancellations and unconfigured legacy prices."
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Populated only when POST /credits/subscription starts a Stripe Checkout Session (BASIC → paid upgrade). Empty string in all other branches — the client redirects to this URL when non-empty.",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "tier",
          "monthly_cost",
          "tier_costs",
          "proration_credit_cents"
        ],
        "title": "SubscriptionStatusResponse"
      },
      "SubscriptionTier": {
        "type": "string",
        "enum": ["NO_TIER", "BASIC", "PRO", "MAX", "BUSINESS", "ENTERPRISE"],
        "title": "SubscriptionTier",
        "description": "Subscription tiers with increasing cost allowances.\n\nMirrors the ``SubscriptionTier`` enum in ``schema.prisma``.\nOnce ``prisma generate`` is run, this can be replaced with::\n\n    from prisma.enums import SubscriptionTier"
      },
      "SubscriptionTierRequest": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": ["NO_TIER", "BASIC", "PRO", "MAX", "BUSINESS"],
            "title": "Tier"
          },
          "success_url": {
            "type": "string",
            "title": "Success Url",
            "default": ""
          },
          "cancel_url": {
            "type": "string",
            "title": "Cancel Url",
            "default": ""
          },
          "billing_cycle": {
            "type": "string",
            "enum": ["monthly", "yearly"],
            "title": "Billing Cycle",
            "default": "monthly"
          }
        },
        "type": "object",
        "required": ["tier"],
        "title": "SubscriptionTierRequest"
      },
      "SuggestedGoalResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "suggested_goal"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "suggested_goal": {
            "type": "string",
            "title": "Suggested Goal",
            "description": "The suggested alternative goal"
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Why the original goal needs refinement",
            "default": ""
          },
          "original_goal": {
            "type": "string",
            "title": "Original Goal",
            "description": "The user's original goal for context",
            "default": ""
          },
          "goal_type": {
            "type": "string",
            "enum": ["vague", "unachievable"],
            "title": "Goal Type",
            "description": "Type: 'vague' or 'unachievable'",
            "default": "vague"
          }
        },
        "type": "object",
        "required": ["message", "suggested_goal"],
        "title": "SuggestedGoalResponse",
        "description": "Response when the goal needs refinement with a suggested alternative."
      },
      "SuggestedPromptsResponse": {
        "properties": {
          "themes": {
            "items": { "$ref": "#/components/schemas/SuggestedTheme" },
            "type": "array",
            "title": "Themes"
          }
        },
        "type": "object",
        "required": ["themes"],
        "title": "SuggestedPromptsResponse",
        "description": "Response model for user-specific suggested prompts grouped by theme."
      },
      "SuggestedTheme": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "prompts": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Prompts"
          }
        },
        "type": "object",
        "required": ["name", "prompts"],
        "title": "SuggestedTheme",
        "description": "A themed group of suggested prompts."
      },
      "SuggestionsResponse": {
        "properties": {
          "recent_searches": {
            "items": { "$ref": "#/components/schemas/SearchEntry" },
            "type": "array",
            "title": "Recent Searches"
          },
          "providers": {
            "items": {
              "type": "string",
              "description": "Provider name for integrations. Can be any string value, including custom provider names."
            },
            "type": "array",
            "title": "Providers"
          },
          "top_blocks": {
            "items": { "$ref": "#/components/schemas/BlockInfo" },
            "type": "array",
            "title": "Top Blocks"
          }
        },
        "type": "object",
        "required": ["recent_searches", "providers", "top_blocks"],
        "title": "SuggestionsResponse"
      },
      "TimezoneResponse": {
        "properties": {
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Africa/Abidjan",
                  "Africa/Accra",
                  "Africa/Addis_Ababa",
                  "Africa/Algiers",
                  "Africa/Asmara",
                  "Africa/Asmera",
                  "Africa/Bamako",
                  "Africa/Bangui",
                  "Africa/Banjul",
                  "Africa/Bissau",
                  "Africa/Blantyre",
                  "Africa/Brazzaville",
                  "Africa/Bujumbura",
                  "Africa/Cairo",
                  "Africa/Casablanca",
                  "Africa/Ceuta",
                  "Africa/Conakry",
                  "Africa/Dakar",
                  "Africa/Dar_es_Salaam",
                  "Africa/Djibouti",
                  "Africa/Douala",
                  "Africa/El_Aaiun",
                  "Africa/Freetown",
                  "Africa/Gaborone",
                  "Africa/Harare",
                  "Africa/Johannesburg",
                  "Africa/Juba",
                  "Africa/Kampala",
                  "Africa/Khartoum",
                  "Africa/Kigali",
                  "Africa/Kinshasa",
                  "Africa/Lagos",
                  "Africa/Libreville",
                  "Africa/Lome",
                  "Africa/Luanda",
                  "Africa/Lubumbashi",
                  "Africa/Lusaka",
                  "Africa/Malabo",
                  "Africa/Maputo",
                  "Africa/Maseru",
                  "Africa/Mbabane",
                  "Africa/Mogadishu",
                  "Africa/Monrovia",
                  "Africa/Nairobi",
                  "Africa/Ndjamena",
                  "Africa/Niamey",
                  "Africa/Nouakchott",
                  "Africa/Ouagadougou",
                  "Africa/Porto-Novo",
                  "Africa/Sao_Tome",
                  "Africa/Timbuktu",
                  "Africa/Tripoli",
                  "Africa/Tunis",
                  "Africa/Windhoek",
                  "America/Adak",
                  "America/Anchorage",
                  "America/Anguilla",
                  "America/Antigua",
                  "America/Araguaina",
                  "America/Argentina/Buenos_Aires",
                  "America/Argentina/Catamarca",
                  "America/Argentina/ComodRivadavia",
                  "America/Argentina/Cordoba",
                  "America/Argentina/Jujuy",
                  "America/Argentina/La_Rioja",
                  "America/Argentina/Mendoza",
                  "America/Argentina/Rio_Gallegos",
                  "America/Argentina/Salta",
                  "America/Argentina/San_Juan",
                  "America/Argentina/San_Luis",
                  "America/Argentina/Tucuman",
                  "America/Argentina/Ushuaia",
                  "America/Aruba",
                  "America/Asuncion",
                  "America/Atikokan",
                  "America/Atka",
                  "America/Bahia",
                  "America/Bahia_Banderas",
                  "America/Barbados",
                  "America/Belem",
                  "America/Belize",
                  "America/Blanc-Sablon",
                  "America/Boa_Vista",
                  "America/Bogota",
                  "America/Boise",
                  "America/Buenos_Aires",
                  "America/Cambridge_Bay",
                  "America/Campo_Grande",
                  "America/Cancun",
                  "America/Caracas",
                  "America/Catamarca",
                  "America/Cayenne",
                  "America/Cayman",
                  "America/Chicago",
                  "America/Chihuahua",
                  "America/Ciudad_Juarez",
                  "America/Coral_Harbour",
                  "America/Cordoba",
                  "America/Costa_Rica",
                  "America/Coyhaique",
                  "America/Creston",
                  "America/Cuiaba",
                  "America/Curacao",
                  "America/Danmarkshavn",
                  "America/Dawson",
                  "America/Dawson_Creek",
                  "America/Denver",
                  "America/Detroit",
                  "America/Dominica",
                  "America/Edmonton",
                  "America/Eirunepe",
                  "America/El_Salvador",
                  "America/Ensenada",
                  "America/Fort_Nelson",
                  "America/Fort_Wayne",
                  "America/Fortaleza",
                  "America/Glace_Bay",
                  "America/Godthab",
                  "America/Goose_Bay",
                  "America/Grand_Turk",
                  "America/Grenada",
                  "America/Guadeloupe",
                  "America/Guatemala",
                  "America/Guayaquil",
                  "America/Guyana",
                  "America/Halifax",
                  "America/Havana",
                  "America/Hermosillo",
                  "America/Indiana/Indianapolis",
                  "America/Indiana/Knox",
                  "America/Indiana/Marengo",
                  "America/Indiana/Petersburg",
                  "America/Indiana/Tell_City",
                  "America/Indiana/Vevay",
                  "America/Indiana/Vincennes",
                  "America/Indiana/Winamac",
                  "America/Indianapolis",
                  "America/Inuvik",
                  "America/Iqaluit",
                  "America/Jamaica",
                  "America/Jujuy",
                  "America/Juneau",
                  "America/Kentucky/Louisville",
                  "America/Kentucky/Monticello",
                  "America/Knox_IN",
                  "America/Kralendijk",
                  "America/La_Paz",
                  "America/Lima",
                  "America/Los_Angeles",
                  "America/Louisville",
                  "America/Lower_Princes",
                  "America/Maceio",
                  "America/Managua",
                  "America/Manaus",
                  "America/Marigot",
                  "America/Martinique",
                  "America/Matamoros",
                  "America/Mazatlan",
                  "America/Mendoza",
                  "America/Menominee",
                  "America/Merida",
                  "America/Metlakatla",
                  "America/Mexico_City",
                  "America/Miquelon",
                  "America/Moncton",
                  "America/Monterrey",
                  "America/Montevideo",
                  "America/Montreal",
                  "America/Montserrat",
                  "America/Nassau",
                  "America/New_York",
                  "America/Nipigon",
                  "America/Nome",
                  "America/Noronha",
                  "America/North_Dakota/Beulah",
                  "America/North_Dakota/Center",
                  "America/North_Dakota/New_Salem",
                  "America/Nuuk",
                  "America/Ojinaga",
                  "America/Panama",
                  "America/Pangnirtung",
                  "America/Paramaribo",
                  "America/Phoenix",
                  "America/Port-au-Prince",
                  "America/Port_of_Spain",
                  "America/Porto_Acre",
                  "America/Porto_Velho",
                  "America/Puerto_Rico",
                  "America/Punta_Arenas",
                  "America/Rainy_River",
                  "America/Rankin_Inlet",
                  "America/Recife",
                  "America/Regina",
                  "America/Resolute",
                  "America/Rio_Branco",
                  "America/Rosario",
                  "America/Santa_Isabel",
                  "America/Santarem",
                  "America/Santiago",
                  "America/Santo_Domingo",
                  "America/Sao_Paulo",
                  "America/Scoresbysund",
                  "America/Shiprock",
                  "America/Sitka",
                  "America/St_Barthelemy",
                  "America/St_Johns",
                  "America/St_Kitts",
                  "America/St_Lucia",
                  "America/St_Thomas",
                  "America/St_Vincent",
                  "America/Swift_Current",
                  "America/Tegucigalpa",
                  "America/Thule",
                  "America/Thunder_Bay",
                  "America/Tijuana",
                  "America/Toronto",
                  "America/Tortola",
                  "America/Vancouver",
                  "America/Virgin",
                  "America/Whitehorse",
                  "America/Winnipeg",
                  "America/Yakutat",
                  "America/Yellowknife",
                  "Antarctica/Casey",
                  "Antarctica/Davis",
                  "Antarctica/DumontDUrville",
                  "Antarctica/Macquarie",
                  "Antarctica/Mawson",
                  "Antarctica/McMurdo",
                  "Antarctica/Palmer",
                  "Antarctica/Rothera",
                  "Antarctica/South_Pole",
                  "Antarctica/Syowa",
                  "Antarctica/Troll",
                  "Antarctica/Vostok",
                  "Arctic/Longyearbyen",
                  "Asia/Aden",
                  "Asia/Almaty",
                  "Asia/Amman",
                  "Asia/Anadyr",
                  "Asia/Aqtau",
                  "Asia/Aqtobe",
                  "Asia/Ashgabat",
                  "Asia/Ashkhabad",
                  "Asia/Atyrau",
                  "Asia/Baghdad",
                  "Asia/Bahrain",
                  "Asia/Baku",
                  "Asia/Bangkok",
                  "Asia/Barnaul",
                  "Asia/Beirut",
                  "Asia/Bishkek",
                  "Asia/Brunei",
                  "Asia/Calcutta",
                  "Asia/Chita",
                  "Asia/Choibalsan",
                  "Asia/Chongqing",
                  "Asia/Chungking",
                  "Asia/Colombo",
                  "Asia/Dacca",
                  "Asia/Damascus",
                  "Asia/Dhaka",
                  "Asia/Dili",
                  "Asia/Dubai",
                  "Asia/Dushanbe",
                  "Asia/Famagusta",
                  "Asia/Gaza",
                  "Asia/Harbin",
                  "Asia/Hebron",
                  "Asia/Ho_Chi_Minh",
                  "Asia/Hong_Kong",
                  "Asia/Hovd",
                  "Asia/Irkutsk",
                  "Asia/Istanbul",
                  "Asia/Jakarta",
                  "Asia/Jayapura",
                  "Asia/Jerusalem",
                  "Asia/Kabul",
                  "Asia/Kamchatka",
                  "Asia/Karachi",
                  "Asia/Kashgar",
                  "Asia/Kathmandu",
                  "Asia/Katmandu",
                  "Asia/Khandyga",
                  "Asia/Kolkata",
                  "Asia/Krasnoyarsk",
                  "Asia/Kuala_Lumpur",
                  "Asia/Kuching",
                  "Asia/Kuwait",
                  "Asia/Macao",
                  "Asia/Macau",
                  "Asia/Magadan",
                  "Asia/Makassar",
                  "Asia/Manila",
                  "Asia/Muscat",
                  "Asia/Nicosia",
                  "Asia/Novokuznetsk",
                  "Asia/Novosibirsk",
                  "Asia/Omsk",
                  "Asia/Oral",
                  "Asia/Phnom_Penh",
                  "Asia/Pontianak",
                  "Asia/Pyongyang",
                  "Asia/Qatar",
                  "Asia/Qostanay",
                  "Asia/Qyzylorda",
                  "Asia/Rangoon",
                  "Asia/Riyadh",
                  "Asia/Saigon",
                  "Asia/Sakhalin",
                  "Asia/Samarkand",
                  "Asia/Seoul",
                  "Asia/Shanghai",
                  "Asia/Singapore",
                  "Asia/Srednekolymsk",
                  "Asia/Taipei",
                  "Asia/Tashkent",
                  "Asia/Tbilisi",
                  "Asia/Tehran",
                  "Asia/Tel_Aviv",
                  "Asia/Thimbu",
                  "Asia/Thimphu",
                  "Asia/Tokyo",
                  "Asia/Tomsk",
                  "Asia/Ujung_Pandang",
                  "Asia/Ulaanbaatar",
                  "Asia/Ulan_Bator",
                  "Asia/Urumqi",
                  "Asia/Ust-Nera",
                  "Asia/Vientiane",
                  "Asia/Vladivostok",
                  "Asia/Yakutsk",
                  "Asia/Yangon",
                  "Asia/Yekaterinburg",
                  "Asia/Yerevan",
                  "Atlantic/Azores",
                  "Atlantic/Bermuda",
                  "Atlantic/Canary",
                  "Atlantic/Cape_Verde",
                  "Atlantic/Faeroe",
                  "Atlantic/Faroe",
                  "Atlantic/Jan_Mayen",
                  "Atlantic/Madeira",
                  "Atlantic/Reykjavik",
                  "Atlantic/South_Georgia",
                  "Atlantic/St_Helena",
                  "Atlantic/Stanley",
                  "Australia/ACT",
                  "Australia/Adelaide",
                  "Australia/Brisbane",
                  "Australia/Broken_Hill",
                  "Australia/Canberra",
                  "Australia/Currie",
                  "Australia/Darwin",
                  "Australia/Eucla",
                  "Australia/Hobart",
                  "Australia/LHI",
                  "Australia/Lindeman",
                  "Australia/Lord_Howe",
                  "Australia/Melbourne",
                  "Australia/NSW",
                  "Australia/North",
                  "Australia/Perth",
                  "Australia/Queensland",
                  "Australia/South",
                  "Australia/Sydney",
                  "Australia/Tasmania",
                  "Australia/Victoria",
                  "Australia/West",
                  "Australia/Yancowinna",
                  "Brazil/Acre",
                  "Brazil/DeNoronha",
                  "Brazil/East",
                  "Brazil/West",
                  "CET",
                  "CST6CDT",
                  "Canada/Atlantic",
                  "Canada/Central",
                  "Canada/Eastern",
                  "Canada/Mountain",
                  "Canada/Newfoundland",
                  "Canada/Pacific",
                  "Canada/Saskatchewan",
                  "Canada/Yukon",
                  "Chile/Continental",
                  "Chile/EasterIsland",
                  "Cuba",
                  "EET",
                  "EST",
                  "EST5EDT",
                  "Egypt",
                  "Eire",
                  "Etc/GMT",
                  "Etc/GMT+0",
                  "Etc/GMT+1",
                  "Etc/GMT+10",
                  "Etc/GMT+11",
                  "Etc/GMT+12",
                  "Etc/GMT+2",
                  "Etc/GMT+3",
                  "Etc/GMT+4",
                  "Etc/GMT+5",
                  "Etc/GMT+6",
                  "Etc/GMT+7",
                  "Etc/GMT+8",
                  "Etc/GMT+9",
                  "Etc/GMT-0",
                  "Etc/GMT-1",
                  "Etc/GMT-10",
                  "Etc/GMT-11",
                  "Etc/GMT-12",
                  "Etc/GMT-13",
                  "Etc/GMT-14",
                  "Etc/GMT-2",
                  "Etc/GMT-3",
                  "Etc/GMT-4",
                  "Etc/GMT-5",
                  "Etc/GMT-6",
                  "Etc/GMT-7",
                  "Etc/GMT-8",
                  "Etc/GMT-9",
                  "Etc/GMT0",
                  "Etc/Greenwich",
                  "Etc/UCT",
                  "Etc/UTC",
                  "Etc/Universal",
                  "Etc/Zulu",
                  "Europe/Amsterdam",
                  "Europe/Andorra",
                  "Europe/Astrakhan",
                  "Europe/Athens",
                  "Europe/Belfast",
                  "Europe/Belgrade",
                  "Europe/Berlin",
                  "Europe/Bratislava",
                  "Europe/Brussels",
                  "Europe/Bucharest",
                  "Europe/Budapest",
                  "Europe/Busingen",
                  "Europe/Chisinau",
                  "Europe/Copenhagen",
                  "Europe/Dublin",
                  "Europe/Gibraltar",
                  "Europe/Guernsey",
                  "Europe/Helsinki",
                  "Europe/Isle_of_Man",
                  "Europe/Istanbul",
                  "Europe/Jersey",
                  "Europe/Kaliningrad",
                  "Europe/Kiev",
                  "Europe/Kirov",
                  "Europe/Kyiv",
                  "Europe/Lisbon",
                  "Europe/Ljubljana",
                  "Europe/London",
                  "Europe/Luxembourg",
                  "Europe/Madrid",
                  "Europe/Malta",
                  "Europe/Mariehamn",
                  "Europe/Minsk",
                  "Europe/Monaco",
                  "Europe/Moscow",
                  "Europe/Nicosia",
                  "Europe/Oslo",
                  "Europe/Paris",
                  "Europe/Podgorica",
                  "Europe/Prague",
                  "Europe/Riga",
                  "Europe/Rome",
                  "Europe/Samara",
                  "Europe/San_Marino",
                  "Europe/Sarajevo",
                  "Europe/Saratov",
                  "Europe/Simferopol",
                  "Europe/Skopje",
                  "Europe/Sofia",
                  "Europe/Stockholm",
                  "Europe/Tallinn",
                  "Europe/Tirane",
                  "Europe/Tiraspol",
                  "Europe/Ulyanovsk",
                  "Europe/Uzhgorod",
                  "Europe/Vaduz",
                  "Europe/Vatican",
                  "Europe/Vienna",
                  "Europe/Vilnius",
                  "Europe/Volgograd",
                  "Europe/Warsaw",
                  "Europe/Zagreb",
                  "Europe/Zaporozhye",
                  "Europe/Zurich",
                  "GB",
                  "GB-Eire",
                  "GMT",
                  "GMT+0",
                  "GMT-0",
                  "GMT0",
                  "Greenwich",
                  "HST",
                  "Hongkong",
                  "Iceland",
                  "Indian/Antananarivo",
                  "Indian/Chagos",
                  "Indian/Christmas",
                  "Indian/Cocos",
                  "Indian/Comoro",
                  "Indian/Kerguelen",
                  "Indian/Mahe",
                  "Indian/Maldives",
                  "Indian/Mauritius",
                  "Indian/Mayotte",
                  "Indian/Reunion",
                  "Iran",
                  "Israel",
                  "Jamaica",
                  "Japan",
                  "Kwajalein",
                  "Libya",
                  "MET",
                  "MST",
                  "MST7MDT",
                  "Mexico/BajaNorte",
                  "Mexico/BajaSur",
                  "Mexico/General",
                  "NZ",
                  "NZ-CHAT",
                  "Navajo",
                  "PRC",
                  "PST8PDT",
                  "Pacific/Apia",
                  "Pacific/Auckland",
                  "Pacific/Bougainville",
                  "Pacific/Chatham",
                  "Pacific/Chuuk",
                  "Pacific/Easter",
                  "Pacific/Efate",
                  "Pacific/Enderbury",
                  "Pacific/Fakaofo",
                  "Pacific/Fiji",
                  "Pacific/Funafuti",
                  "Pacific/Galapagos",
                  "Pacific/Gambier",
                  "Pacific/Guadalcanal",
                  "Pacific/Guam",
                  "Pacific/Honolulu",
                  "Pacific/Johnston",
                  "Pacific/Kanton",
                  "Pacific/Kiritimati",
                  "Pacific/Kosrae",
                  "Pacific/Kwajalein",
                  "Pacific/Majuro",
                  "Pacific/Marquesas",
                  "Pacific/Midway",
                  "Pacific/Nauru",
                  "Pacific/Niue",
                  "Pacific/Norfolk",
                  "Pacific/Noumea",
                  "Pacific/Pago_Pago",
                  "Pacific/Palau",
                  "Pacific/Pitcairn",
                  "Pacific/Pohnpei",
                  "Pacific/Ponape",
                  "Pacific/Port_Moresby",
                  "Pacific/Rarotonga",
                  "Pacific/Saipan",
                  "Pacific/Samoa",
                  "Pacific/Tahiti",
                  "Pacific/Tarawa",
                  "Pacific/Tongatapu",
                  "Pacific/Truk",
                  "Pacific/Wake",
                  "Pacific/Wallis",
                  "Pacific/Yap",
                  "Poland",
                  "Portugal",
                  "ROC",
                  "ROK",
                  "Singapore",
                  "Turkey",
                  "UCT",
                  "US/Alaska",
                  "US/Aleutian",
                  "US/Arizona",
                  "US/Central",
                  "US/East-Indiana",
                  "US/Eastern",
                  "US/Hawaii",
                  "US/Indiana-Starke",
                  "US/Michigan",
                  "US/Mountain",
                  "US/Pacific",
                  "US/Samoa",
                  "UTC",
                  "Universal",
                  "W-SU",
                  "WET",
                  "Zulu"
                ],
                "minLength": 1
              },
              { "type": "string" }
            ],
            "title": "Timezone"
          }
        },
        "type": "object",
        "required": ["timezone"],
        "title": "TimezoneResponse"
      },
      "TodoItem": {
        "properties": {
          "content": {
            "type": "string",
            "title": "Content",
            "description": "Imperative description of the task."
          },
          "activeForm": {
            "type": "string",
            "title": "Activeform",
            "description": "Present-continuous form shown while the task is running."
          },
          "status": {
            "type": "string",
            "enum": ["pending", "in_progress", "completed"],
            "title": "Status",
            "default": "pending"
          }
        },
        "type": "object",
        "required": ["content", "activeForm"],
        "title": "TodoItem",
        "description": "One entry in a ``TodoWrite`` checklist.\n\nMirrors the schema used by Claude Code's built-in ``TodoWrite`` tool so\nthe frontend's ``GenericTool`` accordion renders baseline-emitted todos\nidentically to SDK-emitted ones."
      },
      "TodoWriteResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "todo_write"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "todos": {
            "items": { "$ref": "#/components/schemas/TodoItem" },
            "type": "array",
            "title": "Todos"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "TodoWriteResponse",
        "description": "Ack returned by ``TodoWrite``.\n\nThe tool is effectively stateless — the authoritative task list lives in\nthe assistant's latest tool-call arguments, which are replayed from the\ntranscript on each turn. The tool output only needs to confirm that the\nupdate was accepted so the model can proceed."
      },
      "TokenIntrospectionResult": {
        "properties": {
          "active": { "type": "boolean", "title": "Active" },
          "scopes": {
            "anyOf": [
              { "items": { "type": "string" }, "type": "array" },
              { "type": "null" }
            ],
            "title": "Scopes"
          },
          "client_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Client Id"
          },
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "exp": {
            "anyOf": [{ "type": "integer" }, { "type": "null" }],
            "title": "Exp"
          },
          "token_type": {
            "anyOf": [
              { "type": "string", "enum": ["access_token", "refresh_token"] },
              { "type": "null" }
            ],
            "title": "Token Type"
          }
        },
        "type": "object",
        "required": ["active"],
        "title": "TokenIntrospectionResult",
        "description": "Result of token introspection (RFC 7662)"
      },
      "TokenRateDisplay": {
        "properties": {
          "input_usd_per_1m": {
            "type": "number",
            "minimum": 0.0,
            "title": "Input Usd Per 1M"
          },
          "output_usd_per_1m": {
            "type": "number",
            "minimum": 0.0,
            "title": "Output Usd Per 1M"
          },
          "cache_read_usd_per_1m": {
            "anyOf": [{ "type": "number", "minimum": 0.0 }, { "type": "null" }],
            "title": "Cache Read Usd Per 1M"
          },
          "cache_creation_usd_per_1m": {
            "anyOf": [{ "type": "number", "minimum": 0.0 }, { "type": "null" }],
            "title": "Cache Creation Usd Per 1M"
          }
        },
        "type": "object",
        "required": ["input_usd_per_1m", "output_usd_per_1m"],
        "title": "TokenRateDisplay",
        "description": "Public per-1M-token USD rates surfaced to the builder UI.\n\nPopulated only on LLM block costs whose model has a TOKEN_COST rate.\ncache_* fields are set only when the provider publishes a distinct\ncached-token rate (Anthropic). Display-only — billing always uses the\ninternal credit math in `BlockCost.cost_amount`."
      },
      "TokenRequestByCode": {
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "authorization_code",
            "title": "Grant Type"
          },
          "code": {
            "type": "string",
            "title": "Code",
            "description": "Authorization code"
          },
          "redirect_uri": {
            "type": "string",
            "title": "Redirect Uri",
            "description": "Redirect URI (must match authorization request)"
          },
          "client_id": { "type": "string", "title": "Client Id" },
          "client_secret": { "type": "string", "title": "Client Secret" },
          "code_verifier": {
            "type": "string",
            "title": "Code Verifier",
            "description": "PKCE code verifier"
          }
        },
        "type": "object",
        "required": [
          "grant_type",
          "code",
          "redirect_uri",
          "client_id",
          "client_secret",
          "code_verifier"
        ],
        "title": "TokenRequestByCode"
      },
      "TokenRequestByRefreshToken": {
        "properties": {
          "grant_type": {
            "type": "string",
            "const": "refresh_token",
            "title": "Grant Type"
          },
          "refresh_token": { "type": "string", "title": "Refresh Token" },
          "client_id": { "type": "string", "title": "Client Id" },
          "client_secret": { "type": "string", "title": "Client Secret" }
        },
        "type": "object",
        "required": [
          "grant_type",
          "refresh_token",
          "client_id",
          "client_secret"
        ],
        "title": "TokenRequestByRefreshToken"
      },
      "TokenResponse": {
        "properties": {
          "token_type": {
            "type": "string",
            "const": "Bearer",
            "title": "Token Type",
            "default": "Bearer"
          },
          "access_token": { "type": "string", "title": "Access Token" },
          "access_token_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Access Token Expires At"
          },
          "refresh_token": { "type": "string", "title": "Refresh Token" },
          "refresh_token_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Refresh Token Expires At"
          },
          "scopes": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "access_token_expires_at",
          "refresh_token",
          "refresh_token_expires_at",
          "scopes"
        ],
        "title": "TokenResponse",
        "description": "OAuth 2.0 token response"
      },
      "TransactionHistory": {
        "properties": {
          "transactions": {
            "items": { "$ref": "#/components/schemas/UserTransaction" },
            "type": "array",
            "title": "Transactions"
          },
          "next_transaction_time": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Next Transaction Time"
          }
        },
        "type": "object",
        "required": ["transactions", "next_transaction_time"],
        "title": "TransactionHistory"
      },
      "TriggeredPresetSetupRequest": {
        "properties": {
          "name": { "type": "string", "title": "Name" },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "graph_version": { "type": "integer", "title": "Graph Version" },
          "trigger_config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Trigger Config"
          },
          "agent_credentials": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CredentialsMetaInput"
            },
            "type": "object",
            "title": "Agent Credentials"
          }
        },
        "type": "object",
        "required": ["name", "graph_id", "graph_version", "trigger_config"],
        "title": "TriggeredPresetSetupRequest"
      },
      "UnderstandingUpdatedResponse": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ResponseType",
            "default": "understanding_updated"
          },
          "message": { "type": "string", "title": "Message" },
          "session_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Session Id"
          },
          "updated_fields": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Updated Fields"
          },
          "current_understanding": {
            "additionalProperties": true,
            "type": "object",
            "title": "Current Understanding"
          }
        },
        "type": "object",
        "required": ["message"],
        "title": "UnderstandingUpdatedResponse",
        "description": "Response for add_understanding tool."
      },
      "UnifiedSearchResponse": {
        "properties": {
          "results": {
            "items": { "$ref": "#/components/schemas/UnifiedSearchResult" },
            "type": "array",
            "title": "Results"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["results", "pagination"],
        "title": "UnifiedSearchResponse",
        "description": "Response model for unified search across all content types."
      },
      "UnifiedSearchResult": {
        "properties": {
          "content_type": { "type": "string", "title": "Content Type" },
          "content_id": { "type": "string", "title": "Content Id" },
          "searchable_text": { "type": "string", "title": "Searchable Text" },
          "metadata": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Metadata"
          },
          "updated_at": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Updated At"
          },
          "combined_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Combined Score"
          },
          "semantic_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Semantic Score"
          },
          "lexical_score": {
            "anyOf": [{ "type": "number" }, { "type": "null" }],
            "title": "Lexical Score"
          }
        },
        "type": "object",
        "required": ["content_type", "content_id", "searchable_text"],
        "title": "UnifiedSearchResult",
        "description": "A single result from unified hybrid search across all content types."
      },
      "UpdateAppLogoRequest": {
        "properties": {
          "logo_url": {
            "type": "string",
            "title": "Logo Url",
            "description": "URL of the uploaded logo image"
          }
        },
        "type": "object",
        "required": ["logo_url"],
        "title": "UpdateAppLogoRequest"
      },
      "UpdatePermissionsRequest": {
        "properties": {
          "permissions": {
            "items": { "$ref": "#/components/schemas/APIKeyPermission" },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": ["permissions"],
        "title": "UpdatePermissionsRequest"
      },
      "UpdateSessionTitleRequest": {
        "properties": { "title": { "type": "string", "title": "Title" } },
        "type": "object",
        "required": ["title"],
        "title": "UpdateSessionTitleRequest",
        "description": "Request model for updating a session's title."
      },
      "UpdateTimezoneRequest": {
        "properties": {
          "timezone": {
            "type": "string",
            "enum": [
              "Africa/Abidjan",
              "Africa/Accra",
              "Africa/Addis_Ababa",
              "Africa/Algiers",
              "Africa/Asmara",
              "Africa/Asmera",
              "Africa/Bamako",
              "Africa/Bangui",
              "Africa/Banjul",
              "Africa/Bissau",
              "Africa/Blantyre",
              "Africa/Brazzaville",
              "Africa/Bujumbura",
              "Africa/Cairo",
              "Africa/Casablanca",
              "Africa/Ceuta",
              "Africa/Conakry",
              "Africa/Dakar",
              "Africa/Dar_es_Salaam",
              "Africa/Djibouti",
              "Africa/Douala",
              "Africa/El_Aaiun",
              "Africa/Freetown",
              "Africa/Gaborone",
              "Africa/Harare",
              "Africa/Johannesburg",
              "Africa/Juba",
              "Africa/Kampala",
              "Africa/Khartoum",
              "Africa/Kigali",
              "Africa/Kinshasa",
              "Africa/Lagos",
              "Africa/Libreville",
              "Africa/Lome",
              "Africa/Luanda",
              "Africa/Lubumbashi",
              "Africa/Lusaka",
              "Africa/Malabo",
              "Africa/Maputo",
              "Africa/Maseru",
              "Africa/Mbabane",
              "Africa/Mogadishu",
              "Africa/Monrovia",
              "Africa/Nairobi",
              "Africa/Ndjamena",
              "Africa/Niamey",
              "Africa/Nouakchott",
              "Africa/Ouagadougou",
              "Africa/Porto-Novo",
              "Africa/Sao_Tome",
              "Africa/Timbuktu",
              "Africa/Tripoli",
              "Africa/Tunis",
              "Africa/Windhoek",
              "America/Adak",
              "America/Anchorage",
              "America/Anguilla",
              "America/Antigua",
              "America/Araguaina",
              "America/Argentina/Buenos_Aires",
              "America/Argentina/Catamarca",
              "America/Argentina/ComodRivadavia",
              "America/Argentina/Cordoba",
              "America/Argentina/Jujuy",
              "America/Argentina/La_Rioja",
              "America/Argentina/Mendoza",
              "America/Argentina/Rio_Gallegos",
              "America/Argentina/Salta",
              "America/Argentina/San_Juan",
              "America/Argentina/San_Luis",
              "America/Argentina/Tucuman",
              "America/Argentina/Ushuaia",
              "America/Aruba",
              "America/Asuncion",
              "America/Atikokan",
              "America/Atka",
              "America/Bahia",
              "America/Bahia_Banderas",
              "America/Barbados",
              "America/Belem",
              "America/Belize",
              "America/Blanc-Sablon",
              "America/Boa_Vista",
              "America/Bogota",
              "America/Boise",
              "America/Buenos_Aires",
              "America/Cambridge_Bay",
              "America/Campo_Grande",
              "America/Cancun",
              "America/Caracas",
              "America/Catamarca",
              "America/Cayenne",
              "America/Cayman",
              "America/Chicago",
              "America/Chihuahua",
              "America/Ciudad_Juarez",
              "America/Coral_Harbour",
              "America/Cordoba",
              "America/Costa_Rica",
              "America/Coyhaique",
              "America/Creston",
              "America/Cuiaba",
              "America/Curacao",
              "America/Danmarkshavn",
              "America/Dawson",
              "America/Dawson_Creek",
              "America/Denver",
              "America/Detroit",
              "America/Dominica",
              "America/Edmonton",
              "America/Eirunepe",
              "America/El_Salvador",
              "America/Ensenada",
              "America/Fort_Nelson",
              "America/Fort_Wayne",
              "America/Fortaleza",
              "America/Glace_Bay",
              "America/Godthab",
              "America/Goose_Bay",
              "America/Grand_Turk",
              "America/Grenada",
              "America/Guadeloupe",
              "America/Guatemala",
              "America/Guayaquil",
              "America/Guyana",
              "America/Halifax",
              "America/Havana",
              "America/Hermosillo",
              "America/Indiana/Indianapolis",
              "America/Indiana/Knox",
              "America/Indiana/Marengo",
              "America/Indiana/Petersburg",
              "America/Indiana/Tell_City",
              "America/Indiana/Vevay",
              "America/Indiana/Vincennes",
              "America/Indiana/Winamac",
              "America/Indianapolis",
              "America/Inuvik",
              "America/Iqaluit",
              "America/Jamaica",
              "America/Jujuy",
              "America/Juneau",
              "America/Kentucky/Louisville",
              "America/Kentucky/Monticello",
              "America/Knox_IN",
              "America/Kralendijk",
              "America/La_Paz",
              "America/Lima",
              "America/Los_Angeles",
              "America/Louisville",
              "America/Lower_Princes",
              "America/Maceio",
              "America/Managua",
              "America/Manaus",
              "America/Marigot",
              "America/Martinique",
              "America/Matamoros",
              "America/Mazatlan",
              "America/Mendoza",
              "America/Menominee",
              "America/Merida",
              "America/Metlakatla",
              "America/Mexico_City",
              "America/Miquelon",
              "America/Moncton",
              "America/Monterrey",
              "America/Montevideo",
              "America/Montreal",
              "America/Montserrat",
              "America/Nassau",
              "America/New_York",
              "America/Nipigon",
              "America/Nome",
              "America/Noronha",
              "America/North_Dakota/Beulah",
              "America/North_Dakota/Center",
              "America/North_Dakota/New_Salem",
              "America/Nuuk",
              "America/Ojinaga",
              "America/Panama",
              "America/Pangnirtung",
              "America/Paramaribo",
              "America/Phoenix",
              "America/Port-au-Prince",
              "America/Port_of_Spain",
              "America/Porto_Acre",
              "America/Porto_Velho",
              "America/Puerto_Rico",
              "America/Punta_Arenas",
              "America/Rainy_River",
              "America/Rankin_Inlet",
              "America/Recife",
              "America/Regina",
              "America/Resolute",
              "America/Rio_Branco",
              "America/Rosario",
              "America/Santa_Isabel",
              "America/Santarem",
              "America/Santiago",
              "America/Santo_Domingo",
              "America/Sao_Paulo",
              "America/Scoresbysund",
              "America/Shiprock",
              "America/Sitka",
              "America/St_Barthelemy",
              "America/St_Johns",
              "America/St_Kitts",
              "America/St_Lucia",
              "America/St_Thomas",
              "America/St_Vincent",
              "America/Swift_Current",
              "America/Tegucigalpa",
              "America/Thule",
              "America/Thunder_Bay",
              "America/Tijuana",
              "America/Toronto",
              "America/Tortola",
              "America/Vancouver",
              "America/Virgin",
              "America/Whitehorse",
              "America/Winnipeg",
              "America/Yakutat",
              "America/Yellowknife",
              "Antarctica/Casey",
              "Antarctica/Davis",
              "Antarctica/DumontDUrville",
              "Antarctica/Macquarie",
              "Antarctica/Mawson",
              "Antarctica/McMurdo",
              "Antarctica/Palmer",
              "Antarctica/Rothera",
              "Antarctica/South_Pole",
              "Antarctica/Syowa",
              "Antarctica/Troll",
              "Antarctica/Vostok",
              "Arctic/Longyearbyen",
              "Asia/Aden",
              "Asia/Almaty",
              "Asia/Amman",
              "Asia/Anadyr",
              "Asia/Aqtau",
              "Asia/Aqtobe",
              "Asia/Ashgabat",
              "Asia/Ashkhabad",
              "Asia/Atyrau",
              "Asia/Baghdad",
              "Asia/Bahrain",
              "Asia/Baku",
              "Asia/Bangkok",
              "Asia/Barnaul",
              "Asia/Beirut",
              "Asia/Bishkek",
              "Asia/Brunei",
              "Asia/Calcutta",
              "Asia/Chita",
              "Asia/Choibalsan",
              "Asia/Chongqing",
              "Asia/Chungking",
              "Asia/Colombo",
              "Asia/Dacca",
              "Asia/Damascus",
              "Asia/Dhaka",
              "Asia/Dili",
              "Asia/Dubai",
              "Asia/Dushanbe",
              "Asia/Famagusta",
              "Asia/Gaza",
              "Asia/Harbin",
              "Asia/Hebron",
              "Asia/Ho_Chi_Minh",
              "Asia/Hong_Kong",
              "Asia/Hovd",
              "Asia/Irkutsk",
              "Asia/Istanbul",
              "Asia/Jakarta",
              "Asia/Jayapura",
              "Asia/Jerusalem",
              "Asia/Kabul",
              "Asia/Kamchatka",
              "Asia/Karachi",
              "Asia/Kashgar",
              "Asia/Kathmandu",
              "Asia/Katmandu",
              "Asia/Khandyga",
              "Asia/Kolkata",
              "Asia/Krasnoyarsk",
              "Asia/Kuala_Lumpur",
              "Asia/Kuching",
              "Asia/Kuwait",
              "Asia/Macao",
              "Asia/Macau",
              "Asia/Magadan",
              "Asia/Makassar",
              "Asia/Manila",
              "Asia/Muscat",
              "Asia/Nicosia",
              "Asia/Novokuznetsk",
              "Asia/Novosibirsk",
              "Asia/Omsk",
              "Asia/Oral",
              "Asia/Phnom_Penh",
              "Asia/Pontianak",
              "Asia/Pyongyang",
              "Asia/Qatar",
              "Asia/Qostanay",
              "Asia/Qyzylorda",
              "Asia/Rangoon",
              "Asia/Riyadh",
              "Asia/Saigon",
              "Asia/Sakhalin",
              "Asia/Samarkand",
              "Asia/Seoul",
              "Asia/Shanghai",
              "Asia/Singapore",
              "Asia/Srednekolymsk",
              "Asia/Taipei",
              "Asia/Tashkent",
              "Asia/Tbilisi",
              "Asia/Tehran",
              "Asia/Tel_Aviv",
              "Asia/Thimbu",
              "Asia/Thimphu",
              "Asia/Tokyo",
              "Asia/Tomsk",
              "Asia/Ujung_Pandang",
              "Asia/Ulaanbaatar",
              "Asia/Ulan_Bator",
              "Asia/Urumqi",
              "Asia/Ust-Nera",
              "Asia/Vientiane",
              "Asia/Vladivostok",
              "Asia/Yakutsk",
              "Asia/Yangon",
              "Asia/Yekaterinburg",
              "Asia/Yerevan",
              "Atlantic/Azores",
              "Atlantic/Bermuda",
              "Atlantic/Canary",
              "Atlantic/Cape_Verde",
              "Atlantic/Faeroe",
              "Atlantic/Faroe",
              "Atlantic/Jan_Mayen",
              "Atlantic/Madeira",
              "Atlantic/Reykjavik",
              "Atlantic/South_Georgia",
              "Atlantic/St_Helena",
              "Atlantic/Stanley",
              "Australia/ACT",
              "Australia/Adelaide",
              "Australia/Brisbane",
              "Australia/Broken_Hill",
              "Australia/Canberra",
              "Australia/Currie",
              "Australia/Darwin",
              "Australia/Eucla",
              "Australia/Hobart",
              "Australia/LHI",
              "Australia/Lindeman",
              "Australia/Lord_Howe",
              "Australia/Melbourne",
              "Australia/NSW",
              "Australia/North",
              "Australia/Perth",
              "Australia/Queensland",
              "Australia/South",
              "Australia/Sydney",
              "Australia/Tasmania",
              "Australia/Victoria",
              "Australia/West",
              "Australia/Yancowinna",
              "Brazil/Acre",
              "Brazil/DeNoronha",
              "Brazil/East",
              "Brazil/West",
              "CET",
              "CST6CDT",
              "Canada/Atlantic",
              "Canada/Central",
              "Canada/Eastern",
              "Canada/Mountain",
              "Canada/Newfoundland",
              "Canada/Pacific",
              "Canada/Saskatchewan",
              "Canada/Yukon",
              "Chile/Continental",
              "Chile/EasterIsland",
              "Cuba",
              "EET",
              "EST",
              "EST5EDT",
              "Egypt",
              "Eire",
              "Etc/GMT",
              "Etc/GMT+0",
              "Etc/GMT+1",
              "Etc/GMT+10",
              "Etc/GMT+11",
              "Etc/GMT+12",
              "Etc/GMT+2",
              "Etc/GMT+3",
              "Etc/GMT+4",
              "Etc/GMT+5",
              "Etc/GMT+6",
              "Etc/GMT+7",
              "Etc/GMT+8",
              "Etc/GMT+9",
              "Etc/GMT-0",
              "Etc/GMT-1",
              "Etc/GMT-10",
              "Etc/GMT-11",
              "Etc/GMT-12",
              "Etc/GMT-13",
              "Etc/GMT-14",
              "Etc/GMT-2",
              "Etc/GMT-3",
              "Etc/GMT-4",
              "Etc/GMT-5",
              "Etc/GMT-6",
              "Etc/GMT-7",
              "Etc/GMT-8",
              "Etc/GMT-9",
              "Etc/GMT0",
              "Etc/Greenwich",
              "Etc/UCT",
              "Etc/UTC",
              "Etc/Universal",
              "Etc/Zulu",
              "Europe/Amsterdam",
              "Europe/Andorra",
              "Europe/Astrakhan",
              "Europe/Athens",
              "Europe/Belfast",
              "Europe/Belgrade",
              "Europe/Berlin",
              "Europe/Bratislava",
              "Europe/Brussels",
              "Europe/Bucharest",
              "Europe/Budapest",
              "Europe/Busingen",
              "Europe/Chisinau",
              "Europe/Copenhagen",
              "Europe/Dublin",
              "Europe/Gibraltar",
              "Europe/Guernsey",
              "Europe/Helsinki",
              "Europe/Isle_of_Man",
              "Europe/Istanbul",
              "Europe/Jersey",
              "Europe/Kaliningrad",
              "Europe/Kiev",
              "Europe/Kirov",
              "Europe/Kyiv",
              "Europe/Lisbon",
              "Europe/Ljubljana",
              "Europe/London",
              "Europe/Luxembourg",
              "Europe/Madrid",
              "Europe/Malta",
              "Europe/Mariehamn",
              "Europe/Minsk",
              "Europe/Monaco",
              "Europe/Moscow",
              "Europe/Nicosia",
              "Europe/Oslo",
              "Europe/Paris",
              "Europe/Podgorica",
              "Europe/Prague",
              "Europe/Riga",
              "Europe/Rome",
              "Europe/Samara",
              "Europe/San_Marino",
              "Europe/Sarajevo",
              "Europe/Saratov",
              "Europe/Simferopol",
              "Europe/Skopje",
              "Europe/Sofia",
              "Europe/Stockholm",
              "Europe/Tallinn",
              "Europe/Tirane",
              "Europe/Tiraspol",
              "Europe/Ulyanovsk",
              "Europe/Uzhgorod",
              "Europe/Vaduz",
              "Europe/Vatican",
              "Europe/Vienna",
              "Europe/Vilnius",
              "Europe/Volgograd",
              "Europe/Warsaw",
              "Europe/Zagreb",
              "Europe/Zaporozhye",
              "Europe/Zurich",
              "GB",
              "GB-Eire",
              "GMT",
              "GMT+0",
              "GMT-0",
              "GMT0",
              "Greenwich",
              "HST",
              "Hongkong",
              "Iceland",
              "Indian/Antananarivo",
              "Indian/Chagos",
              "Indian/Christmas",
              "Indian/Cocos",
              "Indian/Comoro",
              "Indian/Kerguelen",
              "Indian/Mahe",
              "Indian/Maldives",
              "Indian/Mauritius",
              "Indian/Mayotte",
              "Indian/Reunion",
              "Iran",
              "Israel",
              "Jamaica",
              "Japan",
              "Kwajalein",
              "Libya",
              "MET",
              "MST",
              "MST7MDT",
              "Mexico/BajaNorte",
              "Mexico/BajaSur",
              "Mexico/General",
              "NZ",
              "NZ-CHAT",
              "Navajo",
              "PRC",
              "PST8PDT",
              "Pacific/Apia",
              "Pacific/Auckland",
              "Pacific/Bougainville",
              "Pacific/Chatham",
              "Pacific/Chuuk",
              "Pacific/Easter",
              "Pacific/Efate",
              "Pacific/Enderbury",
              "Pacific/Fakaofo",
              "Pacific/Fiji",
              "Pacific/Funafuti",
              "Pacific/Galapagos",
              "Pacific/Gambier",
              "Pacific/Guadalcanal",
              "Pacific/Guam",
              "Pacific/Honolulu",
              "Pacific/Johnston",
              "Pacific/Kanton",
              "Pacific/Kiritimati",
              "Pacific/Kosrae",
              "Pacific/Kwajalein",
              "Pacific/Majuro",
              "Pacific/Marquesas",
              "Pacific/Midway",
              "Pacific/Nauru",
              "Pacific/Niue",
              "Pacific/Norfolk",
              "Pacific/Noumea",
              "Pacific/Pago_Pago",
              "Pacific/Palau",
              "Pacific/Pitcairn",
              "Pacific/Pohnpei",
              "Pacific/Ponape",
              "Pacific/Port_Moresby",
              "Pacific/Rarotonga",
              "Pacific/Saipan",
              "Pacific/Samoa",
              "Pacific/Tahiti",
              "Pacific/Tarawa",
              "Pacific/Tongatapu",
              "Pacific/Truk",
              "Pacific/Wake",
              "Pacific/Wallis",
              "Pacific/Yap",
              "Poland",
              "Portugal",
              "ROC",
              "ROK",
              "Singapore",
              "Turkey",
              "UCT",
              "US/Alaska",
              "US/Aleutian",
              "US/Arizona",
              "US/Central",
              "US/East-Indiana",
              "US/Eastern",
              "US/Hawaii",
              "US/Indiana-Starke",
              "US/Michigan",
              "US/Mountain",
              "US/Pacific",
              "US/Samoa",
              "UTC",
              "Universal",
              "W-SU",
              "WET",
              "Zulu"
            ],
            "minLength": 1,
            "title": "Timezone"
          }
        },
        "type": "object",
        "required": ["timezone"],
        "title": "UpdateTimezoneRequest"
      },
      "UsageWindowPublic": {
        "properties": {
          "percent_used": {
            "type": "number",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Percent Used",
            "description": "Percentage of the window's allowance used (0-100). Clamped at 100 when over the cap."
          },
          "resets_at": {
            "type": "string",
            "format": "date-time",
            "title": "Resets At"
          }
        },
        "type": "object",
        "required": ["percent_used", "resets_at"],
        "title": "UsageWindowPublic",
        "description": "Public view of a usage window — only the percentage and reset time.\n\nHides the raw spend and the cap so clients cannot derive per-turn cost\nor reverse-engineer platform margins.  ``percent_used`` is capped at 100."
      },
      "UserAgentCostRollup": {
        "properties": {
          "graph_id": { "type": "string", "title": "Graph Id" },
          "cost_cents": { "type": "integer", "title": "Cost Cents" },
          "run_count": { "type": "integer", "title": "Run Count" }
        },
        "type": "object",
        "required": ["graph_id", "cost_cents", "run_count"],
        "title": "UserAgentCostRollup"
      },
      "UserCostSummary": {
        "properties": {
          "user_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Id"
          },
          "email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Email"
          },
          "total_cost_microdollars": {
            "type": "integer",
            "title": "Total Cost Microdollars"
          },
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens"
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens"
          },
          "total_cache_read_tokens": {
            "type": "integer",
            "title": "Total Cache Read Tokens",
            "default": 0
          },
          "total_cache_creation_tokens": {
            "type": "integer",
            "title": "Total Cache Creation Tokens",
            "default": 0
          },
          "request_count": { "type": "integer", "title": "Request Count" },
          "cost_bearing_request_count": {
            "type": "integer",
            "title": "Cost Bearing Request Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "total_cost_microdollars",
          "total_input_tokens",
          "total_output_tokens",
          "request_count"
        ],
        "title": "UserCostSummary"
      },
      "UserDailyCost": {
        "properties": {
          "date": { "type": "string", "format": "date", "title": "Date" },
          "cost_cents": { "type": "integer", "title": "Cost Cents" },
          "run_count": { "type": "integer", "title": "Run Count" }
        },
        "type": "object",
        "required": ["date", "cost_cents", "run_count"],
        "title": "UserDailyCost"
      },
      "UserExecutionCostSummary": {
        "properties": {
          "total_cents": { "type": "integer", "title": "Total Cents" },
          "run_count": { "type": "integer", "title": "Run Count" },
          "billable_run_count": {
            "type": "integer",
            "title": "Billable Run Count"
          },
          "failed_cost_cents": {
            "type": "integer",
            "title": "Failed Cost Cents"
          },
          "by_agent": {
            "items": { "$ref": "#/components/schemas/UserAgentCostRollup" },
            "type": "array",
            "title": "By Agent"
          },
          "top_runs": {
            "items": { "$ref": "#/components/schemas/UserTopRun" },
            "type": "array",
            "title": "Top Runs"
          },
          "daily": {
            "items": { "$ref": "#/components/schemas/UserDailyCost" },
            "type": "array",
            "title": "Daily"
          }
        },
        "type": "object",
        "required": [
          "total_cents",
          "run_count",
          "billable_run_count",
          "failed_cost_cents",
          "by_agent",
          "top_runs",
          "daily"
        ],
        "title": "UserExecutionCostSummary"
      },
      "UserHistoryResponse": {
        "properties": {
          "history": {
            "items": { "$ref": "#/components/schemas/UserTransaction" },
            "type": "array",
            "title": "History"
          },
          "pagination": { "$ref": "#/components/schemas/Pagination" }
        },
        "type": "object",
        "required": ["history", "pagination"],
        "title": "UserHistoryResponse",
        "description": "Response model for listings with version history"
      },
      "UserOnboarding": {
        "properties": {
          "userId": { "type": "string", "title": "Userid" },
          "completedSteps": {
            "items": { "$ref": "#/components/schemas/OnboardingStep" },
            "type": "array",
            "title": "Completedsteps"
          },
          "walletShown": { "type": "boolean", "title": "Walletshown" },
          "notified": {
            "items": { "$ref": "#/components/schemas/OnboardingStep" },
            "type": "array",
            "title": "Notified"
          },
          "rewardedFor": {
            "items": { "$ref": "#/components/schemas/OnboardingStep" },
            "type": "array",
            "title": "Rewardedfor"
          },
          "usageReason": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Usagereason"
          },
          "integrations": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Integrations"
          },
          "otherIntegrations": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Otherintegrations"
          },
          "selectedStoreListingVersionId": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Selectedstorelistingversionid"
          },
          "agentInput": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Agentinput"
          },
          "onboardingAgentExecutionId": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Onboardingagentexecutionid"
          },
          "agentRuns": { "type": "integer", "title": "Agentruns" },
          "lastRunAt": {
            "anyOf": [
              { "type": "string", "format": "date-time" },
              { "type": "null" }
            ],
            "title": "Lastrunat"
          },
          "consecutiveRunDays": {
            "type": "integer",
            "title": "Consecutiverundays"
          }
        },
        "type": "object",
        "required": [
          "userId",
          "completedSteps",
          "walletShown",
          "notified",
          "rewardedFor",
          "usageReason",
          "integrations",
          "otherIntegrations",
          "selectedStoreListingVersionId",
          "agentInput",
          "onboardingAgentExecutionId",
          "agentRuns",
          "lastRunAt",
          "consecutiveRunDays"
        ],
        "title": "UserOnboarding"
      },
      "UserOnboardingUpdate": {
        "properties": {
          "walletShown": {
            "anyOf": [{ "type": "boolean" }, { "type": "null" }],
            "title": "Walletshown"
          },
          "notified": {
            "anyOf": [
              {
                "items": { "$ref": "#/components/schemas/OnboardingStep" },
                "type": "array"
              },
              { "type": "null" }
            ],
            "title": "Notified"
          },
          "usageReason": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Usagereason"
          },
          "integrations": {
            "anyOf": [
              { "items": { "type": "string" }, "type": "array" },
              { "type": "null" }
            ],
            "title": "Integrations"
          },
          "otherIntegrations": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Otherintegrations"
          },
          "selectedStoreListingVersionId": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Selectedstorelistingversionid"
          },
          "agentInput": {
            "anyOf": [
              { "additionalProperties": true, "type": "object" },
              { "type": "null" }
            ],
            "title": "Agentinput"
          },
          "onboardingAgentExecutionId": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Onboardingagentexecutionid"
          }
        },
        "type": "object",
        "title": "UserOnboardingUpdate"
      },
      "UserPasswordCredentials": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "provider": { "type": "string", "title": "Provider" },
          "title": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Title"
          },
          "is_managed": {
            "type": "boolean",
            "title": "Is Managed",
            "default": false
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "type": {
            "type": "string",
            "const": "user_password",
            "title": "Type",
            "default": "user_password"
          },
          "username": {
            "type": "string",
            "format": "password",
            "title": "Username",
            "writeOnly": true
          },
          "password": {
            "type": "string",
            "format": "password",
            "title": "Password",
            "writeOnly": true
          }
        },
        "type": "object",
        "required": ["provider", "username", "password"],
        "title": "UserPasswordCredentials"
      },
      "UserRateLimitResponse": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "daily_cost_limit_microdollars": {
            "type": "integer",
            "title": "Daily Cost Limit Microdollars"
          },
          "weekly_cost_limit_microdollars": {
            "type": "integer",
            "title": "Weekly Cost Limit Microdollars"
          },
          "daily_cost_used_microdollars": {
            "type": "integer",
            "title": "Daily Cost Used Microdollars"
          },
          "weekly_cost_used_microdollars": {
            "type": "integer",
            "title": "Weekly Cost Used Microdollars"
          },
          "tier": { "$ref": "#/components/schemas/SubscriptionTier" }
        },
        "type": "object",
        "required": [
          "user_id",
          "daily_cost_limit_microdollars",
          "weekly_cost_limit_microdollars",
          "daily_cost_used_microdollars",
          "weekly_cost_used_microdollars",
          "tier"
        ],
        "title": "UserRateLimitResponse"
      },
      "UserReadiness": {
        "properties": {
          "has_all_credentials": {
            "type": "boolean",
            "title": "Has All Credentials",
            "default": false
          },
          "missing_credentials": {
            "additionalProperties": true,
            "type": "object",
            "title": "Missing Credentials",
            "default": {}
          },
          "ready_to_run": {
            "type": "boolean",
            "title": "Ready To Run",
            "default": false
          }
        },
        "type": "object",
        "title": "UserReadiness",
        "description": "User readiness status."
      },
      "UserSearchResult": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          }
        },
        "type": "object",
        "required": ["user_id"],
        "title": "UserSearchResult"
      },
      "UserTierResponse": {
        "properties": {
          "user_id": { "type": "string", "title": "User Id" },
          "tier": { "$ref": "#/components/schemas/SubscriptionTier" }
        },
        "type": "object",
        "required": ["user_id", "tier"],
        "title": "UserTierResponse"
      },
      "UserTopRun": {
        "properties": {
          "execution_id": { "type": "string", "title": "Execution Id" },
          "graph_id": { "type": "string", "title": "Graph Id" },
          "cost_cents": { "type": "integer", "title": "Cost Cents" },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "status": { "$ref": "#/components/schemas/AgentExecutionStatus" },
          "duration_seconds": { "type": "number", "title": "Duration Seconds" },
          "node_error_count": { "type": "integer", "title": "Node Error Count" }
        },
        "type": "object",
        "required": [
          "execution_id",
          "graph_id",
          "cost_cents",
          "started_at",
          "status",
          "duration_seconds",
          "node_error_count"
        ],
        "title": "UserTopRun"
      },
      "UserTransaction": {
        "properties": {
          "transaction_key": {
            "type": "string",
            "title": "Transaction Key",
            "default": ""
          },
          "transaction_time": {
            "type": "string",
            "format": "date-time",
            "title": "Transaction Time",
            "default": "0001-01-01T00:00:00Z"
          },
          "transaction_type": {
            "$ref": "#/components/schemas/CreditTransactionType",
            "default": "USAGE"
          },
          "amount": { "type": "integer", "title": "Amount", "default": 0 },
          "running_balance": {
            "type": "integer",
            "title": "Running Balance",
            "default": 0
          },
          "current_balance": {
            "type": "integer",
            "title": "Current Balance",
            "default": 0
          },
          "description": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Description"
          },
          "usage_graph_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Usage Graph Id"
          },
          "usage_execution_id": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Usage Execution Id"
          },
          "usage_node_count": {
            "type": "integer",
            "title": "Usage Node Count",
            "default": 0
          },
          "usage_start_time": {
            "type": "string",
            "format": "date-time",
            "title": "Usage Start Time",
            "default": "9999-12-31T23:59:59.999999Z"
          },
          "user_id": { "type": "string", "title": "User Id" },
          "user_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "User Email"
          },
          "reason": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Reason"
          },
          "admin_email": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Admin Email"
          },
          "extra_data": {
            "anyOf": [{ "type": "string" }, { "type": "null" }],
            "title": "Extra Data"
          }
        },
        "type": "object",
        "required": ["user_id"],
        "title": "UserTransaction"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] },
            "type": "array",
            "title": "Location"
          },
          "msg": { "type": "string", "title": "Message" },
          "type": { "type": "string", "title": "Error Type" },
          "input": { "title": "Input" },
          "ctx": { "type": "object", "title": "Context" }
        },
        "type": "object",
        "required": ["loc", "msg", "type"],
        "title": "ValidationError"
      },
      "VapidPublicKeyResponse": {
        "properties": {
          "public_key": { "type": "string", "title": "Public Key" }
        },
        "type": "object",
        "required": ["public_key"],
        "title": "VapidPublicKeyResponse"
      },
      "Webhook": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "user_id": { "type": "string", "title": "User Id" },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider name for integrations. Can be any string value, including custom provider names."
          },
          "credentials_id": { "type": "string", "title": "Credentials Id" },
          "webhook_type": { "type": "string", "title": "Webhook Type" },
          "resource": { "type": "string", "title": "Resource" },
          "events": {
            "items": { "type": "string" },
            "type": "array",
            "title": "Events"
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config"
          },
          "secret": { "type": "string", "title": "Secret" },
          "provider_webhook_id": {
            "type": "string",
            "title": "Provider Webhook Id"
          },
          "url": { "type": "string", "title": "Url", "readOnly": true }
        },
        "type": "object",
        "required": [
          "user_id",
          "provider",
          "credentials_id",
          "webhook_type",
          "resource",
          "events",
          "secret",
          "provider_webhook_id",
          "url"
        ],
        "title": "Webhook"
      },
      "WorkspaceFileItem": {
        "properties": {
          "id": { "type": "string", "title": "Id" },
          "name": { "type": "string", "title": "Name" },
          "path": { "type": "string", "title": "Path" },
          "mime_type": { "type": "string", "title": "Mime Type" },
          "size_bytes": { "type": "integer", "title": "Size Bytes" },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          },
          "created_at": { "type": "string", "title": "Created At" }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "path",
          "mime_type",
          "size_bytes",
          "created_at"
        ],
        "title": "WorkspaceFileItem"
      },
      "backend__api__features__chat__share__ShareResponse": {
        "properties": {
          "share_url": { "type": "string", "title": "Share Url" },
          "share_token": { "type": "string", "title": "Share Token" }
        },
        "type": "object",
        "required": ["share_url", "share_token"],
        "title": "ShareResponse"
      },
      "backend__api__features__v1__ShareResponse": {
        "properties": {
          "share_url": { "type": "string", "title": "Share Url" },
          "share_token": { "type": "string", "title": "Share Token" }
        },
        "type": "object",
        "required": ["share_url", "share_token"],
        "title": "ShareResponse",
        "description": "Response from share endpoints."
      },
      "backend__api__features__workspace__routes__UploadFileResponse": {
        "properties": {
          "file_id": { "type": "string", "title": "File Id" },
          "name": { "type": "string", "title": "Name" },
          "path": { "type": "string", "title": "Path" },
          "mime_type": { "type": "string", "title": "Mime Type" },
          "size_bytes": { "type": "integer", "title": "Size Bytes" }
        },
        "type": "object",
        "required": ["file_id", "name", "path", "mime_type", "size_bytes"],
        "title": "UploadFileResponse"
      },
      "backend__api__model__UploadFileResponse": {
        "properties": {
          "file_uri": { "type": "string", "title": "File Uri" },
          "file_name": { "type": "string", "title": "File Name" },
          "size": { "type": "integer", "title": "Size" },
          "content_type": { "type": "string", "title": "Content Type" },
          "expires_in_hours": { "type": "integer", "title": "Expires In Hours" }
        },
        "type": "object",
        "required": [
          "file_uri",
          "file_name",
          "size",
          "content_type",
          "expires_in_hours"
        ],
        "title": "UploadFileResponse"
      }
    },
    "securitySchemes": {
      "APIKeyAuthenticator-X-Postmark-Webhook-Token": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Postmark-Webhook-Token"
      },
      "HTTPBearer": { "type": "http", "scheme": "bearer" },
      "HTTPBearerJWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "jwt"
      }
    },
    "responses": {
      "HTTP401NotAuthenticatedError": {
        "description": "Authentication required",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": { "detail": { "type": "string" } }
            }
          }
        }
      }
    }
  }
}
