Authentication

Updated at:

By default, the E2B CLI reads environment variables for authentication. When connecting to FC Agent Sandbox, configure the API key, API URL, and domain together. For API key creation and management, see Create an API Key.

Environment Variables

export E2B_API_KEY="<your-api-key>"
export E2B_API_URL="https://api.cn-beijing.e2b.fc.aliyuncs.com"
export E2B_DOMAIN="cn-beijing.e2b.fc.aliyuncs.com"

E2B_ACCESS_TOKEN is a deprecated legacy E2B authentication variable. New E2B CLI flows should use E2B_API_KEY instead of depending on E2B_ACCESS_TOKEN.

Check authentication

e2b sandbox list

If authentication fails, check the following items:

  • The API key was created as described in Create an API Key.

  • E2B_API_URL includes https://api.cn-beijing.e2b.fc.aliyuncs.com.

  • E2B_DOMAIN is set to cn-beijing.e2b.fc.aliyuncs.com.

  • The current account has the required permissions for Function Compute operations.