ByteEngine API Overview
The ByteEngine API provides a comprehensive set of endpoints for building healthcare AI applications. This guide covers authentication, base URLs, and the core API concepts.
Base URL
All API requests are made to:
https://api.engine.boolbyte.com
Authentication
ByteEngine uses API key authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Getting Your API Key
- Sign up for a ByteEngine account at console.engine.boolbyte.com
- Navigate to your dashboard
- Go to Settings → API Keys
- Create a new API key
- Copy and securely store your API key
Never expose your API key in client-side code or public repositories. Use environment variables or secure configuration management.
Client Libraries
JavaScript/TypeScript
npm install @boolbyte/engine
import { EngineClient } from '@boolbyte/engine';
const client = new EngineClient({
apiKey: 'your-api-key-here',
baseUrl: 'https://api.engine.boolbyte.com', // optional
timeout: 30000 // optional, default 30s
});
Core API Concepts
1. Workers (AI Agents)
Workers are AI agents that can be configured with specific models, tools, and knowledge bases. They form the foundation of your healthcare AI workflows.
Key Endpoints:
GET /api/workers- List all workersPOST /api/workers- Create a new workerGET /api/workers/{id}- Get worker detailsPUT /api/workers/{id}- Update workerDELETE /api/workers/{id}- Delete worker
2. Sessions
Sessions represent conversations or workflows with a specific worker. They maintain context and message history.
Key Endpoints:
POST /api/session/create- Create a new sessionGET /api/session/{id}- Get session detailsPOST /api/session/{id}/messages- Send messagesGET /api/session/{id}/messages- List messages
3. Tasks
Tasks are individual AI operations within a session. They can involve tool calls, model interactions, and complex workflows.
Key Endpoints:
POST /api/sessions/{sessionId}/tasks- Create a taskGET /api/sessions/{sessionId}/tasks/{taskId}- Get task statusPOST /api/sessions/{sessionId}/tasks/{taskId}/submit_tool_outputs- Submit tool outputs
4. Knowledge Bases
Knowledge bases store documents and data that workers can reference during conversations.
Key Endpoints:
GET /api/knowledgebase/list- List knowledge basesPOST /api/knowledgebase/create- Create knowledge basePOST /api/knowledgebase/upload- Upload files to knowledge base
5. Health Data Stores (FHIR)
Health data stores for storing and managing healthcare data in standardized FHIR formats.
Key Endpoints:
GET /api/fhirserver/list- List FHIR storesPOST /api/fhirserver/create- Create FHIR storeGET /api/fhirserver/{id}- Get FHIR store details
6. Storage
File storage for documents, images, and other healthcare data.
Key Endpoints:
GET /api/storage/list- List storage bucketsPOST /api/storage/create- Create storage bucketPOST /api/storage/{id}/upload- Upload files
7. Models
Available AI models for different use cases.
Key Endpoints:
GET /api/models- List available models
8. Tools & Toolkits
Pre-built tools and toolkits for common healthcare operations.
Key Endpoints:
GET /api/tool/tools- List available toolsGET /api/tool/toolkits- List available toolkits
Response Format
All API responses follow a consistent format:
{
"data": <response_data>,
"success": true,
"message": "Operation completed successfully"
}
Error Responses
{
"data": null,
"success": false,
"message": "Error description",
"error": {
"code": "ERROR_CODE",
"details": "Additional error details"
}
}
Pagination
List endpoints support pagination with these query parameters:
limit: Number of items per page (default: 20, max: 100)after: Cursor for pagination (get items after this ID)before: Cursor for pagination (get items before this ID)order: Sort order (ascordesc)
Webhooks
ByteEngine supports webhooks for real-time notifications:
- Task completion: Notify when tasks finish
- Message updates: Real-time message status updates
- Error notifications: Alert on task failures
Configure webhooks in your dashboard under Settings → Webhooks.
SDK Examples
Quick Start Example
import { EngineClient } from '@boolbyte/engine';
const client = new EngineClient({
apiKey: process.env.BYTEENGINE_API_KEY
});
// Create a worker
const worker = await client.worker.createWorker({
name: "Clinical Assistant",
description: "AI assistant for clinical workflows",
instructions: "You are a helpful clinical assistant...",
defaultModelName: "openai/gpt-4"
});
// Create a session
const session = await client.session.createSession({
workerId: worker.data.id,
metadata: { patientId: "12345" }
});
// Send a message
const message = await client.session.sendMessage(session.data.id, {
content: "Analyze this patient's lab results",
role: "user"
});
Next Steps
- Authentication Guide - Detailed authentication setup
- Workers API - Create and manage AI workers
- Sessions & Tasks - Handle conversations and workflows
- Health Data Store - Work with healthcare data
- Knowledge Bases - Manage document storage and retrieval