SNOWY SDK

SNOWY SDK

Integrate wallet-gated AI inference into your Solana dApps with production-ready SDKs

Install SDK

Quick Start

Installation
Install via npm, yarn, or pnpm
npm install @snowy/sdk
Basic Usage
Initialize and make your first inference request
import { SnowyClient } from '@snowy/sdk';
import { Connection, PublicKey } from '@solana/web3.js';

// Initialize client
const client = new SnowyClient({
  connection: new Connection('https://api.mainnet-beta.solana.com'),
  wallet: yourWalletAdapter,
});

// Generate text
const response = await client.inference.generate({
  prompt: "Create a viral meme caption for a polar bear",
  model: "snowy-v1",
  maxTokens: 100,
});

console.log(response.text);

SDK Features

Wallet Authentication
Seamless integration with Solana wallet adapters. No API keys required - authenticate using wallet signatures.
Type-Safe APIs
Full TypeScript support with comprehensive type definitions for IntelliSense and compile-time safety.
Streaming Support
Real-time streaming inference for interactive applications with token-by-token generation.
On-Chain Verification
Verify inference requests and responses on-chain for transparent usage tracking and billing.
Error Handling
Comprehensive error handling with detailed error messages, retry logic, and rate limit management.
Framework Support
Works seamlessly with Next.js, React, Vue, and other modern web frameworks and Solana programs.

API Reference

Core Methods
Main SDK methods for interacting with SNOWY

client.inference.generate()

Generate text completions using the SNOWY model with customizable parameters.

client.inference.stream()

Stream text completions token-by-token for real-time inference display.

client.auth.verify()

Verify wallet signature for authentication and authorization.

client.usage.getStats()

Retrieve on-chain usage statistics for the connected wallet.

Ready to Build?

Start integrating SNOWY into your dApp today with our comprehensive SDK and documentation.