---
title: "Get auth credentials"
method: GET
path: "/auth"
---

# Get auth credentials

`GET /auth`

## Request

- Base URL: `https://laso.finance`
- URL: `https://laso.finance/auth`
- Auth: API key in header `SIGN-IN-WITH-X`

Free endpoint. Returns an ID token, refresh token, and user ID for the calling wallet. Use the ID token as a Bearer token to call Laso Finance APIs.

Prove wallet ownership by sending a `SIGN-IN-WITH-X` header: a base64-encoded CAIP-122 signed message. Build it with `@x402/extensions/sign-in-with-x` (e.g. `wrapFetchWithSIWx` handles the round-trip automatically). Works for any EVM (Base, eip155:8453) or Solana mainnet wallet.

For ID-token refresh use `POST /auth` with `grant_type=refresh_token`.

## Headers

- `SIGN-IN-WITH-X` string, required

## Response `200`

Auth credentials and user ID

- object
  - `auth` AuthCredentials
    - `id_token` string: ID token — use as Bearer token for Laso Finance APIs
    - `refresh_token` string: Use with POST /auth (grant_type=refresh_token) to get a new id_token when it expires
    - `expires_in` string: Token lifetime in seconds
  - `callable_base_url` string
  - `user_id` string: The user's ID (lowercase wallet address)

## Other responses

- `402`: No valid payment or SIGN-IN-WITH-X proof was presented. All SIWX failures (missing or malformed header, invalid or expired signature, reused nonce, domain mismatch) return 402 per the x402 protocol. The response body is an empty JSON object; a fresh challenge (new nonce, payment options, SIWX info) is base64-encoded in the `PAYMENT-REQUIRED` response header. Sign the new challenge and retry. x402 client libraries such as `wrapFetchWithSIWx` handle this automatically. A **second** 402 on the paid retry means something different: the payment was refused, either at verification (most often an underfunded wallet) or at on-chain settlement. That response body is not empty and carries no `accepts` — it is the x402 settlement-failure shape `{"success": false, "errorReason": "...", "errorMessage": "..."}`, plus `x_laso_guidance` when a concrete next step applies. Distinguish the two by body: a challenge carries `accepts`, a failure carries `success: false`. The usual cause is an underfunded wallet, and the usual cause of that is the fee being charged **on top of** `amount` on routes that add one (a wallet holding exactly \$2,000 cannot send a \$2,000 bank payment; `/get-card` adds no fee, so it costs exactly `amount`). Nothing is charged for a failed settlement, so retrying with a smaller amount is safe.

---

[API](https://skmtc.dev/laso/apis/laso-finance-x402-api.md) · [All operations](https://skmtc.dev/laso/apis/laso-finance-x402-api/llms.txt) · [OpenAPI document](https://skmtc.dev/laso/apis/laso-finance-x402-api/revisions/e83fa3f023fa?raw)
