Download OpenAPI specification:Download
Deezy is your home for lightning liquidity.
Swap instantly from lightning to on-chain bitcoin.
Link an on-chain address to a lightning address.
Earn by providing liquidity.
Keep your channels automatically balanced.
Get the current info about the swap service for converting LN btc to on-chain BTC.
The cost of a swap is a combination of the liquidity fee and the on-chain fee. If the swap value is amount_sats
with chain fee rate on_chain_sats_per_vbyte
, then the total fee of the swap is (amount_sats * liquidity_fee_ppm / 1000000) + (on_chain_sats_per_vbyte * on_chain_bytes_estimate)
Information about the swap service.
{- "liquidity_fee_ppm": 2000,
- "on_chain_bytes_estimate": 300,
- "max_swap_amount_sats": 100000000,
- "min_swap_amount_sats": 100000,
- "available": true
}
Initiate a new swap to send lightning btc in exchange for on-chain btc
an invoice and fee information. upon receipt of payment to the provided bolt11_invoice
, deezy will send amount_sats
to on_chain_address
at fee rate on_chain_sats_per_vbyte
, then settle the invoice. the value fee_sats
covers on-chain fees and service costs.
{- "amount_sats": 500000,
- "on_chain_address": "tb1qrcdhlm0mk5lp4r3lx3sjgg2avryp76v2lul3qc",
- "on_chain_sats_per_vbyte": 2
}
{- "bolt11_invoice": "lntb603u1p3vmxj7pp547868h4ruy4at0xarpftg2akckgy5nlaucsur8uztvuq3y0u7eyqd9dgdhk6mtfw3kk2mn5yp6x7grnwashqgpkxqcrqvpqv96zqumpw3ej7anzyqcjqar0ypskgerjv4ehxgr5vgchzunrv35xcmfsd44n2mrsx3erxmrcxdek5em8xfshvunewqmnva3jd36kcvm3vvsxvmmjypnx2efqxvcrqgrnv968xcqzpgxqzrcsp5x8lvqphg6qn2xjz65yk79hmejnkld6wnf8egcse225zrxf34fnks9qyyssqc3rta3lkug5fxyse50d06wfxvnv30eyfpa9dlwu9aj95ptd9xwqj50zvy6m8c0tx3jlsnzrgavr7jcehga56s0ve303cznm4y76z3ecpuzsdph",
- "fee_sats": 600
}
Lookup the on-chain transaction information for an existing swap
Returns the on_chain_txid
and tx_hex
if they exist, or null
if they don't exist yet
{- "on_chain_txid": "string",
- "tx_hex": "string"
}
Generate an on-chain address linked to your lnurl or lightning address. Any deposits to this on-chain address will be forwarded via lightning to your lightning address.
Notes:
secret_access_key
returned in the response body to authenticate yourself (hope to automate this process in future).an on-chain address controlled by deezy
{- "lnurl_or_lnaddress": "LNURL1DP68GURN8GHJ7MRWW3UXYMM59E3K7MF0D3H82UNV9ACXZ7FLW4EK2UNFVS7NXV34X5MRV4P0TTS",
- "secret_access_key": "b3c6056d2845867fa7c8edcd2af94876e83c9c86ea15532f7665ecbf26e0f4ec",
}
{- "address": "bc1qkceyc5yv7gf2n60lnqftjl070fpc08r7jhhtt4",
- "secret_access_key": "b3c6056d2845867fa7c8edcd2af94876e83c9c86ea15532f7665ecbf26e0f4ec",
- "commitment": "for any satoshis sent to bc1qkceyc5yv7gf2n60lnqftjl070fpc08r7jhhtt4 and confirmed on chain, deezy will send the equivalent amount over lightning minus routing fees to danny@deezy.io. in the event of an issue, the user can authenticate themself to coordinate a resolution using the secret access key b3c6056d2845867fa7c8edcd2af94876e83c9c86ea15532f7665ecbf26e0f4ec",
- "signature": "d69j6aj1ssz5egmsr7hd66rpa1crf1bgnym57r9dc8phpwhz89yahhb6zinopnqeyzthjxxzkmktm8ijsibud6cyfisb38znjgk9jwrh",
}
Lookup (BTC to LN) swaps
List of all (BTC to LN) swaps connected
{- "swaps": [
- {
- "lnurl_or_lnaddress": "string",
- "deposit_address": "string",
- "utxo_key": "string",
- "deposit_amount_sats": 0,
- "target_payout_amount_sats": 0,
- "paid_amount_sats": 0,
- "deezy_fee_sats": 0,
- "status": "string"
}
], - "total_sent_sats": 0,
- "total_received_sats": 0,
- "total_pending_payout_sats": 0,
- "total_deezy_fees_sats": 0
}
Request a channel from the Deezy node
Information on the requested channel and how to pay for it
{- "node_connection_info": "021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d@50.112.125.89:9735",
- "remote_balance": 10000000,
- "on_chain_fee_rate": 2
}
{- "order_id": "f311be364d0205f74a58727d098d32a8",
- "order_total": 11110,
- "lsp_connection_info": "024bfaf0cabe7f874fd33ebf7c6f4e5385971fc504ef3f492432e9e3ec77e1b5cf@52.1.72.207:9735",
- "ln_invoice": "lnbc1..."
}
Get information about a channel request
Information about a requested channel
{- "order_id": "string",
- "remote_balance": 0,
- "order_total": 0,
- "ln_invoice": "string",
- "amount_paid": 0,
- "channel_open_tx": "string",
- "state": "string"
}
Earn sats immediately by letting Deezy close one of your channels. Deezy will pay you for the amount of liquidity on Deezy's side at the time of channel closure. The channel must have been originally initiated by you. See close_channel_earn_ppm
on the 'Get Earn Info' api endpoint for current payout rate. After calling this endpoint with a proper signature, Deezy will pay you and then Deezy will close the channel.
success response
{- "channel_point": "6fce9ee4218ba7dd6940dd6bbac710c9c2884923854152e48a7edd9c24cd3043:0",
- "signature": "d967mbafbuqprz6xkbpu6xxw5qnbpmuysyng9adkgcdbfnd3ntd4ggsm4454x5mk1hitjf3yf1wp54stiroiyiay8ncgoqbsspt3n73w"
}
{- "channel_point": "6fce9ee4218ba7dd6940dd6bbac710c9c2884923854152e48a7edd9c24cd3043:0",
- "payout_ppm": 1000,
- "payout_payment_hash": "5dee9327cb5f6821a76531a67862f3743f550931bc160453aa7c8662b2fafba3",
- "status": "PENDING"
}
Configure Deezy's autobalancing service to keep your channel with Deezy balanced. Set your preferences with this api endpoint. Each new api call overwrites any old configuration for your node. Once you set your configuration here, you can fund the autobalancer by getting an invoice from the Fund Channel Autobalance endpoint. Works best if you have a single channel with Deezy. If you have multiple channels with Deezy, it will just treat them like one big channel.
success response
{- "node_pubkey": "021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d",
- "max_local_balance_sats": 3000000,
- "max_local_out_ppm": 500,
- "max_remote_balance_sats": 7000000,
- "max_local_in_ppm": 600,
- "signature": "string"
}
{- "message": "autobalance successfully configured. use the /v1/autobalance/fund endpoint to set your budget"
}
Fund your autobalance budget. Deezy will use the budget to keep your Deezy channel balanced according to the settings you've set in the Set Channel Autobalance Config endpoint. Request a refund at any time to get back the unused portion of your budget
success response
{- "node_pubkey": "021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d",
- "signature": "string"
}
{- "bolt11_invoice": "lnbc1...."
}
Get information about your autobalance configuration, budget, and history
success response
{- "budget_remaining_msats": 20000000,
- "total_budget_funded_msats": 30000000,
- "total_budget_spent_msats": 10000000,
- "total_budget_refunded_msats": 10000000,
- "total_deezy_fees_msats": 0,
- "budget_funding_payments": [
- {
- "payment_hash": "string",
- "payment_amount_msats": 0
}
], - "budget_refund_payments": [
- {
- "payment_hash": "string",
- "payment_amount_msats": 0
}
], - "autobalances": [
- {
- "payment_hash": "string",
- "fees_spent_msats": 0,
- "fees_spent_ppm": 0
}
], - "current_config": {
- "max_local_balance_sats": 1000000,
- "max_local_out_ppm": 500,
- "max_remote_balance_sats": 3000000,
- "max_local_in_ppm": 600
}
}
Request a refund of the unused budget for a given channel autobalance configuration.
success response
{- "node_pubkey": "021c97a90a411ff2b10dc2a8e32de2f29d2fa49d41bfbb52bd416e460db0747d0d",
- "bolt11_invoice": "lnbc1...."
}
{ }
Get information about an inscriptions collection
collection_id required | string The collection_id of the collection. To get a collection_id you must register your collection with support@deezy.io |
success response
{- "num_available": 970,
- "max_supply": 10000,
- "price_sats": 100000,
- "base_price_sats": 80000,
- "fee_rate_multiplier": 80000,
- "max_per_mint": 10,
- "allowlist_enabled": false
}
Mint one or more inscriptions from a collection
success response
{- "collection_id": "b3c6056d2845867fa7c8edcd2af94876",
- "num_to_mint": 3,
- "receive_address": "bc1q...",
- "fee_rate": 2.5,
- "payment_type": "LIGHTNING",
- "receive_email": "spongebob@nick.com"
}
{- "bolt11_invoice": "lnbc1....",
- "mint_attempt_id": "fa7c8edcd2af94876b3c6056d2845867",
- "payment_intent": "....",
- "payment_address": "bc1q...",
- "amount_sats": 100000
}
Get information about an attempted mint transaction
success response
{- "mint_id": "fa7c8edcd2af94876b3c6056d2845867",
- "collection_id": "b3c6056d2845867fa7c8edcd2af94876",
- "num_to_mint": 3,
- "receive_address": "bc1q...",
- "bolt11_invoice": "lnbc1....",
- "payment_hash": "fa7c8edcd2af94876b3c6056d2845867",
- "payment_address": "bc1q...",
- "amount_sats": 100000,
- "status": "",
- "mint_outpoints": [
- "b3c6056d2845867fa7c8edcd2af94876:0",
- "b3c6056d2845867fa7c8edcd2af94876:1",
- "b3c6056d2845867fa7c8edcd2af94876:2"
]
}
Mint a custom inscription
success response
{- "file_data_base64": "s8YFbShFhn+nyO3NKvlIdg==",
- "file_extension": "png",
- "on_chain_fee_rate": 1,
- "receive_address": "bc1q...",
- "cursed": false
}
{- "bolt11_invoice": "lnbc1....",
- "mint_attempt_id": "fa7c8edcd2af94876b3c6056d2845867",
- "payment_intent": "....",
- "payment_address": "bc1q...",
- "amount_sats": 100000
}
Check whether an address is on the allowlist for a collection
success response
{- "address": "bc1...",
- "num_allowed": 2,
- "num_used": 1
}
Update the number of allowed mints for an address in a collection. This endpoint allows you to update details one address at a time.
collection_id required | string The collection id |
address required | string The bitcoin address |
num_allowed required | number The number of mints this address is allowed in this collection |
secret_key required | string A secret key that is used to authenticate this request. Get one of these for your collection by contacting support@deezy.io |
success response
{- "collection_id": "fa7c8edcd2af94876b3c6056d2845867",
- "address": "bc1...",
- "num_allowed": 2,
- "secret_key": "af94876b3c645867fa7c8edcd2056d28"
}
{ }
Buy a PSBT-listed ordinal with a lightning payment
psbt required | string PSBT of the listed ordinal, encoded as Hex or Base64. This should be a one-input, one-output PSBT signed with Sighash Single | Sighash Anyonecanpay in accordance with the Offers spec: https://github.com/casey/ord/issues/802 |
receive_address required | string The on-chain bitcoin address to receive the ordinal. Warning: this should be dedicated ordinals wallet that does not intermingle with normal funds. If you receive to a wallet that is used for other purposes, you may lose your items. |
on_chain_fee_rate required | number The desired on-chain fee rate of the transaction in sats/vbyte |
refund_lightning_address required | string A lightning address or LNURL (i.e. deezy@getalby.com or lnurl1dp68gurn8ghj7mr...). This is where the user will be refunded if for some reason the trade fails. |
processor | string For commercial agreement use only. |
success response
{- "psbt": "70736274ff01009a0200000001...",
- "receive_address": "bc1q...",
- "on_chain_fee_rate": 2.5,
- "refund_lightning_address": "deezy@getalby.com",
- "processor": ""
}
{- "purchase_id": "fa7c8edcd2af94876b3c6056d2845867",
- "bolt11_invoice": "lnbc1...."
}
If sent too much, an ordinal can run out of juice to pay for itself. Use this API endpoint to boost the ordinal with more sats. Create a half-signed PSBT and post it to this endpoint, pay the invoice, and Deezy will add and input to boost the value of the ordinal.
psbt required | string The half-signed psbt as a hex string. The psbt should have a single ordinal as input and one 10,000 sat output. The input should be signed with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY. See example at https://github.com/dannydeezy/nosft |
fee_rate required | number The desired fee rate of the boost transaction in sats/vbyte |
success response
{- "psbt": "70736274ff010052020000000135a0a3c9deb5935ad4a6e46a288f175710e66b67834456693db9889c77819b0e0000000000ffffffff011027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda800000000000100de02000000000101b667693b2c390a1a471470de5b84149ae813b27aa3d82110ce1f3784505f35b60100000000feffffff022c01000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8b2430f0000000000160014ad198770eed2273c50ec6d450fc8476496bd7aa8024730440220679eb1e45d36122c5c6c55bad8471efdb31182f72a76154d30603e938b503218022041c529d0c533f8ef8e096b46a216a7a9907d5447b2fb9f7aafa7d36f5c8e4123012103bccfc8d7762460d30176e62e4282c8f1b0f11eb5fdbd59d6ef9fae3abee93271b4f9240001011d2c0100000000000014e3718cb2b07cdfcc5829cac03041985ff405bda801086c02483045022100cf0e166edaab012a94b0040ef98800a81b270e7ad33f983bed4abac3b855c42c02204b03099c18479744faed3e45b2b65436f2db31fbd2d8822024a4adeae9bb192383210334903b6e2a8134171da9a363184a928894a73ede4ff0725b9739af197b6a4a100000",
- "fee_rate": 3
}
{- "bolt11_invoice": "lnbc1...."
}
Gets the current fee rate in sats per kb. You should create your batched transaction with this fee rate. After you broadcast it, the Deezy fee bumper will monitor the mempool and dynamically increase the fee as necessary to make sure you get into the next block at the minimum fee.
Current fee rate.
Internal Server Error
{- "current_sats_per_kb": 11000
}
Request a new bumper address from Deezy. You can include an output in your batch to this address, and Deezy will then monitor the transaction and bump the fee as needed to get your transaction into the next block.
A new address owned by Deezy and associated with your account.
Bad Request
Unauthorized. Either an invalid/missing API key or you are accessing the API from an IP address that is not on your allowlist.
Internal Server Error
{- "address": "bc1q2utnxf5d4y2vqmly5w675dqxtgd0fqhnezmq52"
}
Deezy's fee bumping service will send funds leftover from fee bumping here. Funds are sent to the most recent address you post here, so it is recommended to post a new address here before each transaction.
Accepted
Bad Request
Unauthorized. Either an invalid/missing API key or you are accessing the API from an IP address that is not on your allowlist.
Internal Server Error
{- "return_address": "bc1qy3c3vn2pfrmk8t5qt2apqqxx48l80senpfmqqh"
}
{- "message": "Accepted return address bc1qy3c3vn2pfrmk8t5qt2apqqxx48l80senpfmqqh"
}
Do a single AI API call and pay for the call with a lightning micropayment. The first request returns a 402 payment required response with a bolt11 invoice in the header. You should pay this invoice and then make the same request again with the same parameters. The second request will return the result of the AI call. Currently supports OpenAI: https://platform.openai.com/docs/api-reference . Note: this is an experimental feature and the pricing structure is not well-considered. If you want to use this at scale and are particular about getting correct pricing, reach out to support@deezy.io and we'd love to chat.
request_id required | string A random string to identify this request. Each AI call-cycle should use a new request_id, but you should use the same one for the first and second calls in a flow. |
provider required | string The AI provider to use. Currently only supports openai. |
api_path required | string The endpoint to call on the AI provider. See https://platform.openai.com/docs/api-reference |
data required | object Data object for the particular AI request. Depends on what endpoint you're calling. See https://platform.openai.com/docs/api-reference |
payout_lightning_address | string Your lightning address where you will receive earnings from usage of the app |
Successful API request
Payment Required
{- "request_id": "123456789abcdefg",
- "provider": "openai",
- "api_path": "v1/chat/completions",
- "data": {
- "model": "gpt-3.5-turbo",
- "messages": [
- {
- "role": "user",
- "content": "Hello!"
}
]
}, - "payout_lightning_address": "developer@getalby.com"
}
{- "id": "chatcmpl-123",
- "object": "chat.completion",
- "created": 1677652288,
- "choices": [
- {
- "index": 0,
- "message": {
- "role": "assistant",
- "content": "\n\nHello there, how may I assist you today?"
}, - "finish_reason": "stop"
}
], - "usage": {
- "prompt_tokens": 9,
- "completion_tokens": 12,
- "total_tokens": 21
}
}