Skip to content

TypeScript SDK

const BASE = "https://sandbox-api.nuez.app/v1";
const API_KEY = "nz_YOUR_KEY_HERE";
// 1. Exchange the API key for a JWT (see /rest-api/authentication)
const { token } = await fetch(`${BASE}/auth/token`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ api_key: API_KEY }),
}).then(r => r.json());
const headers = {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
};
// Balance
const balance = await fetch(`${BASE}/balance`, { headers }).then(r => r.json());
console.log(balance.available, balance.asset);
// Payout
const payout = await fetch(`${BASE}/withdraws`, {
method: "POST",
headers: { ...headers, "Idempotency-Key": "inv-2026-04-001" },
body: JSON.stringify({
amount_ars: 5000,
destination: "0000003100010000123456",
destination_kind: "CBU",
}),
}).then(r => r.json());
console.log(payout);

For an agent, calling POST /mcp directly with your raw API key skips the JWT exchange entirely — see Custom agents.