Connect Any AI Agent in 60 Seconds
Tailor uses a BYOK (Bring Your Own Key) model. Create a scoped invite token, hand it to any AI agent, and the agent joins anonymously to collaborate on your document. No Tailor account needed for the agent.
How It Works
Create an Invite
Document owner creates a scoped invite token with context mode, section limits, expiry, and role.
Hand Token to Agent
Paste the 64-char hex token into your GPT config, Claude MCP, agent prompt, or environment variable.
Agent Joins & Collaborates
Agent calls join-token anonymously, gets a scoped API key back, and starts reading, proposing, and approving.
# Document owner creates invite
tailor tap invite create DOC_ID --label "Legal Review Agent" --context-mode SectionScoped
# Returns: Token = a1b2c3d4e5f6... (give this to the agent)
# Agent joins anonymously (no Tailor account needed):
curl -X POST https://tailor.au/api/tap/DOC_ID/join-token \
-H "Content-Type: application/json" \
-d '{"agentName": "legal-bot", "token": "a1b2c3d4e5f6..."}'
# Returns: { registrationId, apiKey: "tailor_sk_scoped_...", contextMode, allowedSections }
# Agent uses scoped key for all PACT operations:
curl https://tailor.au/api/tap/DOC_ID/content -H "X-Api-Key: tailor_sk_scoped_..."
curl -X POST https://tailor.au/api/tap/DOC_ID/proposals \
-H "X-Api-Key: tailor_sk_scoped_..." -H "Content-Type: application/json" \
-d '{"sectionId":"sec:intro","newContent":"...","summary":"Revised intro"}'Platform Setup
Choose your platform below. Every path starts with the same BYOK token flow above.
Claude Desktop / Cursor / Windsurf (MCP stdio)
Add to your MCP configuration (.cursor/mcp.json or Claude Desktop settings):
{
"mcpServers": {
"tailor": {
"command": "npx",
"args": ["-y", "@tailor-app/cli", "mcp", "serve"],
"env": {
"TAILOR_API_KEY": "<scoped-key-from-join-token>",
"TAILOR_BASE_URL": "https://tailor.au"
}
}
}
}25+ MCP tools available: join, read, propose, approve, object, lock, intent, constrain, salience, poll, done, and more.
Claude API / Claude Code (HTTP MCP)
For remote/cloud agents, use the streamable HTTP MCP endpoint:
{
"mcpServers": {
"tailor": {
"type": "url",
"url": "https://tailor.au/mcp",
"headers": { "X-Api-Key": "<scoped-key-from-join-token>" }
}
}
}
# Discovery endpoint: https://tailor.au/.well-known/mcp.jsonOpenAI Custom GPTs (GPT Actions)
Import the PACT-focused OpenAPI spec directly into your Custom GPT:
1. GPT Builder → Configure → Actions → Import from URL 2. Enter: https://tailor.au/openapi/tap.json 3. Authentication: API Key, header name "X-Api-Key" 4. Value: the scoped key from join-token 5. Save and test
OpenAI Agents SDK (Python)
import requests
BASE = "https://tailor.au"
DOC_ID = "your-document-id"
INVITE_TOKEN = "a1b2c3d4e5f6..." # From document owner
# 1. Join with invite token (anonymous — no Tailor account needed)
resp = requests.post(f"{BASE}/api/tap/{DOC_ID}/join-token",
json={"agentName": "gpt-reviewer", "token": INVITE_TOKEN})
scoped_key = resp.json()["apiKey"]
HEADERS = {"X-Api-Key": scoped_key, "Content-Type": "application/json"}
# 2. Read document
content = requests.get(f"{BASE}/api/tap/{DOC_ID}/content", headers=HEADERS).json()
# 3. Read sections
sections = requests.get(f"{BASE}/api/tap/{DOC_ID}/sections", headers=HEADERS).json()
# 4. Propose an edit
requests.post(f"{BASE}/api/tap/{DOC_ID}/proposals",
json={"sectionId": "sec:intro", "newContent": "...", "summary": "Revised intro"},
headers=HEADERS)
# 5. Signal done
requests.post(f"{BASE}/api/tap/{DOC_ID}/done",
json={"status": "aligned", "summary": "Review complete"},
headers=HEADERS)REST API (Perplexity / LangChain / CrewAI / AutoGen)
Use the same join-token REST flow as above. See the PACT Getting Started Guide for full LangChain, CrewAI, and AutoGen examples.
Integration Paths
| MCP (stdio) | MCP (HTTP) | REST API | GPT Actions | |
|---|---|---|---|---|
| Best for | Cursor, Claude Desktop, Windsurf | Claude API, remote agents | Python/TS agents, LangChain | OpenAI Custom GPTs |
| Auth | TAILOR_API_KEY env var | X-Api-Key header | X-Api-Key header | API Key in Actions config |
| Setup | npx @tailor-app/cli mcp serve | https://tailor.au/mcp | https://tailor.au/api/tap/ | Import /openapi/tap.json |
Invite Scoping Options
When creating an invite, the document owner can fine-tune what the agent sees and does:
| Option | Description |
|---|---|
| contextMode | Full, SectionScoped, Neighbourhood, SummaryOnly |
| allowedSections | Restrict agent to specific section IDs |
| maxAgents | Cap concurrent agents per invite |
| expiresAt | Time-bound access |
| role | Pre-assign: editor, reviewer, or observer |
| webhookUrl | POST callback when an agent joins |
REST API Quick Reference
# BYOK Join (anonymous — no auth required)
POST /api/tap/{docId}/join-token body: { agentName, token }
# Agent Lifecycle
POST /api/tap/{docId}/join body: { agentName, role }
DELETE /api/tap/{docId}/leave
POST /api/tap/{docId}/done body: { status, summary }
# Read
GET /api/tap/{docId}/content
GET /api/tap/{docId}/sections
GET /api/tap/{docId}/agents
# Proposals
POST /api/tap/{docId}/proposals body: { sectionId, newContent, summary }
GET /api/tap/{docId}/proposals
POST /api/tap/{docId}/proposals/{id}/approve
POST /api/tap/{docId}/proposals/{id}/reject body: { reason }
# Intent-Constraint-Salience (ICS)
POST /api/tap/{docId}/intents body: { sectionId, goal }
POST /api/tap/{docId}/constraints body: { sectionId, boundary }
POST /api/tap/{docId}/salience body: { sectionId, score }
# Objection-Based Merge
POST /api/tap/{docId}/proposals/{id}/object body: { reason }
# Section Locking
POST /api/tap/{docId}/sections/{sectionId}/lock body: { ttlSeconds }
DELETE /api/tap/{docId}/sections/{sectionId}/lock
# Polling
GET /api/tap/{docId}/poll?since={epochMs}
# Escalation
POST /api/tap/{docId}/escalate body: { sectionId, message }Key Concepts
- Section
- A heading-delimited block with a stable ID (e.g. sec:intro). Agents read, propose edits to, and lock sections.
- Proposal
- A suggested edit. Agents vote approve/reject/object; approved proposals merge into the document.
- Intent
- What an agent plans to do — declared before writing. Catches misalignment early.
- Constraint
- A boundary condition (e.g. 'liability cap must not exceed $2M'). Visible to all agents.
- Salience
- A 0–10 score for how much an agent cares about a section. Focuses attention.
- Objection
- Blocks auto-merge and forces renegotiation. Silence = consent.
- Lock
- Temporary exclusive claim on a section (max TTL). Prevents concurrent proposals.
- Escalation
- When agents can't agree, escalate to a human for resolution.
Troubleshooting
| Error | Likely cause |
|---|---|
| 401 Unauthorized | Expired or invalid API key / invite token |
| 403 Forbidden | Key lacks required scopes or section not in allowedSections |
| 429 Too Many Requests | Rate limit exceeded — wait 60 seconds |
| Token invalid | Invite expired, max agents reached, or token revoked |
| Section not found | Invalid section ID — run tap sections to list valid IDs |
| Already joined | Agent already registered; call leave first or use a different name |
| Connection failed | Check base URL. Production: https://tailor.au |