# SideShift.ai API — programmatic no-KYC swap (VPS-clean)

Use when an instant exchanger's API or UI is down (ChangeNOW vip-api returned 502 on every amount) or Cloudflare-blocked from the VPS. SideShift is the one exchanger whose FULL flow (account → quote → fixed shift → status) works via plain curl from the VPS.

## Recipe (verified: USDT/TRON → BNB/BSC, ~32 s settle)

1. **Account** (once): `curl -s -X POST https://sideshift.ai/api/v2/create-account -H 'Content-Type: application/json' -d '{}'` → `{"id":..., "secret":...}`. Store in `~/.secrets/sideshift_acct.json` (chmod 600). The secret is the `x-sideshift-secret` header; id doubles as `affiliateId`. No email, no KYC.
2. **Quote**: `POST /api/v2/quotes` with `{depositCoin:"usdt", depositNetwork:"trx", settleCoin:"bnb", settleNetwork:"bsc", depositAmount:"50", settleAmount:null, affiliateId:...}`. Quote `id` expires in ~15 min.
3. **Fixed shift**: `POST /api/v2/shifts/fixed` with `{settleAddress, affiliateId, quoteId, refundAddress}` — ALWAYS set refundAddress (own TRON address) or anyone with the shift id can redirect refunds. Returns `depositAddress`, exact `depositAmount` (fixed-rate: deposit EXACTLY that amount before `expiresAt`), `settleAmount`.
4. **Fund** the depositAddress (e.g. `/usr/bin/python3 ~/send_usdt_once.py <addr> <amount>` — tronpy runs on system python, NOT Hermes python).
5. **Poll** `GET /api/v2/shifts/<id>` with the secret header until `status: "settled"`.

## Pitfalls
- The old v1 endpoints (`/orders`, `/api/v2/orders`) are dead — docs moved to `/v2/quotes` + `/v2/shifts/fixed`. A 404 on the order path does NOT mean the API is broken.
- Fixed shifts require the deposit to land before `expiresAt` (15 min) — send immediately after creating the shift, quote only when funds are ready.
- The shift id is sensitive (order page reachable by id alone); keep it out of logs where possible.
