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.
Authentication & API Keys
All BondApex REST, WebSocket, and WebRTC signaling gateways require RFC 6750 Bearer JWT authorization or high-entropy scoped server API keys.
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
| Parameter | Type | Required | Built for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization. |
|---|---|---|---|
| Authorization | string (header) | Required | Bearer token in format: Bearer <API_KEY_OR_JWT> |
| X-BondApex-Version | string (header) | Optional | API 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"
}
}
}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.
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
| Parameter | Type | Required | Built for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization. |
|---|---|---|---|
| recipientId | string | Required | Target user ID receiving the encrypted payload. |
| ciphertext | string (Base64) | Required | AES-256-GCM or ChaCha20-Poly1305 encrypted binary string. |
| ratchetHeader | string (Base64) | Required | Double Ratchet sequence header containing public ephemeral key. |
BondApex AI Agent SDK & Tool Calling
Deploy deterministic AI agents, multi-modal streaming conversations, and secure function calling with automated context windows.
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
| Parameter | Type | Required | Built for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization. |
|---|---|---|---|
| model | string | Required | Target neural model: "nexus-ultra-2026" or "nexus-edge-mini". |
| prompt | string | Required | Input message prompt or structured dialogue array. |
| stream | boolean | Optional | Whether to deliver Server-Sent Events (SSE) streaming chunks. |
Diamond Micro-Ledger & Atomic Transfers
Execute ACID double-entry microtransactions, creator tipping, and programmatic balance reconciliations with idempotency guarantees.
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
| Parameter | Type | Required | Built for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization. |
|---|---|---|---|
| recipientWalletId | string | Required | Destination wallet address. |
| amount | integer | Required | Quantity of Diamonds to transfer (minimum 1). |
| idempotencyKey | string (UUID/Hash) | Required | Unique string to prevent duplicate debits during network retries. |
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.
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
| Parameter | Type | Required | Built for families, relationships, and teams who value end-to-end encryption, absolute privacy, and seamless cross-platform synchronization. |
|---|---|---|---|
| name | string | Required | Descriptive title for conference room. |
| maxParticipants | integer | Optional | Maximum concurrent media subscribers (default: 50). |
Standardized Error Code Matrix
All error payloads adhere to RFC 7807 Problem Details for HTTP APIs.
| Error Code | HTTP Status | Root Cause & Resolution |
|---|---|---|
| ERR_UNAUTHORIZED_KEY | 401 | API key is revoked, expired, or lacking required IAM scope. |
| ERR_INSUFFICIENT_DIAMONDS | 402 | Source wallet balance is lower than the requested transfer amount. |
| ERR_KEY_RATCHET_DESYNC | 409 | The Double Ratchet prekey bundle sequence has desynchronized. |
| ERR_RATE_LIMIT_EXCEEDED | 429 | Account exceeded the tier threshold (5,000 requests/minute). |
| ERR_IDEMPOTENCY_COLLISION | 409 | A transaction with this idempotency key was previously processed. |
