SDKs

Rust CLI

solvela-cli — command-line tool for interacting with the Solvela gateway

Installation

cargo install solvela-cli

Or build from the monorepo:

cargo build --release -p solvela-cli
# Binary at: target/release/solvela

Configuration

The CLI reads these environment variables:

export SOLVELA_API_URL=https://api.solvela.ai              # optional; default https://api.solvela.ai
export SOLANA_RPC_URL=https://api.mainnet-beta.solana.com  # required for any paid command (signs USDC-SPL tx)
export RUST_LOG=info                                       # optional logging

SOLANA_RPC_URL is required whenever the CLI has to sign a payment (solvela chat, solvela recover). The public Solana endpoint above works for a smoke test, but its rate limits will throttle real usage — point at your own Helius/QuickNode/Triton RPC for anything beyond that.

The wallet is not read from an environment variable — there is no SOLVELA_SOLANA_PRIVATE_KEY or similar. The CLI loads the keypair from ~/.solvela/wallet.json on every paid command. Initialize one with solvela wallet init (see solvela wallet below) and fund the printed address with USDC-SPL + a small amount of SOL before signing.

Commands

solvela chat

Send a chat completion request.

solvela chat "Explain Solana in one sentence."

# Specify a model
solvela chat --model gpt-4o "Explain Solana in one sentence."

# Use a routing profile (eco, auto, premium, free)
solvela chat --model auto "Complex analysis task..."

# Skip the cost-confirmation prompt (for scripted use)
solvela chat --yes "Write a short story about a Rust programmer."

# Force a specific payment scheme (default: prefer escrow over exact)
solvela chat --scheme exact "Quick one-shot question."

solvela models

List available models with pricing.

solvela models

solvela health

Check gateway health and Solana RPC connectivity.

solvela health

solvela wallet

Manage the local wallet at ~/.solvela/wallet.json. Three subcommands:

solvela wallet init     # Generate a new Solana keypair and print the address to fund
solvela wallet status   # Show address + USDC-SPL balance
solvela wallet export   # Print the base58 secret key (handle with care)

solvela stats

Show gateway usage statistics for your wallet.

solvela stats

solvela doctor

Diagnose common configuration issues.

solvela doctor

Example session

$ solvela health
{
  "status": "ok",
  "solana_rpc": "connected",
  "providers": ["openai", "anthropic", "google", "xai", "deepseek"]
}

$ solvela models
ID                                    Provider    Input $/M   Output $/M
openai/gpt-4o                         openai      2.50        10.00
anthropic/claude-opus-4-20250514      anthropic   5.00        25.00
google/gemini-2.5-flash               google      0.30        2.50
...

$ solvela chat --model eco "Hello, what can you do?"
Hello! I'm an AI assistant. I can help you with...
Cost: $0.000042 USDC

Note

The CLI binary is named solvela. Source code: crates/cli/ in the monorepo.