Save Content
saveSave final designed SVG to disk as text or raster PNG. Use after previewing and refining with render_svg; accepts artifact ID or raw content with auto format detection.
Instructions
Save rendered content to disk. Format-aware: can save as text or render to raster image.
IMPORTANT: Use this only AFTER iterating on the design with render_svg's preview images. Do not save on the first render. Preview and refine your work first.
Input: pass EITHER artifact (id from render_svg, e.g. "art-1" — preferred, no SVG resend) OR content (raw string).
Format detection:
'auto' (default): infers format from file extension. .svg saves as text, .png renders to image.
'svg': saves content as a UTF-8 text file
'png': renders the content (assumed SVG) to a PNG image, then saves it
If the file already exists, a numeric counter is appended before the extension to prevent overwriting: design.svg becomes design-1.svg, then design-2.svg. The actual saved path is returned in the response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | For raster formats (png): render width in pixels. Defaults to the source content's own declared dimensions. | |
| format | No | Output format. 'auto' infers from file extension (.svg saves as text, .png renders to image). 'svg' saves content as a UTF-8 text file. 'png' renders SVG content to a PNG image before saving. | auto |
| content | No | Raw content to save. Only needed when the content did not come from render_svg. | |
| artifact | No | Artifact id returned by render_svg (e.g. "art-1"). Preferred over content. | |
| outputPath | Yes | File path to save to. The directory must already exist. If the file already exists, a numeric counter is appended before the extension: design.svg becomes design-1.svg, then design-2.svg, and so on. The actual saved path is returned in the response. |