Skip to main content
POST /wallet/create creates a non-custodial stablecoin wallet: one unified balance across supported chains, with deposit addresses per network. You receive the private_key only in this response—store it securely; Switch cannot show it again later except via POST /wallet/export when you explicitly request recovery.
Use GET /asset to see which stablecoins support the wallet product (wallet_supported). See Get stablecoins.

Example request

curl https://api.onswitch.xyz/wallet/create \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'x-service-key: '"$YOUR_SERVICE_KEY" \
  --data '{
  "name": "My Wallet",
  "callback_url": "https://your-app.com/webhook"
}'
const res = await fetch('https://api.onswitch.xyz/wallet/create', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-service-key': process.env.YOUR_SERVICE_KEY,
  },
  body: JSON.stringify({
    name: 'My Wallet',
    callback_url: 'https://your-app.com/webhook',
  }),
});

const json = await res.json();
const data = json.data ?? {};
console.log(data.id, Object.keys(data.address ?? {}));
import json
import os
import urllib.request

payload = {
    "name": "My Wallet",
    "callback_url": "https://your-app.com/webhook",
}

req = urllib.request.Request(
    "https://api.onswitch.xyz/wallet/create",
    method="POST",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Content-Type": "application/json",
        "x-service-key": os.environ["YOUR_SERVICE_KEY"],
    },
)

with urllib.request.urlopen(req, timeout=60) as r:
    out = json.load(r)
    data = out.get("data") or {}
    print(data.get("id"), list((data.get("address") or {}).keys()))

Frequently Asked Questions

Set callback_url to receive wallet-related notifications at your server. For general webhook behaviour and security practices, see Webhooks.
{
  "callback_url": "https://your-app.com/webhook"
}
After creation, store only data.id (for subsequent wallet related API calls) and data.private_key (for custody and signing) using your own secure storage. Store data.address if you want to show per-chain deposit addresses without calling GET /wallet/{wallet_id} again.

Example response

{
  "success": true,
  "message": "Wallet created successfully",
  "timestamp": "2026-04-01T12:00:00.000Z",
  "data": {
    "id": "699a6555fd4cab59e6175f79",
    "name": "My Wallet",
    "private_key": "0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb",
    "address": {
      "BASE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "ETHEREUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "POLYGON": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "BSC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "ARBITRUM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "OPTIMISM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "GNOSIS": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "AVALANCHE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "MONAD": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "PLASMA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "LINEA": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "MANTLE": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "HYPEREVM": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "BERACHAIN": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "SONIC": "0xA3B3b28d8E3ec225f555f4AB9fC3607De545Ff49",
      "SOLANA": "2dTHot2BVjqqGD3S5Z2bzEVYnyEcJCdr9SawzqTdKo4h"
    },
    "note": "Do not share your private key. This key grants full control of your account."
  }
}

Security

The private_key is returned only when the wallet is created. Anyone with the key can move funds. Do not log it, embed it in client-side code, or send it over insecure channels. If you lose it and never exported a backup, recovery may not be possible.

Need Help?

Email Support

Send us a message.

Book a call

Hop on a call with us.