# calculateUploadFees

> **calculateUploadFees**(`params`): [`OutputType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculateuploadfees/type-aliases/outputtype/)

Defined in: [packages/synapse-core/src/warm-storage/calculate-upload-fees.ts:37](https://github.com/FilOzone/synapse-sdk/blob/5a206712436ab6bcc46c2a9e3774fc873b328e0f/packages/synapse-core/src/warm-storage/calculate-upload-fees.ts#L37)

Compute the one-time fees an upload incurs.

Scope is intentionally limited to upload-time fees: create-data-set (new
datasets only) and add-pieces. Schedule-removals, terminate, and delete are
post-upload lifecycle operations and are not part of an upload cost preview.

The number of addPieces operations is derived from `pieceCount` and a
pieces-per-call heuristic (`MAX_ADD_PIECES_BATCH_SIZE`): each call is
charged the base fee. Actual batches are limited by message size via
`addPiecesFits`, so this is a fee preview, not an action cap.

TODO: Review in a follow-up and update fee/pricing calculations to match
message-size batching instead of this count heuristic.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `params` | [`ParamsType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculateuploadfees/type-aliases/paramstype/) | [calculateUploadFees.ParamsType](/reference/filoz/synapse-core/warm-storage/namespaces/calculateuploadfees/type-aliases/paramstype/) |

## Returns

[`OutputType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculateuploadfees/type-aliases/outputtype/)

[calculateUploadFees.OutputType](/reference/filoz/synapse-core/warm-storage/namespaces/calculateuploadfees/type-aliases/outputtype/)