Skip to main content
You can view both keys anytime in the Switch dashboard. Both keys works with the same base URL https://api.onswitch.xyz.

Example request

curl https://api.onswitch.xyz/asset \
  -H "x-service-key: $YOUR_SERVICE_KEY" \
  -H "Accept: application/json"
const res = await fetch('https://api.onswitch.xyz/asset', {
  headers: {
    'x-service-key': process.env.YOUR_SERVICE_KEY,
    'Accept': 'application/json',
  },
});
import os, urllib.request

req = urllib.request.Request(
  "https://api.onswitch.xyz/asset",
  headers={
    "x-service-key": os.environ["YOUR_SERVICE_KEY"],
    "Accept": "application/json",
  },
)
urllib.request.urlopen(req, timeout=30)
Use your live key only when it’s production environment, as this might involve live onchain transactions and actual money movement.
If your key may is exposed or compromised, quickly rotate it from the dashboard or contact support at contact@onswitch.xyz for assistance.

Need Help?

Email

Send us a message

Call

Book a call with us