SAGEA Logo
SAGEABeta

SDK Usage

Using the SAGEA SDK

The SAGEA SDK provides a simple way to integrate our powerful AI capabilities directly into your applications. Access VORA voice synthesis, language models, and vision processing with just a few lines of code.

📦 Multiple SDK Options

SAGEA provides SDKs for multiple programming languages including Python, JavaScript/TypeScript, Go, and Rust.

Installation

Python SDK

pip install sagea-sdk

JavaScript/TypeScript SDK

npm install @sagea/sdk
# or
yarn add @sagea/sdk

Go SDK

go get github.com/sagea-ai/go-sdk

Quick Start

from sagea import SAGEA
 
# Initialize the client
client = SAGEA(api_key="your_api_key_here")
 
# Synthesize speech with VORA
response = client.voice.synthesize(
    text="Hello, world! This is VORA speaking.",
    voice="vora-v1",
    emotion="friendly"
)
 
# Save the audio
with open("output.wav", "wb") as f:
    f.write(response.audio)

Perform Business Forecasting

Generate forecasts based on historical data:

api.forecast({
  revenue: [10000, 12000, 15000],
  timeframe: "monthly",
  periods: 3
})
  .then(data => console.log("Forecast Result:", data))
  .catch(error => console.error("Forecasting Error:", error.message));

Get insights on market trends based on social data:

api.analyzeSocialTrends({
  keyword: "AI Trends",
  sources: ["twitter", "news", "blogs"],
  timeframe: "last_30_days"
})
  .then(data => console.log("Social Trends Analysis:", data))
  .catch(error => console.error("Social Analysis Error:", error.message));

Advanced Configuration

You can configure the SDK with additional options:

const api = new ApparatusAI("apai_your_api_token_here", {
  timeout: 30000, // 30 seconds
  baseUrl: "https://api.custom-domain.apparatusai.space",
  debug: true
});

Error Handling

The SDK uses a consistent error handling pattern:

try {
  const forecast = await api.forecast({
    revenue: [10000, 12000, 15000]
  });
  console.log("Success:", forecast);
} catch (error) {
  console.error("Error Code:", error.code);
  console.error("Error Message:", error.message);
  console.error("Error Details:", error.details);
}

Complete SDK Reference

For a full list of available methods and options, check out our SDK Reference Guide.

On this page