Get Started
Authentication
Authenticate with the Prem API using your API key and client encryption key (KEK).
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Authenticate with the Prem API using your API key and client encryption key (KEK).
import createRvencClient from "@premai/api-sdk";
const client = await createRvencClient({
apiKey: process.env.PREM_API_KEY,
clientKEK: process.env.CLIENT_KEK
});
// Verify authentication
const response = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
import createRvencClient, { generateEncryptionKeys } from "@premai/api-sdk";
// Generate keys once
const encryptionKeys = await generateEncryptionKeys();
// Reuse keys across multiple requests
const client = await createRvencClient({
apiKey: process.env.PREM_API_KEY,
encryptionKeys,
});
const response = await client.chat.completions.create({
model: "deepseek-v4-flash",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
const client = await createRvencClient({
apiKey: process.env.PREM_API_KEY,
clientKEK: process.env.CLIENT_KEK,
requestTimeoutMs: 60000, // 60 seconds
maxBufferSize: 20 * 1024 * 1024, // 20MB
});