ASTACK
DEVELOPER
DOCUMENTATION
Build real-time video-to-video AI applications with sub-1000ms response times. AStack provides production-ready APIs for conversational AI.
QUICK START
Get your first AStack integration running in under 5 minutes.
GET YOUR API KEY
Sign up for an AStack account and create your first API key from the dashboard.
CREATE ACCOUNT →SIGN UP →INSTALL THE SDK
$ npm install @astack/client-sdk # or with yarn $ yarn add @astack/client-sdk
CREATE YOUR FIRST SESSION
import { AStackClient } from '@astack/client-sdk'; const client = new AStackClient('your-api-key'); // Create a session const session = await client.createSession({ endUserId: 'user-123', connectionType: 'webrtc' }); // Start video-to-video conversation await session.start({ onResponse: (response) => { console.log('AI Response:', response); }, onLatency: (ms) => { console.log('Latency:', ms + 'ms'); } });
AUTHENTICATION
Secure your API requests with authentication tokens and best practices.
API KEYS
AStack uses API keys for authentication. Include your API key in the Authorization header:
$ curl -X POST https://api.astack.dev/api/v1/sessions \ -H "Authorization: Bearer ak_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"end_user_id": "user_123"}'
SECURITY BEST PRACTICES
- ▶Never expose API keys in client-side code
- ▶Use environment variables to store keys
- ▶Rotate keys regularly (every 90 days recommended)
- ▶Use different keys for different environments
- ▶Monitor key usage for unusual activity
API KEY MANAGEMENT
Create, manage, and secure your API keys for different environments and use cases.
CREATING API KEYS
Create and manage API keys from your dashboard. Each key can have specific permissions:
- ▶
session_create
Create new sessions - ▶
session_manage
Manage existing sessions - ▶
metrics_read
Access usage metrics
RATE LIMITS
Understand usage limits and how to optimize your API requests for best performance.
DEFAULT LIMITS
Rate limits can be customized per API key. Contact support for higher limits.
SESSIONS API
Create and manage real-time video-to-video AI sessions with comprehensive lifecycle management.
CREATE SESSION
POST /api/v1/sessions { "end_user_id": "user_123", "connection_type": "webrtc", "metadata": { "user_type": "premium" } }
Creates a new session and returns a session token for WebRTC connection.
SESSION LIFECYCLE
WEBRTC INTEGRATION
Establish real-time peer-to-peer connections for low-latency video streaming.
CONNECTION SETUP
// Initialize WebRTC connection const pc = new RTCPeerConnection({ iceServers: [ { urls: 'stun:stun.astack.dev:3478' }, { urls: 'turn:turn.astack.dev:3478', username: session.turn_username, credential: session.turn_password } ] }); // Add local media stream const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true }); stream.getTracks().forEach(track => { pc.addTrack(track, stream); });
BILLING & PRICING
Transparent usage-based pricing with flexible tier options for any scale.
USAGE-BASED PRICING
Billing is calculated per second of active session time. 60-second minimum on Standard tier, 30-second minimum on Premium tier.
SUPPORT & RESOURCES
Get help from our team and access additional resources for your integration.