# asset2base64: Convert Asset into Base64 String

> asset2base64 (Convert Asset into Base64 String) is a 1001fx API function in the group Files & PDF: POST https://api.1001fx.com/files/asset2base64, 3 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Converts an uploaded asset (image, zip, audio, video, pdf, ...) or loads and converts the asset from the given URL to a base64 string.

- Group: Files & PDF
- Endpoint: `POST https://api.1001fx.com/files/asset2base64`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: multipart/form-data
- Credits: 3 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/asset2base64

## Parameters

- `url` (string, optional) – URL: The URL of the asset to be converted into a base64 string.
- `addPrefix` (boolean, optional, default `true`) – Add prefix: Specifies if the prefix 'data:MimeType;base64,' should be added to the result string. Default is true.
- `file` (file, optional) – Asset file: Asset file to be processed.

## Example: Convert Asset into Base64 String

```bash
curl -X POST 'https://api.1001fx.com/files/asset2base64' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@1600x900.png'
```
