Skip to main content
BondApexBondApex
Developer Documentation & APIs

BondApex Platform API & SDK Reference

Official technical specifications, cryptographic protocol APIs, real-time WebRTC signaling schemas, Diamond micro-ledger endpoints, and BondApex AI SDK guides.

$npm install @bond-app/core @bond-app/ai-sdk @bond-app/crypto
Node.js 18+ • Python 3.10+ • Rust/C FFI available
Security & Access

Authentication & API Keys

All BondApex REST, WebSocket, and WebRTC signaling gateways require RFC 6750 Bearer JWT authorization or high-entropy scoped server API keys.

GET/api/v1/auth/verify
import { BondApexClient } from '@bond-app/core';

// Initialize SDK client with scoped credentials
const client = new BondApexClient({
  apiKey: process.env.BONDAPEX_SERVER_API_KEY,
  environment: 'production', // 'production' | 'sandbox'
  timeoutMs: 8000,
});

const session = await client.auth.verifyKey();
console.log('Key verified for organization:', session.orgId);

Request Parameters & Headers

ParameterTypeRequiredBuilt for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization.
Authorizationstring (header)RequiredBearer token in format: Bearer <API_KEY_OR_JWT>
X-BondApex-Versionstring (header)OptionalAPI target version header (e.g. 2026-09-01)

Sample JSON Response

{
  "status": "success",
  "data": {
    "orgId": "org_9823410",
    "scopes": ["messages:read", "messages:write", "diamonds:transfer", "webrtc:admin"],
    "rateLimit": {
      "limit": 5000,
      "remaining": 4998,
      "resetAt": "2026-09-20T12:00:00Z"
    }
  }
}
Cryptography

End-to-End Encrypted Messaging (MLS & Signal Ratchet)

Publish ephemeral prekey bundles and dispatch cryptographically sealed payloads. All ciphertexts are end-to-end encrypted with zero server-side key escrow.

POST/api/v1/messages/e2ee/dispatch
import { E2EESession, generateIdentityKeyPair } from '@bond-app/crypto';

// Initialize local cryptographic identities
const identity = await generateIdentityKeyPair();

// Establish encrypted session from verified recipient prekey bundle
const session = await E2EESession.initiate({
  senderIdentity: identity,
  recipientPreKeyBundle: recipientBundle,
  postQuantumKem: 'Kyber768',
});

// Encrypt payload before dispatching through the relay
const ciphertext = await session.encrypt(
  JSON.stringify({ text: 'Confidential institutional order #8849' })
);

const result = await client.messages.dispatchE2EE({
  recipientId: 'usr_7729104',
  ciphertext: ciphertext.payload,
  ephemeralKey: ciphertext.ephemeralKey,
  ratchetHeader: ciphertext.header,
});

Request Parameters & Headers

ParameterTypeRequiredBuilt for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization.
recipientIdstringRequiredTarget user ID receiving the encrypted payload.
ciphertextstring (Base64)RequiredAES-256-GCM or ChaCha20-Poly1305 encrypted binary string.
ratchetHeaderstring (Base64)RequiredDouble Ratchet sequence header containing public ephemeral key.
AI Platform

BondApex AI Agent SDK & Tool Calling

Deploy deterministic AI agents, multi-modal streaming conversations, and secure function calling with automated context windows.

POST/api/v1/nexus/agents/stream
import { BondApexAgent, tool } from '@bond-app/ai-sdk';
import { z } from 'zod';

const agent = new BondApexAgent({
  model: 'nexus-ultra-2026',
  temperature: 0.2,
  systemPrompt: 'You are an institutional compliance assistant on BondApex.',
  tools: [
    tool({
      name: 'checkLedgerBalance',
      description: 'Queries confirmed balance for an institutional wallet',
      parameters: z.object({ walletId: z.string() }),
      execute: async ({ walletId }) => client.diamonds.getBalance(walletId),
    }),
  ],
});

const stream = await agent.stream({
  prompt: 'Verify reserve balances for treasury wallet WAL_9901.',
});

for await (const chunk of stream) {
  process.stdout.write(chunk.text);
}

Request Parameters & Headers

ParameterTypeRequiredBuilt for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization.
modelstringRequiredTarget neural model: "nexus-ultra-2026" or "nexus-edge-mini".
promptstringRequiredInput message prompt or structured dialogue array.
streambooleanOptionalWhether to deliver Server-Sent Events (SSE) streaming chunks.
Monetization & Ledger

Diamond Micro-Ledger & Atomic Transfers

Execute ACID double-entry microtransactions, creator tipping, and programmatic balance reconciliations with idempotency guarantees.

POST/api/v1/diamonds/transfer
import { DiamondLedger } from '@bond-app/core';

const transfer = await client.diamonds.transfer({
  recipientWalletId: 'wal_creator_5510',
  amount: 500, // 500 Diamonds
  idempotencyKey: 'tx_gift_live_8849201948',
  purpose: 'STREAM_SUPER_GIFT',
  metadata: {
    streamId: 'stm_99012',
    tier: 'PLATINUM_ROSE',
  },
});

console.log('Transfer confirmed at block timestamp:', transfer.confirmedAt);

Request Parameters & Headers

ParameterTypeRequiredBuilt for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization.
recipientWalletIdstringRequiredDestination wallet address.
amountintegerRequiredQuantity of Diamonds to transfer (minimum 1).
idempotencyKeystring (UUID/Hash)RequiredUnique string to prevent duplicate debits during network retries.
Media & Voice

WebRTC SFU Media Mesh & Telemetry

Provision low-latency Selective Forwarding Unit (SFU) rooms, allocate ICE candidate pairs, and monitor live Mean Opinion Score (MOS) metrics.

POST/api/v1/webrtc/rooms/create
import { MediaMeshClient } from '@bond-app/core/webrtc';

const room = await client.webrtc.createRoom({
  name: 'Global Executive Conference #104',
  maxParticipants: 100,
  codecPreferences: ['AV1', 'VP9', 'Opus'],
  recordingPolicy: 'COMPLIANCE_ARCHIVE',
});

console.log('Room Token for participant:', room.accessToken);

Request Parameters & Headers

ParameterTypeRequiredBuilt for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization.
namestringRequiredDescriptive title for conference room.
maxParticipantsintegerOptionalMaximum concurrent media subscribers (default: 50).
Reliability & Troubleshooting

Standardized Error Code Matrix

All error payloads adhere to RFC 7807 Problem Details for HTTP APIs.

Error CodeHTTP StatusRoot Cause & Resolution
ERR_UNAUTHORIZED_KEY401API key is revoked, expired, or lacking required IAM scope.
ERR_INSUFFICIENT_DIAMONDS402Source wallet balance is lower than the requested transfer amount.
ERR_KEY_RATCHET_DESYNC409The Double Ratchet prekey bundle sequence has desynchronized.
ERR_RATE_LIMIT_EXCEEDED429Account exceeded the tier threshold (5,000 requests/minute).
ERR_IDEMPOTENCY_COLLISION409A transaction with this idempotency key was previously processed.