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.
Initiate a scanning operation to look for special sats in a UTXO or address. Either utxo_to_scan
or address_to_scan
must be provided.
ID of the scan operation
Internal Server Error
{- "address_to_scan": "bc1qy3c3vn2pfrmk8t5qt2apqqxx48l80senpfmqqh",
- "extract": true,
- "special_sat_addresses": [
- "bc1ptjcfjm8f7gz8umrh0sg3ve8ewq3gm0q9m7khhplny8u7m0nvqf8s0ym0zh",
- "bc1ptnadrqyv2862egv6ywanrpllknxw7tks2j9ddlwll9c8ada492cqy67rqd",
- "bc1pgfyhzsjmkdtknrh3puzartyxjyztkpm7pfgmuleekj7akksr06lqvmxz8g"
], - "regular_funds_addresses": [
- "bc1pdeyrsp2zyevlyenmqv4n240ww9hppf54x4eem5p473lqxh6jepts0wg28y",
- "bc1pd7u90a2xvq3nkh4jdtym35uwa8h5xz9xhtcjkj7nj9vdn328hjvsctgu5r",
- "bc1p3j5hrnxw7nkc0367pfygggf4pwata98zs7u75jcqp8cxklzak7yq9jfk9z"
], - "extraction_fee_rate": 10,
- "excluded_tags": [
- [
- "omega",
- "prime"
], - [
- "omega"
], - [
- "alpha",
- "prime"
], - [
- "alpha"
], - [
- "block_78"
], - [
- "vintage_nakamoto"
], - [
- "pizza"
]
], - "included_tags": [
- [
- "omega",
- "prime"
], - [
- "omega"
], - [
- "alpha",
- "prime"
], - [
- "alpha"
], - [
- "block_78"
], - [
- "vintage_nakamoto"
], - [
- "pizza"
]
], - "min_tag_sizes": {
- "block_78": 100,
- "vintage_nakamoto": 300
}, - "max_tag_ages": {
- "alpha": 2009,
- "omega": 2010
}, - "tag_limits": {
- "alpha": 10,
- "omega": 15
}, - "tag_by_address": {
- "uncommon": "address123",
- "omega": "address345"
}, - "split_trigger": "NEVER",
- "split_target_size_sats": 100000000,
- "withdraw_address": "bc1q2utnxf5d4y2vqmly5w675dqxtgd0fqhnezmq52",
- "withdraw_size_sats": 100000000,
- "split_special_ranges": false
}
{- "id": "20a27d48e7ae0db029a01b1fd06fd6d8"
}
It can be used to check the status of a scanning operation, and to retrieve the results of a completed scan.
Rare Sat Info for the Provided UTXO or address
Internal Server Error
{- "status": "COMPLETED",
- "utxo": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b:0",
- "address": "bc1qy3c3vn2pfrmk8t5qt2apqqxx48l80senpfmqqh",
- "runes": [
- {
- "name": "CUBS•FIRST•RUNES•TOKEN",
- "symbol": "R",
- "amount": 100,
- "divisibility": 8
}
], - "satributes": [
- {
- "name": "nuztfvrevcn",
- "block": 9,
- "epoch": 0,
- "period": 13,
- "cycle": 0,
- "unique_digits": 4,
- "timestamp": "2009-01-17T05:46:32Z",
- "rarity_tags": [
- "uncommon",
- "vintage"
], - "inscriptions": [
- "bitcoin-frogs",
- "bitcoin-punks"
], - "sat_number": 961435802136035,
- "offset": 12002,
- "size": 1
}
], - "extraction_psbt": "cHNidP8BAHECAAAAAeJQY2VLRtutKgQYFUajEKpjFfl0Uyrm6x23OumDpe/4AQAAAAD/////AkxREgEAAAAAFgAUv6pTgbKHN60CZ+RQn5yOuH6c2WiA8PoCAAAAABYAFJDbOFU0E6zFF/M+g/AKDyqI2iUaAAAAAAABAOsCAAAAAAEBbxqXgEf9DlzcqqNM610s5pL1X258ra6+KJ22etb7HAcBAAAAAAAAAAACACT0AAAAAAAiACC7U1W0iJGhQ6o7CexDh5k36V6v3256xpA9/xmB2BybTFZdDQQAAAAAFgAUKp2ThzhswyM2QHlyvmMB6tQB7V0CSDBFAiEA4Md8RIZYqFdUPsgDyomlzMJL9bJ6Ho23JGTihXtEelgCIAeNXRLyt88SOuuWFVn3IodCE4U5D6DojIHesRmikF28ASEDHYFzMEAxfmfq98eSSnZtUwb1w7mAtHG65y8qiRFNnIkAAAAAAQEfVl0NBAAAAAAWABQqnZOHOGzDIzZAeXK+YwHq1AHtXQEDBAEAAAAAAAA=",
- "excluded_tags": [
- [
- "omega"
], - [
- "alpha"
], - [
- "block_78"
], - [
- "vintage_nakamoto"
], - [
- "pizza"
]
], - "included_tags": [
- [
- "omega"
], - [
- "alpha"
], - [
- "block_78"
], - [
- "vintage_nakamoto"
], - [
- "pizza"
]
], - "min_tag_sizes": {
- "block_78": 100,
- "vintage_nakamoto": 300
}, - "tag_limits": {
- "alpha": 10,
- "omega": 15
}, - "tag_by_address": {
- "uncommon": "address123",
- "omega": "address345"
}, - "split_trigger": "NEVER",
- "split_target_size_sats": 100000000,
- "withdraw_address": "bc1q2utnxf5d4y2vqmly5w675dqxtgd0fqhnezmq52",
- "withdraw_size_sats": 100000000,
- "withdraw_success": true,
- "split_special_ranges": true
}
Get the status of scanning operations.
Scan requests for the Provided API User
Internal Server Error
[- {
- "request_id": "358c7d411b3491cf9ed5d65d984a6415",
- "status": "PENDING"
}
]
Get list of recognized rarity tags; these values can be used for the excluded_tags and included_tags parameters in the scan request.
Currently recognized rarity tags for sat scanning
Internal Server Error
{- "rarity_tags": "mythic"
}
This endpoint retrieves the user limits for sat hunting. The user's plan allows for a certain amount of BTC every certain number of days, and allows purchasing additional volume at a rate of a certain number of satoshis per 1 BTC of scan volume. Contact help@deezy.io for questions or to change your plan.
Success response. Returns the user's limits for sat hunting, including the amount limit, unit of the amount, number of days for the limit, subscription cost, one-time cost, and user volume.
Bad request response
{- "payment_address": "1bc1q...",
- "amount": 97666993630,
- "unit": "sats",
- "days": 30,
- "subscription_cost": 100000000,
- "one_time_cost": 200000,
- "user_volume": 97666993631,
- "remaining_volume": 97666993631
}
Retrieves a summary of earnings based on specified criteria. It allows grouping by specific attributes such as year, month, etc., and filtering based on the number of days ago.
A summary of earnings with optional grouping and time-based filtering.
Internal Server Error
{- "summary": [
- {
- "rarity_tags": [
- "omega"
], - "count": 100,
- "group_by_value": "2023-03",
- "floor_price_sats": 1000,
- "total_value_sats": 100000
}, - {
- "rarity_tags": [
- "uncommon",
- "block_9"
], - "count": 1,
- "group_by_value": "2009-04",
- "floor_price_sats": 250000,
- "total_value_sats": 250000
}
], - "group_by": "string",
- "days_ago": 0
}
Get the circulation data of sats
Circulation data for the specified rarity tag(s)
Internal Server Error
{- "data": {
- "n_total": 0,
- "n_mined": 0,
- "n_epoch": 0,
- "n_365": 0,
- "n_seq": 0,
- "n_inscribed": 0,
- "updated_at": "2019-08-24T14:15:22Z"
}
}
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,
- "partner_fee_ppm": 1000,
- "deezy_fee_ppm": 1000
}
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,
- "deezy_user_id": "cfdaa3b0-9dbc-4a9d-9e4c-0f1f5a9a8a5b"
}
{- "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",
- "deezy_user_id": "cfdaa3b0-9dbc-4a9d-9e4c-0f1f5a9a8a5b"
}
{- "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,
- "partner_fee_sats": 0,
- "status": "string"
}
], - "total_sent_sats": 0,
- "total_received_sats": 0,
- "total_pending_payout_sats": 0,
- "total_deezy_fees_sats": 0,
- "total_partner_fees_sats": 0
}
Create a user. A user represents an individual person and must fill out all required KYC documentation before using the service.
User created successfully
{- "external_id": "cfdaa3b0-9dbc-4a9d-9e4c-0f1f5a9a8a5b"
}
{- "external_id": "cfdaa3b0-9dbc-4a9d-9e4c-0f1f5a9a8a5b"
}
Get info about one of your users
KYC status info about a user
Internal Server Error
{- "kyc_status": "PENDING",
}
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"
}
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,
- "num_minted": 21,
- "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...."
}
Populate a PSBT with dummy inputs and a dummy output, which is useful for buying ordinals on decentralized marketplaces
psbt required | string PSBT of the listed ordinal, encoded as Hex or Base64. This should be a one-input, one-output PSBT in accordance with the Offers spec: https://github.com/casey/ord/issues/802. The input can either be unsigned or signed with SIGHASH_SINGLE | SIGHASH_ANYONECANPAY. |
ordinal_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. |
success response
{- "psbt": "70736274ff01009a0200000001...",
- "ordinal_receive_address": "bc1q..."
}
{- "id": "fa7c8edcd2af94876b3c6056d2845867",
- "psbt": "lnbc1....",
- "expires_at": "2021-01-01T00:00:00Z"
}
Signs the dummy inputs for a PSBT that was populated with the v1/psbt/populate endpoint.
success response
{- "id": "fa7c8edcd2af94876b3c6056d2845867",
- "psbt": "70736274ff01009a0200000001..."
}
{- "txid": "fa7c8edcd2af94876b3c6056d2845867",
- "tx_hex": "lnbc1....",
- "funded_signed_psbt": "707123123..."
}
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.
success response
{- "psbt": "70736274ff0100520200000001dcb84258fd10be481d1fcce713d98111c1098d8a2a6a8549765442a85eb3b6190000000000ffffffff011027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda800000000000100fd56010200000000010294181a3f733a94845ac877a5c8feecf19bdb2b7671d55cf352e0cab1cf168dca0000000000ffffffff394e5ca432941a795d06c971c5b8c23639399d6cb50cb5096e676da17f0b09c90100000000ffffffff021027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8aa0417000000000022512046ae9024d7737f0291d1e31a2d5e3341890d677be9e1723df368f5aef312cf59024730440220745468c9cea3fce701da11ef56c8fc94c44a94dcada640eb0a9da5907a260bd2022033b2ffb9c8b176748df76e73138198f90c7faed70aab3dec03aa78963b009c9801210334903b6e2a8134171da9a363184a928894a73ede4ff0725b9739af197b6a4a100141c77db6ddd2d5f299fdb5338ef168fe3446e18d3e30f824e1c7a6d57fd935956624a1f0b668c56d1310d7ac19de9bab15e737212c3e1fcaece511d75176e701e9010000000001011d300200000000000014e3718cb2b07cdfcc5829cac03041985ff405bda80000",
- "fee_rate": 14
}
{- "bolt11_invoice": "lnbc1....",
- "id": "fa7c8edcd2af94876b3c6056d2845867",
- "funded_unsigned_psbt": "70736274ff0100a60200000002dcb84258fd10be481d1fcce713d98111c1098d8a2a6a8549765442a85eb3b6190000000000ffffffffdd68df6f414c14051ac78fa26a0013674770fb48d3fa83669ed53b419dca51d70100000000ffffffff021027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8e2f0160000000000225120124f17b2df28ce45a0009bb8002f8ad8ee42b3fb8b3349b7fdd6d3b33a47eeab00000000000100fd56010200000000010294181a3f733a94845ac877a5c8feecf19bdb2b7671d55cf352e0cab1cf168dca0000000000ffffffff394e5ca432941a795d06c971c5b8c23639399d6cb50cb5096e676da17f0b09c90100000000ffffffff021027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8aa0417000000000022512046ae9024d7737f0291d1e31a2d5e3341890d677be9e1723df368f5aef312cf59024730440220745468c9cea3fce701da11ef56c8fc94c44a94dcada640eb0a9da5907a260bd2022033b2ffb9c8b176748df76e73138198f90c7faed70aab3dec03aa78963b009c9801210334903b6e2a8134171da9a363184a928894a73ede4ff0725b9739af197b6a4a100141c77db6ddd2d5f299fdb5338ef168fe3446e18d3e30f824e1c7a6d57fd935956624a1f0b668c56d1310d7ac19de9bab15e737212c3e1fcaece511d75176e701e9010000000001011d102700000000000014e3718cb2b07cdfcc5829cac03041985ff405bda80001012bc6fa1600000000002251207483eb01de713796c09aa093473548f27971daea126a6893ccdb9d9300c4630201030401000000000000"
}
Update your boost with your half-signed transaction. To be called after signing the funded_unsigned_psbt from the POST request to v1/boost-tx. You must hit this endpoint and pay the invoice to trigger the boost.
success response
{- "id": "fa7c8edcd2af94876b3c6056d2845867",
- "psbt": "70736274ff0100a60200000002dcb84258fd10be481d1fcce713d98111c1098d8a2a6a8549765442a85eb3b6190000000000ffffffffdd68df6f414c14051ac78fa26a0013674770fb48d3fa83669ed53b419dca51d70100000000ffffffff021027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8e2f0160000000000225120124f17b2df28ce45a0009bb8002f8ad8ee42b3fb8b3349b7fdd6d3b33a47eeab00000000000100fd56010200000000010294181a3f733a94845ac877a5c8feecf19bdb2b7671d55cf352e0cab1cf168dca0000000000ffffffff394e5ca432941a795d06c971c5b8c23639399d6cb50cb5096e676da17f0b09c90100000000ffffffff021027000000000000160014e3718cb2b07cdfcc5829cac03041985ff405bda8aa0417000000000022512046ae9024d7737f0291d1e31a2d5e3341890d677be9e1723df368f5aef312cf59024730440220745468c9cea3fce701da11ef56c8fc94c44a94dcada640eb0a9da5907a260bd2022033b2ffb9c8b176748df76e73138198f90c7faed70aab3dec03aa78963b009c9801210334903b6e2a8134171da9a363184a928894a73ede4ff0725b9739af197b6a4a100141c77db6ddd2d5f299fdb5338ef168fe3446e18d3e30f824e1c7a6d57fd935956624a1f0b668c56d1310d7ac19de9bab15e737212c3e1fcaece511d75176e701e9010000000001011d102700000000000014e3718cb2b07cdfcc5829cac03041985ff405bda801086b0247304402201800a874626f2e88a8924ea88587b315da0be8403e0eae28b2b35bc9e147bcf202205aee1b997c65125e142c2bfd147e7e0de677b1036c96f309142888192f39e5c001210334903b6e2a8134171da9a363184a928894a73ede4ff0725b9739af197b6a4a100001012bc6fa1600000000002251207483eb01de713796c09aa093473548f27971daea126a6893ccdb9d9300c4630201030401000000000000"
}
{- "id": "fa7c8edcd2af94876b3c6056d2845867"
}
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
}
}