Quick Start
Get a working AI product live in 5 minutes. Pick your path:
BYOK — OpenAI / Anthropic / Gemini
Create your AI product in the dashboard
Go to AI Products → Set up new AI product in your Aerostack dashboard.
- Choose “AI provider API”
- Select your provider (OpenAI, Anthropic, Gemini, or Workers AI)
- Paste your API key — it’s encrypted at rest with AES-GCM
- Pick a model (e.g.
gpt-4o) - Create at least one subscription plan (e.g. “Free — 10,000 tokens/month”)
Copy your project slug and api slug from the final step.
Add the chat widget (fastest path)
<script src="https://hub.aerostack.io/chat.js"
data-project="your-project"
data-api="your-api-slug"
data-mode="bubble">
</script>That’s it. The widget handles OTP sign-in, streaming, and quota display.
Or build your own UI with the React SDK
npm install @aerostack/reactimport { AerostackProvider } from '@aerostack/react'
import { useGatewayChat } from '@aerostack/react'
// Wrap your app
export default function App() {
return (
<AerostackProvider projectId="your-project" baseUrl="https://api.aerocall.ai/v1">
<MyChatPage />
</AerostackProvider>
)
}
// Use in any component
function MyChatPage() {
const { messages, sendMessage, isStreaming } = useGatewayChat({
apiSlug: 'your-api-slug',
consumerKey: process.env.NEXT_PUBLIC_CONSUMER_KEY,
welcomeMessage: 'Hi! How can I help?',
})
return (
<div>
{messages.map(m => (
<div key={m.id} className={m.role === 'user' ? 'text-right' : 'text-left'}>
{m.content}
</div>
))}
<input
onKeyDown={e => e.key === 'Enter' && sendMessage(e.currentTarget.value)}
disabled={isStreaming}
placeholder="Type a message..."
/>
</div>
)
}Or use the universal SDK
Works in any framework — Vue, Svelte, vanilla JS, React Native, Node.js.
npm install @aerostack/sdkimport { AerostackClient } from '@aerostack/sdk'
const ai = new AerostackClient({ baseUrl: 'https://api.aerocall.ai/v1' })
ai.gateway.setConsumerKey('ask_live_your_key')
await ai.gateway.stream({
apiSlug: 'your-api-slug',
messages: [{ role: 'user', content: 'Explain quantum entanglement simply.' }],
onToken: delta => process.stdout.write(delta),
onDone: ({ tokensUsed }) => console.log(`\nUsed ${tokensUsed} tokens`),
})What happens at runtime
1. User opens widget → JWT checked (or OTP sign-in if none)
2. User sends message → POST /api/gateway/:apiSlug/v1/chat/completions
3. Gateway validates key/JWT → checks quota → enforces rate limit
4. BYOK: runs pipeline (RAG → pre-hook → LLM → post-hook)
BYOC: proxies directly to your server
5. SSE stream flows back → widget renders token by token
6. Usage logged → wallet debited → stats available in dashboardNext steps
- Auth Modes — choose Aerostack Auth, key-only, or BYO JWT
- Pipeline Builder — add RAG, hooks, model fallbacks
- Subscription Plans — set up free and paid tiers
- Chat Widget — full embed reference
- SDK Reference —
useGatewayChat,gateway.stream(), and more