Context Capsule v1 — Portable context for agent workflows
Capsule creation requires a Bearer token. Get one via the signup endpoint. Keys use the ak_ prefix.
Authorization: Bearer ak_your_api_key
Fetch endpoints are public — no authentication required.
Create a context capsule. Auth required. Rate limit: 60/min per API key.
curl -X POST https://www.contextcapsule.ai/v1/capsules \
-H "Authorization: Bearer ak_your_key" \
-H "Content-Type: application/json" \
-d '{
"summary": "Refactored auth module",
"decisions": ["Chose RS256 over HS256"],
"next_steps": ["Add refresh tokens"],
"payload": {"files": ["auth.ts"]},
"refs": {"workflow_id": "wf_123"},
"expires_in": 3600
}'
{
"id": "cap_...",
"short_url": "https://www.contextcapsule.ai/capsule/cap_...",
"expires_at": "2025-01-01T12:00:00.000Z",
"request_id": "req_..."
}
Fetch a capsule by ID. Public. Rate limit: 120/min per IP.
curl https://www.contextcapsule.ai/v1/capsules/cap_abc123
{
"id": "cap_abc123",
"summary": "Refactored auth module",
"decisions": ["Chose RS256 over HS256"],
"next_steps": ["Add refresh tokens"],
"payload": {"files": ["auth.ts"]},
"refs": {"workflow_id": "wf_123"},
"audience": null,
"created_at": "2025-01-01T11:00:00.000Z",
"expires_at": "2025-01-01T12:00:00.000Z"
}
Short URL also works: GET /capsule/:id
Get a free API key. Rate limit: 5/min per IP.
curl -X POST https://www.contextcapsule.ai/v1/auth/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'
{
"api_key": "ak_...",
"message": "Store this key securely — it cannot be retrieved later."
}
Hourly cleanup of expired capsules. Protected by a shared secret.
curl -X POST https://www.contextcapsule.ai/cron/cleanup \
-H "Authorization: Bearer CRON_SECRET"
{"deleted": 42}
| Field | Type | Required | Constraints |
|---|---|---|---|
| summary | string | yes | max 500 chars |
| decisions | string[] | no | |
| next_steps | string[] | no | |
| payload | object | no | max 32KB JSON |
| refs | object | no | see below |
| expires_in | number | no | 60–604800s, default 86400 |
| idempotency_key | string | no | deduplication key |
| audience | string | no | consumer hint |
| Field | Type | Description |
|---|---|---|
| workflow_id | string | Workflow ID |
| agent_id | string | Creating agent |
| session_id | string | Creating session |
| parent_capsule_id | string | Parent capsule (chaining) |
| receipt_ids | string[] | ProofSlip receipt IDs |
All errors return a JSON body with error, message, and request_id.
| Code | HTTP | Description |
|---|---|---|
| validation_error | 400 | Request body failed validation |
| unauthorized | 401 | Missing or invalid credentials |
| capsule_not_found | 404 | Capsule not found or expired |
| idempotency_conflict | 409 | Same key, different body |
| email_exists | 409 | Email already registered |
| rate_limited | 429 | Too many requests |
| internal_error | 500 | Unexpected server error |
Use Context Capsule from any MCP-compatible client:
npx -y @contextcapsule/mcp-server
Tools: create_capsule, fetch_capsule, signup
| URL | Format | Description |
|---|---|---|
| /llms.txt | text | LLM-friendly summary |
| /llms-full.txt | text | Full API reference |
| /.well-known/openapi.json | JSON | OpenAPI 3.1 spec |
| /.well-known/mcp.json | JSON | MCP discovery |
| /.well-known/agent.json | JSON | Agent discovery |
| /robots.txt | text | Robots & discovery |
| /sitemap.xml | XML | Sitemap |
Context Capsule — contextcapsule.ai