跳转到内容
EN

创建卷

POST/e2b/volumes● 支持

E2B 官方文档 ↗

请求体

  • namestring必填

    Name of the volume

返回

201

错误按 E2B 格式返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/e2b/volumes \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"docs-sample"}'
Python
from e2b import Volume

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

volume = Volume.create("docs-sample", **opts)
print(volume.volume_id)
TypeScript
import { Volume } from "e2b";

const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

const volume = await Volume.create("docs-sample", opts);
console.log(volume.volumeId);

响应示例 201

{
  "volumeID": "sbv_d28b7b9a9b6c656f582d",
  "name": "docs-sample",
  "token": "<access-token>"
}

响应

HTTP 201

Successfully created a new team volume

application/json

名称 类型 说明
volumeID string ID of the volume
name string Name of the volume
token string Auth token to use for interacting with volume content
domain string Domain to use as the destination for volume content requests, replacing the default api.<E2B_DOMAIN>. Only returned when the team is connected to a custom (BYOC) cluster; absent otherwise, in which case the default domain is used.