Docs › Build with Beluga

Integrators

Offer Beluga's exchange in your own product: an integrator key without captcha, your own reference per order, and your own fee on top of our quote, paid to you in USDC.

Access

Integrator access is for exchange orders (all pairs on the exchange).

How to apply

  • By email only, to [email protected], from an address on the official domain of the product that will use the API (for example [email protected] for yourexchange.com). We don't hand out keys over SimpleX, Telegram or free-mail addresses.
  • Include: your product's URL and what you are building, your expected volume (orders per day, typical size), the default partner fee you plan to charge, and your USDC payout address on Ethereum. Optionally: your servers' IP addresses, if the key should work only from there.
  • We look at your product and reply to that address. Your credentials come over an encrypted channel.

You get two headers:

X-Beluga-Gatelets your requests through our edge to /api/partner/; without it that path answers 403
X-Beluga-Keyyour API key; we store only its hash. Optionally bound to your server's IP addresses: then the key works only from there, so a leaked key is useless elsewhere

Base URL: https://beluga.to/api/partner/. Integrate against these endpoints only: /api/exchange without /partner is our website's API and may change without notice.

Limits

  • No captcha. 300 requests per minute per key, up to 50 unpaid orders open at a time per key (an unpaid order expires 20 minutes after creation). Need more? Ask us.
  • Keys must deliver swaps. After your first 3 days: with 30 or more orders in the last 7 days, at least 5 % of them must get a deposit. Otherwise the key is limited to 5 unpaid orders and 60 requests per minute until that recovers (it lifts by itself). GET /api/partner/usage shows your limits and why. Keys that only create orders or make requests may be revoked.
  • Same pairs, minimums and maximums as the website (Rate limits & keys, Fees & limits); GET /api/partner/exchange/status lists pairs that are paused right now.
  • Our own fee is the same as on the website. Integrators get no discount.

Your partner fee

Add your own fee on top of our quote with partnerFeeBps on each order: a whole number of basis points from 0 to 300 (0-3 %), or to the maximum agreed for your key. Without it your default applies. On stablecoin ↔ ETH and stablecoin ↔ stablecoin pairs (USDC, USDT, DAI) the maximum is 50 (0.5 %).

  • Example: BTC → XMR, where our fee is 2%, with partnerFeeBps: 50: the customer's quote and order show 2.5 % (feePct), and 0.5 % of the order's value is yours (partnerFeePct).
  • Earned on completed orders only. Refunded orders earn nothing; an order in review earns once it completes.
  • Valued in USD when the order is paid out, and paid in USDC on Ethereum to the one payout address registered for your key (changes only through support, with verification).
  • Payouts go out automatically as soon as you are owed $10 or more, in one transfer for all orders owed so far; we pay the network fee. While Ethereum gas is so high that the transfer would cost more than 3 % of it, the payout waits until more is owed or gas drops.

Endpoints

Every request carries both headers. JSON in, JSON out; errors are {"error": "…"} with the status codes of Errors & retries.

GET /api/partner/exchange/quote?from=BTC&to=XMR&amount=0.5&partnerFeeBps=50our rate now, feePct (ours), partnerFeePct, totalFeePct, expectedOut, min, max, paused. Creates nothing: use it as a dry run
POST /api/partner/exchangecreates an order: from, to, amount, payoutAddress, refundAddress (BTC, ETH, SOL and token sources), optional clientRef, optional partnerFeeBps. 201 with the order, including depositAddress
GET /api/partner/exchange/{id}one of your orders
GET /api/partner/exchange?ref={clientRef}one of your orders by your own reference
GET /api/partner/exchange/orders?updatedSince={ISO time}&limit=100your orders that changed after that time, oldest first (at most 200). Poll every 10-30 s with the largest updatedAt you received; an order can appear twice, so de-duplicate by id. next is set while more are waiting
GET /api/partner/exchange/statusopen and paused pairs, our Monero vault and its latest reserve proof
GET /api/partner/usageyour current limits (unpaid orders, requests per minute, whether the key is throttled and why) and your last 7 days: orders, with a deposit, completed, requests, rate-limited requests, refused creates
GET /api/partner/feesyour balance (balance.owedUsd: payable, paid out once it reaches $10; pendingUsd: orders not completed yet; paidUsd, earnedUsd), your partner fees per order (pending until the order completes, then owed, paying, paid; void if refunded) and your payouts with their Ethereum transaction ids
curl -X POST https://beluga.to/api/partner/exchange \
  -H 'X-Beluga-Gate: your gate token' -H 'X-Beluga-Key: your key' \
  -H 'Content-Type: application/json' \
  -d '{"from":"BTC","to":"XMR","amount":0.05,"payoutAddress":"8...","refundAddress":"bc1q...","clientRef":"order-1001","partnerFeeBps":50}'
# 201 {"id":"N-fKOUCIhMkd","pair":"BTC>XMR","state":"awaiting_deposit","feePct":2.5,"partnerFeePct":0.5,"depositAddress":"bc1q…","expiresAt":"…","clientRef":"order-1001", …}
  • clientRef (1-64 characters of A-Z a-z 0-9 _ . : -) is unique per key: repeating a create with the same clientRef returns the existing order instead of a second one, so retries after a timeout are safe.
  • Order states: awaiting_deposit → confirming → swapping → paying → completed; also expired (nothing arrived within 20 minutes; a late deposit is still processed), review, refund_pending, refunded. Details: Order lifecycle.
  • Order IDs are 12 random characters (A-Z a-z 0-9 _ -). Anyone with an ID can see that order's addresses and transactions, so treat IDs as private to the customer.
  • Your customers can also follow an order on our website at https://beluga.to/#o={id}; it shows the total fee, never your name.
  • Letter of guarantee: every order carries letter: {"ready":false} right after the create, about a second later {"ready":true,"version":1,"signedAt":"…","fingerprint":"…","subkey":"…","asc":"-----BEGIN PGP SIGNED MESSAGE-----…"}. asc is a PGP clearsigned text, signed with our key on /pgp: the deposit address is ours, and for every payment received there we owe the exchange to the payout address, or a refund. It names no integrator and no fee. Give it to your customer as a .asc file (or show it); poll the order once more if ready is false. If an address in it changes later, a newer version replaces it.

Support for your customers

  • Your customers are your customers: they contact you. For an order that needs us (late or wrong deposit, a refund, an order in review), write to support with the order ID; we answer you.
  • Refunds go to the refundAddress given at creation (BTC, ETH, SOL and token sources) under our refund policy; XMR sources: see Late deposits & recovery.

Testing

  • Unfunded test orders with your key are fine: they expire after 20 minutes and count toward your 50 open orders (and, after your first 3 days, toward the share of orders that get a deposit). The quote endpoint is a dry run.
  • There is no staging environment. For an end-to-end test, run one small real swap ($100 minimum).

What we don't offer

  • No listing, export or feed of other customers' orders, and no sample IDs of real orders: an order ID gives access to that order's details. /api/recent is a small, delayed and anonymised showcase for our home page.
  • No webhooks for now: GET /api/partner/exchange/orders?updatedSince= is the cheap way to follow your orders.
  • Bridge orders (XMR ↔ XMR2) use the public bridge API (Market makers).