Skip to main content

Authentication

API Key authentication and E2B SDK setup for the Sandbox API

The Sandbox API uses Bailian API Key authentication. Control-plane requests carry the API Key via an HTTP header:
Authorization: Bearer <your-api-key>
When using the E2B SDK, the SDK-required X-API-Key / api_key only satisfies the E2B protocol format; Bailian does not use it for business authentication. We recommend e2b_${ALIYUN_UID}.
E2B-compatible endpoints return response bodies close to the native E2B structure and are not wrapped in Bailian's unified Result<T> structure.

Get credentials

1

Activate Bailian and open the console

Open the Bailian console, sign in with your Alibaba Cloud account, and activate the service.
2

Create an API Key

Create and copy an API Key on the API-KEY page; it starts with sk-.
API Keys carry account-level permissions. Keep them secure and never share them publicly or commit them to a code repository.
Once configured, start with Create Instance.