B2B Risk Management API

Programmatic access to the Alpha Draconis risk management infrastructure

B2B Risk Management API

The B2B API provides programmatic access to risk management commands, enabling institutional clients to integrate Alpha Draconis into their existing infrastructure.

Authentication

All requests require an API key sent via the X-API-Key header.

curl -X POST https://alphadraconis.io/api/v1/b2b/risk/kill \
  -H "X-API-Key: ad_b2b_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"account_id": "uuid", "action": "CLOSE_ALL"}'

API Key Management

Generate and manage API keys from the Dashboard API Keys page.

  • Maximum 5 active keys per account
  • Keys are shown only once at creation
  • Rate limit: 100 requests per minute per key

Endpoints

POST /api/v1/b2b/risk/kill

Execute risk management commands on monitored accounts.

Request Body:

| Field | Type | Required | Description | |-------|------|----------|-------------| | account_id | string (UUID) | Yes | Monitor ID from your dashboard | | action | string | Yes | One of: CLOSE_ALL, FLATTEN, LOCK |

Actions:

| Action | Description | |--------|-------------| | CLOSE_ALL | Close all open positions immediately | | FLATTEN | Flatten portfolio to base currency | | LOCK | Lock the engine, preventing new trades |

Response:

{
  "success": true,
  "command_id": "uuid",
  "action": "CLOSE_ALL",
  "account_id": "uuid",
  "estimated_execution": "500ms",
  "latency_ms": 45
}

Error Codes:

| Code | Status | Description | |------|--------|-------------| | UNAUTHORIZED | 401 | Missing X-API-Key header | | INVALID_KEY | 401 | API key not found | | KEY_REVOKED | 403 | API key has been revoked | | FORBIDDEN | 403 | Insufficient permissions | | RATE_LIMITED | 429 | Rate limit exceeded | | BAD_REQUEST | 400 | Invalid request body | | NOT_FOUND | 404 | Account not found or not owned |

Prerequisites

Technology Stack

Built on Supabase and Next.js. The API communicates with your Sovereign Node infrastructure powered by Python and CCXT.