Skip to content
中文

Request a template build

POST/e2b/v3/templates● Supported

Request body

  • namestringoptional

    Name of the template. Can include a tag with colon separator (e.g. "my-template" or "my-template:v1"). If tag is included, it will be treated as if the tag was provided in the tags array.

  • tagsarrayoptional

    Tags to assign to the template build

  • aliasstringoptional

    Alias of the template. Deprecated, use name instead.

  • teamIDstringoptional

    Identifier of the team

  • cpuCountintegeroptional

    CPU cores for the sandbox

  • memoryMBintegeroptional

    Memory for the sandbox in MiB

  • minFreeDiskMbintegeroptional

    Requested minimum free space after the template's build steps, in MiB. Omit to use the team's default. Set to 0 to request no minimum free-disk growth. The filesystem is never shrunk, including inherited or already-larger filesystems. Growth is best effort, so filesystem metadata can leave the available space slightly below the requested minimum.

Returns

202

Errors follow the E2B format — see error codes

Request

curl
curl https://api.deepraxis.com/e2b/v3/templates \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"docs-template","cpuCount":2,"memoryMB":1024,"tags":["docs"]}'
Python
import requests

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("POST", opts["api_url"] + "/v3/templates",
    headers={"X-API-Key": opts["api_key"]},
    json={"name":"docs-template","cpuCount":2,"memoryMB":1024,"tags":["docs"]},
)
print(resp.status_code, resp.text)
TypeScript
const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch(opts.apiUrl + "/v3/templates", { method: "POST",
  headers: { "X-API-Key": opts.apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({"name":"docs-template","cpuCount":2,"memoryMB":1024,"tags":["docs"]}),
});
console.log(resp.status, await resp.text());

Response 202

{
  "templateID": "sbe_316095347ee129f46013",
  "buildID": "sbt_e2d426b9-49b3-4082-ace8-ef369dd78c07",
  "public": false,
  "names": [
    "docs-template-2734c250"
  ],
  "aliases": [],
  "tags": [
    "docs"
  ]
}

Response

HTTP 202

The build was requested successfully

application/json

Name Type Description
templateID string Identifier of the template
buildID string Identifier of the last successful build for given template
public boolean Whether the template is public or only accessible by the team
names array<string> Names of the template
tags array<string> Tags assigned to the template build
aliases array<string> Aliases of the template