Build on TiwiLab.
Everything is one base URL and one bearer token. The SDK is a thin typed wrapper over it — you can use plain fetch if you would rather.
Private beta. Endpoints and response shapes are still moving. We will version them before general availability, and tell you before anything breaks.
Quickstart
npm install @tiwi/client @tiwi/swapimport { TiwiLab } from "@tiwi/client";
const lab = new TiwiLab({
apiKey: process.env.TIWILAB_KEY!, // server-side, or a restricted key in the client
});
const { balances } = await lab.portfolio.get({
EVM: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
});
console.log(balances.length, "tokens");The base URL is https://lite.tiwiprotocol.xyz/api. Send your key as Authorization: Bearer tiwi_live_….
Web and React Native
One package, both targets. The client makes no assumption about its environment — no Node builtins, no window, no crypto shims — so Metro bundles it without configuration.
// React Native: the same package, no polyfills required.
// @tiwi/client is fetch-only - no Node builtins, no window access.
import { TiwiLab } from "@tiwi/client";Endpoints
/partner/v1/chains0 creditsEvery chain we can read, with its canonical id, native currency and explorer.
/partner/v1/portfolio10 creditsEvery token held by a wallet's addresses, merged across sources and priced.
/partner/v1/prices1 creditsUSD prices for a list of tokens, keyed by chainId:address, with 24h change where the source reports one.
/partner/v1/tokens1 creditsSearchable token list, filterable by chain and category.
/partner/v1/token/:chainId/:address1 creditsMetadata for a single token: decimals, symbol, logo, verification status.
/partner/v1/quote5 creditsThe best route for a swap, same-chain or cross-chain, with alternatives.
/partner/v1/usage0 creditsYour own consumption, by endpoint, by hour.
Backoff and headers
Every response carries your current budget. Read these rather than retrying blind — a tight retry loop against a 429 is the fastest way to stay rate limited.
X-RateLimit-LimitYour credits per minute.X-RateLimit-RemainingCredits left in the current window.X-RateLimit-ResetUnix seconds when the window resets.Retry-AfterSeconds to wait. Sent on 429 only.One envelope, every time
{
"error": {
"code": "rate_limited",
"message": "Credit limit exceeded. Retry in 12 seconds.",
"request_id": "req_a1b2c3d4"
}
}Every failure carries a request_id. Send it to us and we can find the exact call in our logs — it is far faster than a description.
Uptime
A public status page ships alongside general availability. During beta, incidents are announced in your dashboard and by email to the address on your account.