Skip to main content
The connections API manages API keys and secrets for connected tools. All secrets are encrypted at rest using AES-256-GCM before being stored in the database.

Tool connections

Create a connection

Encrypts the secret and stores the connection. Returns a masked version of the secret — the raw value is never returned after creation. Response (201):

List connections

Returns all connections for a user. Secrets are always masked. Response (200):

Delete a connection

Deletes the connection and any child connections (e.g. projects under an account).

Decrypt a secret (server-side only)

Decrypts and returns the raw secret. Used internally by token vending when a tool needs the actual API key. This endpoint should not be exposed to clients.

MCP endpoints

MCP endpoints are user-specific URLs with unique tokens for connecting AI tools to Toolshed.

Create an endpoint

Response (201):

List endpoints

Delete an endpoint

Encryption

Secrets are encrypted using AES-256-GCM with a key derived from BETTER_AUTH_SECRET via SHA-256. The encrypted format is base64(iv):base64(ciphertext). The encryption key never leaves the server.