Drive for Agents (API)
NewConnect AI agents and scripts to Smart Drive with personal API keys — search, read, upload and share files over REST or the MCP server.
Give your agent a drive
Smart Drive exposes a public REST API so AI agents, scripts and integrations can use your drive the way you do: search files by meaning, read document contents as text, save new files and share them. Everything an agent creates appears instantly in your Drive UI, where you can open it, edit it in aiinak Docs or Sheets, and share it.
Personal API keys
Created in Drive → API Keys. Scoped, revocable, and shown exactly once at creation.
Content, not just bytes
Read documents, spreadsheets and PDFs as extracted text — what agents actually need.
MCP server
One config block connects Claude Desktop, Claude Code or Cursor via @aiinak/workspace-mcp.
Activity log
Every API call is listed in Drive → API Keys, so you always know what your agents did.
API keys and scopes
Create keys in the Drive app under API Keys in the sidebar. Give the key a name, pick its scopes, and copy the key when it is shown — it is stored hashed and can never be displayed again. A key acts as you: it sees the files you can see, and its uploads count against your storage quota. Revoke a key at any time; revocation is immediate.
| Scope | Allows |
|---|---|
| files:read | Search, list, read file content, get download URLs |
| files:write | Upload files, create folders |
| files:delete | Move files to trash (restorable in the app) |
| share | Create share links and send share notifications |
Give agents the narrowest scopes that work. Most agents only need files:read and files:write — delete is separate on purpose.
Authentication
The base URL is https://drive.aiinak.com/api/v1. Send your key as a Bearer token on every request.
curl https://drive.aiinak.com/api/v1/me \
-H "Authorization: Bearer adk_your_key"Requests without a valid key return 401; a valid key used outside its scopes returns 403 with insufficient_scope. All responses share one JSON shape: { success: true, data: … } on success, { success: false, error, message } on failure.
Endpoints
| Endpoint | Scope | Description |
|---|---|---|
| GET /me | any | Account, key scopes, storage used vs quota |
| GET /files | files:read | List folders and files (?folderId= for a subfolder) |
| GET /files/search?q= | files:read | Semantic + keyword search over names and contents, including files shared with you |
| GET /files/{id} | files:read | File metadata |
| GET /files/{id}/content | files:read | Extracted text (?maxChars=, default 20000) |
| GET /files/{id}/download | files:read | Short-lived presigned URL for raw bytes (?expiresIn=, default 600s) |
| POST /files | files:write | Create a file from contentText or contentBase64 (max 25 MB) |
| POST /folders | files:write | Create a folder (idempotent per name and parent) |
| POST /files/{id}/share | share | Share with an email; sends a notification and returns the link |
| DELETE /files/{id} | files:delete | Move a file to trash |
# Search by meaning
curl "https://drive.aiinak.com/api/v1/files/search?q=q3%20sales%20report" \
-H "Authorization: Bearer $KEY"
# Read a document as text
curl "https://drive.aiinak.com/api/v1/files/FILE_ID/content" \
-H "Authorization: Bearer $KEY"
# Save a file the user will see in their Drive
curl -X POST https://drive.aiinak.com/api/v1/files \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"filename":"report.md","contentText":"# Q3 Report…"}'
# Share it
curl -X POST https://drive.aiinak.com/api/v1/files/FILE_ID/share \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"shareWithEmail":"[email protected]","accessLevel":"view"}'Limits and errors
| Limit | Value | On exceeding |
|---|---|---|
| Rate limit | 120 requests / minute per key | 429 rate_limited; retry after the window |
| Upload size | 25 MB per file via API | 413 — use the Drive app for larger files |
| Storage | Your plan's quota (50 GB free) | 413 quota exceeded — upgrade in Drive settings |
Uploads by your agents count against the same storage quota as your own uploads — there is no separate agent storage to manage or pay for.
MCP server for Claude and Cursor
The @aiinak/workspace-mcp package (npm) exposes your drive to any MCP client as eight tools: drive_search, drive_list_files, drive_read_file, drive_upload_file, drive_create_folder, drive_share_file, drive_get_download_url and drive_usage.
{
"mcpServers": {
"aiinak-drive": {
"command": "npx",
"args": ["-y", "@aiinak/workspace-mcp"],
"env": { "AIINAK_DRIVE_API_KEY": "adk_your_key" }
}
}
}claude mcp add aiinak-drive -e AIINAK_DRIVE_API_KEY=adk_your_key -- npx -y @aiinak/workspace-mcp