Quick start
5 minGet your first AI + VI response in under 5 minutes. You'll need an API key from your Pro or Developer plan.
npm install @uniaivi/sdkimport { Uniaivi } from '@uniaivi/sdk';
const client = new Uniaivi({ apiKey: 'uai_your_api_key' });
const response = await client.chat.complete({
model: 'uniaivi-fusion-1',
messages: [
{ role: 'user', content: 'Explain quantum entanglement simply.' }
]
});
console.log(response.message.content);node index.js
# → "Quantum entanglement is when two particles..."Authentication
All API requests must include your API key in the Authorization header as a Bearer token.
curl https://api.uniaivi.com/v1/chat/completions \
-H "Authorization: Bearer uai_your_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"uniaivi-fusion-1","messages":[{"role":"user","content":"Hello"}]}'Never expose your API key in client-side code. Use environment variables and a backend proxy for browser-based apps.
Chat API
The core endpoint. Send a list of messages and receive a response from the AI + VI fusion model.
POST https://api.uniaivi.com/v1/chat/completionsmodelrequiredstringModel ID. Use uniaivi-fusion-1 for full AI + VI.
messagesrequiredarrayArray of message objects with role (system | user | assistant) and content.
max_tokensintegerMaximum tokens in the response. Default: 2048.
temperaturefloatSampling temperature 0–2. Higher = more creative. Default: 0.7.
streambooleanStream the response as server-sent events. Default: false.
vi_modestringVirtual Intelligence mode: auto | focused | creative | analytical. Default: auto.
Example response
{
"id": "chatcmpl_abc123",
"model": "uniaivi-fusion-1",
"created": 1719302400,
"message": {
"role": "assistant",
"content": "Quantum entanglement is when two particles...",
"vi_context": {
"intent": "educational_explanation",
"confidence": 0.97,
"mode": "analytical"
}
},
"usage": {
"prompt_tokens": 14,
"completion_tokens": 128,
"total_tokens": 142
}
}Streaming
Set stream: true to receive tokens as server-sent events — ideal for chat UIs.
const stream = await client.chat.stream({
model: 'uniaivi-fusion-1',
messages: [{ role: 'user', content: 'Write a haiku about AI.' }]
});
for await (const chunk of stream) {
process.stdout.write(chunk.delta.content ?? '');
}
// → "Silicon dreams hum / Patterns bloom in the dark void / Mind without a soul"Webhooks
Subscribe to events in your Uniaivi account and receive HTTP POST notifications to your endpoint.
message.completedFired when a chat response finishes.
usage.thresholdFired when token usage crosses 80% or 100%.
conversation.createdFired when a new conversation is started.
conversation.deletedFired when a conversation is deleted.
// Verify webhook signature
import crypto from 'crypto';
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}SDKs
Official SDKs for the most popular languages. All SDKs are open source and MIT licensed.
JavaScript / TypeScript
@uniaivi/sdknpm install @uniaivi/sdkPython
uniaivipip install uniaiviGo
github.com/uniaivi/go-sdkgo get github.com/uniaivi/go-sdkRate limits
Rate limits are applied per API key. Exceeding a limit returns a 429 Too Many Requests response.
| Plan | Requests / min | Tokens / month |
|---|---|---|
| Starter | — | — |
| Pro | 60 | 1M |
| Developer | 500 | 10M |
| Enterprise | Custom | Custom |
Models
Choose the right model for your use case. All models include the VI perception layer.
uniaivi-fusion-1RecommendedFull AI + VI fusion. Best accuracy, context awareness, and VI perception. Ideal for most applications.
uniaivi-fusion-1-fastLow latencyOptimized for speed. 3× faster than fusion-1 with 90% of the quality. Great for real-time chat UIs.
uniaivi-vi-miniLightweightCompact model with core VI layer. Lowest cost and latency. Best for simple Q&A and classification tasks.
Full API reference
| Method | Endpoint |
|---|---|
| POST | /v1/chat/completions |
| POST | /v1/chat/stream |
| GET | /v1/conversations |
| POST | /v1/conversations |
| GET | /v1/conversations/:id |
| DELETE | /v1/conversations/:id |
| GET | /v1/models |
| GET | /v1/usage |
Ready to build?
Get your API key on the Pro or Developer plan and start integrating AI + VI today.