Python SDK
Using the REST API from Python
Section titled “Using the REST API from Python”import httpx
# 1. Exchange your API key for a JWT (see /rest-api/authentication)auth = httpx.post( "https://sandbox-api.nuez.app/v1/auth/token", json={"api_key": "nz_YOUR_KEY_HERE"},).json()
client = httpx.Client( base_url="https://sandbox-api.nuez.app/v1", headers={"Authorization": f"Bearer {auth['token']}"},)
# Balancebalance = client.get("/balance").json()print(balance["available"], balance["asset"])
# Payoutresponse = client.post( "/withdraws", headers={"Idempotency-Key": "inv-2026-04-001"}, json={ "amount_ars": 5000, "destination": "0000003100010000123456", "destination_kind": "CBU", },)print(response.json())Using MCP from Python instead
Section titled “Using MCP from Python instead”If you’re building an agent rather than a backend integration, the mcp SDK talks to nuez’s POST /mcp endpoint directly with your raw API key — no JWT exchange needed.