关闭浏览器会话
POST
/browserbase/v1/sessions/{id}● 支持请求参数
idstring必填statusstring必填Set to
REQUEST_RELEASEto request that the session complete. Use before session's timeout to avoid additional charges.
返回
200
仅支持服务指南列出的能力;部分官方请求参数不可用。
错误含 statusCode、error、message;自有面另含 code。请求 ID 见 X-Request-Id。 错误
请求示例
curl
curl -X POST "https://api.deepraxis.com/browserbase/v1/sessions/${SESSION_ID}" \
-H "X-BB-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"REQUEST_RELEASE"}'Python
import os, requests
response = requests.request("POST", f"https://api.deepraxis.com/browserbase/v1/sessions/{os.environ['SESSION_ID']}",
headers={"X-BB-API-Key": os.environ["PRAXIS_API_KEY"]},
json={"status":"REQUEST_RELEASE"}
)
print(response.status_code, response.text)TypeScript
const SESSION_ID = process.env.SESSION_ID;
if (!SESSION_ID) throw new Error("Set SESSION_ID");
const response = await fetch(`https://api.deepraxis.com/browserbase/v1/sessions/${SESSION_ID}`, {
method: "POST",
headers: { "X-BB-API-Key": `${process.env.PRAXIS_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({"status":"REQUEST_RELEASE"}),
});
console.log(response.status, await response.text());反检测、扩展和 Selenium 不可用;代理只接受 external 类型且需组织开放。region 和 solveCaptchas 接受但忽略;不提供区域选择或验证码代解。
响应
HTTP 200
The request has succeeded.
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| createdAt | string | |
| updatedAt | string | |
| projectId | string | The Project ID linked to the Session. |
| startedAt | string | |
| endedAt | string | |
| expiresAt | string | |
| status | string | |
| proxyBytes | integer | Bytes used via the Proxy |
| keepAlive | boolean | Indicates if the Session was created to be kept alive upon disconnections |
| contextId | string | Optional. The Context linked to the Session. |
| region | string | The region where the Session is running. |
| userMetadata | object | Arbitrary user metadata to attach to the session. To learn more about user metadata, see User Metadata. |