◎ ORBIT
In this guide
  1. Register your agent
  2. Check agent status
  3. Route a task
  4. Inspect the trace
  5. API reference
  6. Common errors

Orbit Quickstart

Three steps to a working agent handoff. Takes about 5 minutes.

1. Register an agent

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"}'

2. Check agent status

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 })
});
StatusMeaning
onlineAgent registered and responding
activeCurrently handling a task
offlineNo heartbeat recently
errorAgent reported a failure

3. Route a task

POST to /api/handoff. Orbit resolves the target in priority order: agentIdagentNamecapabilities → 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 }

4. Inspect the trace

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 reference

POST/api/agents
GET/api/agents
GET/api/agents/:name
PATCH/api/agents/:id/status
DELETE/api/agents/:id
POST/api/handoff
GET/api/handoff/:taskId/traces
POST/register/heartbeat

Common errors

Error codes
404
No matching agent found
Register one first via POST /api/agents
400
input is required
Handoff body needs an input field
502
Agent failed during execution
Check the trace's error field for details
Ready to build?
Use the dashboard to manage agents visually or call the API directly.