fastpaste_

— documentation

Disposable Clipboard API Reference

FastPaste provides a disposable clipboard API for one-time code sharing and secure temporary file sharing at /api/v1/. All requests require a Bearer token. Responses are JSON, and files are base64-encoded in the response body.

View API pricing plans · Open secure temporary file sharing app

// 02a

Web UI vs API

Web UIAPI (this reference)
Base path/api/clip/api/v1/clip
AuthOptional magic link (free tier)Bearer API key (required)
Rate limit10 req/min per IPDaily plan quota
TTL10 min default; Personal can extend1 h (Starter) or 24 h (Pro)
Multi-readWeb push only (readMode / maxReads)Single pull per code

Specialized viewers (JSON, Redact, Agent, diff, logs, …) use the web push flow at /api/json, /api/redact, etc. — not the v1 API.

// 01

Authentication

Every request must include an Authorization header with your API key as a Bearer token. Keys are 40-character hex strings provisioned when you purchase a plan.

header
Authorization: Bearer a3f1c8e2d94b07651af2...

Missing or invalid keys return 401 Unauthorized.

Passphrase-protected clips also use x-clip-passphrase on pull requests.

// 02

Plans

API StarterPro
Max file size (per upload)10 MB100 MB
Requests / day1,000Unlimited
Content TTL1 hour24 hours

Daily quota is consumed on successful push/pull operations. Remaining quota is returned as requests_remaining and the X-Requests-Remaining header. Quota resets at UTC midnight.

// 02b

Zero-knowledge text sharing

The web UI defaults to Sensitive mode for text pushes. Content is encrypted in the browser with AES-GCM before it reaches the server. Only ciphertext is stored — the server never sees your plaintext.

The recipient needs both the 6-digit code and the passphrase you shared separately. On pull, send the passphrase in the x-clip-passphrase header (API) or enter it in the web UI.

web push (sensitive)
// Browser encrypts before POST
{
  "text": "<base64 ciphertext>",
  "clientEncrypted": true,
  "ttlSeconds": 600
}
// Passphrase is never sent to the server — only used locally for AES-GCM.

Quick mode skips client encryption and stores plaintext on the server (still burn-after-read). Optional server-side passphrase protection locks the code but does not hide content from the server.

// 02d

CLI (from source)

The repo ships cli/fastpaste.mjs for push/pull against the v1 API. It is not published to npm yet — clone the repo or link the binary locally.

usage
git clone https://github.com/tiderbrandt/fastpaste.git
cd fastpaste
export FASTPASTE_API_KEY=your_key

node cli/fastpaste.mjs push "hello world"
node cli/fastpaste.mjs pull 482193
node cli/fastpaste.mjs pull 482193 --passphrase "secret"
node cli/fastpaste.mjs push --file ./report.pdf

// 02e

AI agents & MCP

Run npm run mcp from a clone with FASTPASTE_API_KEY set (or add mcp/server.mjs to Cursor). MCP tools:

ToolPurpose
share_secretPush text once; returns a 6-digit code
share_agent_handoffPush secret + agent prompt + constraints
retrieve_secretPull by code; text, file, or structured JSON

Guide: share secrets with AI agents. UI: Agent Handoff.

cursor mcp.json excerpt
{
  "mcpServers": {
    "fastpaste": {
      "command": "node",
      "args": ["/path/to/fastpaste/mcp/server.mjs"],
      "env": { "FASTPASTE_API_KEY": "your_key" }
    }
  }
}

// 02f

POST /api/v1/agent-handoff

Same clip type as the /agent tool. Pull returns type: agent_handoff with secret, agentPrompt, and constraints. Use {{CODE}} in agentPrompt as a placeholder.

request
curl -X POST https://fastpaste.dev/api/v1/agent-handoff \
  -H "Authorization: Bearer <key>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Deploy token",
    "agentPrompt": "Pull FastPaste code {{CODE}} with retrieve_secret.",
    "constraints": ["Do not echo the secret in chat"],
    "secret": "sk-live-..."
  }'

// 03

POST /api/v1/clip — push content

Text

request
curl -X POST https://fastpaste.dev/api/v1/clip \
  -H "Authorization: Bearer <key>" \
  -H "Content-Type: application/json" \
  -d '{"text": "hello world", "passphrase": "optional-secret", "webhook_url": "https://example.com/hooks/fastpaste"}'

File

request
curl -X POST https://fastpaste.dev/api/v1/clip \
  -H "Authorization: Bearer <key>" \
  -F "file=@/path/to/report.pdf"   -F "passphrase=optional-secret" \
  -F "webhook_url=https://example.com/hooks/fastpaste"

Response 201

json
{
  "code": "482193",
  "expires_in": 3600,
  "plan": "developer",
  "requests_remaining": 999,
  "passphrase_protected": true
}

Text limits are enforced on UTF-8 byte length, not character count.

FieldTypeDescription
textstringRequired for JSON push
passphrasestringOptional server-side pull lock (min 4 chars)
webhook_urlstringOptional HTTPS URL — POST on first pull (see Webhooks)
codestring6-digit retrieval code (response)
expires_innumberSeconds until the code expires (response)
requests_remainingnumberRemaining quota today (response)

// 03b

Webhooks on pull

Pass webhook_url on POST /api/v1/clip (JSON or multipart). When the clip is first pulled, FastPaste POSTs once to your URL and then forgets it.

webhook payload
{
  "event": "clip.opened",
  "code": "482193",
  "type": "text",
  "opened_at": "2026-06-24T12:00:00.000Z"
}

Must be http:// or https://. Web UI pushes can also set webhook_url on POST /api/clip. Guide: webhooks on pull.

// 04

GET /api/v1/clip/:code — pull content

Retrieves and permanently deletes the clip in one atomic operation. There is no second retrieval.

request
curl https://fastpaste.dev/api/v1/clip/482193           -H "Authorization: Bearer <key>"           -H "x-clip-passphrase: optional-secret"

Response 200 — sensitive (encrypted)

json
{
  "type": "text",
  "clientEncrypted": true,
  "data": "{\"v\":1,\"ciphertext\":\"...\", ...}"
}

Decrypt data with the passphrase (CLI: --passphrase; MCP: passphrase arg). Structured tool clips return their own type (e.g. agent_handoff, redacted).

Response 200 — large file

json
{
  "type": "file",
  "download_url": "/api/clip/482193/download",
  "download_token": "<one-time token>",
  "mimeType": "application/pdf",
  "file_name": "report.pdf"
}

Fetch the file with GET download_url and header x-clip-download-token.

Response 200 — text

json
{
  "type": "text",
  "data": "hello world",
  "createdAt": 1746876000000
}

Response 200 — file

json
{
  "type": "image",
  "data": "<base64-encoded content>",
  "mimeType": "image/png",
  "createdAt": 1746876000000
}
FieldDescription
typetext | image | pdf | file
dataRaw text, or base64-encoded binary for files
mimeTypeMIME type of the file (omitted for text)
createdAtUnix timestamp (ms) when the clip was created

// 05

GET /api/clip/:code/receipt — web read receipt

This endpoint is for the web clipboard flow (not API-key flow). It returns whether a clip has been opened, but requires a receipt token from the original web push response to prevent code enumeration.

Push response field

json
{
  "code": "482193",
  "expires_in": 600,
  "receipt_token": "3f2f4b6c0f9946f8ac8cc5f11e72adf7"
}

Receipt request

request
curl https://fastpaste.dev/api/clip/482193/receipt   -H "x-clip-receipt-token: 3f2f4b6c0f9946f8ac8cc5f11e72adf7"

Response 200

json
{
  "opened": false,
  "pending": true
}
FieldDescription
openedtrue once the clip has been consumed
pendingtrue while the clip still exists and is unread
StatusMeaning
200Receipt status returned
400Invalid code format
404Invalid or missing receipt token (or code not found)
429Rate limited

// 06

Errors

StatusMeaning
400Bad request — invalid code format or missing body field
401Invalid/missing API key, or passphrase required for protected clip
403Invalid passphrase for protected clip
404Code not found or already retrieved (burned)
413Content too large for your plan
415Unsupported file type
429Daily request limit reached — resets at UTC midnight
500Server error

Error body

json
{ "error": "Human-readable description" }

// 07

Supported file formats

SVG is permanently blocked — SVG files can embed <script> tags that execute in the browser. All other validation is server-side against a hardcoded MIME type allowlist; filename extensions are ignored.

CategoryFormats
ImagesJPEG, PNG, GIF, WebP, AVIF, BMP, TIFF
Documents — OfficePDF, DOCX, XLSX, PPTX, DOC, XLS, PPT
Documents — OpenDocumentODT, ODS, ODP
eBooksEPUB
ArchivesZIP, GZ, 7Z, TAR, RAR
TextTXT, CSV, Markdown
AudioMP3, WAV, OGG, AAC, FLAC
VideoMP4, WebM, MOV
FontsTTF, OTF, WOFF, WOFF2