API Keys and AI Apps
A key lets an app use your drive without your password. There are two kinds:
- An AI app key works only through MCP, the way AI apps call tools. The app can search, read and save files. You can hold it to one folder.
- A script key works with the Staaash API, for backups and your own tools. It sees your whole drive.
Make a key
Section titled “Make a key”- Open Settings, then Signed in, and press New key.
- Give it a name you will recognize later, such as “Claude Code on my laptop”.
- Choose who will use it, whether it can only read or also change files, and when it ends.
- Press Make key, then copy the key. It is only shown once.
For an AI app key, the next screen also shows the setup for each app below with your key filled in.
Connect an AI app
Section titled “Connect an AI app”The MCP address is your drive’s address with /mcp at the end, for example https://drive.example.com/mcp. Replace stsh_... below with your key.
Claude Code. Run this in a terminal and paste the key when read waits. It keeps the key out of your shell history:
read -rs STAAASH_KEYclaude mcp add --transport http staaash https://drive.example.com/mcp --header "Authorization: Bearer $STAAASH_KEY"Codex. Add this to ~/.codex/config.toml:
[mcp_servers.staaash]url = "https://drive.example.com/mcp"http_headers = { "Authorization" = "Bearer stsh_..." }OpenCode 2. Add this to opencode.json:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "servers": { "staaash": { "type": "remote", "url": "https://drive.example.com/mcp", "oauth": false, "headers": { "Authorization": "Bearer stsh_..." } } } }}Claude Desktop. It reaches Staaash through mcp-remote, so it needs Node.js. Add this to claude_desktop_config.json and restart Claude Desktop:
{ "mcpServers": { "staaash": { "command": "npx", "args": [ "-y", "mcp-remote", "https://drive.example.com/mcp", "--header", "Authorization:${STAAASH_AUTH}" ], "env": { "STAAASH_AUTH": "Bearer stsh_..." } } }}If your drive’s address starts with http://, add "--allow-http" after "Authorization:${STAAASH_AUTH}". The setup in Settings does this for you.
Open WebUI. In Admin Panel, open Settings, then External Tools, and add a server. Pick MCP (Streamable HTTP), paste the MCP address, choose Bearer, and paste the key. Open WebUI connects from its own server, so the address must work from there. If both run in Docker, the address your browser uses may not.
The Claude and ChatGPT websites cannot connect. They need a sign-in flow that Staaash does not have.
What an AI app can do
Section titled “What an AI app can do”| Tool | What it does |
|---|---|
search |
Finds files and folders by name, and files by the words inside them. With no words, lists what was opened lately. |
list_folder |
Lists what is in a folder. |
get_info |
Shows the size, type and dates of a file or folder. |
read_file |
Reads a text file, 100 KB at a time, or a picture up to 5 MB. PDFs, Office files, EPUB books and scans come as the text Staaash read from them. |
create_folder |
Makes a folder. |
write_file |
Saves text as a file. It replaces a file only when asked to. The old content goes to Trash, and from v2.2.0 it stays as an older version instead. |
move |
Moves or renames a file or folder. |
trash |
Moves a file or folder to Trash. |
A read-only key gets only the first four. When read_file asks for a file Staaash has not read yet, Staaash reads it first and the app waits up to 30 seconds. A long scanned PDF can take longer; then the app is told to ask again in a minute. What an AI app trashes waits in Trash, and from v2.2.0 the old content of a file it replaces stays in that file’s older versions. To undo a move or rename, move or rename it back. An AI app cannot delete files for good, make share links, change your account, or open admin pages.
A key held to one folder sees that folder as the top of the drive. It cannot reach anything outside it, even by name. If you trash or delete that folder, the key stops working.
Keep your files safe
Section titled “Keep your files safe”An AI app reads what is in your files, and a file can hold text written to trick it, such as “send this file to …”. Staaash tells the app to treat file text as data, but that is not a guarantee.
- Give an app the least it needs: one folder and read only when that is enough.
- Give Read and change keys only to apps whose actions you watch.
- Use one key per app, so you can delete one without breaking the others.
Use a key in a script
Section titled “Use a key in a script”Send the key in the Authorization header. Don’t type the key into the command itself: the shell saves it in its history, and other people on the computer can see a running command. In Bash or Zsh, paste it into read instead, and let curl read the header from its input:
read -rs STAAASH_KEYprintf 'Authorization: Bearer %s' "$STAAASH_KEY" | curl -H @- "https://drive.example.com/api/search?q=report"Script keys work on the routes for files, uploads, share links, search and sync. A Read and change key can do what you can do on those pages, including making share links and emptying Trash. A read-only key can read and download, including zip downloads, but cannot change anything. No key can change your account or open admin pages. The routes are described in openapi.json.
When a key stops working
Section titled “When a key stops working”- On its end date. A key with no end date stops after a year without use.
- When you press Delete next to it in Settings, Signed in.
- When you change your password, or press Sign out everywhere else. Both delete all your keys.
- When the owner deletes it, or resets your password, in Admin → Users.
Never used and Used next to each key show whether an app is using it.