Quick Start

Get your agent sending events to VIGIL in under 2 minutes. No SDK required — just one HTTP call.

1
Create an account
Go to vigil.costrinity.xyz/dashboard and register with your email.
2
Create an agent
Click "New Agent", give it a name, and copy your API key.
3
Send your first event
Make a POST request from your agent:
bash
curl -X POST https://vigil.costrinity.xyz/api/ingest \
  -H "Authorization: Bearer vigil_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "hello-world", "data": {"message": "VIGIL connected!"}}'
✓ That's it. Open your dashboard and you'll see the event appear in real-time.

REST API

The VIGIL API is a simple REST API. Every endpoint accepts JSON and returns JSON.

POST /api/ingest

Log a single event from your agent. Core endpoint — call this every time your agent does something.

Headers

HeaderValue
AuthorizationBearer vigil_YOUR_KEY
Content-Typeapplication/json
javascript
await fetch('https://vigil.costrinity.xyz/api/ingest', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer vigil_YOUR_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'buy',
    data: { token: 'SOL', amount: 0.5, reason: 'momentum signal' },
    cost_sol: 0.001,
    status: 'success'
  })
})

Response

json
{
  "ok": true,
  "event_id": "550e8400-e29b-41d4-a716-446655440000",
  "storage_mode": "cloud"
}

🔒 Storage Mode

Every event request accepts a storage_mode field. When set to "local", VIGIL validates your API key and enforces rate limits, but never writes to our database. Events are returned to the client and stored in your browser's IndexedDB. Nothing persists on COSTRINITY servers.

☁️ Cloud (default)
Events stored in your isolated VIGIL account. Accessible from any device. 7–90 day history depending on plan.
💾 Local
Events stored in your browser's IndexedDB only. Zero server persistence. Data never leaves your machine.
javascript
// Cloud mode — stored in your VIGIL account
body: JSON.stringify({ action: 'buy', storage_mode: 'cloud' })

// Local mode — VIGIL never touches our DB
body: JSON.stringify({ action: 'buy', storage_mode: 'local' })
// → Server returns enriched event with ID + compliance tags
// → Your dashboard stores it in IndexedDB automatically

POST /api/ingest (batch)

Log multiple events in a single call. Up to 100 events per request.

javascript
await fetch('https://vigil.costrinity.xyz/api/ingest', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer vigil_YOUR_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    events: [
      { action: 'scan', data: { tokens: 847 } },
      { action: 'filter', data: { passed: 12 } },
      { action: 'buy', data: { token: 'BONK' }, cost_sol: 0.1 }
    ]
  })
})

TypeScript SDK

Optional typed wrapper around the REST API. Adds retry logic, batching, and type safety.

bash
npm install @costrinity/vigil
typescript
import { Vigil } from '@costrinity/vigil'

const vigil = new Vigil({
  apiKey: process.env.VIGIL_API_KEY!,
  // Optional: set a default agent name
  // agent: 'my-trading-bot',
})

// Single event
await vigil.log({
  action: 'buy',
  data: { token: 'SOL', amount: 0.5 },
  cost_sol: 0.001,
  status: 'success',
})

// Log an error
await vigil.log({
  action: 'error',
  data: { message: 'Slippage too high', code: 'ERR_SLIPPAGE' },
  status: 'error',
})

// Batch log — efficient for high-frequency agents
await vigil.logBatch([
  { action: 'scan',   data: { tokens: 847 } },
  { action: 'filter', data: { passed: 12 } },
  { action: 'buy',    data: { token: 'BONK' }, cost_sol: 0.1 },
])

// Transfer event with built-in SOL tracking
await vigil.transfer({
  from: '7xKp...1aB2',
  to:   '9mRn...3nR2',
  amount_sol: 1.2,
  memo: 'profit withdrawal',
})

ElizaOS Plugin

Zero-config plugin for ElizaOS agents. Automatically logs every action your agent takes.

bash
npm install @costrinity/vigil-eliza-plugin
typescript
import vigilPlugin from '@costrinity/vigil-eliza-plugin';

export const character = {
  name: 'TradingBot',
  plugins: [
    vigilPlugin({
      apiKey: process.env.VIGIL_API_KEY,
      // Optional: custom agent name (defaults to character.name)
      agentName: 'my-elizaos-bot',
    }),
  ],
  // All agent actions are automatically captured:
  // - Tool calls and responses
  // - Decision reasoning
  // - Memory reads/writes
  // - Errors and retries
};
💡 The ElizaOS plugin hooks into the agent runtime automatically. You don't need to add any vigil.log() calls manually.

Event Schema

Full schema of all fields accepted by the ingest endpoint.

FieldTypeDescription
action*stringWhat the agent did. Free-form string: 'buy', 'error', 'decision', 'transfer', etc.
dataobjectAny additional context. JSON object, up to 64KB. Fully searchable in dashboard.
cost_solnumberSOL spent on this action (for P&L tracking). Supports up to 9 decimal places.
statusstring'success' | 'error' | 'info' | 'warning'. Defaults to 'info'.
iduuidAuto-generated UUID for the event. Returned in response.
agent_iduuidResolved from your API key. You don't need to pass this.
timestamptimestamptzAuto-set to current UTC time. Cannot be overridden.

Alerts

Smart alerts watch your agents for you. Configure them from the dashboard — no code needed.

Silence DetectionMost Popular

Trigger when an agent hasn't sent an event in N minutes. Catches stuck, crashed, or looping agents.

Error Rate

Alert when error events exceed X% of total events in a rolling window.

SOL Spend ThresholdCritical

Alert when cost_sol total exceeds your limit in 1 hour. Protects against runaway spending.

Custom Action Match

Alert when a specific action appears — e.g. fire immediately if action === 'emergency-stop'.

Delivery channels

  • Email (all plans)
  • Webhook POST (Pro+)
  • Slack webhook (Team+)

Webhooks

VIGIL can POST to your endpoint when an alert fires. Available on Pro and above.

json
// Example webhook payload
{
  "event": "alert.fired",
  "alert_type": "silence",
  "agent_id": "agt_abc123",
  "agent_name": "sniper-v5",
  "message": "Agent has been silent for 10 minutes",
  "fired_at": "2026-03-24T18:00:00Z",
  "dashboard_url": "https://vigil.costrinity.xyz/dashboard/agt_abc123"
}

Webhook requests include a X-VIGIL-Signature header (HMAC-SHA256) so you can verify authenticity. Configure your endpoint URL in the Dashboard → Alerts → Settings.

Rate Limits

Rate limits are per API key. Exceeded requests return 429.

PlanRate LimitEvents / MonthHistory
Free100 req/min10k/month7 days
Pro1,000 req/min1M/month90 days
Team5,000 req/min5M/month1 year
EnterpriseUnlimitedUnlimitedCustom
💡 Batch requests via the events[] array count as 1 request regardless of event count. Use batching to maximize throughput on high-frequency agents.