Boltz OneDOCS
v2.4
Guides›Core Concepts›Authentication
Core Concepts

Authentication

Every request must be authenticated with an API key or an OAuth 2.0 token.

Mọi request phải được xác thực bằng khóa API hoặc token OAuth 2.0.

Updated Jun 2026·6 min read

1 · Overview · Tổng quan

Boltz One supports two schemes: API keys for server-to-server calls, and OAuth 2.0 for user-delegated access.

Boltz One hỗ trợ hai cơ chế: khóa API cho gọi server-to-server, và OAuth 2.0 cho truy cập ủy quyền thay mặt người dùng.

2 · API Keys · Khóa API

Pass your secret key as a bearer token in the Authorization header.

Truyền khóa bí mật dưới dạng bearer token trong header Authorization.

curl https://api.boltz.one/v2/me \ -H "Authorization: Bearer bz_live_4f8a…"
ScopeDescription · Mô tả
read:allRead-only access
write:jobsCreate & update jobs
adminFull account access
Note: Secret keys are shown once at creation. Store them securely. / Lưu ý: Khóa bí mật chỉ hiển thị một lần khi tạo — hãy lưu trữ an toàn.

3 · OAuth 2.0 · OAuth 2.0

Use the authorization-code flow to obtain access tokens on behalf of users.

Dùng luồng authorization-code để lấy access token thay mặt người dùng.

POST /v2/auth/token 200 OK { "access_token": "bz_live_4f8a…", "expires_in": 3600 }

4 · Token Lifecycle · Vòng đời token

Access tokens expire after 1 hour; refresh tokens last 30 days. Use a refresh token to re-issue without re-authenticating.

Access token hết hạn sau 1 giờ; refresh token tồn tại 30 ngày. Dùng refresh token để cấp lại mà không cần đăng nhập lại.