{
 "openapi": "3.1.0",
 "info": {
  "title": "MMM Agent API",
  "version": "1.0.0",
  "description": "MMM Framework agent API (mmm-framework-server). Generated from the live FastAPI app."
 },
 "paths": {
  "/auth/signup": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Signup",
    "operationId": "signup_auth_signup_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SignupRequest"
       }
      }
     },
     "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"
        }
       }
      }
     }
    }
   }
  },
  "/auth/login": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Login",
    "operationId": "login_auth_login_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LoginRequest"
       }
      }
     },
     "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"
        }
       }
      }
     }
    }
   }
  },
  "/auth/refresh": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Refresh",
    "operationId": "refresh_auth_refresh_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RefreshRequest"
       }
      }
     },
     "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"
        }
       }
      }
     }
    }
   }
  },
  "/auth/me": {
   "get": {
    "tags": [
     "Auth"
    ],
    "summary": "Me",
    "operationId": "me_auth_me_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UserOut"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/usage": {
   "get": {
    "tags": [
     "Auth"
    ],
    "summary": "Usage",
    "operationId": "usage_auth_usage_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Usage Auth Usage Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/audit-export": {
   "get": {
    "tags": [
     "Auth"
    ],
    "summary": "Audit Export",
    "operationId": "audit_export_auth_audit_export_get",
    "parameters": [
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "number"
        },
        {
         "type": "null"
        }
       ],
       "title": "Since"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 1000,
       "title": "Limit"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Audit Export Auth Audit Export Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/logout": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Logout",
    "operationId": "logout_auth_logout_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LogoutRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/logout-all": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Logout All",
    "operationId": "logout_all_auth_logout_all_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/invite": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Invite",
    "operationId": "invite_auth_invite_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/InviteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/InviteOut"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/accept-invite": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Accept Invite",
    "operationId": "accept_invite_auth_accept_invite_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AcceptInviteRequest"
       }
      }
     },
     "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"
        }
       }
      }
     }
    }
   }
  },
  "/auth/password-reset/request": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Password Reset Request",
    "operationId": "password_reset_request_auth_password_reset_request_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordResetRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "202": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": true,
         "type": "object",
         "title": "Response Password Reset Request Auth Password Reset Request Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/password-reset/confirm": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Password Reset Confirm",
    "operationId": "password_reset_confirm_auth_password_reset_confirm_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PasswordResetConfirm"
       }
      }
     },
     "required": true
    },
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/users/{user_id}/deactivate": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Deactivate User",
    "operationId": "deactivate_user_auth_users__user_id__deactivate_post",
    "parameters": [
     {
      "name": "user_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "User Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/members": {
   "get": {
    "tags": [
     "Auth"
    ],
    "summary": "List Members",
    "operationId": "list_members_auth_members_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response List Members Auth Members Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/members/{user_id}": {
   "patch": {
    "tags": [
     "Auth"
    ],
    "summary": "Set Member Role",
    "operationId": "set_member_role_auth_members__user_id__patch",
    "parameters": [
     {
      "name": "user_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "User Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RoleUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Set Member Role Auth Members  User Id  Patch"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Auth"
    ],
    "summary": "Remove Member",
    "operationId": "remove_member_auth_members__user_id__delete",
    "parameters": [
     {
      "name": "user_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "User Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/invites": {
   "get": {
    "tags": [
     "Auth"
    ],
    "summary": "List Invites",
    "operationId": "list_invites_auth_invites_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response List Invites Auth Invites Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/invites/{token}": {
   "delete": {
    "tags": [
     "Auth"
    ],
    "summary": "Revoke Invite",
    "operationId": "revoke_invite_auth_invites__token__delete",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Token"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/auth/change-password": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Change Password",
    "operationId": "change_password_auth_change_password_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ChangePasswordRequest"
       }
      }
     }
    },
    "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"
        }
       }
      }
     }
    }
   }
  },
  "/chat": {
   "post": {
    "summary": "Chat Endpoint",
    "operationId": "chat_endpoint_chat_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-model-name",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Model-Name"
      }
     },
     {
      "name": "x-base-url",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Base-Url"
      }
     },
     {
      "name": "x-provider",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Provider"
      }
     },
     {
      "name": "x-expert-model",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Expert-Model"
      }
     },
     {
      "name": "x-expert-provider",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Expert-Provider"
      }
     },
     {
      "name": "x-expert-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Expert-Api-Key"
      }
     },
     {
      "name": "x-expert-base-url",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Expert-Base-Url"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ChatRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/state/{thread_id}": {
   "get": {
    "summary": "Get State",
    "operationId": "get_state_state__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Clear State",
    "operationId": "clear_state_state__thread_id__delete",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/history/{thread_id}": {
   "get": {
    "summary": "Get History",
    "description": "Return the checkpoint timeline for this thread, newest first.\n\nEach entry includes the checkpoint id, parent id, a short label derived\nfrom the next node, and the count of messages at that point. The frontend\nuses this to drive Back and Retry.",
    "operationId": "get_history_history__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/rewind/{thread_id}": {
   "post": {
    "summary": "Rewind",
    "description": "Fork the thread back to an earlier checkpoint.\n\n`update_state(target_config, {})` writes a new checkpoint whose parent is\n`target_config`'s checkpoint_id and inherits its values. The thread's tip\nmoves to this fork, so subsequent reads return the rewound state.",
    "operationId": "rewind_rewind__thread_id__post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RewindRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions": {
   "get": {
    "summary": "List Sessions Endpoint",
    "operationId": "list_sessions_endpoint_sessions_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "skip",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 0,
       "title": "Skip"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "title": "Limit"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create Session Endpoint",
    "operationId": "create_session_endpoint_sessions_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CreateSessionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}": {
   "get": {
    "summary": "Get Session Endpoint",
    "operationId": "get_session_endpoint_sessions__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "patch": {
    "summary": "Update Session Endpoint",
    "operationId": "update_session_endpoint_sessions__thread_id__patch",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UpdateSessionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Session Endpoint",
    "operationId": "delete_session_endpoint_sessions__thread_id__delete",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}/mode": {
   "patch": {
    "summary": "Set Session Mode Endpoint",
    "description": "Switch a session's modeling mode (mmm | causal_inference | general_bayes |\ndescriptive). The next /chat turn reads it to select the prompt framing + tools.",
    "operationId": "set_session_mode_endpoint_sessions__thread_id__mode_patch",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetSessionModeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/analysis-plans": {
   "get": {
    "summary": "List Analysis Plans Endpoint",
    "operationId": "list_analysis_plans_endpoint_analysis_plans_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 20,
       "title": "Limit"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Lock Analysis Plan Endpoint",
    "operationId": "lock_analysis_plan_endpoint_analysis_plans_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LockPlanRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/analysis-plans/{plan_id}": {
   "get": {
    "summary": "Get Analysis Plan Endpoint",
    "operationId": "get_analysis_plan_endpoint_analysis_plans__plan_id__get",
    "parameters": [
     {
      "name": "plan_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plan Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Analysis Plan Endpoint",
    "operationId": "delete_analysis_plan_endpoint_analysis_plans__plan_id__delete",
    "parameters": [
     {
      "name": "plan_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plan Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/models": {
   "get": {
    "summary": "List Models Endpoint",
    "description": "Return model_run artifacts from all sessions as lightweight ModelInfo stubs.",
    "operationId": "list_models_endpoint_models_get",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 8,
       "title": "Limit"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/models/{model_id}": {
   "get": {
    "summary": "Get Model Endpoint",
    "operationId": "get_model_endpoint_models__model_id__get",
    "parameters": [
     {
      "name": "model_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Model Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/models/{model_id}/dashboard": {
   "get": {
    "summary": "Get Model Dashboard Endpoint",
    "description": "Return roi_metrics + decomposition + summary from the model's LangGraph thread.",
    "operationId": "get_model_dashboard_endpoint_models__model_id__dashboard_get",
    "parameters": [
     {
      "name": "model_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Model Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects": {
   "get": {
    "summary": "List Projects Endpoint",
    "operationId": "list_projects_endpoint_projects_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create Project Endpoint",
    "operationId": "create_project_endpoint_projects_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectCreateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}": {
   "get": {
    "summary": "Get Project Endpoint",
    "operationId": "get_project_endpoint_projects__project_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "patch": {
    "summary": "Update Project Endpoint",
    "operationId": "update_project_endpoint_projects__project_id__patch",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ProjectUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Project Endpoint",
    "operationId": "delete_project_endpoint_projects__project_id__delete",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/onboarding-status": {
   "get": {
    "summary": "Onboarding Status Endpoint",
    "description": "Self-serve onboarding checklist + next action for a project.",
    "operationId": "onboarding_status_endpoint_projects__project_id__onboarding_status_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/data-quality": {
   "get": {
    "summary": "Data Quality Endpoint",
    "description": "Latest pre-fit data-quality summary for a project (from the agent's EDA),\nsurfaced inline at the onboarding 'add data' step. Reads the most-recently\nupdated session that has an EDA envelope; returns {found: false} otherwise.",
    "operationId": "data_quality_endpoint_projects__project_id__data_quality_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/onboarding": {
   "post": {
    "summary": "Project Onboarding Endpoint",
    "description": "Save the client/project profile, assign team members, and render the\nprofile into a `project_brief.md` in the project's knowledge base \u2014 so\nboth the global guide chat and every session chat can retrieve it. Safe\nto re-run: the meta merges and the brief is replaced.",
    "operationId": "project_onboarding_endpoint_projects__project_id__onboarding_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OnboardingRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/guide": {
   "post": {
    "summary": "Project Guide Session Endpoint",
    "description": "The project's global guide thread: one persistent session per project\nthat the floating chat bubble talks to (full agent + project KB). Created\non first use, reused after \u2014 it's a normal session, so it also shows up in\nthe Workspace if the user wants the full view.",
    "operationId": "project_guide_session_endpoint_projects__project_id__guide_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/users": {
   "get": {
    "summary": "List Users Endpoint",
    "operationId": "list_users_endpoint_users_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create User Endpoint",
    "operationId": "create_user_endpoint_users_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UserCreateRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/users/{user_id}": {
   "patch": {
    "summary": "Update User Endpoint",
    "operationId": "update_user_endpoint_users__user_id__patch",
    "parameters": [
     {
      "name": "user_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "User Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/UserUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete User Endpoint",
    "operationId": "delete_user_endpoint_users__user_id__delete",
    "parameters": [
     {
      "name": "user_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "User Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/members": {
   "get": {
    "summary": "List Members Endpoint",
    "operationId": "list_members_endpoint_projects__project_id__members_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Set Members Endpoint",
    "operationId": "set_members_endpoint_projects__project_id__members_put",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/MembersRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/preferences": {
   "get": {
    "summary": "Get Preferences Endpoint",
    "description": "Global (deployment-wide) user preference defaults.",
    "operationId": "get_preferences_endpoint_preferences_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   },
   "put": {
    "summary": "Put Preferences Endpoint",
    "description": "Set global preference(s). 403 in the hosted multi-tenant profile \u2014\nthere is no per-user identity, so 'global' would leak across tenants\n(project-scoped branding remains available: project ids are capabilities).",
    "operationId": "put_preferences_endpoint_preferences_put",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PreferenceUpdateRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/data-connections": {
   "get": {
    "summary": "List Data Connections Endpoint",
    "operationId": "list_data_connections_endpoint_projects__project_id__data_connections_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create Data Connection Endpoint",
    "description": "Save a reusable data-source connection (a non-secret bucket/query/table\nreference; credentials stay ambient via ADC).",
    "operationId": "create_data_connection_endpoint_projects__project_id__data_connections_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DataConnectionCreate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/data-connections/{connection_id}": {
   "patch": {
    "summary": "Update Data Connection Schedule Endpoint",
    "description": "Set or clear a connection's auto-sync interval.",
    "operationId": "update_data_connection_schedule_endpoint_projects__project_id__data_connections__connection_id__patch",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "connection_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Connection Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ConnectionScheduleUpdate"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Data Connection Endpoint",
    "operationId": "delete_data_connection_endpoint_projects__project_id__data_connections__connection_id__delete",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "connection_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Connection Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/data-connections/{connection_id}/test": {
   "post": {
    "summary": "Test Data Connection Endpoint",
    "operationId": "test_data_connection_endpoint_projects__project_id__data_connections__connection_id__test_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "connection_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Connection Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/data-connections/{connection_id}/preview": {
   "post": {
    "summary": "Preview Data Connection Endpoint",
    "description": "Read the first ``rows`` of a connection (capped) for a UI preview.\n\nGated as a write: it executes the connection's (billable) query/read and\nstamps last_synced.",
    "operationId": "preview_data_connection_endpoint_projects__project_id__data_connections__connection_id__preview_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "connection_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Connection Id"
      }
     },
     {
      "name": "rows",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 20,
       "title": "Rows"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/branding": {
   "get": {
    "summary": "Get Branding Endpoint",
    "operationId": "get_branding_endpoint_projects__project_id__branding_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Put Branding Endpoint",
    "description": "Validate + save project branding. A manual PUT counts as confirmation\nunless the payload explicitly says otherwise.",
    "operationId": "put_branding_endpoint_projects__project_id__branding_put",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "title": "Body"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/branding/extract": {
   "post": {
    "summary": "Extract Branding Endpoint",
    "description": "Extract a branding proposal from a client website (SSRF-guarded,\nserver-side). Saved with confirmed=false \u2014 the UI/user must confirm\nbefore it styles any output.",
    "operationId": "extract_branding_endpoint_projects__project_id__branding_extract_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BrandingExtractRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/budget-plans": {
   "get": {
    "summary": "List Budget Plans Endpoint",
    "description": "List saved budget plans for the caller's org, optionally filtered.",
    "operationId": "list_budget_plans_endpoint_budget_plans_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "model_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Model Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Upsert Budget Plan Endpoint",
    "description": "Create or update a saved budget plan (no model load \u2014 the FE persists an\nalready-computed studio result).",
    "operationId": "upsert_budget_plan_endpoint_budget_plans_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/BudgetPlanUpsertRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/budget-plans/{plan_id}": {
   "get": {
    "summary": "Get Budget Plan Endpoint",
    "operationId": "get_budget_plan_endpoint_budget_plans__plan_id__get",
    "parameters": [
     {
      "name": "plan_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plan Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Budget Plan Endpoint",
    "operationId": "delete_budget_plan_endpoint_budget_plans__plan_id__delete",
    "parameters": [
     {
      "name": "plan_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plan Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/budget-plans/{plan_id}/export.csv": {
   "get": {
    "summary": "Export Budget Plan Csv",
    "description": "Download a saved plan as a CSV flight plan (allocation + geo + flighting)\n\u2014 the executable deliverable a planner hands a partner (B5).",
    "operationId": "export_budget_plan_csv_budget_plans__plan_id__export_csv_get",
    "parameters": [
     {
      "name": "plan_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plan Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/planner/optimize": {
   "post": {
    "summary": "Start Planner Optimization",
    "description": "Start a NON-BLOCKING budget plan: optimal allocation (national or per-geo)\n+ an optional forward flighting calendar. Poll the returned job_id.",
    "operationId": "start_planner_optimization_projects__project_id__planner_optimize_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlannerOptimizeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/planner/optimize/{job_id}": {
   "get": {
    "summary": "Get Planner Optimization",
    "description": "Poll a planner optimization job: {status, result|null, error|null}.",
    "operationId": "get_planner_optimization_projects__project_id__planner_optimize__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/planner/scenario": {
   "post": {
    "summary": "Start Planner Scenario",
    "description": "Start a NON-BLOCKING what-if scenario (uncertainty included). Poll the\nreturned job_id.",
    "operationId": "start_planner_scenario_projects__project_id__planner_scenario_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/PlannerScenarioRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/planner/scenario/{job_id}": {
   "get": {
    "summary": "Get Planner Scenario",
    "description": "Poll a planner scenario job: {status, result|null, error|null}.",
    "operationId": "get_planner_scenario_projects__project_id__planner_scenario__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/experiments": {
   "get": {
    "summary": "List Experiments Endpoint",
    "operationId": "list_experiments_endpoint_experiments_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "channel",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Channel"
      }
     },
     {
      "name": "subchannel",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Subchannel"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Upsert Experiment Endpoint",
    "operationId": "upsert_experiment_endpoint_experiments_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentUpsertRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/experiments/{experiment_id}": {
   "get": {
    "summary": "Get Experiment Endpoint",
    "operationId": "get_experiment_endpoint_experiments__experiment_id__get",
    "parameters": [
     {
      "name": "experiment_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Experiment Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Experiment Endpoint",
    "operationId": "delete_experiment_endpoint_experiments__experiment_id__delete",
    "parameters": [
     {
      "name": "experiment_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Experiment Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/experiments/{experiment_id}/transition": {
   "post": {
    "summary": "Transition Experiment Endpoint",
    "description": "Validated lifecycle move (draft\u2192planned\u2192running\u2192completed\u2192calibrated,\nabandoned from any active state). 409 on an illegal transition so the UI\ncan distinguish state-machine conflicts from bad input.",
    "operationId": "transition_experiment_endpoint_experiments__experiment_id__transition_post",
    "parameters": [
     {
      "name": "experiment_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Experiment Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentTransitionRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}/load-model": {
   "post": {
    "summary": "Load Model Endpoint",
    "description": "Load a saved fitted model into the session directly. UI buttons call\nthis instead of asking the agent to run the load_fitted_model tool.",
    "operationId": "load_model_endpoint_sessions__thread_id__load_model_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LoadModelRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/runs": {
   "get": {
    "summary": "List Runs Endpoint",
    "description": "The model-run lineage timeline: every fit with dataset fingerprint,\nspec diff vs the previous run, and the assumptions added/revised (the\nversioned data + model + rationale record).",
    "operationId": "list_runs_endpoint_runs_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/runs/compare": {
   "get": {
    "summary": "Compare Runs Endpoint",
    "description": "Per-channel ROI/spend delta between two runs (B vs A) \u2014 the structured\nanswer to \"why did this channel change since the last refresh?\".",
    "operationId": "compare_runs_endpoint_runs_compare_get",
    "parameters": [
     {
      "name": "run_a",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Run A"
      }
     },
     {
      "name": "run_b",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Run B"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/portfolio-benchmark": {
   "get": {
    "summary": "Portfolio Benchmark Endpoint",
    "description": "Cross-brand benchmarking + governance over the org's projects' run metrics\n(the agency/holding-co view: rank a brand's channel ROIs against the\nportfolio, see model freshness + calibration coverage).",
    "operationId": "portfolio_benchmark_endpoint_portfolio_benchmark_get",
    "parameters": [
     {
      "name": "stale_after_days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 90,
       "title": "Stale After Days"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/portfolio": {
   "get": {
    "summary": "Portfolio Endpoint",
    "description": "Everything the home page tracks in one call: model-run history, the\nexperiment log, the latest budget/experiment-design recommendations, and\ncomputed next actions (calibrate completed experiments / refresh a stale\nmodel / run the recommended next experiment).",
    "operationId": "portfolio_endpoint_portfolio_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project Id"
      }
     },
     {
      "name": "stale_after_days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 90,
       "title": "Stale After Days"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/history": {
   "get": {
    "summary": "Project History Endpoint",
    "description": "Cycle-over-cycle trajectory series for the Performance page: per-channel\nROI posteriors (CI contraction), spend shares (allocation migration),\nshare gaps, calibration status, and the portfolio series (misallocation\nproxy, marginal ROI, EVPI). Assembled purely from stored run_metrics rows\n\u2014 no model loads.",
    "operationId": "project_history_endpoint_projects__project_id__history_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/estimands": {
   "get": {
    "summary": "Project Estimands Endpoint",
    "description": "Declarative estimands for every fitted model in the project, grouped into\n(estimand \u00d7 KPI) comparability clusters for the Performance page. Models on\nthe same estimand+KPI sit side-by-side; different-KPI models stay separate\n(not directly comparable). Assembled from estimand rows persisted on each\nmodel_run artifact at fit time \u2014 no model loads. Older runs need the backfill\n(``python -m mmm_framework.platform.backfill --what estimands``).",
    "operationId": "project_estimands_endpoint_projects__project_id__estimands_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/signoff": {
   "post": {
    "summary": "Create Signoff Endpoint",
    "description": "Record a formal sign-off approving the model's current assumptions/priors\n(issue #110): who approved, when, and a hash-chained, tamper-evident audit\nentry over the assumption snapshot. The accountability chain a procurement /\naudit reviewer asks for ('who approved these priors?').",
    "operationId": "create_signoff_endpoint_projects__project_id__signoff_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SignoffRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/signoffs": {
   "get": {
    "summary": "List Signoffs Endpoint",
    "description": "The project's sign-off audit trail (newest first) + a chain-integrity\ncheck (``verification.intact`` is false if a past record was tampered with).",
    "operationId": "list_signoffs_endpoint_projects__project_id__signoffs_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/scorecard": {
   "get": {
    "summary": "Project Scorecard Endpoint",
    "description": "Recommendation scorecard (issue #109): each channel's realized experiment\nreadout joined to the ROI the model predicted for it (with its credible\ninterval), the error, and whether the realized value landed inside the\npredicted interval \u2014 the model's interval calibration over time. Joined\nserver-side from persisted estimands + the experiment registry; no model\nloads.",
    "operationId": "project_scorecard_endpoint_projects__project_id__scorecard_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/triangulation": {
   "get": {
    "summary": "Project Triangulation Endpoint",
    "description": "Triangulation panel \u2014 MMM \u00d7 experiment (\u00d7 platform) \u2014 for the project's\nchannels, reconciled server-side from persisted data (issue #119). Joins the\nper-channel ``contribution_roi`` estimands persisted at fit time with the\ncalibrated/completed experiment readouts in the registry; no model loads.\n``kpi``/``run_id`` pin which fitted model's MMM numbers are used (default: the\nlatest ``contribution_roi`` model). Any platform-attribution figures ingested\nfor the project (issue #120) are folded in as the third source.",
    "operationId": "project_triangulation_endpoint_projects__project_id__triangulation_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "kpi",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Kpi"
      }
     },
     {
      "name": "run_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Run Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/platform-figures": {
   "get": {
    "summary": "List Platform Figures Endpoint",
    "description": "Platform-reported attribution figures stored for the project (issue #120).",
    "operationId": "list_platform_figures_endpoint_projects__project_id__platform_figures_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Upload Platform Figures Endpoint",
    "description": "Ingest platform-reported attribution (CSV/TSV or JSON) into the registry\n(issue #120), so triangulation re-uses it without an inline dict. A CSV has a\n``channel`` + ``value`` column (+ optional ``source``/``metric``/\n``attribution_window``/``incremental``/``period``). Figures are stored\n**non-incremental** (last-touch) unless a row sets ``incremental`` true.",
    "operationId": "upload_platform_figures_endpoint_projects__project_id__platform_figures_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_platform_figures_endpoint_projects__project_id__platform_figures_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Platform Figures Endpoint",
    "description": "Clear stored platform figures for the project (optionally one channel).",
    "operationId": "delete_platform_figures_endpoint_projects__project_id__platform_figures_delete",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "channel",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Channel"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/delivery": {
   "get": {
    "summary": "List Delivery Endpoint",
    "description": "Actual in-flight delivery rows stored for the project (issue #123).",
    "operationId": "list_delivery_endpoint_projects__project_id__delivery_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Upload Delivery Endpoint",
    "description": "Ingest actual delivery (CSV/TSV or JSON: spend by channel/period) into the\ndelivery registry (issue #123), so pacing compares against the saved plan\nwithout spend passed inline. A CSV may be LONG (channel/period/spend columns)\nor WIDE (a date/period column + one column per channel); re-uploading a period\noverwrites it.",
    "operationId": "upload_delivery_endpoint_projects__project_id__delivery_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_delivery_endpoint_projects__project_id__delivery_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Delivery Endpoint",
    "description": "Clear stored delivery for the project (optionally one channel).",
    "operationId": "delete_delivery_endpoint_projects__project_id__delivery_delete",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "channel",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Channel"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/pacing": {
   "get": {
    "summary": "Project Pacing Endpoint",
    "description": "In-flight pacing for the project (issue #123): the stored actual delivery\nvs the planned series auto-sourced from the latest saved budget plan, with\nper-channel divergence, off-pace flags, and an alert digest. Model-free (no\nfit load) \u2014 the expected-outcome delta comes from the check_pacing agent tool.\nReturns ``available: false`` with a ``reason`` when there is no saved plan or\nno delivery yet.",
    "operationId": "project_pacing_endpoint_projects__project_id__pacing_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "threshold",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "number"
        },
        {
         "type": "null"
        }
       ],
       "title": "Threshold"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/pacing/alert": {
   "get": {
    "summary": "Project Pacing Alert Endpoint",
    "description": "The most recently persisted off-pace alert for the project (issue #123),\nwritten by the background pacing-alert sweep. Returns ``{alert: null}`` when\nthe project is on pace or the sweep has never run \u2014 a cheap poll the FE can\nuse to badge the Pacing tab without recomputing on every page load.",
    "operationId": "project_pacing_alert_endpoint_projects__project_id__pacing_alert_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/calibration-coverage": {
   "get": {
    "summary": "Calibration Coverage Endpoint",
    "description": "Channels \u00d7 evidence tier (calibrated / stale / model_only) with\ninformation decay applied at read time, plus coverage percentages. The\nin-flight pacing signal is folded in (issue #123): a channel drifting\noff-pace is a reason to re-look even when its evidence is fresh \u2014 the T5\nre-evaluation surface reads ``pacing_status``/``off_pace`` per channel +\nthe top-level ``pacing_alert``.",
    "operationId": "calibration_coverage_endpoint_projects__project_id__calibration_coverage_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "as_of",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "As Of"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-priorities": {
   "get": {
    "summary": "Experiment Priorities Endpoint",
    "description": "The latest EIG/EVOI priority grid with decay + registry state applied\nat read time. 404 when the project has no run metrics yet (fit a model\nfirst, or backfill: python -m mmm_framework.platform.backfill).",
    "operationId": "experiment_priorities_endpoint_projects__project_id__experiment_priorities_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "as_of",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "As Of"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/options": {
   "get": {
    "summary": "Experiment Design Options Endpoint",
    "description": "What designs the project's data supports (geo designs need >= 4 geos),\nplus the recommended one.",
    "operationId": "experiment_design_options_endpoint_projects__project_id__experiment_design_options_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "channel",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Channel"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design": {
   "post": {
    "summary": "Experiment Design Endpoint",
    "description": "Compute a runnable experiment design: randomized matched-pair geo lift\n(or observational matched-market DiD) with DiD power/MDE curves, or a\nbudget-neutral randomized flighting schedule for national data. Pure data\ncomputation \u2014 no model load.",
    "operationId": "experiment_design_endpoint_projects__project_id__experiment_design_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentDesignRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/ghost-ads/power": {
   "post": {
    "summary": "Ghost Ads Power Endpoint",
    "description": "User-level ghost-ads power calculator \u2014 stateless (no dataset or model\nload): two-proportion / count / revenue MDE, ITT vs treatment-on-treated\ndilution, users-required inversion, and an optional simulation check of the\nnormal approximation.",
    "operationId": "ghost_ads_power_endpoint_projects__project_id__ghost_ads_power_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GhostAdsPowerRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/simulate": {
   "post": {
    "summary": "Start Experiment Simulation",
    "description": "Start a NON-BLOCKING model-anchored economics + A/A\u00b7A/B simulation. Loads\nthe project's latest saved model in the background and runs the\nexperiment_economics op; poll the returned job_id for the result.",
    "operationId": "start_experiment_simulation_projects__project_id__experiment_design_simulate_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentSimulateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/simulate/{job_id}": {
   "get": {
    "summary": "Get Experiment Simulation",
    "description": "Poll an experiment-simulation job: {status, result|null, error|null}.",
    "operationId": "get_experiment_simulation_projects__project_id__experiment_design_simulate__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/spec-curve": {
   "post": {
    "summary": "Start Spec Curve",
    "description": "Start a NON-BLOCKING spec-curve / model-averaging sweep (issue #118): fit a\npre-registered set of defensible specs against the project's dataset and\nLOO-stack them, so the robustness of each channel's ROI to the modelling\nchoices is auditable. The declared spec set is pre-registered to the\nassumption log BEFORE the sweep so it provably was not chosen after seeing the\nanswers. Multi-fit NUTS \u2014 poll the returned job_id for the result.",
    "operationId": "start_spec_curve_projects__project_id__spec_curve_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpecCurveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/spec-curve/{job_id}": {
   "get": {
    "summary": "Get Spec Curve",
    "description": "Poll a spec-curve job: {status, result|null, error|null, n_specs}.",
    "operationId": "get_spec_curve_projects__project_id__spec_curve__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/generate-deck": {
   "post": {
    "summary": "Start Deck Generation",
    "description": "Start a NON-BLOCKING PowerPoint slide-deck build from the project's latest\nsaved model. Poll the returned job_id; download the .pptx when done.",
    "operationId": "start_deck_generation_projects__project_id__generate_deck_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-model-name",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Model-Name"
      }
     },
     {
      "name": "x-base-url",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Base-Url"
      }
     },
     {
      "name": "x-provider",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Provider"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GenerateDeckRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/generate-deck/{job_id}": {
   "get": {
    "summary": "Get Deck Job",
    "description": "Poll a slide-deck job: {status, stage, result|null, error|null}.",
    "operationId": "get_deck_job_projects__project_id__generate_deck__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/generate-deck/{job_id}/download": {
   "get": {
    "summary": "Download Deck",
    "description": "Download the generated .pptx for a completed deck job.",
    "operationId": "download_deck_projects__project_id__generate_deck__job_id__download_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/validate": {
   "post": {
    "summary": "Start Model Validation",
    "description": "Start a NON-BLOCKING validation run on the project's latest saved model.\n``check`` selects which validation to run (validate / ppc / residuals /\nchannels / refutation / cross_validation). Poll the returned job_id.",
    "operationId": "start_model_validation_projects__project_id__validate_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ValidationRunRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/validations": {
   "get": {
    "summary": "List Model Validations",
    "description": "History of validation runs for a project \u2014 every completed/pending run\nsurvives reload: UI-started jobs AND chat-run checks (the agent's\nvalidate_model / run_* / run_calibration_check tools persist here too).\nPass ``?thread_id=`` to scope the list to the session that launched each\nrun (rows persisted before session stamping existed are excluded).\nSummary rows only; fetch a run's full result via\n``GET /projects/{id}/validate/{job_id}``.",
    "operationId": "list_model_validations_projects__project_id__validations_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/validate/{job_id}": {
   "get": {
    "summary": "Get Model Validation",
    "description": "Poll a validation job: {status, check, result|null, error|null}. ``result``\nis {content, tables:[ref], plots:[ref]} \u2014 fetch refs via /tables/{id} and\n/plots/{id}.",
    "operationId": "get_model_validation_projects__project_id__validate__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs": {
   "get": {
    "summary": "List Learning Programs Endpoint",
    "description": "The project's continuous-learning programs (each row carries its latest\nfit SNAPSHOT under ``summary``).",
    "operationId": "list_learning_programs_endpoint_projects__project_id__learning_programs_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Create Learning Program Endpoint",
    "description": "Create a learning program: validate the config (dollars), build + save\nthe initial LearningState, insert the sessions row.",
    "operationId": "create_learning_program_endpoint_projects__project_id__learning_programs_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LearningProgramCreateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs/{program_id}": {
   "get": {
    "summary": "Get Learning Program Endpoint",
    "description": "One program + its wave timeline (design/observation/snapshot rows).",
    "operationId": "get_learning_program_endpoint_projects__project_id__learning_programs__program_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Learning Program Endpoint",
    "description": "Delete a program (cascades its waves) AND reap its on-disk directory\n(state.npz holds the client's accumulated panel + posterior draws).",
    "operationId": "delete_learning_program_endpoint_projects__project_id__learning_programs__program_id__delete",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs/{program_id}/design-wave": {
   "post": {
    "summary": "Design Learning Wave Endpoint",
    "description": "Design the next central-composite wave around the program's current\ncenter (no fit; ``optimize=true`` runs the bounded Laplace-KG scoring in a\nworker thread so the event loop never blocks). Stores a 'designed' wave\nrow.",
    "operationId": "design_learning_wave_endpoint_projects__project_id__learning_programs__program_id__design_wave_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LearningDesignWaveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs/{program_id}/waves": {
   "post": {
    "summary": "Ingest Learning Wave Endpoint",
    "description": "Ingest wave evidence (rows / CSV text / registry experiment ids) and\nrefit in the background. 202 + job_id; poll ``.../jobs/{job_id}`` \u2014 the\ndone payload's ``result`` is the fit SNAPSHOT. 409 while a fit job for the\nsame program is still pending/running (concurrent fits race on state.npz).",
    "operationId": "ingest_learning_wave_endpoint_projects__project_id__learning_programs__program_id__waves_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LearningWaveIngestRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs/{program_id}/fit": {
   "post": {
    "summary": "Refit Learning Program Endpoint",
    "description": "Pure refit on the evidence already accumulated (e.g. with overridden\nENBS economics). 202 + job_id. 409 while another fit job for this program\nis still pending/running.",
    "operationId": "refit_learning_program_endpoint_projects__project_id__learning_programs__program_id__fit_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/LearningFitRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/learning-programs/{program_id}/jobs/{job_id}": {
   "get": {
    "summary": "Get Learning Job Endpoint",
    "description": "Poll a learning-fit job: {status: pending|running|done|error,\nresult: SNAPSHOT|null, error|null, project_id, program_id}.",
    "operationId": "get_learning_job_endpoint_projects__project_id__learning_programs__program_id__jobs__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "program_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Program Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden": {
   "post": {
    "summary": "Register Garden Model Endpoint",
    "description": "Register a bespoke model (source defining a BayesianMMM subclass) as a\nDRAFT. Analyst+ role. The source is AST-validated (never executed here) and\nstored in the org's garden; POST the test endpoint next to fit + grade it.",
    "operationId": "register_garden_model_endpoint_model_garden_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenRegisterRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "List Garden Models Endpoint",
    "description": "List the org's Model Garden models (latest version per name by default).",
    "operationId": "list_garden_models_endpoint_model_garden_get",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "name",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Name"
      }
     },
     {
      "name": "all_versions",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "All Versions"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/lint": {
   "post": {
    "summary": "Garden Lint Endpoint",
    "description": "\"Problems\" check for the Atelier editor: real Python diagnostics (ruff \u2014\nundefined names, unused imports, redefinitions, syntax, with line/column\nspans) merged with the AST-only garden-contract conventions. Neither path\nexecutes the source. Analyst+ role.",
    "operationId": "garden_lint_endpoint_model_garden_lint_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenSourceRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/format": {
   "post": {
    "summary": "Garden Format Endpoint",
    "description": "Format the editor source (ruff, black fallback) for the IDE *Format*\nbutton. Returns the formatted source or a one-line error. Analyst+ role.",
    "operationId": "garden_format_endpoint_model_garden_format_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenSourceRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/copilot": {
   "post": {
    "summary": "Garden Copilot Endpoint",
    "description": "Stream a Bayesian-modeling copilot answer (SSE) for the Atelier editor.\n\nStateless: the client sends the running chat + the current editor source each\nturn; the server grounds a focused expert system prompt (the oracle contract\n+ PyMC/MMM authoring knowledge) on that source and streams the model's tokens\nusing the SAME ``data: {...}\\n\\n`` / ``[DONE]`` framing as ``/chat``.\nAnalyst+ role.",
    "operationId": "garden_copilot_endpoint_model_garden_copilot_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-model-name",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Model-Name"
      }
     },
     {
      "name": "x-base-url",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Base-Url"
      }
     },
     {
      "name": "x-provider",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Provider"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenCopilotRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/notebook/dataset": {
   "post": {
    "summary": "Notebook Upload Dataset",
    "description": "Stage a dataset into the notebook's workspace (so cells auto-bind it as\n``df``). Analyst+ role; org-scoped synthetic thread (not a session, so no\n``_sess_write``).",
    "operationId": "notebook_upload_dataset_model_garden_notebook_dataset_post",
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_notebook_upload_dataset_model_garden_notebook_dataset_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/notebook/cell": {
   "post": {
    "summary": "Start Notebook Cell",
    "description": "Start a NON-BLOCKING run of one code cell against the model. Returns a\n``job_id`` to poll. Analyst+ role.",
    "operationId": "start_notebook_cell_model_garden_notebook_cell_post",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NotebookCellRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/notebook/cell/{job_id}": {
   "get": {
    "summary": "Get Notebook Cell",
    "description": "Poll a notebook cell run: {status, result|null, error|null}. result =\n{stdout, plots:[{id,title}], tables:[{id,title,...}], is_error}.",
    "operationId": "get_notebook_cell_model_garden_notebook_cell__job_id__get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/notebook": {
   "get": {
    "summary": "Get Notebook",
    "description": "The persisted notebook doc for this (model, source), or a seeded starter\nwhen none exists yet. Analyst+ role.",
    "operationId": "get_notebook_model_garden_notebook_get",
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Save Notebook",
    "description": "Upsert the notebook doc (one ``atelier_notebook`` artifact per notebook).\nOutputs are stored as content-addressed refs, so they survive. Analyst+.",
    "operationId": "save_notebook_model_garden_notebook_put",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/NotebookSaveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/copilot/chat": {
   "get": {
    "summary": "Get Copilot Chat",
    "description": "The persisted Atelier copilot chat for this (model, version, surface), or\nan empty chat when none exists yet. Analyst+ role.",
    "operationId": "get_copilot_chat_model_garden_copilot_chat_get",
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "title": "Version"
      }
     },
     {
      "name": "surface",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "editor",
       "title": "Surface"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Save Copilot Chat",
    "description": "Upsert the Atelier copilot chat (one artifact per model/version/surface).\nPUT an empty ``messages`` to clear it. Analyst+ role.",
    "operationId": "save_copilot_chat_model_garden_copilot_chat_put",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CopilotChatSaveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/versions": {
   "get": {
    "summary": "List Garden Versions Endpoint",
    "description": "Every version of one garden model, newest first.",
    "operationId": "list_garden_versions_endpoint_model_garden__name__versions_get",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/{version}": {
   "get": {
    "summary": "Get Garden Model Endpoint",
    "description": "One garden model version (incl. its manifest + compatibility report).",
    "operationId": "get_garden_model_endpoint_model_garden__name___version__get",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "patch": {
    "summary": "Update Garden Docs Endpoint",
    "description": "Edit a garden version's docs (markdown) IN PLACE \u2014 no new version. Analyst+\nrole. Docs are metadata, so this does not touch the source, manifest, or\ncompatibility status. PUBLISHED versions are immutable (the store rejects the\nedit -> 409); use \"Edit as new version\" to change a published model's docs.",
    "operationId": "update_garden_docs_endpoint_model_garden__name___version__patch",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenDocsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "summary": "Delete Garden Model Endpoint",
    "description": "Delete a draft/deprecated garden model (org admin/owner only). Published\nhistory is immutable \u2014 deprecate instead.",
    "operationId": "delete_garden_model_endpoint_model_garden__name___version__delete",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/{version}/source": {
   "get": {
    "summary": "Get Garden Source",
    "description": "The stored model source text (for the Atelier editor).",
    "operationId": "get_garden_source_model_garden__name___version__source_get",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/{version}/test": {
   "post": {
    "summary": "Start Garden Test",
    "description": "Start a NON-BLOCKING compatibility test; on pass the model is promoted\ndraft\u2192tested. Returns a job_id to poll.",
    "operationId": "start_garden_test_model_garden__name___version__test_post",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/{version}/test/{job_id}": {
   "get": {
    "summary": "Get Garden Test",
    "description": "Poll a garden test job: {status, result|null, error|null}.",
    "operationId": "get_garden_test_model_garden__name___version__test__job_id__get",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-garden/{name}/{version}/promote": {
   "post": {
    "summary": "Promote Garden Model",
    "description": "Human publish gate: promote a TESTED model to PUBLISHED so every project\nin the org can load it. Org admin/owner only; the model must be `tested`.",
    "operationId": "promote_garden_model_model_garden__name___version__promote_post",
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Version"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/GardenPromoteRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/optimize": {
   "post": {
    "summary": "Start Experiment Optimization",
    "description": "Start a NON-BLOCKING experiment-setup optimization: explores the design\ngrid and returns the Pareto front (MDE \u00d7 short-term cost \u00d7 duration) + a\nrecommended setup with cool-down. Poll the returned job_id.",
    "operationId": "start_experiment_optimization_projects__project_id__experiment_design_optimize_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentOptimizeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/optimize/{job_id}": {
   "get": {
    "summary": "Get Experiment Optimization",
    "description": "Poll an experiment-optimization job: {status, result|null, error|null}.",
    "operationId": "get_experiment_optimization_projects__project_id__experiment_design_optimize__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/identify": {
   "post": {
    "summary": "Start Structural Identification",
    "description": "Start a NON-BLOCKING structural-identification analysis: designs a\nmulti-level flighting schedule and reports how well its refit would\nidentify the channel's saturation (psi), adstock carryover (alpha) and\ncoefficient (beta) \u2014 an optimistic Laplace upper bound, never a guarantee.\nPoll the returned job_id.",
    "operationId": "start_structural_identification_projects__project_id__experiment_design_identify_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ExperimentIdentifyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/experiment-design/identify/{job_id}": {
   "get": {
    "summary": "Get Structural Identification",
    "description": "Poll a structural-identification job: {status, result|null, error|null}.",
    "operationId": "get_structural_identification_projects__project_id__experiment_design_identify__job_id__get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/artifacts/{thread_id}": {
   "get": {
    "summary": "List Artifacts Endpoint",
    "operationId": "list_artifacts_endpoint_artifacts__thread_id__get",
    "deprecated": true,
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}/artifacts": {
   "get": {
    "summary": "List Artifacts Endpoint",
    "operationId": "list_artifacts_endpoint_sessions__thread_id__artifacts_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/artifacts/{artifact_id}": {
   "delete": {
    "summary": "Delete Artifact Endpoint",
    "operationId": "delete_artifact_endpoint_artifacts__artifact_id__delete",
    "parameters": [
     {
      "name": "artifact_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Artifact Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}/export": {
   "get": {
    "summary": "Export Session Endpoint",
    "description": "Download the session's Python work as a standalone, runnable script.\n\nSynthesizes a preamble that reconstitutes tool-injected state (dataset,\nfitted model, helpers), then replays the conversation's tool calls (fits\nas ``build_and_fit`` with the fitted spec embedded, model ops, EDA) and\nexecute_python cells in order \u2014 so the download is a real, portable\nreproduction of the session, not a code dump that NameErrors. ``scope``\nnarrows to ``last`` (final user turn) or ``turn:<k>`` (1-based); invalid\nvalues export everything. See ``agents/session_export.build_session_script``.",
    "operationId": "export_session_endpoint_sessions__thread_id__export_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "all",
       "title": "Scope"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/assumptions/{thread_id}": {
   "get": {
    "summary": "List Assumptions Endpoint",
    "operationId": "list_assumptions_endpoint_assumptions__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "history",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "History"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "post": {
    "summary": "Record Assumption Endpoint",
    "operationId": "record_assumption_endpoint_assumptions__thread_id__post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RecordAssumptionBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/assumption_history/{thread_id}/{key}": {
   "get": {
    "summary": "Get Assumption History Endpoint",
    "description": "Distinct route prefix so {key:path} can't shadow the list endpoint.",
    "operationId": "get_assumption_history_endpoint_assumption_history__thread_id___key__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/assumption/{thread_id}/{key}": {
   "delete": {
    "summary": "Retract Assumption Endpoint",
    "operationId": "retract_assumption_endpoint_assumption__thread_id___key__delete",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "key",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RetractAssumptionBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/workflow/{thread_id}": {
   "get": {
    "summary": "Workflow Status Endpoint",
    "operationId": "workflow_status_endpoint_workflow__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/workflow/{thread_id}/{step}": {
   "patch": {
    "summary": "Update Workflow Step Endpoint",
    "operationId": "update_workflow_step_endpoint_workflow__thread_id___step__patch",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "step",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Step"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/WorkflowStepBody"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/files/{thread_id}": {
   "get": {
    "summary": "List Files Endpoint",
    "operationId": "list_files_endpoint_files__thread_id__get",
    "deprecated": true,
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/sessions/{thread_id}/files": {
   "get": {
    "summary": "List Files Endpoint",
    "operationId": "list_files_endpoint_sessions__thread_id__files_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/files/{file_id}": {
   "delete": {
    "summary": "Delete File Endpoint",
    "operationId": "delete_file_endpoint_files__file_id__delete",
    "parameters": [
     {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "File Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/plots/{plot_id}": {
   "get": {
    "summary": "Get Plot Endpoint",
    "description": "Serve a content-addressed Plotly figure JSON. Because the id is a content\nhash, the response is immutable \u2014 the browser caches it permanently, so each\nplot crosses the wire at most once per client (instead of the full plot list\nbeing re-streamed every turn).",
    "operationId": "get_plot_endpoint_plots__plot_id__get",
    "parameters": [
     {
      "name": "plot_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Plot Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/tables/{table_id}": {
   "get": {
    "summary": "Get Table Endpoint",
    "description": "Serve a content-addressed structured table payload (same immutable-cache\ncontract as /plots/{id} \u2014 refs stream, rows are fetched once).",
    "operationId": "get_table_endpoint_tables__table_id__get",
    "parameters": [
     {
      "name": "table_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Table Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/workspace/{thread_id}/files": {
   "get": {
    "summary": "Workspace Files Endpoint",
    "description": "List the session's registered files (uploads + generated), each with a\ndownload id.",
    "operationId": "workspace_files_endpoint_workspace__thread_id__files_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/files/{file_id}/download": {
   "get": {
    "summary": "Download File Endpoint",
    "operationId": "download_file_endpoint_files__file_id__download_get",
    "parameters": [
     {
      "name": "file_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "File Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/artifacts/{artifact_id}/download": {
   "get": {
    "summary": "Download Artifact Endpoint",
    "operationId": "download_artifact_endpoint_artifacts__artifact_id__download_get",
    "parameters": [
     {
      "name": "artifact_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Artifact Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/kb": {
   "post": {
    "summary": "Kb Upload Endpoint",
    "description": "Add a document to a project's knowledge base: store it, then chunk +\nembed it (in a threadpool) so it becomes searchable. Pass template=true to\ntag it as a template document (surfaced by the agent's list_templates).",
    "operationId": "kb_upload_endpoint_projects__project_id__kb_post",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_kb_upload_endpoint_projects__project_id__kb_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "Kb List Endpoint",
    "operationId": "kb_list_endpoint_projects__project_id__kb_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/projects/{project_id}/kb/search": {
   "get": {
    "summary": "Kb Search Endpoint",
    "operationId": "kb_search_endpoint_projects__project_id__kb_search_get",
    "parameters": [
     {
      "name": "project_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Project Id"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Q"
      }
     },
     {
      "name": "k",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 6,
       "title": "K"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/kb/{document_id}": {
   "delete": {
    "summary": "Kb Delete Endpoint",
    "operationId": "kb_delete_endpoint_kb__document_id__delete",
    "parameters": [
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/dag/{thread_id}": {
   "get": {
    "summary": "Dag Endpoint",
    "description": "Return the current DAG (if any) plus a fresh identifiability report.\nPulls DAG from dashboard_data['dag']['spec'] which `propose_dag` writes.",
    "operationId": "dag_endpoint_dag__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "summary": "Update Dag",
    "description": "Manually update the DAG for a session.\n\nAccepts React Flow node/edge format, converts to DAGSpec, validates,\nand persists into the agent state dashboard_data.dag.",
    "operationId": "update_dag_dag__thread_id__put",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DAGUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/outliers/{thread_id}/apply": {
   "post": {
    "summary": "Apply Outliers Endpoint",
    "description": "Apply confirmed outlier-treatment actions from the UI (EDA tab confirm\nbuttons), without a chat round-trip.\n\nApplies a STATE-ONLY update via aupdate_state (same pattern as PUT /dag):\nno ToolMessage/AIMessage is appended \u2014 an orphan tool message injected\noutside a real tool call corrupts Anthropic message threads.",
    "operationId": "apply_outliers_endpoint_outliers__thread_id__apply_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/OutlierApplyRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}/upload": {
   "post": {
    "summary": "Data Studio Upload",
    "description": "Stage a raw upload (.csv/.xlsx/.parquet) for the Data Studio. Lands under\nthread_dir/data_studio/raw/, (re)initialises the staging manifest with\nheuristic default roles, and returns the columns + a preview. Does NOT set\nthe session's working dataset \u2014 that happens on commit.",
    "operationId": "data_studio_upload_data_studio__thread_id__upload_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_data_studio_upload_data_studio__thread_id__upload_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}": {
   "get": {
    "summary": "Data Studio State",
    "description": "The current staging manifest + a fresh preview (for hydration on reopen).",
    "operationId": "data_studio_state_data_studio__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}/pipeline": {
   "put": {
    "summary": "Data Studio Pipeline",
    "description": "Replace the whole transform pipeline (+ roles) and re-preview the frame.",
    "operationId": "data_studio_pipeline_data_studio__thread_id__pipeline_put",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StudioPipelineRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}/eda": {
   "post": {
    "summary": "Data Studio Eda",
    "description": "Run the requested EDA analyses on the current staged + transformed frame.\nFigures are returned INLINE (never pushed to the session Plots tab).",
    "operationId": "data_studio_eda_data_studio__thread_id__eda_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StudioEdaRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}/commit": {
   "post": {
    "summary": "Data Studio Commit",
    "description": "Promote the cleaned staged frame to the session's working dataset. Writes\nMFF-long CSV, sets dataset_path + spec roles via a STATE-ONLY aupdate_state\n(no ToolMessage \u2014 same pattern as /outliers/apply).",
    "operationId": "data_studio_commit_data_studio__thread_id__commit_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/StudioCommitRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/data-studio/{thread_id}/discard": {
   "post": {
    "summary": "Data Studio Discard",
    "description": "Discard the staging area. Does NOT touch a prior committed dataset_path.",
    "operationId": "data_studio_discard_data_studio__thread_id__discard_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/spec/{thread_id}": {
   "patch": {
    "summary": "Update Spec",
    "description": "Server-authoritative manual edit of the model configuration.\n\nWrites the edited ``model_spec`` directly into the agent state and locks the\nleaf fields the user actually changed (diffed server-side) so the LLM can no\nlonger silently overwrite them. ``unlock_paths`` hands fields back to the LLM.",
    "operationId": "update_spec_spec__thread_id__patch",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpecUpdateRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/spec/{thread_id}/resolve": {
   "post": {
    "summary": "Resolve Spec Change",
    "description": "Confirm or decline an LLM-proposed change to a user-locked field.\n\n``approve`` applies the proposed value (and keeps the field locked at the new\nvalue). ``reject`` keeps the user's value and writes a note into the thread so\nthe LLM has decline-memory and won't re-propose the same change next turn.",
    "operationId": "resolve_spec_change_spec__thread_id__resolve_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SpecResolveRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/dataset/preview/{thread_id}": {
   "get": {
    "summary": "Dataset Preview",
    "description": "Return a time-series for one MFF variable, optionally filtered by one dimension.\n\nQuery params:\n  variable  \u2014 value of VariableName (e.g. 'TV', 'Sales')\n  dim       \u2014 dimension column to filter on (e.g. 'Geography')\n  value     \u2014 the dimension value; pass '(national)' to filter NaN rows",
    "operationId": "dataset_preview_dataset_preview__thread_id__get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "path",
      "required": true,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "variable",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Variable"
      }
     },
     {
      "name": "dim",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Dim"
      }
     },
     {
      "name": "value",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Value"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/upload": {
   "post": {
    "summary": "Upload File",
    "description": "Upload a file scoped to a session. Files land in the session WORKSPACE\ndirectory (so execute_python and the Files tab share one location), are\nregistered in data_files, and an ABSOLUTE path is returned so the agent can\nread it from any tool (execute_python runs in the workspace; fit/inspect run\nin the server cwd).",
    "operationId": "upload_file_upload_post",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_upload_file_upload_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/health": {
   "get": {
    "summary": "Health Check",
    "operationId": "health_check_health_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/observability": {
   "get": {
    "summary": "Observability Endpoint",
    "description": "Reliability signals for operators: audit-chain integrity, off-host ship\nbacklog, and recent fit activity. No tenant data.",
    "operationId": "observability_endpoint_observability_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/metrics": {
   "get": {
    "summary": "Metrics Endpoint",
    "description": "Prometheus metrics (Phase 4d): per-event audit counters, live kernel count,\nand the active-fit gauge the autoscaler scales on (\u00a75.1). Sourced from the\nmmm_audit events so the audit log is the single source of truth.",
    "operationId": "metrics_endpoint_metrics_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/integrations/catalog": {
   "get": {
    "summary": "Integrations Catalog Endpoint",
    "description": "List available data-source + ad-platform integrations (non-secret).\n\nPowers the Settings \"Data connections\" section: which connectors exist,\nwhether their optional SDK is installed, the auth story, and (for ad\nplatforms) the recommended ingestion path. No credentials are returned.\n\nRequires an authenticated principal: the installed-SDK flags reveal\ndeployment topology, so the endpoint is gated like its neighbours rather\nthan left open for reconnaissance.",
    "operationId": "integrations_catalog_endpoint_integrations_catalog_get",
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-config": {
   "get": {
    "summary": "Model Config Endpoint",
    "description": "Report the active LLM provider/model (non-secret).\n\nLets the frontend decide whether to prompt for an API key: when the server\nauthenticates via Vertex AI / ADC (or a server-side env key),\n``requires_api_key`` is False and the login key prompt can be skipped. Never\nreturns the API key or credentials contents.",
    "operationId": "model_config_endpoint_model_config_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/vertex-models": {
   "get": {
    "summary": "Vertex Models Endpoint",
    "description": "List selectable Vertex models for the configured (or given) project/region.\n\nCombines live-discovered Gemini models, a best-effort Claude catalog, and any\nconfigured ``extra_models``. Results are cached briefly. The frontend should\nstill offer a free-text field for ids not in the list (e.g. versioned Claude\nids pasted from the Vertex console).",
    "operationId": "vertex_models_endpoint_vertex_models_get",
    "parameters": [
     {
      "name": "project",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Project"
      }
     },
     {
      "name": "location",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Location"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/lmstudio-models": {
   "get": {
    "summary": "Lmstudio Models Endpoint",
    "description": "List models currently loaded in LM Studio (its OpenAI-compatible\n``/v1/models``). Returns an empty list if LM Studio isn't running, so the\nfrontend can still offer free-text model entry.",
    "operationId": "lmstudio_models_endpoint_lmstudio_models_get",
    "parameters": [
     {
      "name": "base_url",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Base Url"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/report": {
   "get": {
    "summary": "View Report",
    "description": "Serve the generated HTML report inline for embedding.",
    "operationId": "view_report_report_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/report/download": {
   "get": {
    "summary": "Download Report",
    "description": "Download the generated HTML report.",
    "operationId": "download_report_report_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/slide-deck/download": {
   "get": {
    "summary": "Download Slide Deck",
    "description": "Download the PowerPoint deck generated by the chat agent's\n``generate_slide_deck`` tool for a session (the project-scoped UI button uses\n``/projects/{id}/generate-deck/{job_id}/download``).",
    "operationId": "download_slide_deck_slide_deck_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/prefit-report": {
   "get": {
    "summary": "View Prefit Report",
    "description": "Serve the pre-fit Model Design Readout (priors, assumptions, prior\npredictive checks, SBC, change record) generated by the agent's\n``generate_model_design_readout`` tool.",
    "operationId": "view_prefit_report_prefit_report_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/prefit-report/download": {
   "get": {
    "summary": "Download Prefit Report",
    "operationId": "download_prefit_report_prefit_report_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/results-report": {
   "get": {
    "summary": "View Results Report",
    "description": "Serve the interactive MMM Results Report (embedded-posterior,\nrecompute-in-browser) generated by the agent's\n``generate_interactive_report`` tool.",
    "operationId": "view_results_report_results_report_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/results-report/download": {
   "get": {
    "summary": "Download Results Report",
    "operationId": "download_results_report_results_report_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/project-report": {
   "get": {
    "summary": "View Project Report",
    "description": "Serve the project findings HTML report.",
    "operationId": "view_project_report_project_report_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/project-report/download": {
   "get": {
    "summary": "Download Project Report",
    "operationId": "download_project_report_project_report_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/project-slides": {
   "get": {
    "summary": "View Project Slides",
    "description": "Serve the Reveal.js project slideshow.",
    "operationId": "view_project_slides_project_slides_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/project-slides/download": {
   "get": {
    "summary": "Download Project Slides",
    "operationId": "download_project_slides_project_slides_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/client-report": {
   "get": {
    "summary": "View Client Report",
    "description": "Serve the client-ready HTML report (no diagnostics, with nav + confidentiality notice).",
    "operationId": "view_client_report_client_report_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-defense": {
   "get": {
    "summary": "View Model Defense",
    "description": "Serve the model-defense (causal-rigor) report.",
    "operationId": "view_model_defense_model_defense_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/model-defense/download": {
   "get": {
    "summary": "Download Model Defense",
    "operationId": "download_model_defense_model_defense_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/client-report/download": {
   "get": {
    "summary": "Download Client Report",
    "operationId": "download_client_report_client_report_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/client-slides": {
   "get": {
    "summary": "View Client Slides",
    "description": "Serve the client-ready Reveal.js slideshow (no MCMC stats, with confidentiality footer).",
    "operationId": "view_client_slides_client_slides_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/client-slides/download": {
   "get": {
    "summary": "Download Client Slides",
    "operationId": "download_client_slides_client_slides_download_get",
    "parameters": [
     {
      "name": "thread_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Thread Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "AcceptInviteRequest": {
    "properties": {
     "token": {
      "type": "string",
      "title": "Token"
     },
     "password": {
      "type": "string",
      "title": "Password"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     }
    },
    "type": "object",
    "required": [
     "token",
     "password"
    ],
    "title": "AcceptInviteRequest"
   },
   "Body_data_studio_upload_data_studio__thread_id__upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_data_studio_upload_data_studio__thread_id__upload_post"
   },
   "Body_kb_upload_endpoint_projects__project_id__kb_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     },
     "template": {
      "type": "boolean",
      "title": "Template",
      "default": false
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_kb_upload_endpoint_projects__project_id__kb_post"
   },
   "Body_notebook_upload_dataset_model_garden_notebook_dataset_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_notebook_upload_dataset_model_garden_notebook_dataset_post"
   },
   "Body_upload_delivery_endpoint_projects__project_id__delivery_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_delivery_endpoint_projects__project_id__delivery_post"
   },
   "Body_upload_file_upload_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_file_upload_post"
   },
   "Body_upload_platform_figures_endpoint_projects__project_id__platform_figures_post": {
    "properties": {
     "file": {
      "type": "string",
      "format": "binary",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_upload_platform_figures_endpoint_projects__project_id__platform_figures_post"
   },
   "BrandingExtractRequest": {
    "properties": {
     "url": {
      "type": "string",
      "title": "Url"
     },
     "save": {
      "type": "boolean",
      "title": "Save",
      "default": true
     }
    },
    "type": "object",
    "required": [
     "url"
    ],
    "title": "BrandingExtractRequest"
   },
   "BudgetPlanUpsertRequest": {
    "properties": {
     "plan_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Plan Id"
     },
     "project_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Project Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "model_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Model Id"
     },
     "kind": {
      "type": "string",
      "title": "Kind",
      "default": "optimization"
     },
     "spend_changes": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "number"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Spend Changes"
     },
     "baseline_outcome": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Baseline Outcome"
     },
     "scenario_outcome": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Scenario Outcome"
     },
     "outcome_change": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Outcome Change"
     },
     "outcome_change_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Outcome Change Pct"
     },
     "channel_details": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Channel Details"
     },
     "plan_payload": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Plan Payload"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "BudgetPlanUpsertRequest"
   },
   "ChangePasswordRequest": {
    "properties": {
     "current_password": {
      "type": "string",
      "title": "Current Password"
     },
     "new_password": {
      "type": "string",
      "title": "New Password"
     }
    },
    "type": "object",
    "required": [
     "current_password",
     "new_password"
    ],
    "title": "ChangePasswordRequest"
   },
   "ChatRequest": {
    "properties": {
     "message": {
      "type": "string",
      "title": "Message"
     },
     "thread_id": {
      "type": "string",
      "title": "Thread Id",
      "default": "default_thread"
     },
     "page_context": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page Context"
     }
    },
    "type": "object",
    "required": [
     "message"
    ],
    "title": "ChatRequest"
   },
   "ConnectionScheduleUpdate": {
    "properties": {
     "sync_interval_minutes": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Sync Interval Minutes"
     }
    },
    "type": "object",
    "title": "ConnectionScheduleUpdate"
   },
   "CopilotChatSaveRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "version": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Version"
     },
     "surface": {
      "type": "string",
      "title": "Surface",
      "default": "editor"
     },
     "messages": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Messages",
      "default": []
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "CopilotChatSaveRequest",
    "description": "Persist the Atelier copilot chat for one ``(model, version, surface)``.\n\nThe chat is scoped per model/version so each model keeps its own running\nconversation; ``surface`` separates the editor copilot from the notebook\ncopilot. PUT an empty ``messages`` to clear it. ``messages`` are stored as\nfree-form dicts (id/role/content/targetCellId) so the client owns the shape."
   },
   "CopilotTurn": {
    "properties": {
     "role": {
      "type": "string",
      "title": "Role",
      "default": "user"
     },
     "content": {
      "type": "string",
      "title": "Content",
      "default": ""
     }
    },
    "type": "object",
    "title": "CopilotTurn"
   },
   "CreateSessionRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "project_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Project Id"
     },
     "modeling_mode": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Modeling Mode"
     }
    },
    "type": "object",
    "title": "CreateSessionRequest"
   },
   "DAGUpdateRequest": {
    "properties": {
     "nodes": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Nodes"
     },
     "edges": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Edges"
     }
    },
    "type": "object",
    "required": [
     "nodes",
     "edges"
    ],
    "title": "DAGUpdateRequest"
   },
   "DataConnectionCreate": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "kind": {
      "type": "string",
      "title": "Kind"
     },
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config",
      "default": {}
     }
    },
    "type": "object",
    "required": [
     "name",
     "kind"
    ],
    "title": "DataConnectionCreate"
   },
   "ExperimentDesignRequest": {
    "properties": {
     "channel": {
      "type": "string",
      "title": "Channel"
     },
     "design_key": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Design Key"
     },
     "method": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Method"
     },
     "design": {
      "type": "string",
      "title": "Design",
      "default": "scaling"
     },
     "intensity_pct": {
      "type": "number",
      "title": "Intensity Pct",
      "default": 50.0
     },
     "n_pairs": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "N Pairs"
     },
     "duration": {
      "type": "integer",
      "title": "Duration",
      "default": 8
     },
     "amplitude_pct": {
      "type": "number",
      "title": "Amplitude Pct",
      "default": 50.0
     },
     "block_weeks": {
      "type": "integer",
      "title": "Block Weeks",
      "default": 2
     },
     "levels": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Levels"
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 42
     }
    },
    "type": "object",
    "required": [
     "channel"
    ],
    "title": "ExperimentDesignRequest"
   },
   "ExperimentIdentifyRequest": {
    "properties": {
     "channel": {
      "type": "string",
      "title": "Channel"
     },
     "levels": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array",
        "maxItems": 8
       },
       {
        "type": "null"
       }
      ],
      "title": "Levels"
     },
     "block_weeks": {
      "anyOf": [
       {
        "type": "integer",
        "maximum": 13.0,
        "minimum": 1.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Block Weeks"
     },
     "duration": {
      "type": "integer",
      "maximum": 52.0,
      "minimum": 4.0,
      "title": "Duration",
      "default": 12
     },
     "max_draws": {
      "type": "integer",
      "maximum": 1000.0,
      "minimum": 20.0,
      "title": "Max Draws",
      "default": 200
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 42
     }
    },
    "type": "object",
    "required": [
     "channel"
    ],
    "title": "ExperimentIdentifyRequest"
   },
   "ExperimentOptimizeRequest": {
    "properties": {
     "channel": {
      "type": "string",
      "title": "Channel"
     },
     "margin": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Margin"
     },
     "price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Price"
     },
     "kpi_kind": {
      "type": "string",
      "title": "Kpi Kind",
      "default": "revenue"
     },
     "duration_min": {
      "type": "integer",
      "title": "Duration Min",
      "default": 4
     },
     "duration_max": {
      "type": "integer",
      "title": "Duration Max",
      "default": 12
     },
     "intensity_min": {
      "type": "number",
      "title": "Intensity Min",
      "default": 50.0
     },
     "intensity_max": {
      "type": "number",
      "title": "Intensity Max",
      "default": 100.0
     },
     "include_holdout": {
      "type": "boolean",
      "title": "Include Holdout",
      "default": true
     },
     "durations": {
      "anyOf": [
       {
        "items": {
         "type": "integer"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Durations"
     },
     "scaling_intensities": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Scaling Intensities"
     },
     "net_value_axis": {
      "type": "boolean",
      "title": "Net Value Axis",
      "default": true
     },
     "response_horizon_weeks": {
      "type": "integer",
      "title": "Response Horizon Weeks",
      "default": 26
     },
     "max_draws": {
      "type": "integer",
      "title": "Max Draws",
      "default": 80
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 42
     }
    },
    "type": "object",
    "required": [
     "channel"
    ],
    "title": "ExperimentOptimizeRequest"
   },
   "ExperimentSimulateRequest": {
    "properties": {
     "channel": {
      "type": "string",
      "title": "Channel"
     },
     "design_key": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Design Key"
     },
     "design": {
      "type": "string",
      "title": "Design",
      "default": "scaling"
     },
     "intensity_pct": {
      "type": "number",
      "title": "Intensity Pct",
      "default": 50.0
     },
     "n_pairs": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "N Pairs"
     },
     "duration": {
      "type": "integer",
      "title": "Duration",
      "default": 8
     },
     "amplitude_pct": {
      "type": "number",
      "title": "Amplitude Pct",
      "default": 50.0
     },
     "block_weeks": {
      "type": "integer",
      "title": "Block Weeks",
      "default": 2
     },
     "levels": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Levels"
     },
     "margin": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Margin"
     },
     "price": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Price"
     },
     "kpi_kind": {
      "type": "string",
      "title": "Kpi Kind",
      "default": "revenue"
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 42
     },
     "max_draws": {
      "type": "integer",
      "title": "Max Draws",
      "default": 100
     }
    },
    "type": "object",
    "required": [
     "channel"
    ],
    "title": "ExperimentSimulateRequest"
   },
   "ExperimentTransitionRequest": {
    "properties": {
     "status": {
      "type": "string",
      "title": "Status"
     },
     "note": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Note"
     },
     "value": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value"
     },
     "se": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Se"
     },
     "estimand": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Estimand"
     },
     "start_date": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Start Date"
     },
     "end_date": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "End Date"
     },
     "readout": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Readout"
     },
     "calibrated_run_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Calibrated Run Id"
     }
    },
    "type": "object",
    "required": [
     "status"
    ],
    "title": "ExperimentTransitionRequest"
   },
   "ExperimentUpsertRequest": {
    "properties": {
     "id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Id"
     },
     "project_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Project Id"
     },
     "thread_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Thread Id"
     },
     "channel": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Channel"
     },
     "subchannel": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Subchannel"
     },
     "design_type": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Design Type"
     },
     "status": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Status"
     },
     "start_date": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Start Date"
     },
     "end_date": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "End Date"
     },
     "estimand": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Estimand"
     },
     "value": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value"
     },
     "se": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Se"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     },
     "recommending_run_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recommending Run Id"
     },
     "design": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Design"
     },
     "readout": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Readout"
     },
     "priority": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Priority"
     }
    },
    "type": "object",
    "title": "ExperimentUpsertRequest"
   },
   "GardenCopilotRequest": {
    "properties": {
     "messages": {
      "items": {
       "$ref": "#/components/schemas/CopilotTurn"
      },
      "type": "array",
      "title": "Messages",
      "default": []
     },
     "source_code": {
      "type": "string",
      "title": "Source Code",
      "default": ""
     },
     "notebook": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/NotebookCopilotContext"
       },
       {
        "type": "null"
       }
      ]
     }
    },
    "type": "object",
    "title": "GardenCopilotRequest",
    "description": "A modeling-copilot turn: the running chat plus the current editor source\nso the assistant grounds its answer in the user's actual code. When invoked\nfrom the Atelier notebook, ``notebook`` carries the failing/active cell so the\nsame copilot diagnoses cell-execution errors and rewrites the cell."
   },
   "GardenDocsRequest": {
    "properties": {
     "docs": {
      "type": "string",
      "title": "Docs",
      "default": ""
     }
    },
    "type": "object",
    "title": "GardenDocsRequest",
    "description": "In-place docs (markdown) edit for a non-published garden version."
   },
   "GardenPromoteRequest": {
    "properties": {
     "note": {
      "type": "string",
      "title": "Note",
      "default": ""
     }
    },
    "type": "object",
    "title": "GardenPromoteRequest"
   },
   "GardenRegisterRequest": {
    "properties": {
     "source_code": {
      "type": "string",
      "title": "Source Code"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "docs": {
      "type": "string",
      "title": "Docs",
      "default": ""
     },
     "version": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Version"
     },
     "tags": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tags"
     },
     "dataset_schema": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dataset Schema"
     },
     "recommended_fit": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Recommended Fit"
     }
    },
    "type": "object",
    "required": [
     "source_code",
     "name"
    ],
    "title": "GardenRegisterRequest"
   },
   "GardenSourceRequest": {
    "properties": {
     "source_code": {
      "type": "string",
      "title": "Source Code",
      "default": ""
     }
    },
    "type": "object",
    "title": "GardenSourceRequest",
    "description": "A bare source payload for the editor's IDE tools (lint / format)."
   },
   "GenerateDeckRequest": {
    "properties": {
     "client": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Client"
     },
     "kpi_name": {
      "type": "string",
      "title": "Kpi Name",
      "default": "Revenue"
     },
     "currency": {
      "type": "string",
      "title": "Currency",
      "default": "$"
     },
     "break_even": {
      "type": "number",
      "title": "Break Even",
      "default": 1.0
     },
     "margin": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Margin"
     },
     "hdi_prob": {
      "type": "number",
      "title": "Hdi Prob",
      "default": 0.8
     }
    },
    "type": "object",
    "title": "GenerateDeckRequest"
   },
   "GhostAdsPowerRequest": {
    "properties": {
     "users_reached": {
      "type": "integer",
      "title": "Users Reached"
     },
     "baseline_rate": {
      "type": "number",
      "title": "Baseline Rate",
      "default": 0.02
     },
     "treated_fraction": {
      "type": "number",
      "title": "Treated Fraction",
      "default": 0.5
     },
     "outcome": {
      "type": "string",
      "title": "Outcome",
      "default": "binary"
     },
     "baseline_mean": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Baseline Mean"
     },
     "baseline_dispersion": {
      "type": "number",
      "title": "Baseline Dispersion",
      "default": 1.0
     },
     "value_sd": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Sd"
     },
     "alpha": {
      "type": "number",
      "title": "Alpha",
      "default": 0.05
     },
     "power_target": {
      "type": "number",
      "title": "Power Target",
      "default": 0.8
     },
     "two_sided": {
      "type": "boolean",
      "title": "Two Sided",
      "default": true
     },
     "exposure_rate": {
      "type": "number",
      "title": "Exposure Rate",
      "default": 1.0
     },
     "cost_per_user": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Cost Per User"
     },
     "value_per_conversion": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Value Per Conversion"
     },
     "target_lift_abs": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Target Lift Abs"
     },
     "simulate": {
      "type": "boolean",
      "title": "Simulate",
      "default": false
     },
     "n_sims": {
      "type": "integer",
      "title": "N Sims",
      "default": 2000
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "users_reached"
    ],
    "title": "GhostAdsPowerRequest"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "InviteOut": {
    "properties": {
     "token": {
      "type": "string",
      "title": "Token"
     },
     "email": {
      "type": "string",
      "title": "Email"
     },
     "role": {
      "$ref": "#/components/schemas/Role"
     },
     "org_id": {
      "type": "string",
      "title": "Org Id"
     },
     "expires_at": {
      "type": "number",
      "title": "Expires At"
     }
    },
    "type": "object",
    "required": [
     "token",
     "email",
     "role",
     "org_id",
     "expires_at"
    ],
    "title": "InviteOut"
   },
   "InviteRequest": {
    "properties": {
     "email": {
      "type": "string",
      "title": "Email"
     },
     "role": {
      "$ref": "#/components/schemas/Role",
      "default": "analyst"
     }
    },
    "type": "object",
    "required": [
     "email"
    ],
    "title": "InviteRequest"
   },
   "LearningDesignWaveRequest": {
    "properties": {
     "delta": {
      "type": "number",
      "title": "Delta",
      "default": 0.6
     },
     "probe_pairs": {
      "anyOf": [
       {
        "items": {
         "items": {
          "type": "integer"
         },
         "type": "array"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Probe Pairs"
     },
     "n_geo": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "N Geo"
     },
     "n_holdout": {
      "type": "integer",
      "title": "N Holdout",
      "default": 0
     },
     "seed": {
      "type": "integer",
      "title": "Seed",
      "default": 0
     },
     "optimize": {
      "type": "boolean",
      "title": "Optimize",
      "default": false
     },
     "candidate_deltas": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array",
        "maxItems": 8
       },
       {
        "type": "null"
       }
      ],
      "title": "Candidate Deltas"
     },
     "kg_n_outcomes": {
      "type": "integer",
      "maximum": 256.0,
      "minimum": 8.0,
      "title": "Kg N Outcomes",
      "default": 32
     },
     "stratify": {
      "type": "boolean",
      "title": "Stratify",
      "default": true
     }
    },
    "type": "object",
    "title": "LearningDesignWaveRequest"
   },
   "LearningFitRequest": {
    "properties": {
     "margin": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Margin"
     },
     "population": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Population"
     },
     "wave_cost": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Wave Cost"
     },
     "fit_kwargs": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Fit Kwargs"
     }
    },
    "type": "object",
    "title": "LearningFitRequest"
   },
   "LearningProgramCreateRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "config": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config"
     }
    },
    "type": "object",
    "required": [
     "config"
    ],
    "title": "LearningProgramCreateRequest",
    "description": "Body: ``{name, config}`` \u2014 ``config`` is the \u00a73.1 program config dict\n(dollars, PER GEO per period): channels (+ optional arms), center, budget,\nvalue_per_unit, spend_ref?, mode, activation, gamma_scale/beta_scale,\npair_signs?, kpi, cadence_weeks, and the ENBS economics (margin /\nhorizon_periods / wave_cost). The Sextant wizard sends channels INSIDE\nconfig, ``mode: \"fixed\"``, and a fully-populated ``center``. The wizard's\nhorizon rides ``horizon_periods`` (a legacy ``population`` key is read as\nhorizon periods too); the backend scales it by the program's geo count at\nfit time \u2014 the ENBS population is GEO-PERIODS."
   },
   "LearningWaveIngestRequest": {
    "properties": {
     "rows": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rows"
     },
     "experiment_ids": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Experiment Ids"
     },
     "csv_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Csv Text"
     },
     "economics": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Economics"
     },
     "fit_kwargs": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Fit Kwargs"
     },
     "period_col": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Period Col"
     }
    },
    "type": "object",
    "title": "LearningWaveIngestRequest"
   },
   "LoadModelRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "LoadModelRequest"
   },
   "LockPlanRequest": {
    "properties": {
     "thread_id": {
      "type": "string",
      "title": "Thread Id"
     },
     "name": {
      "type": "string",
      "title": "Name",
      "default": "Analysis Plan"
     },
     "dag": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dag"
     },
     "research_question": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Research Question"
     },
     "assumptions": {
      "anyOf": [
       {
        "items": {},
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Assumptions"
     },
     "extra": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Extra"
     }
    },
    "type": "object",
    "required": [
     "thread_id"
    ],
    "title": "LockPlanRequest"
   },
   "LoginRequest": {
    "properties": {
     "email": {
      "type": "string",
      "title": "Email"
     },
     "password": {
      "type": "string",
      "title": "Password"
     }
    },
    "type": "object",
    "required": [
     "email",
     "password"
    ],
    "title": "LoginRequest"
   },
   "LogoutRequest": {
    "properties": {
     "refresh_token": {
      "type": "string",
      "title": "Refresh Token"
     }
    },
    "type": "object",
    "required": [
     "refresh_token"
    ],
    "title": "LogoutRequest"
   },
   "MembersRequest": {
    "properties": {
     "members": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Members"
     }
    },
    "type": "object",
    "required": [
     "members"
    ],
    "title": "MembersRequest"
   },
   "NotebookCellRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name",
      "default": "untitled"
     },
     "version": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Version"
     },
     "source_code": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Code"
     },
     "source_rev": {
      "type": "string",
      "title": "Source Rev",
      "default": ""
     },
     "code": {
      "type": "string",
      "title": "Code",
      "default": ""
     },
     "dataset_path": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dataset Path"
     }
    },
    "type": "object",
    "title": "NotebookCellRequest",
    "description": "Run one code cell against the model. ``version=None`` => the live editor\nbuffer in ``source_code`` (re-imported when ``source_rev`` changes); else a\nregistered version (source resolved from the registry)."
   },
   "NotebookCopilotContext": {
    "properties": {
     "cell_code": {
      "type": "string",
      "title": "Cell Code",
      "default": ""
     },
     "traceback": {
      "type": "string",
      "title": "Traceback",
      "default": ""
     },
     "dataset_preview": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dataset Preview"
     },
     "other_cells": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Other Cells",
      "default": []
     },
     "is_error": {
      "type": "boolean",
      "title": "Is Error",
      "default": false
     }
    },
    "type": "object",
    "title": "NotebookCopilotContext",
    "description": "Notebook context attached to a copilot turn so the assistant can diagnose\na failed cell: the cell's code + traceback, the dataset preview, and the\nsibling cells (variables flow between cells in one shared kernel)."
   },
   "NotebookSaveRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name",
      "default": "untitled"
     },
     "version": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Version"
     },
     "cells": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Cells",
      "default": []
     },
     "dataset": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Dataset"
     }
    },
    "type": "object",
    "title": "NotebookSaveRequest"
   },
   "OnboardingRequest": {
    "properties": {
     "client_name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Client Name"
     },
     "industry": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Industry"
     },
     "website": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Website"
     },
     "markets": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Markets"
     },
     "goals": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Goals"
     },
     "kpis": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Kpis"
     },
     "channels": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Channels"
     },
     "constraints": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Constraints"
     },
     "audience": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Audience"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     },
     "members": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Members"
     }
    },
    "type": "object",
    "title": "OnboardingRequest"
   },
   "OutlierApplyRequest": {
    "properties": {
     "action_ids": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Action Ids"
     },
     "reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reason"
     }
    },
    "type": "object",
    "required": [
     "action_ids"
    ],
    "title": "OutlierApplyRequest"
   },
   "PasswordResetConfirm": {
    "properties": {
     "token": {
      "type": "string",
      "title": "Token"
     },
     "new_password": {
      "type": "string",
      "title": "New Password"
     }
    },
    "type": "object",
    "required": [
     "token",
     "new_password"
    ],
    "title": "PasswordResetConfirm"
   },
   "PasswordResetRequest": {
    "properties": {
     "email": {
      "type": "string",
      "title": "Email"
     }
    },
    "type": "object",
    "required": [
     "email"
    ],
    "title": "PasswordResetRequest"
   },
   "PlannerOptimizeRequest": {
    "properties": {
     "total_budget": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Total Budget"
     },
     "budget_change_pct": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Budget Change Pct"
     },
     "min_multiplier": {
      "type": "number",
      "title": "Min Multiplier",
      "default": 0.0
     },
     "max_multiplier": {
      "type": "number",
      "title": "Max Multiplier",
      "default": 2.0
     },
     "channel_bounds": {
      "anyOf": [
       {
        "additionalProperties": {
         "items": {
          "type": "number"
         },
         "type": "array"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Channel Bounds"
     },
     "by_geo": {
      "type": "boolean",
      "title": "By Geo",
      "default": false
     },
     "flighting": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Flighting"
     },
     "max_draws": {
      "type": "integer",
      "title": "Max Draws",
      "default": 120
     },
     "abs_bounds": {
      "anyOf": [
       {
        "additionalProperties": {
         "items": {
          "type": "number"
         },
         "type": "array"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Abs Bounds"
     },
     "groups": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Groups"
     },
     "min_channel_spend": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "additionalProperties": {
         "type": "number"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Min Channel Spend"
     },
     "objective": {
      "type": "string",
      "title": "Objective",
      "default": "mean"
     },
     "mode": {
      "type": "string",
      "title": "Mode",
      "default": "fixed"
     },
     "value_per_kpi": {
      "type": "number",
      "title": "Value Per Kpi",
      "default": 1.0
     },
     "frontier": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Frontier"
     },
     "target_kpi": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Target Kpi"
     }
    },
    "type": "object",
    "title": "PlannerOptimizeRequest"
   },
   "PlannerScenarioRequest": {
    "properties": {
     "spend_changes": {
      "additionalProperties": {
       "type": "number"
      },
      "type": "object",
      "title": "Spend Changes"
     },
     "time_period": {
      "anyOf": [
       {
        "items": {
         "type": "integer"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Time Period"
     },
     "max_draws": {
      "type": "integer",
      "title": "Max Draws",
      "default": 120
     }
    },
    "type": "object",
    "required": [
     "spend_changes"
    ],
    "title": "PlannerScenarioRequest"
   },
   "PreferenceUpdateRequest": {
    "properties": {
     "key": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Key"
     },
     "value": {
      "title": "Value"
     },
     "preferences": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Preferences"
     }
    },
    "type": "object",
    "title": "PreferenceUpdateRequest"
   },
   "ProjectCreateRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "ProjectCreateRequest"
   },
   "ProjectUpdateRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     }
    },
    "type": "object",
    "title": "ProjectUpdateRequest"
   },
   "RecordAssumptionBody": {
    "properties": {
     "key": {
      "type": "string",
      "title": "Key"
     },
     "value": {
      "title": "Value"
     },
     "rationale": {
      "type": "string",
      "title": "Rationale"
     },
     "category": {
      "type": "string",
      "title": "Category",
      "default": "other"
     },
     "change_note": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Change Note"
     }
    },
    "type": "object",
    "required": [
     "key",
     "value",
     "rationale"
    ],
    "title": "RecordAssumptionBody"
   },
   "RefreshRequest": {
    "properties": {
     "refresh_token": {
      "type": "string",
      "title": "Refresh Token"
     }
    },
    "type": "object",
    "required": [
     "refresh_token"
    ],
    "title": "RefreshRequest"
   },
   "RetractAssumptionBody": {
    "properties": {
     "reason": {
      "type": "string",
      "title": "Reason"
     }
    },
    "type": "object",
    "required": [
     "reason"
    ],
    "title": "RetractAssumptionBody"
   },
   "RewindRequest": {
    "properties": {
     "checkpoint_id": {
      "type": "string",
      "title": "Checkpoint Id"
     }
    },
    "type": "object",
    "required": [
     "checkpoint_id"
    ],
    "title": "RewindRequest"
   },
   "Role": {
    "type": "string",
    "enum": [
     "viewer",
     "analyst",
     "admin",
     "owner"
    ],
    "title": "Role",
    "description": "Org/project roles, ordered least \u2192 most privileged."
   },
   "RoleUpdate": {
    "properties": {
     "role": {
      "$ref": "#/components/schemas/Role"
     }
    },
    "type": "object",
    "required": [
     "role"
    ],
    "title": "RoleUpdate"
   },
   "SetSessionModeRequest": {
    "properties": {
     "modeling_mode": {
      "type": "string",
      "title": "Modeling Mode"
     }
    },
    "type": "object",
    "required": [
     "modeling_mode"
    ],
    "title": "SetSessionModeRequest"
   },
   "SignoffRequest": {
    "properties": {
     "approver": {
      "type": "string",
      "title": "Approver"
     },
     "role": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Role"
     },
     "note": {
      "type": "string",
      "title": "Note",
      "default": ""
     }
    },
    "type": "object",
    "required": [
     "approver"
    ],
    "title": "SignoffRequest"
   },
   "SignupRequest": {
    "properties": {
     "organization": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1,
      "title": "Organization"
     },
     "email": {
      "type": "string",
      "title": "Email"
     },
     "password": {
      "type": "string",
      "title": "Password"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     }
    },
    "type": "object",
    "required": [
     "organization",
     "email",
     "password"
    ],
    "title": "SignupRequest"
   },
   "SpecCurveRequest": {
    "properties": {
     "variants": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Variants"
     },
     "rationale": {
      "type": "string",
      "title": "Rationale",
      "default": ""
     },
     "max_draws": {
      "type": "integer",
      "title": "Max Draws",
      "default": 400
     },
     "compute_loo": {
      "type": "boolean",
      "title": "Compute Loo",
      "default": true
     }
    },
    "type": "object",
    "title": "SpecCurveRequest"
   },
   "SpecResolveRequest": {
    "properties": {
     "path": {
      "type": "string",
      "title": "Path"
     },
     "action": {
      "type": "string",
      "title": "Action"
     }
    },
    "type": "object",
    "required": [
     "path",
     "action"
    ],
    "title": "SpecResolveRequest"
   },
   "SpecUpdateRequest": {
    "properties": {
     "model_spec": {
      "additionalProperties": true,
      "type": "object",
      "title": "Model Spec"
     },
     "lock_paths": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lock Paths"
     },
     "unlock_paths": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Unlock Paths"
     }
    },
    "type": "object",
    "required": [
     "model_spec"
    ],
    "title": "SpecUpdateRequest"
   },
   "StudioCommitRequest": {
    "properties": {
     "reason": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Reason"
     }
    },
    "type": "object",
    "title": "StudioCommitRequest"
   },
   "StudioEdaRequest": {
    "properties": {
     "analyses": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Analyses"
     },
     "variables": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Variables"
     },
     "sensitivity": {
      "type": "string",
      "title": "Sensitivity",
      "default": "default"
     }
    },
    "type": "object",
    "title": "StudioEdaRequest"
   },
   "StudioPipelineRequest": {
    "properties": {
     "steps": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Steps",
      "default": []
     },
     "roles": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "string"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Roles"
     }
    },
    "type": "object",
    "title": "StudioPipelineRequest"
   },
   "TokenResponse": {
    "properties": {
     "access_token": {
      "type": "string",
      "title": "Access Token"
     },
     "refresh_token": {
      "type": "string",
      "title": "Refresh Token"
     },
     "token_type": {
      "type": "string",
      "title": "Token Type",
      "default": "bearer"
     },
     "expires_in": {
      "type": "integer",
      "title": "Expires In"
     }
    },
    "type": "object",
    "required": [
     "access_token",
     "refresh_token",
     "expires_in"
    ],
    "title": "TokenResponse"
   },
   "UpdateSessionRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "project_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Project Id"
     }
    },
    "type": "object",
    "title": "UpdateSessionRequest",
    "description": "PATCH /sessions/{thread_id} \u2014 both fields optional, at least one required.\n\nMatches the FE ``SessionUpdateRequest`` (sessionService.ts); the store's\n``update_session`` already supported project_id, but the endpoint only\naccepted ``name`` until the 2026-07-24 v1.0 contract audit."
   },
   "UserCreateRequest": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Email"
     },
     "role": {
      "type": "string",
      "title": "Role",
      "default": "analyst"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "UserCreateRequest"
   },
   "UserOut": {
    "properties": {
     "user_id": {
      "type": "string",
      "title": "User Id"
     },
     "email": {
      "type": "string",
      "title": "Email"
     },
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "org_id": {
      "type": "string",
      "title": "Org Id"
     },
     "org_role": {
      "$ref": "#/components/schemas/Role"
     }
    },
    "type": "object",
    "required": [
     "user_id",
     "email",
     "org_id",
     "org_role"
    ],
    "title": "UserOut"
   },
   "UserUpdateRequest": {
    "properties": {
     "name": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Name"
     },
     "email": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Email"
     },
     "role": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Role"
     }
    },
    "type": "object",
    "title": "UserUpdateRequest"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "ValidationRunRequest": {
    "properties": {
     "check": {
      "type": "string",
      "title": "Check",
      "default": "validate"
     },
     "thread_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Thread Id"
     }
    },
    "type": "object",
    "title": "ValidationRunRequest"
   },
   "WorkflowStepBody": {
    "properties": {
     "status": {
      "type": "string",
      "title": "Status"
     },
     "notes": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Notes"
     }
    },
    "type": "object",
    "required": [
     "status"
    ],
    "title": "WorkflowStepBody"
   }
  }
 }
}