{
  "openapi": "3.1.1",
  "info": {
    "title": "AlphaSense SuperAnalyst API (Beta)",
    "version": "1.0",
    "description": "Beta. Guides and examples: https://developer.alpha-sense.com/superanalyst-api/overview"
  },
  "servers": [
    {
      "url": "https://api.research.alpha-sense.com/superanalyst/v1"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/superanalysts/{superanalyst_id}/sessions": {
      "post": {
        "operationId": "createSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Create a session and run its first turn",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionObject"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "listSessions",
        "tags": [
          "Sessions"
        ],
        "summary": "List the caller's sessions",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1–200, default 20."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` from the previous page."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/sessions/{session_id}": {
      "get": {
        "operationId": "retrieveSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Retrieve a session's status and metadata",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionObject"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/sessions/{session_id}/messages": {
      "post": {
        "operationId": "continueSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Post a follow-up message into a session",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionObject"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "get": {
        "operationId": "listSessionMessages",
        "tags": [
          "Sessions"
        ],
        "summary": "List a session's messages",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1–200, default 200. Keeps the newest messages."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/sessions/{session_id}/cancel": {
      "post": {
        "operationId": "cancelSession",
        "tags": [
          "Sessions"
        ],
        "summary": "Cancel the session's current execution",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionObject"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/sessions/{session_id}/events": {
      "get": {
        "operationId": "streamSessionEvents",
        "tags": [
          "Sessions"
        ],
        "summary": "Stream a session's live events",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Gateway"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Gateway Timeout"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/sessions/{session_id}/artifacts": {
      "get": {
        "operationId": "listSessionArtifacts",
        "tags": [
          "Artifacts"
        ],
        "summary": "List the artifacts a session produced",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session id from a create or list response. URL-encode it."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1–100, default 20."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` from the previous page."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/files": {
      "get": {
        "operationId": "listFiles",
        "tags": [
          "Files"
        ],
        "summary": "List a directory in the SuperAnalyst's workspace",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Folder path from an earlier listing. Omit for the workspace root."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "1–100, default 20."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The `next_cursor` from the previous page."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/files/{file_id}": {
      "get": {
        "operationId": "retrieveFile",
        "tags": [
          "Files"
        ],
        "summary": "Retrieve one workspace entry's metadata",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "File id from a file list."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileObject"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/files/{file_id}/content": {
      "get": {
        "operationId": "readFileContent",
        "tags": [
          "Files"
        ],
        "summary": "Read a file's content inline",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "File id from a file list."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileContentObject"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/artifacts/{artifact_id}": {
      "get": {
        "operationId": "retrieveArtifact",
        "tags": [
          "Artifacts"
        ],
        "summary": "Retrieve one artifact's metadata",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "artifact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Artifact id from an artifact list."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactObject"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/superanalysts/{superanalyst_id}/artifacts/{artifact_id}/content": {
      "get": {
        "operationId": "readArtifactContent",
        "tags": [
          "Artifacts"
        ],
        "summary": "Read an artifact's content inline",
        "parameters": [
          {
            "name": "superanalyst_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "default"
              ]
            },
            "description": "Always `default`."
          },
          {
            "name": "artifact_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Artifact id from an artifact list."
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactContentObject"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuperAnalystErrorEnvelope"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "webhooks": {},
  "components": {
    "schemas": {
      "SessionErrorBody": {
        "type": [
          "object",
          "null"
        ],
        "title": "SessionErrorBody",
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        }
      },
      "SessionObject": {
        "type": "object",
        "title": "SessionObject",
        "required": [
          "id",
          "superanalyst_id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "superanalyst_id": {
            "type": "string"
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/SessionErrorBody"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "SuperAnalystErrorBody": {
        "type": "object",
        "title": "SuperAnalystErrorBody",
        "required": [
          "code",
          "message",
          "type"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "param": {
            "type": [
              "string",
              "null"
            ]
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "SuperAnalystErrorEnvelope": {
        "type": "object",
        "title": "SuperAnalystErrorEnvelope",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/SuperAnalystErrorBody"
          }
        }
      },
      "SessionList": {
        "type": "object",
        "title": "SessionList",
        "required": [
          "data"
        ],
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionObject"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MessageContentPart": {
        "type": "object",
        "title": "MessageContentPart",
        "required": [
          "text"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "CitationTextRange": {
        "type": "object",
        "title": "CitationTextRange",
        "required": [
          "start",
          "end"
        ],
        "properties": {
          "start": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          }
        }
      },
      "MessageCitation": {
        "type": "object",
        "title": "MessageCitation",
        "required": [
          "type",
          "id",
          "text_ranges"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "document_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "statement_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "broker_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "broker_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "text_ranges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CitationTextRange"
            }
          }
        }
      },
      "MessageArtifact": {
        "type": "object",
        "title": "MessageArtifact",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "file_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MessageObject": {
        "type": "object",
        "title": "MessageObject",
        "required": [
          "id",
          "superanalyst_id",
          "session_id",
          "role",
          "content"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "superanalyst_id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageContentPart"
            }
          },
          "citations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageCitation"
            }
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageArtifact"
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MessageList": {
        "type": "object",
        "title": "MessageList",
        "required": [
          "session_id",
          "session_status",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "session_status": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageObject"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "dropped_older_messages": {
            "type": "integer"
          }
        }
      },
      "ArtifactObject": {
        "type": "object",
        "title": "ArtifactObject",
        "required": [
          "id",
          "superanalyst_id",
          "file_id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "superanalyst_id": {
            "type": "string"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ArtifactList": {
        "type": "object",
        "title": "ArtifactList",
        "required": [
          "session_id",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtifactObject"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FileObject": {
        "type": "object",
        "title": "FileObject",
        "required": [
          "id",
          "name",
          "path",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "mime_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FileList": {
        "type": "object",
        "title": "FileList",
        "required": [
          "path",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileObject"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "FileContentError": {
        "type": [
          "object",
          "null"
        ],
        "title": "FileContentError",
        "required": [
          "code",
          "message",
          "retryable"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retryable": {
            "type": "boolean"
          }
        }
      },
      "FileContentObject": {
        "type": "object",
        "title": "FileContentObject",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "delivery": {
            "type": "string"
          },
          "encoding": {
            "type": [
              "string",
              "null"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_base64": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/FileContentError"
          }
        }
      },
      "ArtifactContentObject": {
        "type": "object",
        "title": "ArtifactContentObject",
        "required": [
          "id",
          "superanalyst_id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "superanalyst_id": {
            "type": "string"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivery": {
            "type": "string"
          },
          "encoding": {
            "type": [
              "string",
              "null"
            ]
          },
          "content": {
            "type": [
              "string",
              "null"
            ]
          },
          "content_base64": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/FileContentError"
          }
        }
      },
      "MessageRequest": {
        "type": "object",
        "required": [
          "input"
        ],
        "additionalProperties": false,
        "properties": {
          "input": {
            "type": "object",
            "required": [
              "text"
            ],
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "text"
                ]
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "description": "Your question."
              }
            }
          },
          "model": {
            "type": "string",
            "description": "Omit, or send `default`."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Your own string key/value pairs. Echoed back."
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token from https://auth.research.alpha-sense.com/oauth/token. See https://developer.alpha-sense.com/superanalyst-api/authentication"
      }
    }
  },
  "tags": [
    {
      "name": "Sessions"
    },
    {
      "name": "Artifacts"
    },
    {
      "name": "Files"
    }
  ]
}
