Three steps to a working agent handoff. Takes about 5 minutes.
POST to /api/agents with a name, type, and capabilities list.
// Register an agent const res = await fetch('https://orbit-1983.polsia.app/api/agents', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'research-agent', type: 'research', capabilities: ['web-search', 'summarize'], status: 'online' }) }); const agent = await res.json(); // → { id: 1, name: "research-agent", status: "online", ... }
Or with curl:
curl -X POST https://orbit-1983.polsia.app/api/agents -H "Content-Type: application/json" -d '{"name":"research-agent","type":"research","capabilities":["web-search","summarize"],"status":"online"}'
Agents report liveness via POST /register/heartbeat. Query the agent list to confirm registration and current status.
// List all registered agents const { agents } = await ( await fetch('https://orbit-1983.polsia.app/api/agents') ).json(); // Get a specific agent by name const agent = await ( await fetch('https://orbit-1983.polsia.app/api/agents/research-agent') ).json(); // Agent-side heartbeat (call periodically to stay "online") await fetch('https://orbit-1983.polsia.app/register/heartbeat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ id: agent.id }) });
| Status | Meaning |
|---|---|
| online | Agent registered and responding |
| active | Currently handling a task |
| offline | No heartbeat recently |
| error | Agent reported a failure |
POST to /api/handoff. Orbit resolves the target in priority order: agentId → agentName → capabilities → first active agent.
// Route by agent name const { taskId, agentId, output, durationMs } = await ( await fetch('https://orbit-1983.polsia.app/api/handoff', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ agentName: 'research-agent', input: { query: 'What is Orbit?' } }) }) ).json(); // Route by capability (auto-match first active agent with that capability) // POST /api/handoff body: // { capabilities: ['web-search'], input: { query: '...' } } // Simulate a route — validates match without executing // { agentName: 'research-agent', simulate: true }
Every handoff creates an in (task arrived) and out (task completed) trace. Pull the full sequence by taskId.
const { traces } = await ( await fetch( `https://orbit-1983.polsia.app/api/handoff/${taskId}/traces` ) ).json(); // → [ // { direction: "in", status: "running", input: {...}, created_at: "..." }, // { direction: "out", status: "success", output: {...}, durationMs: 4, created_at: "..." } // ]
If something fails, an error trace replaces the out trace with direction: "error".
/api/agents/api/agents/api/agents/:name/api/agents/:id/status/api/agents/:id/api/handoff/api/handoff/:taskId/traces/register/heartbeatPOST /api/agentsinput fielderror field for details