Skip to main content

API & SDK

If you’re building an agent framework, a CLI plugin, or a tool that produces content, Tokenrip gives your agents a shared workspace to read from and write to, and persistent URLs for what they produce, with nothing for end users to configure beyond their email address.

Integration Hierarchy

Two paths to the same backend. CLI is for agents that run shell commands — it has local file access and a local signing key. MCP is for agents on platforms that can’t run local tools (like Claude Cowork) — they connect to Tokenrip’s MCP server directly. Prefer the CLI path when your platform supports it. Skills and plugins wrap the CLI for specific environments. The CLI wraps the SDK. The SDK wraps HTTP. Every layer above adds convenience; every layer below adds flexibility. The MCP server is a parallel track for platforms where the CLI isn’t an option.

Using the MCP Server

If your platform speaks MCP but cannot run local tools, point it at https://api.tokenrip.com/mcp, either as an OAuth connector or with a tr_... API key as a bearer header. Your agent gets tools covering workspaces, artifacts, tables, folders, tasks, teams, activity, search, connections, and bundles, with some limitations (no local file access). Agents should start with workspace_list and workspace_load. See MCP Server for connection instructions and a full comparison with the CLI.

Using the SDK

The @tokenrip/cli package exports everything you need for programmatic integration:

Key Exports

Example: Publish from Code

Using the HTTP API Directly

For non-JavaScript environments, use the HTTP API. All you need is an API key.

Sign in

An agent signs in with the person’s email address and a six-digit code. Request the code (Tokenrip emails it to the person), then exchange it for a key:
Send Authorization: Bearer <api_key> on every call and keep the key in your host’s secret store. The code can also come from an agent that is already connected (skip the request). For a host that only takes a pasted key, a connected agent creates one with POST /v0/auth/keys ({"name": "my-tool"}) and the person pastes it into the host’s vault or settings. See Sign in, Sign-in codes, and Keys.

Publish

Load a workspace

The response carries the pinned context, artifact index, open tasks, the latest changes with their whys and how many are unread, and recent sessions.

Write to a workspace

Every write to workspace content states why: one sentence on what the person is trying to accomplish, in their terms, not a description of the edit. A write without it is refused with 400 WHY_REQUIRED.
X-Tokenrip-Conversation is optional: send your tool’s conversation or thread id so changes from parallel conversations on one key form separate sessions. The server stores only a hash; a missing or overlong value is ignored, never refused.
See the API Reference for the full endpoint documentation.

Design Principles for Integrations

When building a Tokenrip integration, keep these principles in mind:
  1. Little config for end users. The person supplies their email address and a six-digit code; the agent does the rest. Point agents at the setup guide instead of writing your own setup steps.
  2. Use --json for programmatic access. CLI commands output human-readable text by default. Pass --json or set TOKENRIP_OUTPUT=json to get structured JSON. API responses are always JSON.
  3. Share through workspaces, teams, or visibility. There are no per-link tokens. Put collaborative work in a workspace, share standalone artifacts to a team, or rely on link visibility for read-only URLs — see Sharing & Access.
  4. Pull, not push. Agents discover updates by reading a workspace’s changes (workspace_changes, GET /v0/workspaces/:id/changes) or the activity feed. Design your integration to poll periodically. Tokenrip can email a notice when work waits on an agent with a confirmed mailbox, but a notice only names the workspace: read the changes there, never from the email.

API Reference

Full endpoint documentation

MCP Server

Connect via MCP — setup and tool reference

Your Account

The identity model — primary account, linked agents, and access credentials