HomeDocumentation

Quick Start Guide

Get up and running with the Telesoft Healthcare AI API in minutes. This guide will walk you through the basic steps to integrate our API into your application.

Step 1: Create an Account

Sign up for a Telesoft developer account to get your API keys and access to our dashboard.

  1. Visit the Telesoft Developer Portal
  2. Fill out the registration form
  3. Verify your email address
  4. Complete your organization profile

⚠️ Important

Healthcare developers must provide verification of their organization's compliance status and credentials for full API access.

Step 2: Obtain API Keys

Generate API keys through the developer portal to authenticate your requests.

  1. Navigate to the API Keys section in your dashboard
  2. Click "Create New API Key"
  3. Select the appropriate access level and permissions
  4. Name your key for easy identification
  5. Store your key securely - it will only be shown once

Your API key follows this format: ts_live_xxxxxxxxxxxxxxxxxxxx

⚠️ Security Warning

Never expose your API keys in client-side code or public repositories. Always use server-side authentication to protect your keys.

Step 3: Install the SDK

While you can make direct API calls, our SDKs simplify integration and provide type safety.

JavaScript/TypeScript

npm install @telesoft/healthcare-sdk

Python

pip install telesoft-healthcare

Java

<!-- Add to your pom.xml -->
<dependency>
  <groupId>us.telesoft</groupId>
  <artifactId>healthcare-sdk</artifactId>
  <version>2.5.0</version>
</dependency>

Step 4: Make Your First API Call

Let's make a simple API call to verify your setup is working correctly. This example uses the JavaScript SDK to check the API status.

import { TelesoftAI } from '@telesoft/healthcare-sdk';

// Initialize the client with your API key
const telesoft = new TelesoftAI({
  apiKey: 'YOUR_API_KEY', // Replace with your actual API key
  environment: 'sandbox' // Use 'production' for live data
});

// Check API status
async function checkApiStatus() {
  try {
    const status = await telesoft.system.status();
    console.log('API Status:', status);
    /*
      Example output:
      {
        status: 'operational',
        version: '2.5.0',
        latency: 45, // milliseconds
        regions: {
          'us-east': 'operational',
          'eu-west': 'operational',
          'ap-south': 'operational'
        }
      }
    */
    return status;
  } catch (error) {
    console.error('Error checking API status:', error);
    throw error;
  }
}

This simple test verifies that your API key is working and that you can connect to our services.

💡 Pro Tip

Always use the sandbox environment during development to avoid incurring charges for API usage. The sandbox environment uses synthetic data but mirrors the behavior of the production API.

Step 5: Implement Core Functionality

Now let's make a more substantial request to analyze medical data and get diagnostic suggestions.

// Continue from previous example
async function getDiagnosticSuggestions() {
  try {
    // Prepare patient data
    const patientData = {
      age: 58,
      sex: 'male',
      vitalSigns: {
        bloodPressure: { systolic: 145, diastolic: 92 },
        heartRate: 88,
        temperature: 99.1,
        respiratoryRate: 18,
        oxygenSaturation: 96
      },
      symptoms: ['chest pain', 'shortness of breath', 'fatigue'],
      medicalHistory: ['hypertension', 'high cholesterol'],
      medications: ['lisinopril', 'atorvastatin'],
      labResults: {
        cholesterol: { total: 240, hdl: 35, ldl: 165 },
        glucose: 110,
        troponin: 0.03
      }
    };

    // Request diagnostic analysis
    const result = await telesoft.diagnostics.analyze({
      patientData,
      options: {
        includeConfidenceScores: true,
        includeDifferentialDiagnosis: true,
        includeRecommendations: true,
        includeReferences: true,
        maxResults: 5,
        modelVersion: 'v2.5-cardiology'
      }
    });

    console.log('Top diagnostic suggestion:', result.suggestions[0]);
    console.log('Confidence score:', result.confidenceScores[0]);
    console.log('Recommendations:', result.recommendations);
    
    return result;
  } catch (error) {
    console.error('Error getting diagnostic suggestions:', error);
    throw error;
  }
}

Example Response

{
  "requestId": "req_fae45b2c8a7d",
  "timestamp": "2025-05-06T11:42:07Z",
  "processingTimeMs": 126,
  "suggestions": [
    {
      "condition": "Unstable Angina",
      "icd10": "I20.0",
      "description": "A condition characterized by chest pain due to insufficient blood flow to the heart muscles."
    },
    {
      "condition": "Acute Coronary Syndrome",
      "icd10": "I24.9",
      "description": "A range of conditions associated with sudden, reduced blood flow to the heart."
    },
    {
      "condition": "Hypertensive Heart Disease",
      "icd10": "I11.9",
      "description": "Heart damage caused by long-term high blood pressure."
    }
    // Additional results truncated
  ],
  "confidenceScores": [0.87, 0.76, 0.68],
  "recommendations": {
    "urgency": "high",
    "followUp": "immediate cardiology consultation",
    "diagnosticTests": [
      "12-lead ECG",
      "Cardiac enzymes panel",
      "Stress test"
    ],
    "treatments": [
      "Nitroglycerin for acute chest pain",
      "Aspirin therapy",
      "Consider beta blockers"
    ]
  },
  "references": [
    {
      "title": "2024 AHA/ACC Guidelines for Evaluation and Diagnosis of Chest Pain",
      "url": "https://www.ahajournals.org/guidelines/chest-pain-2024",
      "relevanceScore": 0.92
    }
    // Additional references truncated
  ]
}

Step 6: Handle Errors

Implement proper error handling to manage API responses gracefully.

// Error handling best practices
try {
  const result = await telesoft.diagnostics.analyze({
    // ... request parameters
  });
  
  // Process successful response
} catch (error) {
  if (error instanceof telesoft.TelesoftAPIError) {
    // Handle API-specific errors
    console.error(`API Error: ${error.code} - ${error.message}`);
    
    switch (error.code) {
      case 'invalid_request_error':
        // Handle validation errors
        console.error('Request validation failed:', error.details);
        break;
      case 'authentication_error':
        // Handle authentication issues
        console.error('API key may be invalid or expired');
        break;
      case 'rate_limit_error':
        // Handle rate limiting
        const retryAfter = error.headers['retry-after'];
        console.error(`Rate limit exceeded. Retry after ${retryAfter} seconds`);
        break;
      case 'medical_data_insufficient':
        // Handle medical data specific errors
        console.error('Insufficient medical data provided:', error.details);
        break;
      default:
        // Handle other API errors
        console.error('Unexpected API error:', error);
    }
  } else {
    // Handle network or other client-side errors
    console.error('Client error:', error);
  }
}

ℹ️ Error Codes

Our API uses standard HTTP status codes along with descriptive error codes. See the Error Handling documentation for a complete list.

Next Steps

Now that you've made your first API call, explore our documentation to implement more advanced features: