{
  "openapi": "3.1.0",
  "info": {
    "title": "Marvin Labs API",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/responses": {
      "post": {
        "tags": [
          "Responses"
        ],
        "summary": "Create",
        "description": "Ask Marvin a question.\n\nSynchronous by default: the request is held until the turn finishes (whitespace\nis sent while it runs) and the body is the completed response. With\n`background: true` it returns `queued` at once; poll `GET /v1/responses/{id}`.",
        "operationId": "create_v1_responses_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateResponseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseObject"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/responses/{response_id}": {
      "get": {
        "tags": [
          "Responses"
        ],
        "summary": "Retrieve",
        "description": "A response by id: queued, running, or finished with its answer.",
        "operationId": "retrieve_v1_responses__response_id__get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Response Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseObject"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/responses/{response_id}/cancel": {
      "post": {
        "tags": [
          "Responses"
        ],
        "summary": "Cancel",
        "description": "Stop a running response. A response still queued behind another is not removed.",
        "operationId": "cancel_v1_responses__response_id__cancel_post",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "response_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Response Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseObject"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "summary": "List ",
        "description": "Your conversations, most recently updated first. Includes the ones started in the app.",
        "operationId": "list__v1_conversations_get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponseContainer_Conversation_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{conversation_id}": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "summary": "Retrieve",
        "description": "A conversation's title, timestamps and the companies it involves.",
        "operationId": "retrieve_v1_conversations__conversation_id__get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Conversation Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/conversations/{conversation_id}/items": {
      "get": {
        "tags": [
          "Conversations"
        ],
        "summary": "Items",
        "description": "The conversation's questions and answers, oldest first.\n\nEach turn gives a `user` item (the question) and an `assistant` item (the\nanswer, with the `response_id` of its turn when it has one).",
        "operationId": "items_v1_conversations__conversation_id__items_get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "conversation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Conversation Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Turns per page.",
              "default": 20,
              "title": "Limit"
            },
            "description": "Turns per page."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponseContainer_ConversationItem_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent_results": {
      "get": {
        "tags": [
          "Agent results"
        ],
        "summary": "List ",
        "description": "Agent results you can read, newest first: yours, ones shared with you, and public ones.",
        "operationId": "list__v1_agent_results_get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "company",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only results about this company: a ticker or company id.",
              "title": "Company"
            },
            "description": "Only results about this company: a ticker or company id."
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only results from this agent, e.g. `earnings_call_summary`.",
              "title": "Agent"
            },
            "description": "Only results from this agent, e.g. `earnings_call_summary`."
          },
          {
            "name": "mine",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only results you ran, leaving out public and shared ones.",
              "default": false,
              "title": "Mine"
            },
            "description": "Only results you ran, leaving out public and shared ones."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponseContainer_AgentResultSummary_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent_results/{agent_result_id}": {
      "get": {
        "tags": [
          "Agent results"
        ],
        "summary": "Retrieve",
        "description": "One agent result with its report in markdown (`output_text`).",
        "operationId": "retrieve_v1_agent_results__agent_result_id__get",
        "security": [
          {
            "Bearer": []
          }
        ],
        "parameters": [
          {
            "name": "agent_result_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Result Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentResultObject"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tools/documents/list": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "List Documents ",
        "description": "One company's documents, newest first: filings, Marvin's reports and your uploads.",
        "operationId": "list_documents__v1_tools_documents_list_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDocumentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/documents/search": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Search Documents ",
        "description": "The passages in one company's documents that answer `query`, best first. Uses credits.",
        "operationId": "search_documents__v1_tools_documents_search_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchDocumentsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchDocumentsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/documents/read": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Read Document ",
        "description": "Read any document you can see, by short or full id: whole, a window, or around a match.\n\nA long document read without `query` or offsets returns a preview with its\n`sections`. When `has_more` is true, read on from `end_token_offset`.",
        "operationId": "read_document__v1_tools_documents_read_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/documents/explore": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Explore Documents ",
        "description": "What one of a company's documents says about `question`, as verbatim passages. Uses credits.\n\nThe document is read for you; `coverage` says how much of it.",
        "operationId": "explore_documents__v1_tools_documents_explore_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExploreDocumentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExploreDocumentResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/financials/query": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Query Financials ",
        "description": "Reported figures by metric and period, one result per metric. Uses credits.\n\nA whole statement asked for here comes back under `redirects`, naming the\nstatement to read with `/statements`.",
        "operationId": "query_financials__v1_tools_financials_query_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryFinancialsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialQueryResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/financials/statements": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Get Financial Statements ",
        "description": "A company's statements whole, every line in order. Without `statement`, the list of them.",
        "operationId": "get_financial_statements__v1_tools_financials_statements_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinancialStatementsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Financial Statements  V1 Tools Financials Statements Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    },
    "/v1/tools/financials/provenance": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Get Financial Provenance ",
        "description": "Where figures come from: the document and line each was read from, or its inputs.",
        "operationId": "get_financial_provenance__v1_tools_financials_provenance_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinancialProvenanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Financial Provenance  V1 Tools Financials Provenance Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "4XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "5XX": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AgentResultCompany": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "AgentResultCompany"
      },
      "AgentResultObject": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "const": "agent_result",
            "title": "Object",
            "default": "agent_result"
          },
          "agent": {
            "type": "string",
            "title": "Agent",
            "description": "The agent that wrote it, e.g. `earnings_call_summary`."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus"
          },
          "created_at": {
            "type": "integer",
            "title": "Created At",
            "description": "Unix seconds."
          },
          "updated_at": {
            "type": "integer",
            "title": "Updated At",
            "description": "Unix seconds."
          },
          "companies": {
            "items": {
              "$ref": "#/components/schemas/AgentResultCompany"
            },
            "type": "array",
            "title": "Companies"
          },
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public"
          },
          "output_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Text",
            "description": "The report, in markdown. Null until a version has completed. While a newer version is being written, this is the latest completed one."
          },
          "newer_version_in_progress": {
            "type": "boolean",
            "title": "Newer Version In Progress",
            "description": "A newer version is being written; `output_text` is the previous one.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "agent",
          "title",
          "status",
          "created_at",
          "updated_at",
          "is_public",
          "output_text"
        ],
        "title": "AgentResultObject",
        "description": "One agent result with its report."
      },
      "AgentResultSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "const": "agent_result",
            "title": "Object",
            "default": "agent_result"
          },
          "agent": {
            "type": "string",
            "title": "Agent",
            "description": "The agent that wrote it, e.g. `earnings_call_summary`."
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus"
          },
          "created_at": {
            "type": "integer",
            "title": "Created At",
            "description": "Unix seconds."
          },
          "updated_at": {
            "type": "integer",
            "title": "Updated At",
            "description": "Unix seconds."
          },
          "companies": {
            "items": {
              "$ref": "#/components/schemas/AgentResultCompany"
            },
            "type": "array",
            "title": "Companies",
            "description": "Companies the result covers."
          },
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public"
          }
        },
        "type": "object",
        "required": [
          "id",
          "agent",
          "title",
          "status",
          "created_at",
          "updated_at",
          "is_public"
        ],
        "title": "AgentResultSummary",
        "description": "One agent result in a list, without its text. Reflects the current version."
      },
      "AgentStatus": {
        "type": "string",
        "enum": [
          "pending",
          "running",
          "completed",
          "failed",
          "cancelled"
        ],
        "title": "AgentStatus",
        "description": "Status of an agent result."
      },
      "AmendmentDisclosure": {
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "publication_datetime": {
            "type": "string",
            "format": "date-time",
            "title": "Publication Datetime"
          },
          "citations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Citations"
          }
        },
        "type": "object",
        "required": [
          "value",
          "publication_datetime"
        ],
        "title": "AmendmentDisclosure"
      },
      "CompanyFinancialResult": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "basis": {
            "type": "string",
            "enum": [
              "common",
              "as_reported"
            ],
            "title": "Basis",
            "description": "common: normalised onto the common taxonomy; as_reported: the company's own tagged line"
          },
          "element": {
            "type": "string",
            "title": "Element",
            "description": "The element the figures are read from"
          },
          "statement": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Statement"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dimension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimension"
          },
          "values": {
            "items": {
              "$ref": "#/components/schemas/ValuePeriodPair"
            },
            "type": "array",
            "title": "Values"
          }
        },
        "type": "object",
        "required": [
          "label",
          "basis",
          "element",
          "values"
        ],
        "title": "CompanyFinancialResult",
        "description": "One series of figures, all on one basis."
      },
      "Conversation": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "const": "conversation",
            "title": "Object",
            "default": "conversation"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "created_at": {
            "type": "integer",
            "title": "Created At",
            "description": "Unix seconds."
          },
          "updated_at": {
            "type": "integer",
            "title": "Updated At",
            "description": "Unix seconds."
          },
          "companies": {
            "items": {
              "$ref": "#/components/schemas/ConversationCompany"
            },
            "type": "array",
            "title": "Companies",
            "description": "Companies the conversation involves, in first-mention order."
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "created_at",
          "updated_at"
        ],
        "title": "Conversation"
      },
      "ConversationCompany": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ticker"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "ConversationCompany"
      },
      "ConversationItem": {
        "properties": {
          "type": {
            "type": "string",
            "const": "message",
            "title": "Type",
            "default": "message"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "title": "Role"
          },
          "content": {
            "items": {
              "$ref": "#/components/schemas/ItemText"
            },
            "type": "array",
            "title": "Content"
          },
          "response_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Id",
            "description": "On an answer: the /v1/responses id of its turn, when the turn has one."
          }
        },
        "type": "object",
        "required": [
          "id",
          "role",
          "content"
        ],
        "title": "ConversationItem",
        "description": "One message: the user's question or Marvin's answer for one turn."
      },
      "ConversationRef": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "ConversationRef",
        "description": "A conversation is a Marvin chat thread; its id is the thread id."
      },
      "CreateResponseRequest": {
        "properties": {
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/InputMessage"
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "The question: a string, or a list holding one user message."
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Accepted for SDK compatibility; always `marvin`."
          },
          "previous_response_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Response Id",
            "description": "Continue the conversation this response belongs to."
          },
          "conversation": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ConversationRef"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation",
            "description": "Continue a chat thread you own, by its id (the id in `/chat/<id>`)."
          },
          "background": {
            "type": "boolean",
            "title": "Background",
            "description": "Return `queued` at once and poll `GET /v1/responses/{id}`.",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "input"
        ],
        "title": "CreateResponseRequest"
      },
      "DatapointRef": {
        "properties": {
          "element": {
            "type": "string",
            "title": "Element",
            "description": "The element, e.g. common:revenue or us-gaap:Revenues"
          },
          "period": {
            "type": "string",
            "title": "Period",
            "description": "The reporting period, e.g. FY-2024 or 3Q-2025"
          },
          "dimensions": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Axis -> member of a member figure (a segment, product or geography); omitted for the consolidated figure"
          }
        },
        "type": "object",
        "required": [
          "element",
          "period"
        ],
        "title": "DatapointRef",
        "description": "A stored figure named by what it is rather than by its handle."
      },
      "DocumentSearchMatch": {
        "properties": {
          "snippet": {
            "type": "string",
            "title": "Snippet"
          },
          "start_token_offset": {
            "type": "integer",
            "title": "Start Token Offset"
          },
          "similarity": {
            "type": "number",
            "title": "Similarity"
          }
        },
        "type": "object",
        "required": [
          "snippet",
          "start_token_offset",
          "similarity"
        ],
        "title": "DocumentSearchMatch",
        "description": "One fuzzy match of a query inside a document."
      },
      "DocumentSection": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "level": {
            "type": "integer",
            "title": "Level"
          },
          "start_token_offset": {
            "type": "integer",
            "title": "Start Token Offset"
          },
          "token_length": {
            "type": "integer",
            "title": "Token Length"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "title",
          "level",
          "start_token_offset",
          "token_length"
        ],
        "title": "DocumentSection",
        "description": "One outline entry: a section/heading with its token location/extent."
      },
      "ExploreDocumentRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "document_id": {
            "type": "string",
            "title": "Document Id",
            "description": "A document's `id` (short, e.g. `fd:k7qm2xp`) or `full_id` from `/v1/tools/documents/list` or `/search`. Short ids belong to your account and stay valid."
          },
          "question": {
            "type": "string",
            "title": "Question",
            "description": "What you want to know from this document, in one or two sentences."
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section",
            "description": "Key of one section from a read_document preview (filings only): read only that section."
          }
        },
        "type": "object",
        "required": [
          "company",
          "document_id",
          "question"
        ],
        "title": "ExploreDocumentRequest"
      },
      "ExploreDocumentResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The id you passed."
          },
          "full_id": {
            "type": "string",
            "title": "Full Id"
          },
          "document_type": {
            "type": "string",
            "title": "Document Type"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Date"
          },
          "earnings_period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Earnings Period"
          },
          "coverage": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "full",
                  "section",
                  "narrative",
                  "ranked",
                  "sampled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Coverage",
            "description": "What was read: the whole document, a section, the parts that best match the question, or a sample."
          },
          "passages": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Passages",
            "description": "Verbatim passages from the document that answer the question."
          },
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "not_found": {
            "type": "boolean",
            "title": "Not Found",
            "description": "The document does not address the question."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          }
        },
        "type": "object",
        "required": [
          "id",
          "full_id",
          "document_type",
          "title",
          "passages",
          "summary",
          "not_found"
        ],
        "title": "ExploreDocumentResponse"
      },
      "FinancialProvenanceRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "datapoints": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/DatapointRef"
                }
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Datapoints",
            "description": "The figures in question: their `id` (e.g. `dp:4hq8m2xta`) or, for a computed figure, the ids in its `inputs`, from `/query` or `/statements`. Or name a stored figure by `element`, `period` and `dimensions`."
          }
        },
        "type": "object",
        "required": [
          "company",
          "datapoints"
        ],
        "title": "FinancialProvenanceRequest"
      },
      "FinancialQueryResult": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/QueryResult"
            },
            "type": "array",
            "title": "Results"
          },
          "redirects": {
            "items": {
              "$ref": "#/components/schemas/Redirect"
            },
            "type": "array",
            "title": "Redirects"
          },
          "periods_without_data": {
            "items": {
              "properties": {
                "year": {
                  "type": "integer",
                  "title": "Year"
                },
                "period_type": {
                  "type": "string",
                  "title": "Period Type"
                },
                "period_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string",
                      "const": "irregular"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Period Number"
                },
                "canonical_period_text": {
                  "type": "string",
                  "title": "Canonical Period Text",
                  "readOnly": true
                },
                "downscaled_period_text": {
                  "type": "string",
                  "title": "Downscaled Period Text",
                  "readOnly": true
                },
                "period_display_name": {
                  "type": "string",
                  "title": "Period Display Name",
                  "readOnly": true
                }
              },
              "type": "object",
              "required": [
                "year",
                "period_type"
              ],
              "title": "ReportingPeriod"
            },
            "type": "array",
            "title": "Periods Without Data",
            "description": "Requested periods the company has no financial data for at all; not repeated under missing."
          },
          "unrecognised_periods": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unrecognised Periods",
            "description": "Requested labels that are not reporting periods (e.g. calendar dates), so nothing was looked up for them. Periods are fiscal: FY-2024, 3Q-2024, 1H-2024, 9M-2024."
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "FinancialQueryResult",
        "description": "Final result of query_financials — one result per decomposed metric,\nthe queries redirected to another tool, and the periods the company has\nno data for at all."
      },
      "FinancialStatementsRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "statement": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Statement",
            "description": "A statement id, e.g. `common:income_statement`, `as_reported:balance_sheet` or `as_reported:<role id>`. Omitted: the list of statements this company has."
          },
          "periods": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Periods",
            "description": "Reporting periods, e.g. `FY-2023` or `2Q-2025`; years and interim periods may be mixed. Omitted: the last five fiscal years and the last four quarters (two halves for a half-year reporter). Each column gives the calendar days it covers."
          }
        },
        "type": "object",
        "required": [
          "company"
        ],
        "title": "FinancialStatementsRequest"
      },
      "InputMessage": {
        "properties": {
          "type": {
            "type": "string",
            "const": "message",
            "title": "Type",
            "default": "message"
          },
          "role": {
            "type": "string",
            "const": "user",
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/InputText"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "InputMessage"
      },
      "InputText": {
        "properties": {
          "type": {
            "type": "string",
            "const": "input_text",
            "title": "Type"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "title": "InputText"
      },
      "ItemText": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "input_text",
              "output_text"
            ],
            "title": "Type"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "type",
          "text"
        ],
        "title": "ItemText"
      },
      "ListDocumentsRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "document_type": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "filing_document",
                    "agent_result",
                    "user_document"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Type",
            "description": "Only these kinds: `filing_document` (filings, transcripts, press releases), `agent_result` (Marvin's reports) or `user_document` (your uploads). Leave it out unless you know the kind."
          },
          "period": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period",
            "description": "Earnings periods, e.g. `1Q-2024`. Only filings carry one, so this keeps to filings."
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From",
            "description": "Only documents dated on or after this day."
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To",
            "description": "Only documents dated on or before this day."
          },
          "limit": {
            "type": "integer",
            "maximum": 50,
            "minimum": 1,
            "title": "Limit",
            "default": 10
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cursor",
            "description": "`next_cursor` from the previous page."
          }
        },
        "type": "object",
        "required": [
          "company"
        ],
        "title": "ListDocumentsRequest"
      },
      "ListDocumentsResponse": {
        "properties": {
          "documents": {
            "items": {
              "$ref": "#/components/schemas/ToolDocument"
            },
            "type": "array",
            "title": "Documents"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "documents"
        ],
        "title": "ListDocumentsResponse"
      },
      "ListResponseContainer_AgentResultSummary_": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/AgentResultSummary"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ListResponseContainer[AgentResultSummary]"
      },
      "ListResponseContainer_ConversationItem_": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ConversationItem"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ListResponseContainer[ConversationItem]"
      },
      "ListResponseContainer_Conversation_": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Conversation"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ListResponseContainer[Conversation]"
      },
      "MissingPeriods": {
        "properties": {
          "periods": {
            "items": {
              "properties": {
                "year": {
                  "type": "integer",
                  "title": "Year"
                },
                "period_type": {
                  "type": "string",
                  "title": "Period Type"
                },
                "period_number": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string",
                      "const": "irregular"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Period Number"
                },
                "canonical_period_text": {
                  "type": "string",
                  "title": "Canonical Period Text",
                  "readOnly": true
                },
                "downscaled_period_text": {
                  "type": "string",
                  "title": "Downscaled Period Text",
                  "readOnly": true
                },
                "period_display_name": {
                  "type": "string",
                  "title": "Period Display Name",
                  "readOnly": true
                }
              },
              "type": "object",
              "required": [
                "year",
                "period_type"
              ],
              "title": "ReportingPeriod"
            },
            "type": "array",
            "title": "Periods"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "periods"
        ],
        "title": "MissingPeriods",
        "description": "Requested periods of a query without a value, among those the company\nhas data for. One entry per distinct reason, not per period: a wide\ngrid's gaps were most of a return, and the model is shown them again on\nevery later request of the turn."
      },
      "OutputMessage": {
        "properties": {
          "type": {
            "type": "string",
            "const": "message",
            "title": "Type",
            "default": "message"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "role": {
            "type": "string",
            "const": "assistant",
            "title": "Role",
            "default": "assistant"
          },
          "status": {
            "type": "string",
            "const": "completed",
            "title": "Status",
            "default": "completed"
          },
          "content": {
            "items": {
              "$ref": "#/components/schemas/OutputText"
            },
            "type": "array",
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "id",
          "content"
        ],
        "title": "OutputMessage"
      },
      "OutputText": {
        "properties": {
          "type": {
            "type": "string",
            "const": "output_text",
            "title": "Type",
            "default": "output_text"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "annotations": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Annotations"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "OutputText"
      },
      "QueryFinancialsRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "queries": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Queries",
            "description": "Plain-language queries naming metrics and periods, e.g. `revenue and EBITDA FY2023-FY2024` or `iPhone net sales last 8 quarters`. Put every metric and period you need in one call: they are resolved together."
          },
          "bias": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "common",
                  "as_reported"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Bias",
            "description": "`common` for figures normalised to compare across companies, `as_reported` for the company's own lines and labels. Omitted: the best match."
          }
        },
        "type": "object",
        "required": [
          "company",
          "queries"
        ],
        "title": "QueryFinancialsRequest"
      },
      "QueryResult": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "The metric and periods this result answers"
          },
          "from_query": {
            "type": "integer",
            "title": "From Query",
            "description": "Index of the caller's query it was decomposed from"
          },
          "series": {
            "items": {
              "$ref": "#/components/schemas/CompanyFinancialResult"
            },
            "type": "array",
            "title": "Series"
          },
          "missing": {
            "items": {
              "$ref": "#/components/schemas/MissingPeriods"
            },
            "type": "array",
            "title": "Missing"
          }
        },
        "type": "object",
        "required": [
          "query",
          "from_query"
        ],
        "title": "QueryResult",
        "description": "One metric the caller's queries were decomposed into: the figures\nfound for it, on one basis per series, and its gaps."
      },
      "ReadDocumentRequest": {
        "properties": {
          "document_id": {
            "type": "string",
            "title": "Document Id",
            "description": "A document's `id` (short, e.g. `fd:k7qm2xp`) or `full_id` from `/v1/tools/documents/list` or `/search`. Short ids belong to your account and stay valid."
          },
          "section": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Section",
            "description": "Key of one section from a preview's `sections` (filings only). Offsets are then relative to that section."
          },
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query",
            "description": "Text to find inside the document (fuzzy). Overrides `start_token_offset`."
          },
          "start_token_offset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Token Offset"
          },
          "max_token_length": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Token Length"
          }
        },
        "type": "object",
        "required": [
          "document_id"
        ],
        "title": "ReadDocumentRequest"
      },
      "ReadDocumentResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "The id you passed."
          },
          "full_id": {
            "type": "string",
            "title": "Full Id"
          },
          "document_type": {
            "type": "string",
            "title": "Document Type"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "start_token_offset": {
            "type": "integer",
            "title": "Start Token Offset"
          },
          "end_token_offset": {
            "type": "integer",
            "title": "End Token Offset"
          },
          "total_token_length": {
            "type": "integer",
            "title": "Total Token Length"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "More follows: read on from `end_token_offset`."
          },
          "sections": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DocumentSection"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sections",
            "description": "The outline, when this was a preview."
          },
          "matches": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DocumentSearchMatch"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matches",
            "description": "Where `query` matched."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          }
        },
        "type": "object",
        "required": [
          "id",
          "full_id",
          "document_type",
          "title",
          "content",
          "start_token_offset",
          "end_token_offset",
          "total_token_length",
          "has_more"
        ],
        "title": "ReadDocumentResponse"
      },
      "Redirect": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query"
          },
          "use": {
            "type": "string",
            "const": "get_financial_statements",
            "title": "Use",
            "default": "get_financial_statements"
          },
          "statement": {
            "type": "string",
            "title": "Statement"
          }
        },
        "type": "object",
        "required": [
          "query",
          "statement"
        ],
        "title": "Redirect",
        "description": "A caller's query served by another tool."
      },
      "ResponseError": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ResponseError"
      },
      "ResponseObject": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "const": "response",
            "title": "Object",
            "default": "response"
          },
          "created_at": {
            "type": "integer",
            "title": "Created At",
            "description": "Unix seconds."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "in_progress",
              "completed",
              "failed",
              "cancelled"
            ],
            "title": "Status"
          },
          "background": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Background"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "default": "marvin"
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationRef"
          },
          "previous_response_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Response Id"
          },
          "output": {
            "items": {
              "$ref": "#/components/schemas/OutputMessage"
            },
            "type": "array",
            "title": "Output"
          },
          "output_text": {
            "type": "string",
            "title": "Output Text",
            "default": ""
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResponseError"
              },
              {
                "type": "null"
              }
            ]
          },
          "usage": {
            "type": "null",
            "title": "Usage"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status",
          "conversation"
        ],
        "title": "ResponseObject"
      },
      "SearchDocumentsRequest": {
        "properties": {
          "company": {
            "type": "string",
            "title": "Company",
            "description": "The company: a ticker or a company id."
          },
          "query": {
            "type": "string",
            "title": "Query",
            "description": "One sentence saying what you are looking for: the metric, the segment, the period. It decides the ranking."
          },
          "terms": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 8,
            "title": "Terms",
            "description": "Up to 8 keywords or phrases a matching passage would contain: names, line items, figures with a word (`13.5 billion`). A passage need not contain all of them."
          },
          "n_results": {
            "type": "integer",
            "maximum": 20,
            "minimum": 1,
            "title": "N Results",
            "default": 10
          },
          "document_type": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "filing_document",
                    "agent_result",
                    "user_document"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Type",
            "description": "Only these kinds: `filing_document` (filings, transcripts, press releases), `agent_result` (Marvin's reports) or `user_document` (your uploads). Leave it out unless you know the kind."
          },
          "period": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period",
            "description": "Earnings periods, e.g. `1Q-2024`. Only filings carry one, so this keeps to filings."
          },
          "date_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From",
            "description": "Only documents dated on or after this day."
          },
          "date_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To",
            "description": "Only documents dated on or before this day: what was known then."
          }
        },
        "type": "object",
        "required": [
          "company",
          "query"
        ],
        "title": "SearchDocumentsRequest"
      },
      "SearchDocumentsResponse": {
        "properties": {
          "hits": {
            "items": {
              "$ref": "#/components/schemas/SearchHit"
            },
            "type": "array",
            "title": "Hits"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note",
            "description": "Why nothing matched, when nothing did."
          }
        },
        "type": "object",
        "required": [
          "hits"
        ],
        "title": "SearchDocumentsResponse"
      },
      "SearchHit": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Short id, e.g. `fd:k7qm2xp`."
          },
          "full_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Id"
          },
          "document_type": {
            "type": "string",
            "title": "Document Type"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Date"
          },
          "earnings_period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Earnings Period"
          },
          "token_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Length"
          },
          "passages": {
            "items": {
              "$ref": "#/components/schemas/SearchPassage"
            },
            "type": "array",
            "title": "Passages"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link"
          }
        },
        "type": "object",
        "required": [
          "id",
          "document_type",
          "passages"
        ],
        "title": "SearchHit"
      },
      "SearchPassage": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "start_token_offset": {
            "type": "integer",
            "title": "Start Token Offset",
            "description": "Pass to `/read` as `start_token_offset` to read around it."
          }
        },
        "type": "object",
        "required": [
          "text",
          "start_token_offset"
        ],
        "title": "SearchPassage"
      },
      "Sources": {
        "properties": {
          "element": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Element"
          },
          "context_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Id"
          },
          "inputs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Inputs"
          },
          "document_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Document Ids"
          },
          "external_urls": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "External Urls"
          }
        },
        "type": "object",
        "title": "Sources",
        "description": "What citing a figure needs, and nothing more.\n\n``element`` and ``context_id`` are the identity of the stored figure the\nfigure *is* (None for a figure computed at read time), and ``handle`` the\n``dp:`` handle made from them; ``inputs`` are the handles of the stored\nfigures a computed figure was computed from, ``document_ids`` the filing documents its evidence was read from,\n``external_urls`` any external document among them. Where\n:class:`FinancialProvenance` is the audit trail, this is the citation\nslip: it rides through report arithmetic (``CitedDecimal``) and into the\nmodel-facing tools, which never see a graph — the graph is served on\nexplicit request by ``get_financial_provenance``, from the datapoint (or,\nfor a computed figure, from its inputs)."
      },
      "ToolDocument": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Short id, e.g. `fd:k7qm2xp`."
          },
          "full_id": {
            "type": "string",
            "title": "Full Id",
            "description": "Prefixed row id, e.g. `fd:6f1c…`."
          },
          "document_type": {
            "type": "string",
            "title": "Document Type"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind",
            "description": "Form type of a filing, agent name of a report, type of an upload."
          },
          "document_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Date"
          },
          "earnings_period": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Earnings Period"
          },
          "token_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Length"
          },
          "abstract": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Abstract"
          },
          "link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Link",
            "description": "The document in the Marvin app."
          }
        },
        "type": "object",
        "required": [
          "id",
          "full_id",
          "document_type",
          "title"
        ],
        "title": "ToolDocument",
        "description": "One document in a listing."
      },
      "ValuePeriodPair": {
        "additionalProperties": true,
        "type": "object"
      },
      "ErrorCode": {
        "enum": [
          "validation_error",
          "bad_request",
          "not_found",
          "conflict",
          "tool_failed",
          "method_not_allowed",
          "unauthenticated",
          "invalid_api_key",
          "api_key_not_allowed",
          "permission_denied",
          "upgrade_required",
          "insufficient_credits",
          "rate_limited",
          "request_timeout",
          "db_pool_exhausted",
          "user_not_provisioned",
          "auth_unavailable",
          "service_unavailable",
          "upstream_unavailable",
          "internal_error"
        ],
        "title": "ErrorCode",
        "type": "string"
      },
      "ErrorDetail": {
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ErrorType"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "param": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Param"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Request Id"
          },
          "required_entitlements": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Required Entitlements"
          }
        },
        "required": [
          "type",
          "code",
          "message"
        ],
        "title": "ErrorDetail",
        "type": "object"
      },
      "ErrorType": {
        "enum": [
          "invalid_request_error",
          "authentication_error",
          "permission_error",
          "rate_limit_error",
          "api_error"
        ],
        "title": "ErrorType",
        "type": "string"
      },
      "ErrorResponse": {
        "description": "The body of every error response.",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "type": "object"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}