@solrouter/sdk
v1.0.0
Published
SolRouter Privacy SDK - End-to-end encrypted AI API calls
Maintainers
Readme
@solrouter/sdk
Privacy-first AI API client with end-to-end encryption.
Installation
npm install @solrouter/sdkQuick Start
import { SolRouter } from '@solrouter/sdk';
const client = new SolRouter({
apiKey: 'sk_solrouter_your_key_here'
});
// Your prompt is encrypted client-side before being sent
const response = await client.chat('Explain quantum computing');
console.log(response.message);How It Works
- Client-side Encryption: Your prompt is encrypted using Arcium's RescueCipher before leaving your device
- Blind Backend: The server only sees encrypted data - it cannot read your prompt
- TEE Processing: Decryption only happens inside a Trusted Execution Environment (hardware-isolated)
- Encrypted Response: The AI response is encrypted back to you
API Reference
new SolRouter(config)
Create a new SolRouter client.
const client = new SolRouter({
apiKey: 'sk_solrouter_...', // Required: Your API key
baseUrl: 'https://...', // Optional: Custom API URL
encrypted: true, // Optional: Enable encryption (default: true)
});client.chat(prompt, options?)
Send a chat message.
const response = await client.chat('Hello!', {
model: 'gpt-oss-20b', // Model to use
encrypted: true, // Override encryption setting
systemPrompt: 'You are...', // System prompt
chatId: 'conv-123', // For multi-turn conversations
useRAG: false, // Enable knowledge retrieval
useLiveSearch: false, // Enable web search
});
console.log(response.message); // AI response
console.log(response.encrypted); // Was request encrypted?
console.log(response.usage); // Token usage
console.log(response.cost); // Cost in USDCAvailable Models
| Model | Description |
|-------|-------------|
| gpt-oss-20b | Open-source GPT 20B (default, cheapest) |
| qwen3-8b | Qwen 3 8B parameters |
| gemini-flash | Google Gemini Flash |
| claude-sonnet | Anthropic Claude Sonnet |
| gpt-4o-mini | OpenAI GPT-4o Mini |
client.getBalance()
Check your account balance.
const balance = await client.getBalance();
console.log(balance.balanceFormatted); // "$10.5000"Pricing
| Model | Input (per 1M tokens) | Output (per 1M tokens) | |-------|----------------------|------------------------| | gpt-oss-20b | $0.15 | $0.30 | | qwen3-8b | $0.05 | $0.10 | | gemini-flash | $0.075 | $0.30 | | claude-sonnet | $3.00 | $15.00 | | gpt-4o-mini | $0.15 | $0.60 |
Privacy Guarantee
When encryption is enabled (default):
- Your prompts are encrypted on your device using Arcium's MPC encryption
- The SolRouter backend NEVER sees your plaintext prompts
- Decryption only happens inside a hardware-isolated TEE
- On-chain privacy attestations are available for verification
Get an API Key
- Visit solrouter.com/api
- Connect your wallet
- Generate an API key
- Deposit USDC to fund your account
