SDKs & Libraries
Official client libraries for integrating with Valta.
TypeScript / JavaScript SDK
The official Valta SDK for TypeScript and JavaScript is the primary client library for interacting with the Valta API. It supports Node.js 18+, Deno, Bun, and modern browsers with full TypeScript type definitions included out of the box.
Installation
Or using other package managers:
Quick Start
Initialize the client with your API key and start making requests immediately:
import { Valta } from "@valta/sdk";
const valta = new Valta({
apiKey: process.env.VALTA_API_KEY,
});Create a Wallet
Provision a new USDC wallet for a user. Each wallet is assigned a unique ID and can hold balances across supported currencies.
const wallet = await valta.wallets.create({
userId: "user_abc123",
currency: "USDC",
metadata: {
label: "Primary Wallet",
},
});
console.log(wallet.id); // "wal_7f3k..."
console.log(wallet.balance); // 0.00
console.log(wallet.currency); // "USDC"Check Balance
Retrieve the current balance for any wallet by its ID. The response includes the available balance, pending holds, and the last updated timestamp.
const balance = await valta.wallets.getBalance("wal_7f3k...");
console.log(balance.available); // 142.50
console.log(balance.pending); // 0.00
console.log(balance.currency); // "USDC"
console.log(balance.updatedAt); // "2026-02-27T10:30:00Z"Deduct Usage
Record a usage event and deduct the corresponding amount from a wallet. Usage deductions are atomic, idempotent (when providing a deduction key), and emit a payment.deducted webhook event.
const deduction = await valta.usage.deduct({
walletId: "wal_7f3k...",
amount: 0.03,
description: "GPT-4o inference — 1,200 tokens",
idempotencyKey: "req_abc123",
});
console.log(deduction.id); // "txn_9x2m..."
console.log(deduction.newBalance); // 142.47
console.log(deduction.status); // "completed"List Transactions
Fetch a paginated list of transactions for a wallet, with optional filters for date range and transaction type.
const txns = await valta.wallets.listTransactions("wal_7f3k...", {
limit: 25,
type: "deduction",
startDate: "2026-02-01",
});
for (const txn of txns.data) {
console.log(txn.id, txn.amount, txn.description);
}Python SDK
The official Python SDK is currently in development and will support Python 3.9+. It will provide the same full-featured interface as the TypeScript SDK, including async/await support via asyncio and synchronous wrappers.
# Coming soon pip install valta
Join the waitlist on our Discord to be notified when the Python SDK enters beta.
Other Languages
SDKs for Go, Ruby, and PHP are on the roadmap. In the meantime, you can integrate with Valta using the REST API directly. All endpoints accept and return JSON, and authentication is handled via Bearer tokens in the Authorization header.
Need Help?
If you run into issues or have questions about the SDK, reach out via our support channels or open an issue on GitHub. We aim to respond within 24 hours.