{"title":"Rate Limits & Quotas","slug":"rate-limits","category":"api","summary":"Rate limit policies for Synapse API — Bearer header (unlimited), ?key= (60/min), public endpoints.","audience":["human","llm"],"tags":["api","rate-limits","quotas","throttling"],"difficulty":"beginner","updated":"2026-06-27","word_count":326,"read_minutes":2,"llm_context":"Mind Key (Authorization: Bearer header) → NO rate limit\nMind Key (?key= query param) → 60 req/min per IP\nJWT (Authorization: Bearer header) → NO rate limit\nPublic endpoints (/tools/*, /docs, /health, /endpoints) → NO rate limit\nRate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After\nRecommendation: ALWAYS use Authorization header. Use ?key= only for URL-only tools.\n","lang":"en","translated":true,"requested_lang":"en","content_markdown":"\n# Rate Limits & Quotas\n\nSynapse has a simple, predictable rate limit policy designed to prevent abuse\nwhile not getting in the way of legitimate usage.\n\n## Rate Limit Policy\n\n| Auth Method | Limit | Scope |\n|-------------|-------|-------|\n| Mind Key (`Authorization: Bearer`) | **None** | Per-mind |\n| Mind Key (`?key=`) | 60 req/min | Per-IP |\n| JWT (`Authorization: Bearer`) | **None** | Per-user |\n| Public endpoints | **None** | Global |\n\n> [!TIP]\n> **Always use the `Authorization: Bearer` header** when possible. It has no\n> rate limit. Use `?key=` only for tools that can't set custom headers.\n\n## Rate Limit Headers\n\nWhen you use `?key=` auth, responses include rate limit headers:\n\n```\nX-RateLimit-Limit: 60\nX-RateLimit-Remaining: 42\nX-RateLimit-Reset: 1782567840\n```\n\nWhen you exceed the limit:\n\n```\nHTTP/1.1 429 Too Many Requests\nX-RateLimit-Limit: 60\nX-RateLimit-Remaining: 0\nRetry-After: 42\nContent-Type: application/json\n\n{\n  \"statusCode\": 429,\n  \"error\": \"Too Many Requests\",\n  \"message\": \"Rate limit exceeded. Use Authorization header for unlimited access.\"\n}\n```\n\n## When You Hit a Rate Limit\n\nIf you get a 429:\n\n1. **Switch to Authorization header** (recommended):\n   ```bash\n   # Don't: ?key=YOUR_MIND_KEY (60/min limit)\n   curl \".../memory/recall?key=YOUR_MIND_KEY\"\n   \n   # Do: Authorization header (unlimited)\n   curl -H \"Authorization: Bearer YOUR_MIND_KEY\" .../memory/recall\n   ```\n\n2. **Or wait `Retry-After` seconds** and retry.\n\n## Why the ?key= Limit Exists\n\nThe `?key=` query parameter is convenient for URL-only tools (browsers,\n`open` commands), but it has security and performance implications:\n\n- **Security:** Query parameters are logged in server access logs, browser\n  history, and Referer headers. Limiting usage reduces exposure.\n- **Performance:** Query-parameter auth requires an IP-based rate limiter\n  (Redis lookup per request), which adds latency. Header auth skips this.\n- **Abuse prevention:** A leaked `?key=` URL could be shared and hammered.\n  The IP limit contains the blast radius.\n\n## Recommended Patterns\n\n### LLM agents\n\n```python\n# Always use header auth\nheaders = {\"Authorization\": f\"Bearer {MIND_KEY}\"}\nresponse = requests.get(f\"{URL}/memory/recall\", headers=headers)\n```\n\n### Browser-based tools\n\nIf your tool can only open URLs:\n\n```bash\n# OK for occasional use (under 60/min)\nopen \"https://synapse.schaefer.zone/memory/recall?key=YOUR_MIND_KEY\"\n\n# For frequent use, switch to a tool that supports headers\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" .../memory/recall\n```\n\n### MCP server\n\nMCP servers always use header auth via `SYNAPSE_MIND_KEY` env var — no rate\nlimit applies.\n\n### Bulk imports\n\nFor bulk operations (e.g. importing 1000 memories), always use header auth.\nBulk imports via `?key=` will hit the rate limit within 1 minute.\n\n## Quotas (Mind-Level)\n\nThere are currently no per-mind quotas on storage size or memory count. All\nlimits are at the auth/IP level, not the data level. This may change in the\nfuture for multi-tenant fairness.\n\n## Monitoring Your Usage\n\n```bash\n# Check your current rate limit status (with ?key= auth)\ncurl -i \"https://synapse.schaefer.zone/memory/stats?key=YOUR_MIND_KEY\" | grep -i ratelimit\n\n# Output:\n# X-RateLimit-Limit: 60\n# X-RateLimit-Remaining: 58\n# X-RateLimit-Reset: 1782567840\n```\n\n## Next Steps\n\n- [Authentication](/docs/getting-started/authentication)\n- [Errors & Error Handling](/docs/api/errors)\n","content_html":"<h1>Rate Limits &amp; Quotas</h1>\n<p>Synapse has a simple, predictable rate limit policy designed to prevent abuse\nwhile not getting in the way of legitimate usage.</p>\n<h2>Rate Limit Policy</h2>\n<table>\n<thead>\n<tr>\n<th>Auth Method</th>\n<th>Limit</th>\n<th>Scope</th>\n</tr>\n</thead>\n<tbody><tr>\n<td>Mind Key (<code>Authorization: Bearer</code>)</td>\n<td><strong>None</strong></td>\n<td>Per-mind</td>\n</tr>\n<tr>\n<td>Mind Key (<code>?key=</code>)</td>\n<td>60 req/min</td>\n<td>Per-IP</td>\n</tr>\n<tr>\n<td>JWT (<code>Authorization: Bearer</code>)</td>\n<td><strong>None</strong></td>\n<td>Per-user</td>\n</tr>\n<tr>\n<td>Public endpoints</td>\n<td><strong>None</strong></td>\n<td>Global</td>\n</tr>\n</tbody></table>\n<div class=\"callout callout-ok\">**Always use the `Authorization: Bearer` header** when possible. It has no\nrate limit. Use `?key=` only for tools that can't set custom headers.</div><h2>Rate Limit Headers</h2>\n<p>When you use <code>?key=</code> auth, responses include rate limit headers:</p>\n<pre><code class=\"hljs language-plaintext\">X-RateLimit-Limit: 60\nX-RateLimit-Remaining: 42\nX-RateLimit-Reset: 1782567840</code></pre><p>When you exceed the limit:</p>\n<pre><code class=\"hljs language-plaintext\">HTTP/1.1 429 Too Many Requests\nX-RateLimit-Limit: 60\nX-RateLimit-Remaining: 0\nRetry-After: 42\nContent-Type: application/json\n\n{\n  &quot;statusCode&quot;: 429,\n  &quot;error&quot;: &quot;Too Many Requests&quot;,\n  &quot;message&quot;: &quot;Rate limit exceeded. Use Authorization header for unlimited access.&quot;\n}</code></pre><h2>When You Hit a Rate Limit</h2>\n<p>If you get a 429:</p>\n<ol>\n<li><p><strong>Switch to Authorization header</strong> (recommended):</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Don&#x27;t: ?key=YOUR_MIND_KEY (60/min limit)</span>\ncurl <span class=\"hljs-string\">&quot;.../memory/recall?key=YOUR_MIND_KEY&quot;</span>\n\n<span class=\"hljs-comment\"># Do: Authorization header (unlimited)</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> .../memory/recall</code></pre></li>\n<li><p><strong>Or wait <code>Retry-After</code> seconds</strong> and retry.</p>\n</li>\n</ol>\n<h2>Why the ?key= Limit Exists</h2>\n<p>The <code>?key=</code> query parameter is convenient for URL-only tools (browsers,\n<code>open</code> commands), but it has security and performance implications:</p>\n<ul>\n<li><strong>Security:</strong> Query parameters are logged in server access logs, browser\nhistory, and Referer headers. Limiting usage reduces exposure.</li>\n<li><strong>Performance:</strong> Query-parameter auth requires an IP-based rate limiter\n(Redis lookup per request), which adds latency. Header auth skips this.</li>\n<li><strong>Abuse prevention:</strong> A leaked <code>?key=</code> URL could be shared and hammered.\nThe IP limit contains the blast radius.</li>\n</ul>\n<h2>Recommended Patterns</h2>\n<h3>LLM agents</h3>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-comment\"># Always use header auth</span>\nheaders = {<span class=\"hljs-string\">&quot;Authorization&quot;</span>: <span class=\"hljs-string\">f&quot;Bearer <span class=\"hljs-subst\">{MIND_KEY}</span>&quot;</span>}\nresponse = requests.get(<span class=\"hljs-string\">f&quot;<span class=\"hljs-subst\">{URL}</span>/memory/recall&quot;</span>, headers=headers)</code></pre><h3>Browser-based tools</h3>\n<p>If your tool can only open URLs:</p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># OK for occasional use (under 60/min)</span>\nopen <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/recall?key=YOUR_MIND_KEY&quot;</span>\n\n<span class=\"hljs-comment\"># For frequent use, switch to a tool that supports headers</span>\ncurl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> .../memory/recall</code></pre><h3>MCP server</h3>\n<p>MCP servers always use header auth via <code>SYNAPSE_MIND_KEY</code> env var — no rate\nlimit applies.</p>\n<h3>Bulk imports</h3>\n<p>For bulk operations (e.g. importing 1000 memories), always use header auth.\nBulk imports via <code>?key=</code> will hit the rate limit within 1 minute.</p>\n<h2>Quotas (Mind-Level)</h2>\n<p>There are currently no per-mind quotas on storage size or memory count. All\nlimits are at the auth/IP level, not the data level. This may change in the\nfuture for multi-tenant fairness.</p>\n<h2>Monitoring Your Usage</h2>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Check your current rate limit status (with ?key= auth)</span>\ncurl -i <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/memory/stats?key=YOUR_MIND_KEY&quot;</span> | grep -i ratelimit\n\n<span class=\"hljs-comment\"># Output:</span>\n<span class=\"hljs-comment\"># X-RateLimit-Limit: 60</span>\n<span class=\"hljs-comment\"># X-RateLimit-Remaining: 58</span>\n<span class=\"hljs-comment\"># X-RateLimit-Reset: 1782567840</span></code></pre><h2>Next Steps</h2>\n<ul>\n<li><a href=\"/docs/getting-started/authentication\">Authentication</a></li>\n<li><a href=\"/docs/api/errors\">Errors &amp; Error Handling</a></li>\n</ul>\n","urls":{"html":"/docs/api/rate-limits","text":"/docs/api/rate-limits?format=text","json":"/docs/api/rate-limits?format=json","llm":"/docs/api/rate-limits?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}