Developer Guide

UPAI Platform Integration Guide

Learn how to authenticate with the UPAI API, stream reasoning tokens from Gemini 3.6 Flash, handle rate limits, and build resilient client integrations.

1. Quickstart

Install the official client SDK and initialize with your project API key. Never expose your API key in browser bundles or commit it to source control.

Installation
npm install @upai/sdk
index.ts
import { UltronClient } from '@upai/sdk';

// Initialize the client strictly server-side
const client = new UltronClient({
  apiKey: process.env.UPAI_API_KEY, // Key format: upai_live_...
  baseUrl: 'https://api.upaitechnologies.com/v1',
});

2. API Key Authentication

All developer requests must include your API key in the Authorization header using the Bearer scheme. Keys follow the prefix format upai_live_....

Cryptographic Key Security

UPAI hashes all API keys using SHA-256 before storage. Full key secrets are revealed only once upon creation and cannot be recovered if lost.

3. Real SSE Streaming

Enable true server-sent event streaming by setting stream: true. Response chunks are pushed incrementally as they are synthesized by Gemini 3.6 Flash.

stream-example.ts
// Consuming true Server-Sent Events stream
const response = await client.chat.stream({
  model: 'gemini-3.6-flash',
  messages: [
    { role: 'system', content: 'You are an expert systems architect.' },
    { role: 'user', content: 'Design an idempotent payment webhook handler.' }
  ],
  temperature: 0.2,
});

for await (const chunk of response) {
  process.stdout.write(chunk.text);
}

4. Active Foundation Models

gemini-3.6-flash

High-velocity multimodal reasoning and agent tool orchestration.

Active