Simple pass-through to enclave chat completion endpoint with encrypted payload. Rvenc = raw volatile encrypted. Accepts a single encrypted inference parameter that encapsulates all chat completion data. Only provides authentication, security checks, and token rate limiting. No chat history, file management, or custom features.
| Option | Default | Description |
|---|---|---|
apiKey | required | Authorization token |
encryptionKeys | auto-generated | Pre-generated { sharedSecret, cipherText } |
requestTimeoutMs | 30000 | Request timeout in ms |
maxBufferSize | 10MB | Max SSE buffer size |
Send your access token as header Authorization: Bearer {accessToken}
Your API key that starts with sk_live or sk_test. You can create yours at go.prem.io/api-keys.
Request body for rvenc (raw volatile encrypted) chat completion. Contains an encrypted payload with cryptographic materials needed for decryption.
Encrypted JSON string containing all chat completion parameters. When decrypted, this string must match the structure shown in the expandable _decryptedInference property below (reference only - do not send this property).
Cipher text for shared secret generation (ECDH key exchange)
Nonce used for encrypting the inference payload
Server-sent events stream with encrypted OpenAI-compatible chat completion chunks. Each chunk in the stream is encrypted and must be decrypted using the same shared secret and nonce from the request.
Server-sent events (SSE) stream response structure. The actual response is a text stream, but this schema documents the structure for reference.
Server-sent events (SSE) stream with encrypted chat completion chunks. The stream contains three types of events:
event: data followed by data: <encrypted_hex_string> - Encrypted chunk that must be decrypted using the same shared secret and nonce from the request. When decrypted, each chunk matches the structure shown in the _decryptedChunk property below (reference only).event: error followed by data: <error_data> - Error event (can be encrypted or plain JSON)event: done followed by data: [DONE] - Stream completion markerEach encrypted data: line contains a hex-encoded string. Decrypt each chunk using XChaCha20-Poly1305 with the shared secret and nonce from your request.
Reference only - This shows the structure that each encrypted chunk should contain when decrypted. Decrypt each chunk in the stream using the same shared secret and nonce from your request to get this structure.
{
"id": "cd9d05b657a041a6a14ab2fc890a7d7e",
"object": "chat.completion.chunk",
"created": 1764004858,
"model": "openai/gpt-oss-120b",
"choices": [
{
"index": 0,
"delta": {
"role": null,
"content": null,
"reasoning_content": "This ",
"tool_calls": null
},
"logprobs": null,
"finish_reason": null,
"matched_stop": null
}
],
"usage": null
}{
"id": "cd9d05b657a041a6a14ab2fc890a7d7e",
"object": "chat.completion.chunk",
"created": 1764004858,
"model": "openai/gpt-oss-120b",
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": "Hello",
"reasoning_content": null,
"tool_calls": null
},
"logprobs": null,
"finish_reason": null,
"matched_stop": null
}
],
"usage": null
}{
"id": "cd9d05b657a041a6a14ab2fc890a7d7e",
"object": "chat.completion.chunk",
"created": 1764004858,
"model": "openai/gpt-oss-120b",
"choices": [
{
"index": 0,
"delta": [],
"logprobs": null,
"finish_reason": "stop",
"matched_stop": null
}
],
"usage": null
}