Solrouter
Build on Solrouter

Quickstart

Sign in with email or a Solana wallet, create an API key, install @solrouter/sdk, and send your first sealed request in a few lines of TypeScript.

Most AI APIs can read every prompt you send them. Solrouter does not: your message is encrypted on your machine before it leaves, and the backend relays it without seeing the plaintext. The next five steps set that up end to end. You sign in, install the SDK, and send your first sealed request. Using Claude Code, Cursor, or Claude Desktop instead? See Integrations.

Get an API key

Your key is how Solrouter authenticates you and counts your calls.

Go to solrouter.com/sdk, sign in with an email address or a Solana wallet, and generate an API key. Then pick a plan: Pro $9 for 2,000 calls, Builder $49 for 12,500, or Scale $99 for 30,000, each per 30 days. Without a plan, each sealed call costs $0.02 from your USDC balance. The 5 free messages belong to the web chat sign-in, not to API keys. See Pricing.

No KYC. If you sign in with email and have no wallet, one is made for you.

Install the SDK

The SDK handles encryption, routing, and decryption for you, so you write normal TypeScript and get privacy by default.

Add @solrouter/sdk to your project using your preferred package manager.

npm install @solrouter/sdk
yarn add @solrouter/sdk
pnpm add @solrouter/sdk

Initialize the client

One call gets you a configured client. Pass your API key.

The SDK fetches the enclave's published public key from GET /tee/public-key before your first encrypted request. That key is the encryption target for your prompts. The SDK does not fetch or verify the attestation quote. To check the enclave yourself, see Attestation.

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

const client = new SolRouter({
  apiKey: 'sk_solrouter_...',
  baseUrl: 'https://api.solrouter.com',
});

baseUrl is optional. Without it the SDK uses the production backend host directly, which serves the same API as api.solrouter.com.

Send your first encrypted chat

Here the privacy guarantee pays off. Your prompt travels encrypted through the Solrouter backend. Only the TEE (Trusted Execution Environment: hardware that isolates code and data from the machine's operator) can decrypt it. The enclave then sends the plaintext to an open-weight model on a Nosana GPU node.

Call client.chat() to send a message. The SDK encrypts it client-side with Arcium's RescueCipher. It sends the encrypted blob through the Solrouter backend, which cannot read it. Then it decrypts the response for you.

Use the default model gpt-oss-20b. The other two models pass through with a type cast; see Models.

// Encrypted end to end: the Solrouter backend never sees plaintext
const response = await client.chat('What are the risks of this DeFi protocol?');
console.log(response.message);

If the GPU node was idle, the first reply can say "Nosana GPU node is warming up". Wait a moment and send the request again.

Check your credit balance

Calls draw from your plan first, then from USDC credit at $0.02 a call. You can read the credit balance from the SDK:

const { balance, balanceFormatted } = await client.getBalance();
console.log(`Balance: ${balanceFormatted}`);

Next steps

You have sent an encrypted request and checked your balance. That is the core loop. Where you go next depends on what you build: the full SDK surface, keyless payments, or direct HTTP access.

On this page