{"title":"Computer-Control-API","slug":"computers","category":"api","summary":"Fernsteuerung registrierter Rechner — Commands in die Warteschlange stellen, Screenshots aufnehmen, Scripts auf Remote-Maschinen ausführen.","audience":["human","llm"],"tags":["api","computers","remote-control","automation"],"difficulty":"advanced","updated":"2026-06-27","word_count":316,"read_minutes":2,"llm_context":"Two sides: user-facing (Mind Key/JWT) and agent-facing (Computer Token)\nRegister agent: POST /computers/register { install_code } → returns computer_token\nList: GET /computers/list (Mind Key or JWT)\nQueue command: POST /computers/:id/commands { type, payload }\nCommand types: screenshot, click, move, type, key, scroll, drag\nAgent poll: GET /computers/me/poll?wait=5 (Computer Token)\nAgent result: POST /computers/me/commands/:cid/result (Computer Token)\nOne-shot screenshot: GET /computers/:id/screenshot (waits 30s for result)\nPattern: register agent on remote machine → user queues commands → agent polls and executes\n","lang":"de","translated":true,"requested_lang":"de","content_markdown":"\n# Computer-Control-API\n\nDie Computer-Control-API ermöglicht die Fernsteuerung registrierter Rechner. Ein\nkleiner Agent (`screen-remote-agent`) läuft auf der Zielmaschine, fragt Commands\nab, führt sie aus und postet Ergebnisse zurück. Das ermöglicht LLM-gesteuerte\nGUI-Automatisierung.\n\n## Architektur\n\n```\n┌─────────────┐  queue cmd   ┌──────────┐  poll   ┌─────────────────┐\n│ LLM Agent   │ ───────────▶ │ Synapse  │ ◀───── │ screen-remote   │\n│ (user-side) │              │  Server  │ ──────▶│ (on target PC)  │\n└─────────────┘              └──────────┘ result  └─────────────────┘\n                                     ▲\n                                     │\n                              ┌─────────────┐\n                              │  Human UI   │\n                              │ (browser)   │\n                              └─────────────┘\n```\n\n## Nutzerseitige Endpunkte (Mind Key oder JWT)\n\n### GET /computers/list\n\nAlle registrierten Rechner auflisten.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/list\n```\n\n### GET /computers/:id\n\nDetails eines einzelnen Rechners abrufen.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/comp_001\n```\n\n### POST /computers/install-code\n\nInstallationscode zur Registrierung eines neuen Rechners generieren.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/computers/install-code \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"computer_name\": \"office-mac\"}'\n```\n\nAntwort: `{ \"install_code\": \"ic_xyz789\", \"expires_at\": \"...\" }`\n\n### POST /computers/:id/commands\n\nEin Command für den Remote-Agent in die Warteschlange stellen.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/computers/comp_001/commands \\\n  -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"type\": \"screenshot\",\n    \"payload\": {}\n  }'\n```\n\nAntwort: `{ \"command_id\": \"cmd_001\", \"status\": \"queued\" }`\n\n### GET /computers/:id/command (via Query)\n\nEin Command via GET einreihen (für einfache Fälle).\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/computers/comp_001/command?type=screenshot\"\n```\n\n### GET /computers/:id/commands\n\nLetzte Commands für einen Rechner auflisten.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     \"https://synapse.schaefer.zone/computers/comp_001/commands?limit=50\"\n```\n\n### GET /computers/:id/commands/:cid\n\nStatus + Ergebnis eines bestimmten Commands abrufen.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/comp_001/commands/cmd_001\n```\n\n### GET /computers/:id/screenshot\n\nOne-Shot: ein Screenshot-Command einreihen und bis zu 30s auf das Ergebnis warten.\n\n```bash\ncurl -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/comp_001/screenshot > screenshot.png\n```\n\n### POST /computers/:id/disable\n\nEinen Rechner deaktivieren (widerruft seinen Token, behält den Eintrag fürs Audit).\n\n```bash\ncurl -X POST -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/comp_001/disable\n```\n\n### DELETE /computers/:id\n\nEinen Rechner dauerhaft löschen.\n\n```bash\ncurl -X DELETE -H \"Authorization: Bearer YOUR_MIND_KEY\" \\\n     https://synapse.schaefer.zone/computers/comp_001\n```\n\n## Agentseitige Endpunkte (Computer-Token)\n\nDiese Endpunkte werden vom `screen-remote-agent` auf der Zielmaschine verwendet.\nSie verwenden einen Computer-Token (von `/computers/register` zurückgegeben),\nkeinen Mind Key.\n\n### POST /computers/register\n\nInstallationscode einlösen und einen Computer-Token erhalten.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/computers/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"code\": \"ic_xyz789\",\n    \"computer_name\": \"office-mac\",\n    \"platform\": \"darwin\",\n    \"platform_release\": \"14.5.0\",\n    \"python\": \"3.12.4\"\n  }'\n```\n\nAntwort: `{ \"computer_id\": \"comp_001\", \"computer_token\": \"ct_...\" }`\n\n> [!CRITICAL]\n> Speichere den `computer_token` — er wird nur einmal angezeigt und wird für\n> alle agentseitigen Endpunkte benötigt.\n\n### GET /computers/me/poll\n\nLong-Poll für neue Commands. Der Agent ruft dies in einer Schleife auf.\n\n```bash\ncurl -H \"Authorization: Bearer ct_YOUR_COMPUTER_TOKEN\" \\\n     \"https://synapse.schaefer.zone/computers/me/poll?wait=30\"\n```\n\nKehrt sofort zurück, wenn Commands ausstehen, sonst nach `wait` Sekunden.\n\n### POST /computers/me/commands/:cid/result\n\nDas Ergebnis der Ausführung eines Commands posten.\n\n```bash\ncurl -X POST https://synapse.schaefer.zone/computers/me/commands/cmd_001/result \\\n  -H \"Authorization: Bearer ct_YOUR_COMPUTER_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"status\": \"done\",\n    \"result\": { \"screenshot_b64\": \"iVBORw0KG...\" }\n  }'\n```\n\n## Command-Typen\n\n| Typ | Payload | Beschreibung |\n|------|---------|--------------|\n| `screenshot` | `{}` | Bildschirm als PNG aufnehmen (base64) |\n| `click` | `{x, y}` | An Koordinaten klicken |\n| `move` | `{x, y}` | Maus zu Koordinaten bewegen |\n| `type` | `{text}` | Text am Cursor tippen |\n| `key` | `{keys: [\"Ctrl\",\"c\"]}` | Tastenkombination drücken |\n| `scroll` | `{deltaX, deltaY}` | Scrollrad |\n| `drag` | `{fromX, fromY, toX, toY}` | Drag-and-Drop |\n\n## Typisches Pattern: LLM-gesteuerte GUI-Automatisierung\n\n```python\n# LLM agent workflow\n1. List computers: GET /computers/list\n2. Take screenshot: GET /computers/:id/screenshot\n3. Analyze screenshot (vision model)\n4. Queue click: POST /computers/:id/commands {type:\"click\", payload:{x,y}}\n5. Wait for result: GET /computers/:id/commands/:cid\n6. Take new screenshot to verify\n7. Repeat until task done\n```\n\n## Nächste Schritte\n\n- [Browser-Proxy](/docs/api/browser) — separater Dienst für Browser-Automatisierung\n- [Self-Hosted-Agents-Guide](/docs/guides/self-hosted-agents)\n","content_html":"<h1>Computer-Control-API</h1>\n<p>Die Computer-Control-API ermöglicht die Fernsteuerung registrierter Rechner. Ein\nkleiner Agent (<code>screen-remote-agent</code>) läuft auf der Zielmaschine, fragt Commands\nab, führt sie aus und postet Ergebnisse zurück. Das ermöglicht LLM-gesteuerte\nGUI-Automatisierung.</p>\n<h2>Architektur</h2>\n<pre><code class=\"hljs language-plaintext\">┌─────────────┐  queue cmd   ┌──────────┐  poll   ┌─────────────────┐\n│ LLM Agent   │ ───────────▶ │ Synapse  │ ◀───── │ screen-remote   │\n│ (user-side) │              │  Server  │ ──────▶│ (on target PC)  │\n└─────────────┘              └──────────┘ result  └─────────────────┘\n                                     ▲\n                                     │\n                              ┌─────────────┐\n                              │  Human UI   │\n                              │ (browser)   │\n                              └─────────────┘</code></pre><h2>Nutzerseitige Endpunkte (Mind Key oder JWT)</h2>\n<h3>GET /computers/list</h3>\n<p>Alle registrierten Rechner auflisten.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/list</code></pre><h3>GET /computers/:id</h3>\n<p>Details eines einzelnen Rechners abrufen.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/comp_001</code></pre><h3>POST /computers/install-code</h3>\n<p>Installationscode zur Registrierung eines neuen Rechners generieren.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/computers/install-code \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{&quot;computer_name&quot;: &quot;office-mac&quot;}&#x27;</span></code></pre><p>Antwort: <code>{ &quot;install_code&quot;: &quot;ic_xyz789&quot;, &quot;expires_at&quot;: &quot;...&quot; }</code></p>\n<h3>POST /computers/:id/commands</h3>\n<p>Ein Command für den Remote-Agent in die Warteschlange stellen.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/computers/comp_001/commands \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;type&quot;: &quot;screenshot&quot;,\n    &quot;payload&quot;: {}\n  }&#x27;</span></code></pre><p>Antwort: <code>{ &quot;command_id&quot;: &quot;cmd_001&quot;, &quot;status&quot;: &quot;queued&quot; }</code></p>\n<h3>GET /computers/:id/command (via Query)</h3>\n<p>Ein Command via GET einreihen (für einfache Fälle).</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/computers/comp_001/command?type=screenshot&quot;</span></code></pre><h3>GET /computers/:id/commands</h3>\n<p>Letzte Commands für einen Rechner auflisten.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/computers/comp_001/commands?limit=50&quot;</span></code></pre><h3>GET /computers/:id/commands/:cid</h3>\n<p>Status + Ergebnis eines bestimmten Commands abrufen.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/comp_001/commands/cmd_001</code></pre><h3>GET /computers/:id/screenshot</h3>\n<p>One-Shot: ein Screenshot-Command einreihen und bis zu 30s auf das Ergebnis warten.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/comp_001/screenshot &gt; screenshot.png</code></pre><h3>POST /computers/:id/disable</h3>\n<p>Einen Rechner deaktivieren (widerruft seinen Token, behält den Eintrag fürs Audit).</p>\n<pre><code class=\"hljs language-bash\">curl -X POST -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/comp_001/disable</code></pre><h3>DELETE /computers/:id</h3>\n<p>Einen Rechner dauerhaft löschen.</p>\n<pre><code class=\"hljs language-bash\">curl -X DELETE -H <span class=\"hljs-string\">&quot;Authorization: Bearer YOUR_MIND_KEY&quot;</span> \\\n     https://synapse.schaefer.zone/computers/comp_001</code></pre><h2>Agentseitige Endpunkte (Computer-Token)</h2>\n<p>Diese Endpunkte werden vom <code>screen-remote-agent</code> auf der Zielmaschine verwendet.\nSie verwenden einen Computer-Token (von <code>/computers/register</code> zurückgegeben),\nkeinen Mind Key.</p>\n<h3>POST /computers/register</h3>\n<p>Installationscode einlösen und einen Computer-Token erhalten.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/computers/register \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;code&quot;: &quot;ic_xyz789&quot;,\n    &quot;computer_name&quot;: &quot;office-mac&quot;,\n    &quot;platform&quot;: &quot;darwin&quot;,\n    &quot;platform_release&quot;: &quot;14.5.0&quot;,\n    &quot;python&quot;: &quot;3.12.4&quot;\n  }&#x27;</span></code></pre><p>Antwort: <code>{ &quot;computer_id&quot;: &quot;comp_001&quot;, &quot;computer_token&quot;: &quot;ct_...&quot; }</code></p>\n<div class=\"callout callout-critical\">Speichere den `computer_token` — er wird nur einmal angezeigt und wird für\nalle agentseitigen Endpunkte benötigt.</div><h3>GET /computers/me/poll</h3>\n<p>Long-Poll für neue Commands. Der Agent ruft dies in einer Schleife auf.</p>\n<pre><code class=\"hljs language-bash\">curl -H <span class=\"hljs-string\">&quot;Authorization: Bearer ct_YOUR_COMPUTER_TOKEN&quot;</span> \\\n     <span class=\"hljs-string\">&quot;https://synapse.schaefer.zone/computers/me/poll?wait=30&quot;</span></code></pre><p>Kehrt sofort zurück, wenn Commands ausstehen, sonst nach <code>wait</code> Sekunden.</p>\n<h3>POST /computers/me/commands/:cid/result</h3>\n<p>Das Ergebnis der Ausführung eines Commands posten.</p>\n<pre><code class=\"hljs language-bash\">curl -X POST https://synapse.schaefer.zone/computers/me/commands/cmd_001/result \\\n  -H <span class=\"hljs-string\">&quot;Authorization: Bearer ct_YOUR_COMPUTER_TOKEN&quot;</span> \\\n  -H <span class=\"hljs-string\">&quot;Content-Type: application/json&quot;</span> \\\n  -d <span class=\"hljs-string\">&#x27;{\n    &quot;status&quot;: &quot;done&quot;,\n    &quot;result&quot;: { &quot;screenshot_b64&quot;: &quot;iVBORw0KG...&quot; }\n  }&#x27;</span></code></pre><h2>Command-Typen</h2>\n<table>\n<thead>\n<tr>\n<th>Typ</th>\n<th>Payload</th>\n<th>Beschreibung</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>screenshot</code></td>\n<td><code>{}</code></td>\n<td>Bildschirm als PNG aufnehmen (base64)</td>\n</tr>\n<tr>\n<td><code>click</code></td>\n<td><code>{x, y}</code></td>\n<td>An Koordinaten klicken</td>\n</tr>\n<tr>\n<td><code>move</code></td>\n<td><code>{x, y}</code></td>\n<td>Maus zu Koordinaten bewegen</td>\n</tr>\n<tr>\n<td><code>type</code></td>\n<td><code>{text}</code></td>\n<td>Text am Cursor tippen</td>\n</tr>\n<tr>\n<td><code>key</code></td>\n<td><code>{keys: [&quot;Ctrl&quot;,&quot;c&quot;]}</code></td>\n<td>Tastenkombination drücken</td>\n</tr>\n<tr>\n<td><code>scroll</code></td>\n<td><code>{deltaX, deltaY}</code></td>\n<td>Scrollrad</td>\n</tr>\n<tr>\n<td><code>drag</code></td>\n<td><code>{fromX, fromY, toX, toY}</code></td>\n<td>Drag-and-Drop</td>\n</tr>\n</tbody></table>\n<h2>Typisches Pattern: LLM-gesteuerte GUI-Automatisierung</h2>\n<pre><code class=\"hljs language-python\"><span class=\"hljs-comment\"># LLM agent workflow</span>\n<span class=\"hljs-number\">1.</span> <span class=\"hljs-type\">List</span> computers: GET /computers/<span class=\"hljs-built_in\">list</span>\n<span class=\"hljs-number\">2.</span> Take screenshot: GET /computers/:<span class=\"hljs-built_in\">id</span>/screenshot\n<span class=\"hljs-number\">3.</span> Analyze screenshot (vision model)\n<span class=\"hljs-number\">4.</span> Queue click: POST /computers/:<span class=\"hljs-built_in\">id</span>/commands {<span class=\"hljs-built_in\">type</span>:<span class=\"hljs-string\">&quot;click&quot;</span>, payload:{x,y}}\n<span class=\"hljs-number\">5.</span> Wait <span class=\"hljs-keyword\">for</span> result: GET /computers/:<span class=\"hljs-built_in\">id</span>/commands/:cid\n<span class=\"hljs-number\">6.</span> Take new screenshot to verify\n<span class=\"hljs-number\">7.</span> Repeat until task done</code></pre><h2>Nächste Schritte</h2>\n<ul>\n<li><a href=\"/docs/api/browser\">Browser-Proxy</a> — separater Dienst für Browser-Automatisierung</li>\n<li><a href=\"/docs/guides/self-hosted-agents\">Self-Hosted-Agents-Guide</a></li>\n</ul>\n","urls":{"html":"/docs/api/computers","text":"/docs/api/computers?format=text","json":"/docs/api/computers?format=json","llm":"/docs/api/computers?format=llm"},"translations_available":["en","zh","hi","es","fr","ar","pt","ru","ja","de","it","ko","nl","pl","tr","sv","vi","th","id","uk"]}