Developer docs

Build with AI + VI

Integrate the full Uniaivi intelligence stack into your product. REST API, streaming, webhooks, and SDKs for every major language.

Get API key

Quick start

5 min

Get your first AI + VI response in under 5 minutes. You'll need an API key from your Pro or Developer plan.

1
Install the SDK
bash
npm install @uniaivi/sdk
2
Make your first request
javascript
import { 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);
3
Run it
bash
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.

bash
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.

http
POST https://api.uniaivi.com/v1/chat/completions
Request body
modelrequired
string

Model ID. Use uniaivi-fusion-1 for full AI + VI.

messagesrequired
array

Array of message objects with role (system | user | assistant) and content.

max_tokens
integer

Maximum tokens in the response. Default: 2048.

temperature
float

Sampling temperature 0–2. Higher = more creative. Default: 0.7.

stream
boolean

Stream the response as server-sent events. Default: false.

vi_mode
string

Virtual Intelligence mode: auto | focused | creative | analytical. Default: auto.

Example response

json
{
  "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.

javascript
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.completed

Fired when a chat response finishes.

usage.threshold

Fired when token usage crosses 80% or 100%.

conversation.created

Fired when a new conversation is started.

conversation.deleted

Fired when a conversation is deleted.

javascript
// 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/sdk
bash
npm install @uniaivi/sdk

Python

uniaivi
bash
pip install uniaivi

Go

github.com/uniaivi/go-sdk
bash
go get github.com/uniaivi/go-sdk

Rate limits

Rate limits are applied per API key. Exceeding a limit returns a 429 Too Many Requests response.

PlanRequests / minTokens / month
Starter
Pro601M
Developer50010M
EnterpriseCustomCustom

Models

Choose the right model for your use case. All models include the VI perception layer.

uniaivi-fusion-1Recommended

Full AI + VI fusion. Best accuracy, context awareness, and VI perception. Ideal for most applications.

128k tokens
uniaivi-fusion-1-fastLow latency

Optimized for speed. 3× faster than fusion-1 with 90% of the quality. Great for real-time chat UIs.

32k tokens
uniaivi-vi-miniLightweight

Compact model with core VI layer. Lowest cost and latency. Best for simple Q&A and classification tasks.

8k tokens

Full API reference

MethodEndpoint
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.