square-codeSDKS

KrosAI provides official SDKs to simplify integration with your applications.

Voice SDK (JavaScript)

Connect WebRTC voice agents to phone numbers with the KrosAI Voice SDK.

Installation

Install (npm)
npm install @krosai/voice-sdk

Quick Start

quickstart.ts
import { KrosAI } from '@krosai/voice-sdk';

const krosai = new KrosAI({ 
  apiKey: 'kros_live_your_key' 
});

// Connect your voice agent to a phone number
const call = await krosai.call({
  phoneNumber: '+2348012345678',
  audioStream: myAgentAudioStream,
});

// Handle call events
call.on('connected', () => console.log('Call connected'));
call.on('ended', (data) => console.log('Call ended:', data.reason));

// Control the call
call.mute();
call.unmute();
await call.hangup();

Features

  • WebRTC to Phone: Connect any WebRTC audio stream to phone calls

  • Event Streaming: Real-time call status and audio events

  • Audio Controls: Mute, unmute, and volume control

  • Low Latency: Sub-second audio transmission

Full Voice SDK Documentation

React SDK

React hooks and components for voice integration.

Installation

Quick Start

Hooks

Hook
Description

useKrosAICall()

Main hook for call management

useAudioLevels(call)

Real-time audio level meters

useKrosAIClient()

Access the raw SDK client

REST API

For server-side integrations, use the REST API directly:

Python SDK (Coming Soon)

A Python SDK is in development:

circle-info

Interested in early access? Contact us at [email protected]envelope

Community Libraries

Community-maintained libraries (unofficial):

Language
Library
Author

Go

krosai-go

Community

Ruby

krosai-ruby

Community

PHP

krosai-php

Community

circle-exclamation

API Rate Limits

SDK requests are subject to rate limits:

Tier
Requests/Second
Requests/Day

Free

10

1,000

Pro

50

50,000

Business

200

500,000

Enterprise

Custom

Custom

Rate limit headers are included in responses:

Error Handling

All SDKs use consistent error codes:

Last updated