Integration Guide

Wire any AI agent into
Agent OS in 5 minutes

Copy-paste code for Node.js, Python, and curl. No SDK required — just REST and a JSONL append.

⏱ ~5 minutes end-to-end 🔌 REST API + file append 🌐 Works with any language or framework Platform live
Loading...
Active agents:
Events today:
Total events:
Before you begin
Agent OS URL
vantageaiadvisory.com/agent-auth-api
Authentication
JWT or API Key (Bearer token)
Required
Agent OS account → Sign in →
API Key path
Platform → API Keys → Create new
The 5 steps
1
Get your API key
Create a write-scoped API key from the Agent OS dashboard. This is the only credential your agent needs. Keys are SHA-256 hashed on the server and never stored in plain text.
curl
# Create an API key (requires JWT from browser session)
curl -X POST "https://vantageaiadvisory.com/agent-auth-api/keys" \
  -H "Authorization: Bearer <YOUR_JWT>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-agent-key",
    "scope": "write"
  }'

# Returns: { "key": "sk-aos-abc123...", "id": 1, "name": "my-agent-key" }
# Save this key — it is shown ONCE
Node.js
// Create an API key via the REST API
const res = await fetch('https://vantageaiadvisory.com/agent-auth-api/keys', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.AGENT_OS_JWT}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'my-agent-key', scope: 'write' }),
});
const { key } = await res.json();
console.log('🔑 Save this key:', key);
// → "sk-aos-abc123..." — shown once, store in env var
Python
import requests

res = requests.post(
    'https://vantageaiadvisory.com/agent-auth-api/keys',
    headers={
        'Authorization': f'Bearer {jwt_token}',
        'Content-Type': 'application/json',
    },
    json={'name': 'my-agent-key', 'scope': 'write'},
)
key = res.json()['key']
print(f'Save this key: {key}')
# → "sk-aos-abc123..." — shown once, store in environment
💡
Easier path: Create API keys directly in the platform UI at Agent OS → API Keys. Paste the generated sk-aos-... key into your agent's environment as AGENT_OS_KEY.
2
Register your agent
Tell Agent OS your agent exists. Registration takes an agent ID (lowercase, no spaces), a human-readable label, and an optional role description. Once registered, your agent appears on the Presence page and in all analytics.
curl
curl -X POST "https://vantageaiadvisory.com/agent-auth-api/agents/register" \
  -H "Authorization: Bearer sk-aos-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "my-agent",
    "label": "My Agent",
    "role": "Automated research and analysis"
  }'

# → { "ok": true, "agent_id": "my-agent" }
Node.js
const AGENT_OS = 'https://vantageaiadvisory.com/agent-auth-api';
const KEY     = process.env.AGENT_OS_KEY;

async function register(agentId, label, role) {
  const res = await fetch(`${AGENT_OS}/agents/register`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${KEY}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_id: agentId, label, role }),
  });
  return res.json(); // { ok: true, agent_id: "my-agent" }
}

await register('my-agent', 'My Agent', 'Automated research and analysis');
Python
import os, requests

AGENT_OS = 'https://vantageaiadvisory.com/agent-auth-api'
KEY      = os.environ['AGENT_OS_KEY']
HEADERS  = {'Authorization': f'Bearer {KEY}', 'Content-Type': 'application/json'}

res = requests.post(
    f'{AGENT_OS}/agents/register',
    headers=HEADERS,
    json={
        'agent_id': 'my-agent',
        'label':    'My Agent',
        'role':     'Automated research and analysis',
    },
)
print(res.json())  # {'ok': True, 'agent_id': 'my-agent'}
Response
{ "ok": true, "agent_id": "my-agent" }
ℹ️
Agent IDs must be lowercase letters, numbers, hyphens, and underscores only. Registration is idempotent — calling it twice with the same ID is safe.
3
Emit conscience events
Add event emission to your agent's main loop. A CONSCIENCE_EVENT is the heartbeat of your agent — it tells Agent OS what your agent is currently doing, its state, and which task it's working on. Emit one at the start of each iteration.
CONSCIENCE_EVENT DEBRIEF_EVENT
curl
# Emit a conscience event (heartbeat)
curl -X POST "https://vantageaiadvisory.com/agent-auth-api/agents/ping" \
  -H "Authorization: Bearer sk-aos-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "my-agent",
    "event_type": "CONSCIENCE_EVENT",
    "payload": {
      "text": "Analysing Q2 pipeline data — 42 records processed",
      "state": "working",
      "task_id": "pipeline-analysis"
    }
  }'

# Emit a debrief when a task completes
curl -X POST "https://vantageaiadvisory.com/agent-auth-api/agents/ping" \
  -H "Authorization: Bearer sk-aos-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "my-agent",
    "event_type": "DEBRIEF_EVENT",
    "payload": {
      "outcome": "completed",
      "summary": "Pipeline analysis complete — 3 anomalies flagged",
      "task_id": "pipeline-analysis"
    }
  }'
Node.js
const AGENT_OS = 'https://vantageaiadvisory.com/agent-auth-api';
const KEY      = process.env.AGENT_OS_KEY;
const AGENT_ID = 'my-agent';

async function emit(type, payload) {
  await fetch(`${AGENT_OS}/agents/ping`, {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${KEY}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ agent_id: AGENT_ID, event_type: type, payload }),
  });
}

// In your agent loop:
while (running) {
  await emit('CONSCIENCE_EVENT', {
    text:    `Analysing record ${i} of ${total}`,
    state:   'working',
    task_id: 'pipeline-analysis',
  });

  // ... do work ...
}

// Signal completion:
await emit('DEBRIEF_EVENT', {
  outcome: 'completed',
  summary: 'Pipeline analysis complete — 3 anomalies flagged',
  task_id: 'pipeline-analysis',
});
Python
import os, requests

AGENT_OS = 'https://vantageaiadvisory.com/agent-auth-api'
KEY      = os.environ['AGENT_OS_KEY']
AGENT_ID = 'my-agent'

def emit(event_type, payload):
    requests.post(
        f'{AGENT_OS}/agents/ping',
        headers={'Authorization': f'Bearer {KEY}', 'Content-Type': 'application/json'},
        json={'agent_id': AGENT_ID, 'event_type': event_type, 'payload': payload},
    )

# In your agent loop:
for i, record in enumerate(records):
    emit('CONSCIENCE_EVENT', {
        'text':    f'Analysing record {i+1} of {len(records)}',
        'state':   'working',
        'task_id': 'pipeline-analysis',
    })
    # ... process record ...

# Signal completion:
emit('DEBRIEF_EVENT', {
    'outcome': 'completed',
    'summary': 'Pipeline analysis complete — 3 anomalies flagged',
    'task_id': 'pipeline-analysis',
})
💡
State values: Use thinking, working, waiting, or done in the state field. These map to the coloured pulse indicator on the Presence page.
4
Wire interrupts for human decisions
When your agent hits a decision it shouldn't make alone — a risky action, a fork in strategy, a high-stakes API call — fire an INTERRUPT_EVENT. Agent OS presents the question on the Presence page. Your agent polls until a human resolves it, then reads the selected option from the OVERRIDE_EVENT.
INTERRUPT_EVENT OVERRIDE_EVENT
curl
# Step 1: Fire the interrupt
curl -X POST "https://vantageaiadvisory.com/agent-auth-api/agents/ping" \
  -H "Authorization: Bearer sk-aos-your-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "my-agent",
    "event_type": "INTERRUPT_EVENT",
    "payload": {
      "question": "Pipeline found 42 anomalies. How should I proceed?",
      "options": ["Send alert only", "Quarantine and notify", "Abort pipeline"],
      "urgency": "high",
      "task_id": "pipeline-analysis"
    }
  }'

# Step 2: Poll for the OVERRIDE_EVENT (every 10s)
curl "https://vantageaiadvisory.com/agent-auth-api/agents/decisions" \
  -H "Authorization: Bearer sk-aos-your-key-here"
Node.js
/**
 * Fire an interrupt and wait for human resolution.
 * Returns the selected option string, or null on timeout.
 */
async function interrupt(question, options, urgency = 'medium') {
  // Fire the interrupt event
  const fireRes = await emit('INTERRUPT_EVENT', {
    question, options, urgency, task_id: 'pipeline-analysis',
  });
  const { event_id } = await fireRes.json();

  // Poll for the override (10 min timeout)
  const deadline = Date.now() + 10 * 60_000;
  while (Date.now() < deadline) {
    await new Promise(r => setTimeout(r, 10_000)); // wait 10s
    const decisions = await (await fetch(`${AGENT_OS}/agents/decisions`, {
      headers: { 'Authorization': `Bearer ${KEY}` },
    })).json();

    const resolved = decisions.find(
      d => d.interrupt_event_id === event_id && d.selected_option
    );
    if (resolved) return resolved.selected_option;
  }
  return null; // timed out — proceed with default
}

// Usage:
const decision = await interrupt(
  'Pipeline found 42 anomalies. How should I proceed?',
  ['Send alert only', 'Quarantine and notify', 'Abort pipeline'],
  'high'
);
console.log('Human chose:', decision); // "Quarantine and notify"
Python
import time

def interrupt(question, options, urgency='medium'):
    """Fire interrupt and block until a human resolves it (10 min timeout)."""
    # Fire the interrupt
    res = requests.post(
        f'{AGENT_OS}/agents/ping',
        headers=HEADERS,
        json={'agent_id': AGENT_ID, 'event_type': 'INTERRUPT_EVENT',
              'payload': {'question': question, 'options': options,
                          'urgency': urgency, 'task_id': 'pipeline-analysis'}},
    )
    event_id = res.json().get('event_id')

    # Poll for resolution
    deadline = time.time() + 600
    while time.time() < deadline:
        time.sleep(10)
        decisions = requests.get(
            f'{AGENT_OS}/agents/decisions', headers=HEADERS
        ).json()
        for d in decisions:
            if d.get('interrupt_event_id') == event_id and d.get('selected_option'):
                return d['selected_option']
    return None  # timed out

# Usage:
decision = interrupt(
    'Pipeline found 42 anomalies. How should I proceed?',
    ['Send alert only', 'Quarantine and notify', 'Abort pipeline'],
    'high',
)
print(f'Human chose: {decision}')  # Quarantine and notify
Share with clients, no login needed: In the Agent OS Presence page, each pending interrupt has a "↗ Share with client" button that generates a one-time URL. Your client taps a link, selects an option, and the OVERRIDE_EVENT is written — no account needed.
5
Verify on the Presence page
Open the Agent OS Presence page and confirm your agent appears with a live teal pulse. You can also ping the status API to confirm programmatically before going to production.
curl
# Check your agent appears in the live fleet
curl "https://vantageaiadvisory.com/agent-auth-api/agents/status" \
  -H "Authorization: Bearer sk-aos-your-key-here" \
  | python3 -m json.tool | grep -A5 "my-agent"

# Expected output:
# "agent_id": "my-agent"
# "label": "My Agent"
# "online": true
# "last_seen": "2026-05-07T08:42:15Z"
# "last_text": "Analysing Q2 pipeline data..."
Node.js
// Verify your agent is live before starting production work
async function verify(agentId) {
  const agents = await (await fetch(`${AGENT_OS}/agents/status`, {
    headers: { 'Authorization': `Bearer ${KEY}` },
  })).json();

  const me = agents.find(a => a.agent_id === agentId);
  if (!me) throw new Error(`Agent "${agentId}" not found — did you register?`);
  if (!me.online) console.warn('⚠ Agent registered but not yet seen as online');

  console.log(`✓ ${me.label} is ${me.online ? '🟢 online' : '⚪ offline'}`);
  console.log(`  Last seen: ${me.last_seen}`);
  console.log(`  Last text: ${me.last_text}`);
  return me;
}

await verify('my-agent');
// ✓ My Agent is 🟢 online
//   Last seen: 2026-05-07T08:42:15Z
//   Last text: Analysing Q2 pipeline data — 42 records processed
Python
def verify(agent_id):
    agents = requests.get(
        f'{AGENT_OS}/agents/status', headers=HEADERS
    ).json()
    me = next((a for a in agents if a['agent_id'] == agent_id), None)

    if not me:
        raise ValueError(f'Agent "{agent_id}" not found — did you register?')

    status = 'online' if me['online'] else 'offline'
    print(f'✓ {me["label"]} is {status}')
    print(f'  Last seen: {me["last_seen"]}')
    print(f'  Last text: {me["last_text"]}')
    return me

verify('my-agent')
# ✓ My Agent is online
#   Last seen: 2026-05-07T08:42:15Z
#   Last text: Analysing Q2 pipeline data — 42 records processed
🎯
You're done. Once your agent appears on the Presence page with a teal pulse, it is fully wired into Agent OS. Its history, decisions, SLA scores, and knowledge contributions will accumulate automatically — no further configuration needed. Open the Onboarding Wizard for a guided 4-step walkthrough with live confirmation at each stage.

What happens next

Once wired in, your agent starts accumulating intelligence automatically — no extra setup needed.