> For the complete documentation index, see [llms.txt](https://support.marscat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.marscat.io/development-guide/frontend-development/api-interface/api-interface-details/level-0/saveimage.md).

# saveImage

Used to save an image to the system album, supporting base64 data files.

{% hint style="warning" %}
**Note:** Currently only suitable for small images, the data size in the `image` field must not exceed 1MB. If the image content exceeds 1MB, an error will be returned; it is recommended to compress before transmission.
{% endhint %}

## Request Parameters

| Parameter Name | Type   | Required | Description                                                                  |
| -------------- | ------ | -------- | ---------------------------------------------------------------------------- |
| image          | String | Yes      | Image content, Base64 format with prefix, e.g., `data:image/png;base64,...`. |

## Response Parameters

None

## Call Example

{% code title="saveImage example" %}

```javascript
let payload = {
  image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
};

const response = await relayx.saveImage(payload);
if (response.code === 200) {
    console.log("Image saved");
}
```

{% endcode %}
