Skip to main content
POST
Encrypted Audio Transcriptions (RVENC)

TypeScript SDK

The SDK is available on GitHub: premAI-io/api-sdk-ts

Usage

Basic Setup

Create a client with auto-generated encryption keys:

Pre-generate Keys

You can pre-generate encryption keys and reuse them:

Basic Transcription

Transcription with Options

Configuration

Note: openai/whisper-large-v3 model supports non-streaming only.

OpenAI-Compatible API Server

Run as a standalone server with automatic DEK store management per API key:
Use with any OpenAI-compatible client:
Or use the SDK directly in Node.js:
The server caches clients in memory per API key for better performance.

Authorizations

Authorization
string
header
required

Send your access token as header Authorization: Bearer {accessToken}

Authorization
string
header
required

Your API key that starts with sk_live or sk_test. You can create yours at go.prem.io/api-keys.

Body

application/json

Request body for rvenc (raw volatile encrypted) audio transcription. Contains an encrypted payload with cryptographic materials needed for decryption.

encryptedInference
string
required

Encrypted JSON string containing all audio transcription parameters. When decrypted, this string must match the structure shown in the expandable _decryptedInference property below (reference only - do not send this property).

cipherText
string
required

Cipher text for shared secret generation (ECDH key exchange)

nonce
string
required

Nonce used for encrypting the inference payload

encryptedFileName
string
required

The encrypted audio file name. The file name is encrypted using XChaCha20-Poly1305 with the shared secret and fileNameNonce.

fileNameNonce
string
required

Nonce used for encrypting the encrypted audio file name

encryptedFile
string
required

The encrypted audio file data. The audio content is encrypted using XChaCha20-Poly1305 with the shared secret and fileNonce.

fileNonce
string
required

Nonce used for encrypting the encrypted audio file

Response

Encrypted audio transcription response. The response contains the encrypted transcription result which must be decrypted using the shared secret derived from the request's cipherText, along with the response nonce.

status
enum<integer>
required

Status code of the response

Available options:
200,
201,
202
data
object
required

Encrypted audio transcription response. Contains the encrypted transcription result that must be decrypted using the shared secret derived from the request's cipherText.

Example:
message
string | null
required

Message of the response, human readable

Example:

"Resource created successfully"

env
enum<string>
required

API environment

Available options:
development,
production
error
string | null

Error message of the response, human readable

Example:

"Invalid email address"

log

Useful informaiton, not always present, to debug the response

Examples:

"Some pertinent log message"

validator

Validator response object, each key is the field name and value is the error message

Example:
support_id
string<uuid> | null

Support ID linked to the response, used to identify it when talking with our team

Example:

"support_uuidv7-something-else"