Solrouter

TypeScript SDK

Install @solrouter/sdk and call client.chat(). The prompt is sealed inside chat() before the request leaves your process.

An encrypted-by-default client for your own app or agent. client.chat() seals the prompt to the enclave's key before it sends anything, and opens the sealed reply for you.

ItemValue
Package@solrouter/sdk
Modelgpt-oss-20b (default)
NeedsNode.js 18 or newer
SealedYes, for client.chat() with the default encrypted: true

Setup

Install

npm install @solrouter/sdk

Send a sealed prompt

Encryption happens inside chat() before the request is sent.

import { SolRouter } from '@solrouter/sdk';

const client = new SolRouter({ apiKey: process.env.SOLROUTER_API_KEY });
const res = await client.chat('Summarise this contract', { model: 'gpt-oss-20b' });
console.log(res.message);
ModelWhy
gpt-oss-20bThe default and the only live id in the SDK's type

The other two models are reachable by passing the backend id with a cast, for example model: 'nosana:qwen3-coder:30b' as any. See Models.

What is sealed

  • Sealed: client.chat(prompt) and client.chat(prompt, { encrypted: true }).
  • Not sealed: client.chat(prompt, { encrypted: false }) and client.chat(prompt, { reasoning: 'braid' }). Both send the prompt to Solrouter's backend in plaintext.
  • Metadata you pass, such as chatId or systemPrompt, reaches the backend in plaintext on every path.

Every option is on Privacy SDK.

When it fails

SymptomFix
apiKey is required or invalid apiKey formatPass a key that starts with sk_solrouter_. Create one on the keys page.
401 unauthorizedThe key was deleted or mistyped.
402 insufficient fundsYour plan calls are used up and the USDC balance is below $0.02. Pick a plan or add USDC. See Pricing.
Model not foundUse gpt-oss-20b. qwen3-8b is still in the SDK's type but that model is retired.
"Nosana GPU node is warming up"The model's node was idle. Wait a moment and retry.

On this page