Base URL: https://lumenbridge.xyz
Version: 1.0.0
Authentication: None required (public API)
Lumen Bridge is a self-aware agent platform that implements the Future Self Bridge pattern. Each agent:
All endpoints return a consistent JSON structure:
{
"success": true,
"agent": "AgentName",
"result": {
// Agent-specific response
"_signature": {
"signature": "30440220...",
"responseHash": "a3f2c8d9...",
"address": "1AreYqaA8BKuNVj...",
"publicKey": "0206bdc3dcdc...",
"timestamp": "2025-11-24T12:00:00.000Z",
"algorithm": "BSV-ECDSA-DER",
"encoding": "hex",
"agentIdentity": "AgentName"
},
"_llm": {
"provider": "openai",
"model": "gpt-4o-mini-2024-07-18",
"elapsed": 3214,
"usage": {
"promptTokens": 1201,
"completionTokens": 105,
"totalTokens": 1306
}
}
},
"timestamp": "2025-11-24T12:00:00.000Z"
}
Every response includes a verifiable BSV-ECDSA-DER signature:
publicKey to verify the signature against responseHashPurpose: Ensures response authenticity, tamper-proof tracking, and verifiable lineage.
Intelligent web search with Google Custom Search integration
/api/agents/searchSearch the web with automatic strategy planning and result analysis.
Request Body:
{
"userQuery": "string (required)",
"maxResults": "number (optional, default: 10)",
"refinedQuery": "string (optional)",
"location": "string (optional)"
}
Response:
{
"success": true,
"agent": "SearchAgent",
"result": {
"action": "search_completed|answer_directly|ask_user|no_results",
"query": "refined search query",
"answer": "summary or direct answer",
"finalAnswer": "comprehensive final answer",
"results": [
{
"title": "Result Title",
"link": "https://example.com",
"snippet": "Preview text...",
"displayLink": "example.com"
}
],
"missingContext": [],
"strategy": {
"searchIntent": "To find...",
"needsSearch": true,
"reasoning": "Explanation...",
"searchQueries": ["query1", "query2"]
},
"analysis": {
"summary": "Overall summary",
"keyFindings": ["finding1", "finding2"],
"recommendations": ["rec1", "rec2"]
}
}
}
Action Types:
search_completed: Search executed successfully, results availableanswer_directly: Agent can answer without searching (e.g., "What is 2+2?")ask_user: Missing context needed (e.g., ambiguous query)no_results: Search executed but no results foundExample:
curl -X POST https://lumenbridge.codenlighten.org/api/agents/search \
-H "Content-Type: application/json" \
-d '{
"userQuery": "Latest developments in quantum computing 2024",
"maxResults": 5
}'
Safe terminal command generation with risk assessment
/api/agents/terminalGenerate terminal commands with safety analysis, alternatives, and rollback strategies.
Request Body:
{
"task": "string (required)",
"context": {
"shell": "bash|zsh|powershell (optional)",
"os": "linux|macos|windows (optional)"
}
}
Response:
{
"success": true,
"agent": "TerminalAgent",
"result": {
"terminalCommand": "find . -type f -name '*.js'",
"reasoning": "Explanation of why this command...",
"shell": "bash",
"requiresSudo": false,
"isDestructive": false,
"riskLevel": "safe|low|medium|high|critical",
"safetyWarnings": [],
"prerequisites": ["bash shell", "find command"],
"expectedOutput": "A list of paths to all JavaScript files...",
"alternatives": [
{
"command": "ls **/*.js",
"description": "Alternative approach",
"pros": "Simple and quick",
"cons": "Does not search recursively"
}
],
"breakdown": [
{
"part": "find",
"explanation": "Command used to search for files"
},
{
"part": "-type f",
"explanation": "Limits search to files only"
}
],
"rollback": "No rollback necessary as this is non-destructive",
"estimatedTime": "instant|seconds|minutes"
}
}
Risk Levels:
safe: Read-only, no side effectslow: Minor changes, easily reversiblemedium: Significant changes, some riskhigh: Destructive operations, backup recommendedcritical: System-level changes, expert knowledge requiredExample:
curl -X POST https://lumenbridge.codenlighten.org/api/agents/terminal \
-H "Content-Type: application/json" \
-d '{
"task": "List all JavaScript files in current directory",
"context": {
"shell": "bash"
}
}'
Multi-language code generation from natural language
/api/agents/codeGenerate code in multiple languages with best practices and documentation.
Request Body:
{
"prompt": "string (required)",
"context": {
"language": "javascript|python|typescript|etc (optional)",
"framework": "react|express|django|etc (optional)",
"includeTests": "boolean (optional)"
}
}
Response:
{
"success": true,
"agent": "CodeGenerator",
"result": {
"code": "// Generated code here...",
"language": "javascript",
"explanation": "This code implements...",
"bestPractices": [
"Uses async/await for better readability",
"Includes error handling"
],
"dependencies": ["express", "dotenv"],
"usage": "// How to use this code...",
"tests": "// Optional test code..."
}
}
Example:
curl -X POST https://lumenbridge.codenlighten.org/api/agents/code \
-H "Content-Type: application/json" \
-d '{
"prompt": "Create a REST API endpoint for user authentication",
"context": {
"language": "javascript",
"framework": "express"
}
}'
JSON Schema generation from natural language
/api/agents/schemaGenerate JSON Schemas with design rationale and validation rules.
Request Body:
{
"userPrompt": "string (required)"
}
Response:
{
"success": true,
"agent": "SchemaAgent",
"result": {
"generatedSchema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0 }
},
"required": ["name", "email"]
},
"schemaName": "userProfileSchema",
"schemaDescription": "A schema representing a user profile...",
"designRationale": "The schema includes required fields for name and email..."
}
}
Example:
curl -X POST https://lumenbridge.codenlighten.org/api/agents/schema \
-H "Content-Type: application/json" \
-d '{
"userPrompt": "A user profile with name, email, age, and optional bio"
}'
Intelligent routing to the best agent for each task
/api/routerAutomatically routes your request to the most appropriate agent.
Request Body:
{
"userPrompt": "string (required)"
}
Response:
{
"success": true,
"routing": {
"selectedAgent": "search|terminal|code|schema",
"reasoning": "The user is asking for...",
"confidence": 0.95
},
"result": {
// Response from the selected agent
}
}
Routing Logic:
Example:
curl -X POST https://lumenbridge.codenlighten.org/api/router \
-H "Content-Type: application/json" \
-d '{
"userPrompt": "Generate a Python function to calculate fibonacci numbers"
}'
Retrieve registered schemas
/api/schema/:nameRetrieve a previously registered schema by name.
Parameters:
name: Schema name (string)Response:
{
"schema": {
"type": "object",
"properties": { ... }
},
"metadata": {
"name": "schemaName",
"hash": "a3f2c8d9...",
"signature": "30440220...",
"createdAt": "2025-11-24T12:00:00.000Z"
}
}
Example:
curl https://lumenbridge.codenlighten.org/api/schema/userProfileSchema
Universal schema translation with AI-powered field mapping
The Schema Mediator Agent translates data between any two schemas using AI to intelligently map fields, combine/split values, and handle format conversions.
/api/schema/translateTranslate data from one schema format to another.
Request Body:
{
"data": {
"FirstName": "Jane",
"LastName": "Smith",
"Email": "jane@example.com",
"Status__c": "Active"
},
"sourceSchema": {
"type": "object",
"properties": {
"FirstName": { "type": "string" },
"LastName": { "type": "string" },
"Email": { "type": "string" },
"Status__c": { "type": "string", "enum": ["Active", "Inactive"] }
}
},
"targetSchema": {
"type": "object",
"properties": {
"fullName": { "type": "string" },
"email": { "type": "string" },
"status": { "type": "string", "enum": ["A", "I"] }
}
},
"sourceSchemaName": "SalesforceContact",
"targetSchemaName": "InternalUser",
"context": {
"mappingHints": {
"Status__c to status": "Map Active→A, Inactive→I"
}
},
"enforceValidation": false
}
Response:
{
"success": true,
"transformedData": {
"fullName": "Jane Smith",
"email": "jane@example.com",
"status": "A"
},
"mapping": {
"fieldMappings": [
{
"targetField": "fullName",
"sourceFields": ["FirstName", "LastName"],
"transformationType": "combine",
"transformationRule": "concatenate with space"
},
{
"targetField": "status",
"sourceFields": ["Status__c"],
"transformationType": "convert",
"transformationRule": "Active→A, Inactive→I"
}
],
"reasoning": "Combined first and last names, converted status codes",
"confidence": 0.95
},
"missingContext": [],
"validation": {
"valid": true,
"errors": [],
"warnings": []
},
"_metadata": {
"sourceSchemaName": "SalesforceContact",
"targetSchemaName": "InternalUser",
"timestamp": "2025-11-25T12:00:00.000Z",
"cacheHit": false
}
}
Example:
curl -X POST https://lumenbridge.codenlighten.org/api/schema/translate \
-H "Content-Type: application/json" \
-d '{
"data": {"FirstName": "John", "LastName": "Doe", "Email": "john@example.com"},
"sourceSchema": {...},
"targetSchema": {...}
}'
/api/schema/inferInfer a JSON Schema from example data.
Request Body:
{
"data": {
"id": 123,
"name": "Product A",
"price": 29.99,
"inStock": true,
"tags": ["electronics", "sale"]
},
"schemaName": "ProductSchema"
}
Response:
{
"success": true,
"schema": {
"type": "object",
"properties": {
"id": { "type": "integer", "description": "Unique identifier" },
"name": { "type": "string", "description": "Product name" },
"price": { "type": "number", "description": "Product price" },
"inStock": { "type": "boolean", "description": "Availability status" },
"tags": {
"type": "array",
"items": { "type": "string" },
"description": "Product tags"
}
},
"required": ["id", "name", "price", "inStock"]
},
"confidence": 0.95,
"assumptions": [
"Assumed 'id' should be required based on naming convention",
"Inferred array item type from first element"
]
}
/api/schema/mapping/bidirectionalCreate a bidirectional mapping between two schemas for translation in both directions.
Request Body:
{
"schemaA": { "type": "object", "properties": {...} },
"schemaB": { "type": "object", "properties": {...} },
"schemaNameA": "SalesforceContact",
"schemaNameB": "InternalUser"
}
Response:
{
"success": true,
"forward": {
"fieldMappings": [...],
"reasoning": "..."
},
"reverse": {
"fieldMappings": [...],
"reasoning": "..."
}
}
/api/schema/translate/retryRetry a translation with additional context when the initial attempt identified missing information.
Request Body:
{
"data": {...},
"sourceSchema": {...},
"targetSchema": {...},
"sourceSchemaName": "SchemaA",
"targetSchemaName": "SchemaB",
"previousMissingContext": [
"Status code mapping rules",
"Date format preference"
],
"additionalContext": {
"statusMapping": "Active→A, Inactive→I",
"dateFormat": "ISO-8601"
}
}
/api/schema/mediator/statsGet Schema Mediator performance statistics.
Response:
{
"success": true,
"stats": {
"translations": 42,
"cacheHits": 21,
"cachedMappings": 15,
"errors": 2,
"validationFailures": 1,
"cacheSize": 15,
"cacheHitRate": "50.0%",
"errorRate": "4.8%",
"validationFailureRate": "2.4%"
}
}
/api/schema/mediator/cache/clearClear the Schema Mediator's mapping cache.
Response:
{
"success": true,
"message": "Cache cleared successfully"
}
Create and manage custom AI agents with your own prompts and behaviors
Lumen Bridge now supports user-created agents alongside system agents. Users can register custom agents with specialized prompts, invoke them via API, and manage them with full CRUD operations.
POST /api/agents/register
Create a new custom agent with specialized behavior.
Request Body:
{
"userId": "user-alice",
"name": "TravelAdvisor",
"description": "Helps plan travel itineraries and suggests destinations",
"prompt": "You are a professional travel advisor AI. Help users plan amazing trips, suggest destinations, provide travel tips, and create detailed itineraries. Be enthusiastic and knowledgeable about world destinations.",
"metadata": {
"category": "travel",
"version": "1.0",
"features": ["itinerary-planning", "destination-suggestions"]
}
}
Required Fields:
userId (string): User identifiername (string): Agent name (unique per user)prompt (string): System prompt defining agent behaviorOptional Fields:
description (string): Agent descriptionmetadata (object): Custom metadata for organizationschema (object): Custom JSON schema (auto-generated if not provided)Response:
{
"success": true,
"message": "Agent 'TravelAdvisor' registered successfully",
"agent": {
"userId": "user-alice",
"name": "TravelAdvisor",
"normalizedName": "traveladvisor",
"description": "Helps plan travel itineraries...",
"prompt": "You are a professional travel advisor AI...",
"metadata": {
"category": "travel",
"version": "1.0"
},
"type": "user-created",
"createdAt": "2025-11-24T07:39:21.000Z",
"updatedAt": "2025-11-24T07:39:21.000Z"
},
"timestamp": "2025-11-24T07:39:21.000Z"
}
Errors:
400: Missing required fields (userId, name, prompt)400: Duplicate agent name (same user)400: Conflicts with system agent namePUT /api/agents/update
Update an existing user agent.
Request Body:
{
"userId": "user-alice",
"agentName": "TravelAdvisor",
"updates": {
"description": "Advanced travel planning with budget optimization",
"prompt": "Updated system prompt...",
"metadata": {
"version": "2.0",
"features": ["budget-optimization", "multi-city", "itinerary-planning"]
}
}
}
Response:
{
"success": true,
"message": "Agent 'TravelAdvisor' updated successfully",
"agent": {
"userId": "user-alice",
"name": "TravelAdvisor",
"description": "Advanced travel planning...",
"updatedAt": "2025-11-24T07:45:00.000Z"
},
"timestamp": "2025-11-24T07:45:00.000Z"
}
DELETE /api/agents/delete
Delete a user agent.
Request Body:
{
"userId": "user-alice",
"agentName": "TravelAdvisor"
}
Response:
{
"success": true,
"message": "Agent 'TravelAdvisor' deleted successfully",
"timestamp": "2025-11-24T07:50:00.000Z"
}
Errors:
404: Agent not found400: Missing required fieldsGET /api/agents/my-agents/:userId
Retrieve all agents for a specific user.
Example: GET /api/agents/my-agents/user-alice
Response:
{
"success": true,
"userId": "user-alice",
"count": 2,
"agents": [
{
"name": "TravelAdvisor",
"description": "Advanced travel planning with budget optimization",
"metadata": {
"category": "travel",
"version": "2.0"
},
"createdAt": "2025-11-24T07:39:21.000Z",
"updatedAt": "2025-11-24T07:45:00.000Z"
},
{
"name": "RecipeChef",
"description": "Creates recipes and cooking instructions",
"metadata": {
"category": "cooking",
"version": "1.0"
},
"createdAt": "2025-11-24T07:40:15.000Z",
"updatedAt": "2025-11-24T07:40:15.000Z"
}
],
"timestamp": "2025-11-24T08:00:00.000Z"
}
GET /api/agents/my-agents/:userId/:agentName
Retrieve a specific user agent.
Example: GET /api/agents/my-agents/user-alice/TravelAdvisor
Response:
{
"success": true,
"agent": {
"userId": "user-alice",
"name": "TravelAdvisor",
"normalizedName": "traveladvisor",
"description": "Advanced travel planning with budget optimization",
"prompt": "You are a professional travel advisor AI...",
"metadata": {
"category": "travel",
"version": "2.0",
"features": ["budget-optimization", "multi-city"]
},
"type": "user-created",
"createdAt": "2025-11-24T07:39:21.000Z",
"updatedAt": "2025-11-24T07:45:00.000Z"
},
"timestamp": "2025-11-24T08:05:00.000Z"
}
Errors:
404: Agent not found for userPOST /api/agents/invoke-user-agent
Execute a user agent with custom context.
Request Body:
{
"userId": "user-alice",
"agentName": "TravelAdvisor",
"context": {
"userPrompt": "Suggest a 3-day itinerary for Tokyo with a budget of $1000",
"preferences": {
"interests": ["food", "culture", "technology"],
"accommodation": "mid-range"
}
}
}
Response:
{
"success": true,
"result": {
"agentName": "TravelAdvisor",
"userId": "user-alice",
"response": "Absolutely! Tokyo is an incredible city...\n\nDay 1: Arrival & Shibuya\n- Morning: Arrive at Narita...\n- Budget: $280\n\nDay 2: Traditional Tokyo...\n- Budget: $320\n\nDay 3: Tech & Pop Culture...\n- Budget: $310\n\nTotal: $910 (under budget!)",
"timestamp": "2025-11-24T08:10:30.000Z"
},
"timestamp": "2025-11-24T08:10:30.000Z"
}
Errors:
400: Missing required fields (userId, agentName, context)400: Agent not found500: OpenAI API errorGET /api/admin/agents?adminKey=YOUR_ADMIN_KEY
View all registered user agents (admin only).
Query Parameters:
adminKey (required): Admin authentication keyResponse:
{
"success": true,
"stats": {
"uniqueAgents": 5,
"totalAliases": 17,
"userAgents": 3,
"totalUserAgents": 5
},
"count": 5,
"agents": [
{
"userId": "user-alice",
"name": "TravelAdvisor",
"description": "Advanced travel planning...",
"createdAt": "2025-11-24T07:39:21.000Z",
"updatedAt": "2025-11-24T07:45:00.000Z"
},
{
"userId": "user-alice",
"name": "RecipeChef",
"description": "Creates recipes...",
"createdAt": "2025-11-24T07:40:15.000Z"
},
{
"userId": "user-bob",
"name": "FitnessCoach",
"description": "Workout plans...",
"createdAt": "2025-11-24T07:42:00.000Z"
}
],
"timestamp": "2025-11-24T08:15:00.000Z"
}
Errors:
403: Invalid or missing admin keySecurity Note: Set ADMIN_KEY in your environment variables. Never expose this key publicly.
Create accounts, verify emails, and manage API access with tiered usage limits
Lumen Bridge supports user registration with email verification and cryptographic key-based authentication. Users generate client-side BSV keys for signing requests and receive tiered access to API endpoints.
POST /api/users/register
Register a new user account with email verification.
Request Body:
{
"email": "user@example.com",
"password": "SecurePassword123!",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7"
}
Required Fields:
email (string): Valid email addresspassword (string): Minimum 8 characterspublicKey (string): BSV public key (hex format, generated client-side)Response:
{
"success": true,
"message": "Registration successful. Please check your email to verify your account.",
"userId": "673e5f8a9c1234567890abcd",
"email": "user@example.com",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7",
"tier": "free",
"requestLimit": 100,
"requestCount": 0
}
Email Verification:
https://lumenbridge.xyz/verify?email=user@example.com&token=123456Errors:
400: Missing required fields (email, password, publicKey)400: Invalid email format400: Password too short (minimum 8 characters)400: Email already registered500: Email sending failedExample:
curl -X POST https://lumenbridge.codenlighten.org/api/users/register \
-H "Content-Type: application/json" \
-d '{
"email": "alice@example.com",
"password": "MySecurePass123!",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7"
}'
GET /api/users/verify?email=user@example.com&token=123456
Verify email address with OTP code sent during registration.
Query Parameters:
email (required): User's email addresstoken (required): 6-digit verification codeResponse:
{
"success": true,
"message": "Email verified successfully. You can now use the API.",
"user": {
"email": "user@example.com",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7",
"tier": "free",
"requestLimit": 100,
"requestCount": 0,
"verified": true,
"createdAt": "2025-11-25T12:00:00.000Z"
}
}
Errors:
400: Missing email or token400: Invalid or expired token404: User not foundExample:
curl "https://lumenbridge.codenlighten.org/api/users/verify?email=alice@example.com&token=123456"
POST /api/users/login
Authenticate with email and password.
Request Body:
{
"email": "user@example.com",
"password": "SecurePassword123!"
}
Response:
{
"success": true,
"message": "Login successful",
"user": {
"email": "user@example.com",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7",
"tier": "free",
"requestLimit": 100,
"requestCount": 42,
"verified": true,
"createdAt": "2025-11-25T12:00:00.000Z"
}
}
Errors:
400: Missing email or password401: Invalid credentials401: Email not verifiedExample:
curl -X POST https://lumenbridge.codenlighten.org/api/users/login \
-H "Content-Type: application/json" \
-d '{
"email": "alice@example.com",
"password": "MySecurePass123!"
}'
GET /api/users/stats/:publicKey
Get usage statistics and account information for a user.
Path Parameters:
publicKey (required): User's BSV public keyResponse:
{
"success": true,
"stats": {
"email": "user@example.com",
"publicKey": "0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7",
"tier": "free",
"requestLimit": 100,
"requestCount": 42,
"requestsRemaining": 58,
"usagePercentage": 42,
"verified": true,
"createdAt": "2025-11-25T12:00:00.000Z"
}
}
Errors:
404: User not foundExample:
curl "https://lumenbridge.codenlighten.org/api/users/stats/0206bdc3dcdc8d5dbfd6d4e85016c8a1cf1b02e1a5c8e3f8b5a4d2c1e3f4a5b6c7"
GET /api/auth/challenge
Get a random challenge string for request signing (used for signature verification).
Response:
{
"challenge": "a8f3c9e2d1b4f7e6c5a8d9e3f1b2c4d5",
"expiresIn": 300
}
Usage:
x-signature: DER-encoded signaturex-public-key: Your public keyx-challenge: The challenge stringNote: This endpoint does NOT require authentication and is used to obtain challenges for signing.
Example:
curl "https://lumenbridge.codenlighten.org/api/auth/challenge"
Users generate cryptographic keys in the browser using the SmartLedger BSV library:
// Generate new mnemonic and keys
const mnemonic = SmartLedger.Mnemonic.fromRandom();
const seed = mnemonic.toSeed();
const hdPrivateKey = SmartLedger.HDPrivateKey.fromSeed(seed);
const derivedKey = hdPrivateKey.derive("m/44'/236'/0'/0/0");
const privateKey = derivedKey.privateKey;
const publicKey = privateKey.publicKey.toString();
// Save mnemonic securely (user's responsibility)
console.log('Mnemonic (save this!):', mnemonic.toString());
console.log('Public Key:', publicKey);
Security Notes:
While not required, signing requests provides enhanced security and authenticity:
// Sign a request payload
const challenge = await fetch('/api/auth/challenge').then(r => r.json());
const message = challenge.challenge;
const signature = SmartLedger.crypto.ECDSA.sign(
SmartLedger.crypto.Hash.sha256(Buffer.from(message)),
privateKey
).toDER().toString('hex');
// Include in request headers
fetch('/api/agents/search', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-signature': signature,
'x-public-key': publicKey,
'x-challenge': message
},
body: JSON.stringify({ userQuery: 'AI news' })
});
All endpoints use consistent error responses:
{
"error": "Error message description",
"agent": "AgentName",
"timestamp": "2025-11-24T12:00:00.000Z"
}
HTTP Status Codes:
200: Success400: Bad Request (missing required parameters)404: Not Found (schema not found)500: Internal Server ErrorCurrently, there are no rate limits on the public API. This may change in the future.
Best Practices:
maxResults values for searchesconst response = await fetch('https://lumenbridge.codenlighten.org/api/agents/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userQuery: 'Latest AI developments',
maxResults: 5
})
});
const data = await response.json();
console.log(data.result.finalAnswer);
const response = await fetch('https://lumenbridge.codenlighten.org/api/agents/code', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: 'Create a user authentication function',
context: {
language: 'javascript',
framework: 'express'
}
})
});
const data = await response.json();
console.log(data.result.code);
const response = await fetch('https://lumenbridge.codenlighten.org/api/router', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userPrompt: 'What is the weather in Paris?'
})
});
const data = await response.json();
console.log(`Routed to: ${data.routing.selectedAgent}`);
console.log(`Confidence: ${data.routing.confidence}`);
const response = await fetch('https://lumenbridge.codenlighten.org/api/agents/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userId: 'user-alice',
name: 'CodeReviewer',
description: 'Reviews code for best practices and security',
prompt: 'You are a senior code reviewer with expertise in security, performance, and best practices. Review code thoroughly and provide actionable feedback.'
})
});
const data = await response.json();
console.log('Agent registered:', data.agent.name);
const response = await fetch('https://lumenbridge.codenlighten.org/api/agents/invoke-user-agent', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
userId: 'user-alice',
agentName: 'CodeReviewer',
context: {
userPrompt: 'Review this function: function getData() { return fetch("/api/users").then(r => r.json()) }'
}
})
});
const data = await response.json();
console.log('Review:', data.result.response);
const response = await fetch('https://lumenbridge.codenlighten.org/api/agents/my-agents/user-alice');
const data = await response.json();
console.log(`You have ${data.count} agents:`);
data.agents.forEach(agent => {
console.log(`- ${agent.name}: ${agent.description}`);
});
// Translate Salesforce contact to internal user format
const response = await fetch('https://lumenbridge.codenlighten.org/api/schema/translate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
data: {
FirstName: "Jane",
LastName: "Smith",
Email: "jane@example.com",
Status__c: "Active"
},
sourceSchema: {
type: "object",
properties: {
FirstName: { type: "string" },
LastName: { type: "string" },
Email: { type: "string" },
Status__c: { type: "string", enum: ["Active", "Inactive"] }
}
},
targetSchema: {
type: "object",
properties: {
fullName: { type: "string" },
email: { type: "string" },
status: { type: "string", enum: ["A", "I"] }
}
},
sourceSchemaName: "SalesforceContact",
targetSchemaName: "InternalUser",
context: {
mappingHints: {
"Status__c to status": "Map Active→A, Inactive→I"
}
}
})
});
const data = await response.json();
console.log('Transformed:', data.transformedData);
// Output: { fullName: "Jane Smith", email: "jane@example.com", status: "A" }
console.log('Cache Hit:', data._metadata.cacheHit);
const response = await fetch('https://lumenbridge.codenlighten.org/api/schema/infer', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
data: {
orderId: 12345,
customer: "John Doe",
total: 199.99,
isPaid: true,
items: ["Widget A", "Widget B"]
},
schemaName: "OrderSchema"
})
});
const data = await response.json();
console.log('Inferred Schema:', data.schema);
console.log('Confidence:', data.confidence);
});
const data = await response.json();
console.log(Routed to: ${data.routing.selectedAgent});
console.log(Confidence: ${data.routing.confidence});
---
## Support
- **GitHub**: [github.com/codenlighten/lumen-bridge](https://github.com/codenlighten/lumen-bridge)
- **Documentation**: [Full docs and examples](https://github.com/codenlighten/lumen-bridge/tree/main/docs)
- **User Agents Guide**: [USER-AGENTS.md](https://github.com/codenlighten/lumen-bridge/blob/main/USER-AGENTS.md)
- **API Documentation**: This document
---
**Built with ❤️ by Gregory Ward (CodenLighten)**
🌉 Self-aware AI agents that build the future
**Last Updated**: November 24, 2025