Documentation
Comprehensive guides and API documentation for the Micro AI platform
Migrating to Micro AI
Complete guide for software developers to migrate their applications to use local and online LLMs through Micro AI
Quick Setup
API Key Required: Contact elie.r@sirenanalytics.com to get your Micro AI API key.
Base URL
https://microai.staging.sirenanalytics.com/llm_router/v1Replace OpenAI's base URL with your Micro AI endpoint
Authentication
Bearer your-microai-keyUse Micro AI generated keys (not OpenAI keys)
Migration Examples
PythonBefore → After
❌ Before (OpenAI)
from openai import OpenAI
client = OpenAI(
api_key="sk-proj-xxx" # OpenAI key
)
response = client.chat.completions.create(
model="gpt-4.1",
messages=[{"role": "user", "content": "Hello"}]
)✅ After (Micro AI)
from openai import OpenAI
client = OpenAI(
base_url="https://microai.staging.sirenanalytics.com/llm_router/v1",
api_key="microai-key-xxx", # Micro AI key
timeout=60 # Increased timeout
)
response = client.chat.completions.create(
model="openai/gpt-4.1", # Local model
messages=[{"role": "user", "content": "Hello"}]
)JavaScriptBefore → After
❌ Before (OpenAI)
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'sk-proj-xxx' // OpenAI key
});
const response = await openai.chat.completions.create({
model: 'gpt-4.1',
messages: [{ role: 'user', content: 'Hello' }]
});✅ After (Micro AI)
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://microai.staging.sirenanalytics.com/llm_router/v1',
apiKey: 'microai-key-xxx', // Micro AI key
timeout: 60000 // Increased timeout
});
const response = await openai.chat.completions.create({
model: 'openai/gpt-4.1', // Local model
messages: [{ role: 'user', content: 'Hello' }]
});cURLRaw HTTP Request
curl -X POST "https://microai.staging.sirenanalytics.com/llm_router/v1/chat/completions" \
-H "Authorization: Bearer microai-key-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4.1",
"messages": [{"role": "user", "content": "Hello"}],
"max_tokens": 150
}'Available Models
☁️ Online Models
All OpenAI, Cohere, and OpenRouter models:
GET https://microai.staging.sirenanalytics.com/llm_router/modelsAdditional Services
Text Tools
Chunking, tokenization, and NLP utilities
https://microai.staging.sirenanalytics.com/text_toolsLangFuse Logs
Monitor your requests and performance
https://microai.staging.sirenanalytics.com/langfuseBest Practices & Lessons Learned
Increase Timeout: Set request timeout to 60+ seconds to handle server load spikes gracefully.
Implement Retry Logic: Add retry mechanisms with exponential backoff before throwing errors.
Use Concurrent Requests: Make parallel API calls instead of sequential ones to reduce overall latency.