Skip to content

Authentication

https://sandbox-api.nuez.app/v1

nuez is currently only available in this sandbox environment — see current status.

Unlike MCP, the REST API does not accept a raw API key directly — exchange it for a JWT first:

Terminal window
curl -X POST https://sandbox-api.nuez.app/v1/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "nz_YOUR_KEY_HERE"}'
{ "token": "eyJhbGciOi...", "expires_in": 86400 }

Or, for a human logging in with a password instead of an agent using a key:

Terminal window
curl -X POST https://sandbox-api.nuez.app/v1/login \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "password": "..."}'

Both return the same {token, expires_in} shape. expires_in is seconds, controlled by JWT_EXPIRY_HOURS server-side (default 24h). There’s no refresh endpoint — request a new token the same way once the old one expires.

Include the JWT as a Bearer token in every REST request:

Terminal window
curl https://sandbox-api.nuez.app/v1/balance \
-H "Authorization: Bearer eyJhbGciOi..."
nz_<24 random bytes, base64url>

There’s no nz_sk_live_/nz_sk_test_ distinction and no scopes — see API keys for the full model.

Every endpoint returns errors in a consistent shape:

{ "error": "CODE", "message": "human-readable description" }
StatusCodeMeaning
400INVALID_JSONMalformed request body
401UNAUTHENTICATEDMissing Bearer token
401TOKEN_EXPIREDJWT expired
401INVALID_TOKENJWT signature/claims invalid
401INVALID_API_KEYWrong key at /v1/auth/token
401INVALID_CREDENTIALSWrong email/password at /v1/login
429RATE_LIMIT_EXCEEDEDOver 60 requests/minute for this user