curl --request POST \
--url https://api.tusky.io/v2/uploads/cost \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"size": 123,
"name": "<string>"
}
],
"epochs": 123,
"publisherId": "<string>"
}
'{
"files": [
{
"name": "<string>",
"size": 123,
"encodedSize": 123,
"walCost": "<string>",
"gasCost": "<string>"
}
],
"totals": {
"fileCount": 123,
"totalSize": 123,
"totalEncodedSize": 123,
"totalWal": "<string>",
"totalGas": "<string>",
"totalSui": "<string>"
},
"epochs": 123,
"balance": {
"walBalance": "<string>",
"suiBalance": "<string>",
"sufficient": true,
"walDeficit": "<string>",
"suiDeficit": "<string>"
},
"conversion": {
"required": true,
"walNeeded": "<string>",
"estimatedSuiCost": "<string>",
"rate": "<string>",
"source": "<string>"
},
"subscription": {
"plan": "<string>",
"coveredGas": true,
"monthlyUploadsRemaining": 123,
"monthlyBandwidthRemaining": 123
}
}curl --request POST \
--url https://api.tusky.io/v2/uploads/cost \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"size": 123,
"name": "<string>"
}
],
"epochs": 123,
"publisherId": "<string>"
}
'{
"files": [
{
"name": "<string>",
"size": 123,
"encodedSize": 123,
"walCost": "<string>",
"gasCost": "<string>"
}
],
"totals": {
"fileCount": 123,
"totalSize": 123,
"totalEncodedSize": 123,
"totalWal": "<string>",
"totalGas": "<string>",
"totalSui": "<string>"
},
"epochs": 123,
"balance": {
"walBalance": "<string>",
"suiBalance": "<string>",
"sufficient": true,
"walDeficit": "<string>",
"suiDeficit": "<string>"
},
"conversion": {
"required": true,
"walNeeded": "<string>",
"estimatedSuiCost": "<string>",
"rate": "<string>",
"source": "<string>"
},
"subscription": {
"plan": "<string>",
"coveredGas": true,
"monthlyUploadsRemaining": 123,
"monthlyBandwidthRemaining": 123
}
}epochs, quilt, and autoConvert settings. When omitted, the account default publisher is used.Show File cost object
Show Totals object
Show Balance object
autoConvert: true and the WAL balance is insufficient.Show Conversion object
"cetus", "deepbook", "aggregated").Show Subscription object
"starter", "growth", "scale").curl -X POST https://api.tusky.io/v2/uploads/cost \
-H "Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
{ "size": 10485760, "name": "video.mp4" },
{ "size": 2097152, "name": "document.pdf" },
{ "size": 524288, "name": "image.png" }
],
"epochs": 5
}'
{
"files": [
{
"name": "video.mp4",
"size": 10485760,
"encodedSize": 52428800,
"walCost": "0.045",
"gasCost": "0.002"
},
{
"name": "document.pdf",
"size": 2097152,
"encodedSize": 10485760,
"walCost": "0.012",
"gasCost": "0.002"
},
{
"name": "image.png",
"size": 524288,
"encodedSize": 2621440,
"walCost": "0.008",
"gasCost": "0.001"
}
],
"totals": {
"fileCount": 3,
"totalSize": 13107200,
"totalEncodedSize": 65536000,
"totalWal": "0.065",
"totalGas": "0.005",
"totalSui": "0.005"
},
"epochs": 5,
"balance": {
"walBalance": "120.0",
"suiBalance": "45.2",
"sufficient": true,
"walDeficit": "0",
"suiDeficit": "0"
},
"conversion": {
"required": false,
"walNeeded": "0",
"estimatedSuiCost": "0",
"rate": "0.38",
"source": "aggregated"
},
"subscription": {
"plan": "growth",
"coveredGas": true,
"monthlyUploadsRemaining": 8750,
"monthlyBandwidthRemaining": 96636764160
}
}
autoConvert is enabled and WAL balance is insufficient, the conversion object shows the swap details:
{
"totals": {
"fileCount": 3,
"totalWal": "0.065",
"totalGas": "0.005",
"totalSui": "0.019"
},
"balance": {
"walBalance": "0.02",
"suiBalance": "45.2",
"sufficient": true,
"walDeficit": "0",
"suiDeficit": "0"
},
"conversion": {
"required": true,
"walNeeded": "0.045",
"estimatedSuiCost": "0.014",
"rate": "0.38",
"source": "cetus"
}
}
conversion.required is true, the totals.totalSui includes the estimated swap cost. The balance.sufficient field accounts for the conversion — if your SUI balance covers both gas and the swap, it reports true even if WAL balance alone is too low.encodedSize includes Walrus erasure coding overhead (~5x the original size).