Official SDKs
Skip the raw HTTP and let the SDKs handle authentication, retries, and typed responses. Same API surface across every language.
npm install @l4b/labs
import { L4B } from "@l4b/labs";
const l4b = new L4B(process.env.L4B_API_KEY);
const { data } = await l4b.emi.calculate({
principal: 1000000,
annual_rate_pct: 10.5,
tenure_months: 60,
});
console.log(data.emi); // 21493.9pip install l4b-labs
from l4b_labs import L4B
l4b = L4B(api_key="l4b_live_...")
resp = l4b.emi.calculate(
principal=1_000_000,
annual_rate_pct=10.5,
tenure_months=60,
)
print(resp.data.emi) # 21493.9composer require loan4bank/labs
<?php
require_once 'vendor/autoload.php';
use L4B\Labs\Client;
$l4b = new Client(getenv('L4B_API_KEY'));
$resp = $l4b->emi->calculate([
'principal' => 1000000,
'annual_rate_pct' => 10.5,
'tenure_months' => 60,
]);
echo $resp->data->emi; // 21493.9implementation 'com.loan4bank:labs:1.2.0'
import com.loan4bank.labs.L4B;
import com.loan4bank.labs.model.EmiRequest;
L4B l4b = new L4B(System.getenv("L4B_API_KEY"));
var resp = l4b.emi().calculate(
EmiRequest.builder()
.principal(1_000_000)
.annualRatePct(10.5)
.tenureMonths(60)
.build()
);
System.out.println(resp.getData().getEmi()); // 21493.9Common SDK conventions
- Read the API key from
L4B_API_KEYin your environment. - Every SDK auto-retries on 429 and 5xx with exponential backoff (max 3 attempts).
- Errors surface as typed exceptions carrying the L4B code —
try/catchonL4B.PlanGateError,L4B.RateLimitError, etc. - Sandbox vs live is chosen purely by the key prefix —
l4b_sandbox_…orl4b_live_….
No SDK for your language?
Every endpoint is a plain HTTP call with an X-API-Key header — you can integrate from anywhere with a fetch/curl-equivalent. Open a GitHub Discussion if you'd like us to prioritise a Ruby, Go, or Rust client.
Why use an official LOAN4BANK SDK?
The LOAN4BANK SDKs are thin, batteries-included clients that turn every REST endpoint into a native function call in your language of choice. They wrap authentication, retries, HMAC signing, response typing, error class hierarchy and pagination so your integration code can focus on the business logic instead of transport plumbing. Every SDK ships from the same monorepo and is released on the same day as the API — you can pin exact versions with lock files, and Renovate/Dependabot updates just work.
The JavaScript / TypeScript SDK is the most mature and doubles as a Node.js server-side client and a browser client (the browser bundle is tree-shaken and only imports the endpoints you actually use — median footprint is under 12 KB gzipped). The Python SDK targets 3.10+ and uses `httpx` for asyncio-first performance; both sync and async APIs are exposed. The PHP SDK works on 8.1+ and integrates cleanly with Laravel service providers. The Java SDK targets JDK 17+ and ships as a shaded jar so you don't fight transitive-dependency conflicts. The Go SDK follows the `context.Context` convention throughout and lets you inject a custom `http.RoundTripper` for observability tooling.
Every SDK exposes the exact same error class hierarchy — `AuthError`, `PlanGateError`, `RateLimitError`, `ValidationError`, `NotFoundError`, `ConflictError`, `WebhookSignatureError` and a generic `ServerError` — so you can share error-handling patterns across microservices even when they're written in different languages. The retry policy defaults to 3 attempts with jittered exponential backoff on 429 and 5xx, and it can be tuned per client instance if your workload needs a different profile.
Frequently asked questions
Which LOAN4BANK SDK should I use for a Next.js or React app?
Do the LOAN4BANK SDKs support async/await?
How do I keep LOAN4BANK SDKs up to date with API changes?
Can I use the LOAN4BANK API without an SDK?
Are LOAN4BANK SDKs open source?
Prefer to build against the raw HTTP surface? The API Reference has copy-paste curl and fetch snippets for every endpoint, and the Quick Start walks you through your first request in five minutes.