# 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:34](https://github.com/FilOzone/synapse-sdk/blob/f4adc7552fa24bfba59bb0e5536386c6f139097b/packages/synapse-core/src/warm-storage/calculate-upload-fees.ts#L34)

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 the
`MAX_ADD_PIECES_BATCH_SIZE` batch limit: a single addPieces call cannot
exceed the limit, so `pieceCount` pieces span `ceil(pieceCount / limit)`
calls, each charged the base fee.

## 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/)