Skip to main content

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

  1. Sign up for a ByteEngine account at console.engine.boolbyte.com
  2. Navigate to your dashboard
  3. Go to SettingsAPI Keys
  4. Create a new API key
  5. Copy and securely store your API key
Security

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 workers
  • POST /api/workers - Create a new worker
  • GET /api/workers/{id} - Get worker details
  • PUT /api/workers/{id} - Update worker
  • DELETE /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 session
  • GET /api/session/{id} - Get session details
  • POST /api/session/{id}/messages - Send messages
  • GET /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 task
  • GET /api/sessions/{sessionId}/tasks/{taskId} - Get task status
  • POST /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 bases
  • POST /api/knowledgebase/create - Create knowledge base
  • POST /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 stores
  • POST /api/fhirserver/create - Create FHIR store
  • GET /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 buckets
  • POST /api/storage/create - Create storage bucket
  • POST /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 tools
  • GET /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 (asc or desc)

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 SettingsWebhooks.

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