Skip to main content

Getting Started with Crypto Swaps

Leverage SideShift's trading infrastructure to add fast, direct-to-wallet shifts to your project. Our API lets you request quotes, create shifts, and support 200+ assets across multiple networks. Track your earnings and configure automatic withdrawals via your dashboard.

1. Create an Account​

  1. A SideShift.ai account is created in three ways:

    If you already have an account from the site, skip to the Already have an account on the site? note below.

  2. To create one programmatically, generate an Ed25519 keypair offline. See Authentication.

    warning

    Never share your secret key with anyone. It grants full access to your account and SideShift cannot recover it.

  3. Create your account with the public key via POST /v2/create-account:

    curl -L 'https://sideshift.ai/api/v2/create-account' \
    -H 'Content-Type: application/json' \
    -d '{ "pubKey": "PUBLIC_KEY" }'
  4. Save the returned Account ID (id) – passed as affiliateId.

    info

    Your account represents your integration, not your individual users. Use the same credentials for all shift requests. End users are identified by their shiftId.

.env
SIDESHIFT_SECRET_KEY=YOUR_ED25519_SECRET_KEY #NEVER COMMIT THIS
SIDESHIFT_PUB_KEY=YOUR_ED25519_PUBLIC_KEY
AFFILIATE_ID=YQMi62XMb #REPLACE WITH YOUR SIDESHIFT ACCOUNT ID

Authenticated requests are signed with your secret key and carry three headers: x-sideshift-key, x-sideshift-timestamp and x-sideshift-signature. See Authentication for how to build them.

Already have an account on the site?

Click Show Private Key on the account page and copy the key. If it is 64 hex characters, it is your Ed25519 secret key and is already registered, so you can sign with it straight away. It is not your old account secret. If it is 32 characters, it is a legacy account secret: send it as the x-sideshift-secret header instead of the three signature headers. It works during a migration period, so register a key and switch to signing.

2. Request a Quote​

Replace PUBLIC_KEY, TIMESTAMP and SIGNATURE with the headers built for this exact request (POST, /api/v2/quotes and the body), as shown in Authentication. Replace AFFILIATE_ID with your account ID.

curl -L 'https://sideshift.ai/api/v2/quotes' \
-H 'Content-Type: application/json' \
-H 'x-sideshift-key: PUBLIC_KEY' \
-H 'x-sideshift-timestamp: TIMESTAMP' \
-H 'x-sideshift-signature: SIGNATURE' \
-d '{
"depositCoin": "eth",
"depositNetwork": "arbitrum",
"settleCoin": "eth",
"settleNetwork": "mainnet",
"depositAmount": "0.14364577",
"settleAmount": null,
"affiliateId": "AFFILIATE_ID"
}'

Save the returned id as QUOTE_ID.

3. Create a Fixed Shift​

curl -L 'https://sideshift.ai/api/v2/shifts/fixed' \
-H 'Content-Type: application/json' \
-H 'x-sideshift-key: PUBLIC_KEY' \
-H 'x-sideshift-timestamp: TIMESTAMP' \
-H 'x-sideshift-signature: SIGNATURE' \
-d '{
"settleAddress": "0xde2642b2120fd3011fe9659688f76e9E4676F472",
"affiliateId": "AFFILIATE_ID",
"quoteId": "QUOTE_ID"
}'

Display the depositAddress to your user and poll /v2/shifts/{shiftId} to monitor the shift's status.

warning

The returned shift id is sensitive data. The order page is reachable by ID alone, so anyone with the ID can open it and, if the refundAddress was not set at order creation, choose where a refund is sent or cancel the order.

Relevant Resources​