{"openapi":"3.1.0","info":{"title":"Groundwork","version":"1.0.0","description":"Two ways in. Projects: an organization key (`gwo_…`) makes isolated projects and keys that open one project each (`gwp_…`); add text and files, build, then search and ask. Sessions, for trying it out: `POST /v1/sessions` returns a key (`gwd_…`) for a session that lasts three idle hours."},"servers":[{"url":"https://connect.groundwork.computer"}],"security":[{"key":[]}],"components":{"securitySchemes":{"key":{"type":"http","scheme":"bearer","description":"A session key, `gwd_…`, from `POST /v1/sessions` or the get started page. It opens only that session's files."},"id":{"type":"http","scheme":"bearer","description":"An id.orgsoft.org key, `om_sk_…`, or a Greenfield license token. Each call is charged to its account, from the Pro allowance first and then purchased credit."},"org":{"type":"http","scheme":"bearer","description":"An organization key, `gwo_…`, or an id.orgsoft.org key (`om_sk_…`), which works as its account's organization key. It manages projects and keys and opens every project. Keep it on your server. With an id.orgsoft.org account, adding, searching and asking are charged to that account and each reply says what it cost in `usage`."},"project":{"type":"http","scheme":"bearer","description":"A project key, `gwp_…`, made with `POST /v1/keys`. It opens one project, to read, write or both."}}},"paths":{"/v1/sessions":{"post":{"operationId":"createSession","summary":"Start a session","description":"Start an empty session and get its key, with no page and no files yet. Then add files and sources, wait for `GET /v1/build`, and ask. The key is shown once. A session holds the same files, bytes and answers as one made on the get started page, is deleted after three idle hours, and each client address may start a few an hour.","security":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"key":"gwd_…","expiresAt":"2026-11-19T09:00:00.000Z","limits":{"files":60,"bytes":50000000,"answers":30}}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/build":{"get":{"operationId":"build","summary":"Build status","description":"Where the session's build stands: `none` before any file, `queued` or `run` while it builds, then `done` or `err`. `built` is true once there is an index to ask, which can be while a newer build runs. Adding a file or source starts a build on its own.","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"state":"done","built":true,"steps":[{"id":"chunk","label":"Split into passages","state":"done","detail":"38 passages"}],"files":[{"name":"ops-review.vtt","state":"ok"}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/ask":{"post":{"operationId":"ask","summary":"Ask with citations","description":"Answer a question from your files. The answer is Markdown with `[^s1]` markers, each naming one of `sources` by its id. Each source gives the uploaded `file` it came from, a short `excerpt`, and its `page` or `start` in seconds. `instructions` shape the answer's form and voice and never change what counts as evidence. `thread` holds the earlier turns of a conversation, so a follow-up such as \"and then?\" is read in context; reading it counts as one more answer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","maxLength":500,"description":"The question, in plain words."},"instructions":{"type":"string","maxLength":1500,"description":"How to answer: a role to play, a length, a format. The evidence rules still apply."},"thread":{"type":"array","maxItems":4,"description":"Earlier turns, oldest first. Only the last four are read, each answer cut to 600 characters.","items":{"type":"object","required":["question","answer"],"properties":{"question":{"type":"string"},"answer":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"answer":"Repairs over 500 dollars need the shop manager's sign-off. [^s1]","sources":[{"id":"s1","title":"Larkspur staff handbook","label":"Larkspur staff handbook, page 3","file":"handbook.docx","excerpt":"Repairs over 500 dollars need the shop manager's sign-off…","page":3}],"run":"4f0c1a2b-…"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/search":{"post":{"operationId":"search","summary":"Search passages","description":"The passages that best match a query, best first. No model call, so it costs nothing and keeps working after the key's answers are used up.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","maxLength":500},"k":{"type":"integer","minimum":1,"maximum":20,"default":8,"description":"How many passages."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"passages":[{"id":"docs/handbook#3","title":"Larkspur staff handbook.docx","text":"Repairs over 500 dollars…","score":0.82,"page":3}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/agent":{"post":{"operationId":"agent","summary":"Run an agent","description":"Run Groundwork's agent over your files as the product `instructions` describe: it searches, queries tables and draws charts, then answers with citations. Charts come back as data in `figures`, and diagrams as SVG.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","maxLength":500,"description":"What the user asked."},"instructions":{"type":"string","maxLength":4000,"description":"Your product's system prompt: who it is for and how it answers."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"answer":"Repairs over 500 dollars need the shop manager's sign-off. [^s1]","sources":[{"id":"s1","title":"Larkspur staff handbook","label":"Larkspur staff handbook, page 3","file":"handbook.docx","excerpt":"Repairs over 500 dollars need the shop manager's sign-off…","page":3}],"run":"4f0c1a2b-…","figures":[{"type":"chart","title":"Orders by month","chart":{"kind":"bar","title":"Orders by month","labels":["Jul","Aug","Sep"],"series":[{"name":"Orders","values":[21,26,25]}]}}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/sources":{"post":{"operationId":"addSource","summary":"Add a source","description":"Add a web page, a YouTube video, a Google Drive file shared by link, or a service by name: `notion`, `slack` or `drive`. A service you haven't signed in to answers `wait` with a `signIn` link; open it, then send the same call again. The files build again on their own.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from"],"properties":{"from":{"type":"string","maxLength":2000,"examples":["https://example.com/pricing","notion"],"description":"A link, or a service's name."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"status":"ok","added":1,"building":true}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/files":{"put":{"operationId":"addFile","summary":"Add a file","description":"Add one file, its bytes as the body: a PDF, Word, PowerPoint, Excel, CSV, Markdown, text or captions file. The files build again on their own.","parameters":[{"name":"name","in":"query","required":true,"description":"The file's name, with its extension","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"status":"ok","added":1,"building":true}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/mcp":{"post":{"operationId":"mcp","summary":"MCP","description":"Model Context Protocol over streamable HTTP, one JSON-RPC message at a time, with the `ask`, `search` and `add` tools.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{},"method":{"type":"string","examples":["initialize","tools/list","tools/call"]},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"jsonrpc":"2.0","id":1,"result":{"tools":[{"name":"ask"},{"name":"search"}]}}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/web/fetch":{"post":{"operationId":"webFetch","summary":"A public web page as clean text","description":"Read a public web page and return its main text, without menus or ads, up to 60,000 characters. Takes an id.orgsoft.org key and is charged to its account; `meta.charge_usd` says what it cost.","security":[{"id":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","maxLength":2000,"examples":["https://example.com"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"url":"https://example.com/","title":"Example Domain","text":"This domain is for use in illustrative examples…","meta":{"request":"web_4f0c…","charge_usd":0.0006}}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/web/search":{"post":{"operationId":"webSearch","summary":"Web results for a query","description":"Search the web and return the top results, each with its title, link and snippet. Takes an id.orgsoft.org key and is charged to its account; `meta.charge_usd` says what it cost.","security":[{"id":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","maxLength":400},"limit":{"type":"integer","minimum":1,"maximum":10,"default":5}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"results":[{"title":"Example Domain","url":"https://example.com/","snippet":"This domain is for use in illustrative examples…","position":1}],"meta":{"request":"web_4f0c…","charge_usd":0.0012}}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects":{"post":{"operationId":"createProject","summary":"Make a project","description":"Make an empty project. Each project is isolated: its own files, index and build, and nothing it holds is read by another project. Make one for each of your clients. Takes the organization key.","security":[{"org":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,62}$"},"name":{"type":"string","maxLength":100}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"slug":"halvorsen-riley","name":"Riley Moreno","createdAt":"2026-11-19T14:02:11.000Z"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"get":{"operationId":"listProjects","summary":"List projects","description":"The organization's projects. Takes the organization key.","security":[{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"projects":[{"slug":"halvorsen-riley","name":"Riley Moreno","createdAt":"2026-11-19T14:02:11.000Z"}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}":{"delete":{"operationId":"deleteProject","summary":"Delete a project","description":"Delete a project with all its files and its index, and revoke every key that opened it. Takes the organization key.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"deleted":"halvorsen-riley"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/keys":{"post":{"operationId":"createKey","summary":"Make a key","description":"Make a key. With `project`, it opens only that project, for `read` (search and ask), `write` (add and build) or both. Without one, it is another organization key. The key is in the reply once and never stored; keep it on your server. To rotate, make a new key, switch to it, then revoke the old one.","security":[{"org":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"project":{"type":"string","description":"The project's slug."},"scopes":{"type":"array","items":{"enum":["read","write"]},"default":["read"]},"label":{"type":"string","maxLength":100},"expiresInDays":{"type":"integer","minimum":1,"maximum":3650}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"key":"gwp_…","record":{"id":"k_1a2b3c4d","kind":"project","project":"halvorsen-riley","scopes":["read"],"label":"Riley's app","start":"gwp_9f3e","createdAt":"2026-11-19T14:03:00.000Z"}}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"get":{"operationId":"listKeys","summary":"List keys","description":"Every key the organization has made, revoked ones included, without their secrets. Takes the organization key.","security":[{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"keys":[{"id":"k_1a2b3c4d","kind":"project","project":"halvorsen-riley","scopes":["read"],"start":"gwp_9f3e","createdAt":"2026-11-19T14:03:00.000Z"}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/keys/{id}":{"delete":{"operationId":"revokeKey","summary":"Revoke a key","description":"Revoke a key. It stops working at once. Takes the organization key.","parameters":[{"name":"id","in":"path","required":true,"description":"The key's id, such as `k_1a2b3c4d`","schema":{"type":"string"}}],"security":[{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"id":"k_1a2b3c4d","revokedAt":"2026-11-19T15:00:00.000Z"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/add":{"post":{"operationId":"projectAdd","summary":"Add text, a link or a file","description":"Add one of: plain text, such as notes or a transcript, kept as a Markdown file named for its title; a public web page by its `url`, read as text; or a small file as base64 `file` with its `name`. Tags let search and ask read some files only. Build the project once you have added everything.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":1000000},"url":{"type":"string","maxLength":2000},"file":{"type":"string","contentEncoding":"base64","description":"The file's bytes, up to about 3.5 MB. Larger files go to PUT …/files."},"name":{"type":"string","description":"The file's name, with its extension, when sending `file`."},"title":{"type":"string"},"tags":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":40}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"id":"f1a2b3c4d","name":"1 1 with Dana.md","bytes":2311,"addedAt":"2026-11-19T14:05:00.000Z","tags":["meetings"]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/files":{"put":{"operationId":"projectAddFile","summary":"Add a file","description":"Add one file up to 100 MB, its bytes as the body: a PDF, Word, PowerPoint, Excel, CSV, Markdown, text or captions file. Build the project once you have added everything.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}},{"name":"name","in":"query","required":true,"description":"The file's name, with its extension","schema":{"type":"string"}},{"name":"tags","in":"query","required":true,"description":"Tags, separated by commas","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"id":"f1a2b3c4d","name":"1-1-dana.vtt","bytes":48211,"addedAt":"2026-11-19T14:05:00.000Z"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"get":{"operationId":"projectFiles","summary":"List files","description":"The project's files.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"files":[{"id":"f1a2b3c4d","name":"1-1-dana.vtt","bytes":48211,"addedAt":"2026-11-19T14:05:00.000Z"}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/files/{id}":{"delete":{"operationId":"projectRemoveFile","summary":"Remove a file","description":"Remove a file, and its passages from the index.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"The file's id","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"deleted":"f1a2b3c4d"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/build":{"post":{"operationId":"projectBuild","summary":"Build","description":"Build what was added, so search and ask read it. A build already queued or running is the one you get.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"state":"queued"}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}},"get":{"operationId":"projectBuildStatus","summary":"Build status","description":"Where the build stands: `none`, `queued`, `run`, `done` or `err`, with its steps and files.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"state":"done","steps":[{"id":"chunk","label":"Passages","state":"ok","done":8,"total":8,"detail":"212 passages"}],"files":[{"name":"1-1-dana.vtt","state":"ok"}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/search":{"post":{"operationId":"projectSearch","summary":"Search","description":"The passages that best match a query, best first. No model call.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","maxLength":500},"k":{"type":"integer","minimum":1,"maximum":20,"default":8},"tags":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":40},"description":"Read only files with one of these tags."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"passages":[{"id":"f1a2b3c4d#3","title":"1:1 with Dana","text":"Riley Moreno: Before you start…","score":0.82,"start":252}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/v1/projects/{project}/ask":{"post":{"operationId":"projectAsk","summary":"Ask","description":"A prompt answered from the project's files, citing each claim with `[^s1]` markers. `mode` is `chat` (one search, then an answer), `agent` (plans, searches, queries tables and draws charts) or `auto`, which picks agent only for counting or charting over tables. Search reads the prompt alone, so put the words that find the evidence there, and how the answer should read in `instructions`. Send earlier turns as `messages`; nothing is stored. With `format` of `json` or `csv`, the answer also comes back in that shape as `data`, matching `schema` or `columns`.","parameters":[{"name":"project","in":"path","required":true,"description":"The project's slug, such as `halvorsen-riley`","schema":{"type":"string"}}],"security":[{"project":[]},{"org":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","maxLength":2000},"instructions":{"type":"string","maxLength":4000,"description":"How the answer should read: voice, length, form. It never changes what the answer may claim."},"mode":{"enum":["auto","chat","agent"],"default":"auto"},"messages":{"type":"array","maxItems":20,"items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["user","assistant"]},"content":{"type":"string"}}}},"format":{"enum":["markdown","json","csv"],"default":"markdown"},"schema":{"type":"object","description":"A JSON Schema the `json` result must match."},"columns":{"type":"array","items":{"type":"string"},"maxItems":30,"description":"The keys of each row, for `json` without a schema or for `csv`."},"tags":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":40},"description":"Read only files with one of these tags. Asks with tags run in chat mode."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"answer":"Riley tends to give the update before asking what Dana needs. [^s1]","sources":[{"id":"s1","title":"1:1 with Dana","label":"1:1 with Dana, 04:12","file":"1-1-dana.vtt","excerpt":"Riley Moreno: Before you start, here's where the Tacoma numbers are…","start":252}],"mode":"chat","run":"4f0c1a2b-…","data":[{"edge":"Gives the update before asking what Dana needs","sources":["s1"]}]}}}},"400":{"description":"The body is missing or not JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"No key, or a key that opens nothing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"The key cannot do this, such as a read key adding a file","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"No such project, file or key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"409":{"description":"The files are not built yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"No room left for this file or source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"422":{"description":"The link or file could not be read","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"429":{"description":"Over a limit for now, such as the sessions an address may start in an hour","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"The answer model failed; try again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Every session slot is taken; try again later","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}