Libraries And Sdk
UI Library
@ageofai/vp-ui
A beautiful, reusable voice interface component for React. Features real-time audio visualization, transcript display, and seamless Pipecat AI integration.
Install the package and import VoiceUI into any React component. Connect to your Pipecat server with a single prop.
Basic Configuration
Configure essential connection settings, authentication tokens, and basic media access.
Key Properties
serverUrlPipecat server endpoint URLsystemPromptInstructions for the AI assistantauthTokenAuthentication tokenenableMic / enableCamToggle microphone and camera accessTheme & Styling
Customize appearance with built-in themes and size variants. Toggle which UI elements are visible.
Available Options
theme'dark' | 'light'size'sm' | 'md' | 'lg'showInfo / showShare / showTranscriptToggle individual UI sectionsAdvanced Styling
Apply custom CSS classes to specific parts of the component and add custom event handlers.
Custom Class Props
classNameMain container elementorbClassNameVoice orb ring and shadowcontrolsClassNameControl button rowtranscriptClassNameTranscript scroll areaUsing the Hook Separately
For fully custom interfaces, use useAgeOfAiConnect directly to manage the connection lifecycle.
Hook Returns
clientWebSocket client instanceisConnected / isConnectingConnection state booleanstranscriptArray of conversation messagesisBotSpeaking / isUserSpeakingReal-time audio activityNode.js SDK
https://voiceai.aicoworker.tech/api/v1@ageofai/vp-sdk
Official Node.js SDK for the Scoreexl API — STT, TTS (Google Chirp3 HD & Deepgram Aura-2), RAG knowledge, analytics, credits, and notifications.
Install and initialise with your API key. All API calls are async and return typed responses.
Authentication
Manage user accounts with registration, login, and logout. All subsequent API calls use the stored session token automatically.
Methods
auth.register()Create a new user accountauth.login()Authenticate an existing userauth.logout()End the current sessionText-to-Speech
Convert text to high-quality speech using Google Chirp3 HD and Deepgram Aura-2. TTS is async — submit, poll, then download.
Workflow
tts.listVoices()Fetch all available voicestts.synthesize()Submit a synthesis job, returns synthesisIdtts.getSynthesisStatus()Poll status: 'pending' | 'completed' | 'failed'tts.downloadAudio()Stream the completed audio fileSpeech-to-Text
Transcribe audio files asynchronously. Returns full text plus per-word segment timestamps.
Methods
stt.transcribe()Upload audio file and start transcriptionstt.getTranscriptionStatus()Poll for result — includes text and segmentsCredits & Analytics
Monitor API usage, manage credits, and access detailed analytics with date-range filtering.
Methods
credits.getCredits()Current balancecredits.purchaseCredits()Add credits to accountanalytics.getUsageStats()Usage data with from/to date rangeRAG & Agents
Use Retrieval-Augmented Generation for document Q&A, and run specialised AI agents.
Methods
rag.createSession()Start a RAG session with document listrag.query()Ask a question against the sessionagents.listAgents()Fetch available agentsagents.runAgent()Execute an agent with a promptMinimal Voice UI
Bare-minimum setup — no info bar, no share button, compact size.
Next.js Integration
Full-page Next.js route using environment variables and custom orb styling.
Complete TTS Workflow
End-to-end: authenticate → list voices → synthesise → poll → download.
STT with Error Handling
Robust transcription with typed error catching and status polling.
TypeScript Support
Both packages ship full TypeScript definitions. Import types alongside components for complete type safety.
Key Types
VoiceUIPropsAll props accepted by the VoiceUI componentUseAgentConnectOptionsOptions for the useAgeOfAiConnect hookTranscriptMessageSingle message in the transcript arrayError Handling
All SDK errors extend ScoreexlError and expose message, statusCode, code, and details.
Error Types
AuthenticationErrorLogin or token issuesRateLimitErrorAPI rate limit exceededTranscriptionErrorSTT job failureSynthesisErrorTTS job failureRequirements & Configuration
System requirements and advanced client configuration options.
System Requirements
React 18+Required for the UI libraryNode.js 16+Required for the SDKTailwind CSSRecommended for styling the UI componentPipecat ServerRunning instance for voice processing