Export a ZIP or SVG
Get a project out through the API as Mermaid text, the project file, an SVG picture or a ZIP with every file.
GET /v1/projects/{id}/export gets a project out of aiMermaid. Choose the format with format:
format | What you get | Cost |
|---|---|---|
mermaid (default) | The Mermaid text of the diagram | 5 |
json | The sealed project file, as the editor saves it | 10 |
svg | One level as an SVG picture, or a private download link to it | 10 |
bundle | A download link to a ZIP with everything | 20 |
Cost is what the call takes from your daily quota.
The ZIP bundle
GET /v1/projects/{id}/export?format=bundleThe answer is JSON, not the ZIP itself. It holds:
download_url: the link to the ZIP. It works for 15 minutes and needs no API key. After that, call the export again for a fresh link.files: every file in the ZIP with its size.sealed: true: the project file inside is sealed like a file saved in the editor, so the editor can open it again.
The ZIP holds AI-README.md, README.md, diagram.mmd, the sealed project.json, the diagrams of nested levels, and every attached file. It is the same ZIP as the editor's AI bundle.
Over 50 MB
A bundle can hold at most 50 MB of attachments. A bigger project answers payload_too_large (413). Then export format=json and download the files one by one from the links in GET /v1/projects/{id}/brief.
A file is missing
If an attached file is missing from storage, the answer is attachment_missing (422) with a list of the missing files. Remove each one with the remove_attachment operation, or upload it again, then export again.
SVG picture
GET /v1/projects/{id}/export?format=svgYou get the diagram drawn exactly like the editor's SVG image download: light look, with the aiMermaid footer. The file holds no scripts and no outside links.
- Without
level, you get the main level. - Add
level=n3to draw the level under stepn3, orlevel=n3/n7for a level deeper down. Take the path from the brief. - A level without steps answers
nothing_to_draw(422).
PNG export is not available through the API.
SVG as a download link
Some AI apps cannot save text as a file, for example in a chat. When the AI needs a real .svg file to embed in a page or upload to a document, add delivery=link:
curl "https://pltlaavsvbpebaopfbsp.supabase.co/functions/v1/api/v1/projects/<id>/export?format=svg&delivery=link" \
-H "Authorization: Bearer amk_live_<id>_<secret>"The answer is JSON instead of the picture:
{
"format": "svg",
"delivery": "link",
"filename": "Sales-process.svg",
"bytes": 18420,
"version": 7,
"download_url": "https://<project>.supabase.co/storage/v1/object/sign/exports/<owner>/3f6c1e2a-9b7d-4c1e-8a2f-5d6e7f8a9b0c/<id>.svg?token=<signed>&download=Sales-process.svg",
"expires_at": "2026-11-12T09:15:00.000Z",
"expires_in": 900,
"next": [
"GET download_url within 15 minutes (no auth header needed), save it as filename and embed or upload it. The link is private: it stops working after 15 minutes."
]
}- The link is private. Opening it needs no API key, but it stops working after 15 minutes. Nothing becomes public.
- Need the file again later? Call the export again for a fresh link.
- Save the file under
filename.levelworks the same way as above. - The cost stays 10.
- If you can save text as a file, keep the default (
delivery=inline): you get the SVG text directly.
delivery works only with format=svg. Using it with another format, or with any value other than inline or link, answers invalid_field (400). A level without steps still answers nothing_to_draw (422).
Attribution
Exports carry the same aiMermaid attribution as the editor.
Reference page: export a project.