curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/snapshot \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}'
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
headers={
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
json={
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}),
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"name": "my-setup",
"scope": "workspace",
"status": "saving",
"revision": 1,
"image_digest": "sha256:9b2e...c41f",
"agents": [],
"description": "Repos cloned, dependencies installed",
"default_port": null,
"entrypoint": null,
"public": false,
"created": 1764662400,
"updated": 1764662400
}
Lifecycle
Snapshot an instance
Save an instance as a template, then start any number of new instances that already hold its files.
POST
/
v1
/
instances
/
{id}
/
snapshot
curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/snapshot \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}'
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
headers={
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
json={
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}),
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"name": "my-setup",
"scope": "workspace",
"status": "saving",
"revision": 1,
"image_digest": "sha256:9b2e...c41f",
"agents": [],
"description": "Repos cloned, dependencies installed",
"default_port": null,
"entrypoint": null,
"public": false,
"created": 1764662400,
"updated": 1764662400
}
curl -X POST \
https://api.agent37.com/v1/instances/ab12cd34ef/snapshot \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}'
import requests
response = requests.post(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
headers={
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
json={
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
},
)
response.raise_for_status()
print(response.json())
const response = await fetch(
"https://api.agent37.com/v1/instances/ab12cd34ef/snapshot",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_live_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "my-setup",
"description": "Repos cloned, dependencies installed"
}),
},
);
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());
{
"name": "my-setup",
"scope": "workspace",
"status": "saving",
"revision": 1,
"image_digest": "sha256:9b2e...c41f",
"agents": [],
"description": "Repos cloned, dependencies installed",
"default_port": null,
"entrypoint": null,
"public": false,
"created": 1764662400,
"updated": 1764662400
}
Authorization: Bearer sk_live_... on https://api.agent37.com.
Set an instance up once: clone the repositories, install the packages, sign in to the tools. Snapshot it, and every instance you create from the snapshot starts with all of that already in place.
Path parameters
Body parameters
The name of the template the snapshot is saved as: 2 to 63 characters, lowercase letters, numbers, and hyphens, starting with a letter. A name you have already used publishes the next revision of that template.
Response and behavior
The response is a template object. A snapshot is a template: it is listed with your other templates, and you start instances from it by name.POST /v1/instances/{id}/snapshot saves everything on the instance’s disk, wherever it was written: the data disk and every package and file changed outside it. The call returns in seconds whatever the disk holds, and the instance keeps running throughout. Like a fork, it copies files and not memory, so running processes are not carried over.
The source must be running, stopped, or sleeping.
Start instances from it
curl
curl -X POST https://api.agent37.com/v1/instances \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "template": "my-setup" }'
| Field | Default | You can change it |
|---|---|---|
type | the saved instance’s | No. A sandbox’s snapshot starts sandboxes, a VM’s starts VMs |
region | the saved instance’s | No |
resources.cpu, resources.memory | the saved instance’s | Yes, to any shape |
resources.disk | the saved instance’s | Only to a larger disk |
type or region, or a smaller disk, returns 400.
saving and ready
A new snapshot reads "status": "saving". You can create instances from it straight away. GET /v1/templates/{name} reads ready a little later, sooner for a small disk and after a few minutes for a large one.
While it is still saving, a create can return 409 try_again when there is no room for another instance beside the original. Retry in a moment, or wait for ready.
Revisions
Snapshot under the same name again and the template moves to the next revision. New instances start from the newest one, and an earlier one stays available by its pin:"template": "my-setup@1".
Size and price
A snapshot can be as large as the instance’s disk. The 15 GB limit on template images does not apply to it. Storage is $0.09 per GB per month on what the instance’s disk held when the snapshot was taken, from the moment it is taken until you delete the template. Taking one requires a balance in your wallet.Delete it
Delete the template and every revision’s snapshot goes with it, which ends the storage charge. Instances already started from it keep running: their disks are their own.Snapshot or fork
| Snapshot | Fork | |
|---|---|---|
| You get | A template | A second instance |
| Use it to | Start many instances from one setup, now and later | Copy one instance once |
| The source afterwards | Can be deleted | Can be deleted once the fork is running |
Keeps the source’s env, name, and metadata | No, set them on create | Yes |
What cannot be snapshotted
- An instance of an Agent37 agent template, such as
agent37-hermesoragent37-claude-code, or ofagent37-n8n. Fork it instead. Instances ofagent37-base,agent37-ubuntu, and your own templates can be snapshotted. - An instance parked in cold storage. Start it first.
Errors
| Status | Code | When |
|---|---|---|
400 | invalid_request | The name is not a valid template name, the instance is not running, stopped, or sleeping, or its template cannot be snapshotted |
402 | insufficient_balance | The wallet is empty |
409 | try_again | The instance is starting, stopping, restoring, or being updated. Retry in a few seconds |
409 | invalid_request | The instance is parked in cold storage, or was deleted while it was being saved |