roblox-open-cloud
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseroblox-open-cloud
roblox-open-cloud
Open Cloud is the REST API surface for Roblox resources. It lets you build command-line tools, web apps, CI/CD pipelines, scheduled jobs, and external automation that read and write the same resources your live game servers use, without running a game server.
Cross-reference:
- roblox-datastores/SKILL.md: in-engine DataStore API; Open Cloud Data Stores is the external counterpart.
- roblox-gamepasses/SKILL.md: game passes, developer products, and subscriptions also have Open Cloud management endpoints.
- roblox-networking/SKILL.md: for in-experience HTTP via and the security model around outbound requests.
HttpService - roblox-core/SKILL.md: services, , script contexts.
HttpService
Open Cloud 是 Roblox 资源的 REST API 接口层。它让你构建命令行工具、Web 应用、CI/CD 管道、定时任务和外部自动化,读取和写入与在线游戏服务器相同的资源,而无需运行游戏服务器。
交叉参考:
- roblox-datastores/SKILL.md:引擎内 DataStore API;Open Cloud Data Stores 是对应的外部接口。
- roblox-gamepasses/SKILL.md:游戏通行证、开发者产品和订阅也具有 Open Cloud 管理端点。
- roblox-networking/SKILL.md:了解通过 进行体验内 HTTP 调用,以及出站请求相关的安全模型。
HttpService - roblox-core/SKILL.md:服务、、脚本上下文。
HttpService
Authentication
认证
Three auth models, in order of preference:
三种认证模型,按推荐程度排序如下:
1. API keys (recommended for most automation)
1. API 密钥(大多数自动化任务的推荐方式)
All Open Cloud APIs accept an header containing an API key string. Create keys on the Creator Dashboard → API Keys page.
x-api-key- A key's access is determined by the permissions of the user who owns it. It can reach any resource that user can, including their personal experiences and any group-owned experiences where they have the right role.
- Some scopes can be restricted to specific experiences; not all.
- Best practices (from the official docs):
- Create separate keys per application to isolate blast radius.
- Select the minimum permissions needed; restrict scope to specific experiences where possible.
- Use IP restrictions (CIDR notation). But not when calling from Roblox game servers (Roblox server IPs aren't known/predictable).
- Set expiration dates for short-term keys; avoid them for long-term use without a rotation process.
- Never store keys in source control, scripts, or public channels. Use a secrets manager; in Roblox places use a Secrets Store.
- For group-owned resources, create a dedicated alternate account with only the target group access and generate the key there. Don't use your personal account's key for group automation.
所有 Open Cloud API 都接受包含 API 密钥字符串的 请求头。可在 Creator Dashboard → API Keys 页面创建密钥。
x-api-key- 密钥的访问权限由密钥所有者的权限决定。它可以访问该用户有权访问的任何资源,包括其个人体验,以及用户拥有相应角色的群组所属体验。
- 部分 scope 可以限制到特定体验;并非所有 scope 都支持此限制。
- 最佳实践(来自官方文档):
- 为每个应用创建单独的密钥,以隔离影响范围。
- 仅选择所需的最低权限;尽可能将 scope 限制到特定体验。
- 使用 IP 限制(CIDR 表示法)。但从 Roblox 游戏服务器调用时不要使用此限制,因为 Roblox 服务器 IP 未知且无法预测。
- 为短期密钥设置过期日期;如果没有轮换流程,应避免将其用于长期用途。
- 绝不将密钥存储在源代码、脚本或公开渠道中。请使用 secrets manager;在 Roblox Place 中使用 Secrets Store。
- 对于群组所属资源,创建一个仅具有目标群组访问权限的专用备用账号,并在该账号下生成密钥。群组自动化不要使用个人账号的密钥。
2. OAuth 2.0 (for apps acting on behalf of other users)
2. OAuth 2.0(用于代表其他用户操作的 app)
Use OAuth 2.0 when your app needs to act on behalf of a Roblox user who isn't you (e.g. a third-party tool a creator logs into). See https://create.roblox.com/docs/cloud/auth/oauth2-overview. Has stronger stability guarantees and regular updates.
当你的 app 需要代表某个并非你的 Roblox 用户进行操作时,使用 OAuth 2.0,例如用户登录的第三方工具。参见 https://create.roblox.com/docs/cloud/auth/oauth2-overview。OAuth 2.0 具有更强的稳定性保证,并会定期更新。
3. legacy cookie auth (avoid)
3. 旧版 Cookie 认证(应避免使用)
Legacy APIs use cookie-based auth, can break without notice, and have minimal stability guarantees. Not recommended for production. Only use for one-off internal tooling where breakage is acceptable.
旧版 API 使用基于 Cookie 的认证,可能在无通知的情况下失效,且稳定性保证极少。不推荐用于生产环境。 仅当可以接受意外中断时,才将其用于一次性内部工具。
API key lifecycle
API 密钥生命周期
API keys have these statuses (from the official docs):
| Status | Reason | Resolution |
|---|---|---|
| Active | No issues. | N/A |
| Disabled | You toggled Enable Key off. | Toggle it back on. |
| Expired | Expiration date passed. | Remove or set a new expiration. |
| Auto-Expired | Unused or unmodified for 60 days (even without a set expiration). | Disable then re-enable, or update any property. |
| Revoked | Group key: the generating account lost group access. | Regenerate the key. |
| Moderated | A Roblox admin changed the key secret for security. | Regenerate. |
| User Moderated | The generating account is under moderation. | Resolve the moderation. |
The 60-day auto-expiry is the most common surprise: keys you set up and forget will silently stop working. Either use them regularly or build a rotation/reminder process.
API 密钥具有以下状态(来自官方文档):
| 状态 | 原因 | 处理方式 |
|---|---|---|
| Active | 未发现问题。 | 不适用 |
| Disabled | 你关闭了 Enable Key。 | 重新启用它。 |
| Expired | 过期日期已过。 | 删除密钥或设置新的过期日期。 |
| Auto-Expired | 60 天内未使用或未作任何修改(即使未设置过期日期)。 | 先禁用再重新启用,或更新任意属性。 |
| Revoked | 群组密钥:生成密钥的账号已失去群组访问权限。 | 重新生成密钥。 |
| Moderated | Roblox 管理员出于安全原因更改了密钥内容。 | 重新生成密钥。 |
| User Moderated | 生成密钥的账号正受到审核。 | 解决审核问题。 |
60 天自动过期是最常见的意外情况:创建后被遗忘的密钥会悄无声息地停止工作。要么定期使用这些密钥,要么建立轮换或提醒流程。
Introspect endpoint
Introspect 端点
POST https://apis.roblox.com/api-keys/v1/introspectbash
curl --location --request POST 'https://apis.roblox.com/api-keys/v1/introspect' \
--header 'Content-Type: application/json' \
--data '{"apiKey": "your-api-key"}'Returns the key name, authorized user, scopes (with /// resource identifiers; means all resources of that type), , , and .
userIdgroupIduniverseIduniverseDatastore*enabledexpiredexpirationTimeUtcPOST https://apis.roblox.com/api-keys/v1/introspectbash
curl --location --request POST 'https://apis.roblox.com/api-keys/v1/introspect' \
--header 'Content-Type: application/json' \
--data '{"apiKey": "your-api-key"}'返回密钥名称、授权用户、scope(包含 /// 资源标识符; 表示该类型的全部资源)、、 和 。
userIdgroupIduniverseIduniverseDatastore*enabledexpiredexpirationTimeUtcThe endpoint map
端点映射
Base URL: (plus a few legacy paths for assets). All v2 endpoints accept .
https://apis.roblox.com/cloud/v2/...apis.roblox.com/<feature>/v1/...x-api-key基础 URL:(另外还有少量用于资产的 旧版路径)。所有 v2 端点都接受 。
https://apis.roblox.com/cloud/v2/...apis.roblox.com/<feature>/v1/...x-api-keyData and memory stores (the most-used surface)
数据存储和内存存储(最常用的接口范围)
Data stores ():
/cloud/v2/universes/{universe_id}/data-stores/...- ,
ListDataStores(daily snapshot trigger).SnapshotDataStores - ,
ListDataStoreEntries,CreateDataStoreEntry,GetDataStoreEntry,UpdateDataStoreEntry,IncrementDataStoreEntry.DeleteDataStoreEntry - (version history per entry).
ListDataStoreEntryRevisions - Scoped variants under .
/data-stores/{data_store_id}/scopes/{scope}/entries/... - Rate limits (v2): share the experience Data Store request budgets with in-engine APIs (read/write/list/remove scale with concurrent users). See error codes & limits and rate-limit external callers (fixed spacing or leaky bucket). Do not assume Open Cloud has a separate unlimited pool.
- Legacy v1 (,
/datastores/v1/): after July 29, 2026 the fixed non-scaling tables on the throttling guide apply only to those legacy paths./ordered-data-stores/v1/
Memory stores ():
/cloud/v2/universes/{universe_id}/memory-stores/...- Sorted maps: ,
ListMemoryStoreSortedMapItems,CreateMemoryStoreSortedMapItem,GetMemoryStoreSortedMapItem,UpdateMemoryStoreSortedMapItem.DeleteMemoryStoreSortedMapItem - Queues: ,
CreateMemoryStoreQueueItem,ReadMemoryStoreQueueItems.DiscardMemoryStoreQueueItems - (requires
FlushMemoryStore).universe.memory-store:flush
Ordered data stores ():
/cloud/v2/universes/{universe_id}/ordered-data-stores/...- ,
ListOrderedDataStoreEntries,CreateOrderedDataStoreEntry,GetOrderedDataStoreEntry,UpdateOrderedDataStoreEntry,IncrementOrderedDataStoreEntry.DeleteOrderedDataStoreEntry - Same shared experience budget model as standard Data Stores v2 (see error-codes page).
Data Stores():
/cloud/v2/universes/{universe_id}/data-stores/...- 、
ListDataStores(触发每日快照)。SnapshotDataStores - 、
ListDataStoreEntries、CreateDataStoreEntry、GetDataStoreEntry、UpdateDataStoreEntry、IncrementDataStoreEntry。DeleteDataStoreEntry - (每个条目的版本历史)。
ListDataStoreEntryRevisions - 作用域变体位于 。
/data-stores/{data_store_id}/scopes/{scope}/entries/... - 速率限制(v2): 与引擎内 API 共用体验的 Data Store 请求预算(读、写、列出和删除额度会随并发用户数扩展)。参见错误代码与限制,并对外部调用方实施速率限制(固定间隔或漏桶算法)。不要假设 Open Cloud 拥有独立且不受限制的请求池。
- 旧版 v1(、
/datastores/v1/):自 2026 年 7 月 29 日起,节流指南中的固定且不扩展的表仅适用于这些旧版路径。/ordered-data-stores/v1/
Memory Stores():
/cloud/v2/universes/{universe_id}/memory-stores/...- Sorted Map:、
ListMemoryStoreSortedMapItems、CreateMemoryStoreSortedMapItem、GetMemoryStoreSortedMapItem、UpdateMemoryStoreSortedMapItem。DeleteMemoryStoreSortedMapItem - Queue:、
CreateMemoryStoreQueueItem、ReadMemoryStoreQueueItems。DiscardMemoryStoreQueueItems - (需要
FlushMemoryStore)。universe.memory-store:flush
Ordered Data Stores():
/cloud/v2/universes/{universe_id}/ordered-data-stores/...- 、
ListOrderedDataStoreEntries、CreateOrderedDataStoreEntry、GetOrderedDataStoreEntry、UpdateOrderedDataStoreEntry、IncrementOrderedDataStoreEntry。DeleteOrderedDataStoreEntry - 与标准 Data Stores v2 使用相同的共享体验预算模型(参见错误代码页面)。
Universes and places
Universes 和 Places
- ,
GetUniverse.UpdateUniverse - (publish a message to all servers of a universe; external counterpart to
PublishUniverseMessage).MessagingService - (restart all live servers of a universe).
RestartUniverseServers - ,
GetPlace(publish a place version; the CI/CD primitive).UpdatePlace - ,
GetInstance.UpdateInstance
- 、
GetUniverse。UpdateUniverse - (向 Universe 中的所有服务器发布消息;是
PublishUniverseMessage的外部对应接口)。MessagingService - (重启 Universe 中的所有在线服务器)。
RestartUniverseServers - 、
GetPlace(发布 Place 版本;CI/CD 的核心操作)。UpdatePlace - 、
GetInstance。UpdateInstance
Assets
Assets
- ,
GetAsset,ListAssetVersions(v1 path:GetAssetVersion).apis.roblox.com/assets/v1/assets/{assetId} - Asset upload (images, audio, models) via the assets API. Useful for batch-importing content.
- 、
GetAsset、ListAssetVersions(v1 路径:GetAssetVersion)。apis.roblox.com/assets/v1/assets/{assetId} - 通过 assets API 上传 Asset(图片、音频、模型)。适用于批量导入内容。
Users and inventories
用户和 Inventory
- ,
GetUser.GenerateUserThumbnail - .
ListInventoryItems
- 、
GetUser。GenerateUserThumbnail - 。
ListInventoryItems
Groups
群组
- ,
GetGroup,ListGroupMemberships,UpdateGroupMembership,ListGroupRoles,GetGroupRole,ListGroupJoinRequests,AcceptGroupJoinRequest,DeclineGroupJoinRequest.GetGroupShout
- 、
GetGroup、ListGroupMemberships、UpdateGroupMembership、ListGroupRoles、GetGroupRole、ListGroupJoinRequests、AcceptGroupJoinRequest、DeclineGroupJoinRequest。GetGroupShout
Monetization (cross-ref roblox-gamepasses)
变现(交叉参考 roblox-gamepasses)
- Game passes: ,
CreateGamePass,UpdateGamePass,GetGamePassConfig.ListGamePassConfigsByUniverse - Developer products: ,
CreateDeveloperProduct,UpdateDeveloperProduct,GetDeveloperProductConfig.ListDeveloperProductConfigsByUniverse - Subscriptions: managed via subscription endpoints; webhook events for /
cancelled/purchased/refunded.renewed
- 游戏通行证:、
CreateGamePass、UpdateGamePass、GetGamePassConfig。ListGamePassConfigsByUniverse - 开发者产品:、
CreateDeveloperProduct、UpdateDeveloperProduct、GetDeveloperProductConfig。ListDeveloperProductConfigsByUniverse - 订阅:通过订阅端点管理;/
cancelled/purchased/refunded对应 Webhook 事件。renewed
Moderation and bans
审核和封禁
- ,
ListUserRestrictions,GetUserRestriction(place- and universe-scoped),UpdateUserRestriction.ListUserRestrictionLogs
- 、
ListUserRestrictions、GetUserRestriction(Place 级和 Universe 级)、UpdateUserRestriction。ListUserRestrictionLogs
Luau execution
Luau 执行
- (run Luau against a universe/place from outside the engine; treat as privileged).
CreateLuauExecutionSessionTask
- (从引擎外部针对 Universe 或 Place 运行 Luau;应视为高权限操作)。
CreateLuauExecutionSessionTask
Notifications and configs
通知和配置
- (send a notification to a user from outside the experience).
CreateUserNotification - Configs (CreatorConfigs): , draft/publish/revision flow for live configuration.
GetConfigRepositoryValues
- (从体验外 向用户发送通知)。
CreateUserNotification - Configs(CreatorConfigs):、线上配置的草稿/发布/修订流程。
GetConfigRepositoryValues
Creator store
Creator Store
- ,
CreateCreatorStoreProduct,GetCreatorStoreProduct,UpdateCreatorStoreProduct.CreatorStoreAssetsSearch
See https://create.roblox.com/docs/en-us/cloud for the full, current list (new endpoints are added regularly).
- 、
CreateCreatorStoreProduct、GetCreatorStoreProduct、UpdateCreatorStoreProduct。CreatorStoreAssetsSearch
有关完整且最新的端点列表,请参见 https://create.roblox.com/docs/en-us/cloud(系统会定期新增端点)。
Calling Open Cloud from in-experience (HttpService
)
HttpService在体验内调用 Open Cloud(HttpService
)
HttpServiceA subset of Open Cloud endpoints is callable from inside a live game server via . This is how you do things like update group memberships or kick users from external triggers without leaving the experience.
HttpServiceRequirements:
- Enable Allow HTTP Requests in Experience Settings.
- The API key must be stored as a via the Secrets Store. Retrieve it with
Secret. Never hardcode the key in a script.HttpService:GetSecret("APIKey") - Only the and
x-api-keyheaders are allowed.content-type - The value must be a
x-api-keydatatype, not a string.Secret - The string is not allowed in URL path parameters (so data stores/entries containing
..are inaccessible from..).HttpService - Only HTTPS; no ports below 1024 except 80/443; port 1194 blocked.
Rate limits (per game server):
- 2500 Open Cloud requests per minute per server. Exceeding stalls request methods for ~30 seconds and may fail with "Number of Open Cloud requests exceeded limit."
pcall - Open Cloud requests do not count against the separate 500-req/min general HTTP limit.
- Each endpoint also has a per-key-owner limit enforced regardless of where calls originate.
Example: update a group membership from an experience.
lua
--!strict
local HttpService = game:GetService("HttpService")
local function updateGroupMembership(groupId: string, membershipId: string, roleId: string)
local response
local ok, err = pcall(function()
response = HttpService:RequestAsync({
Url = `https://apis.roblox.com/cloud/v2/groups/{groupId}/memberships/{membershipId}`,
Method = "PATCH",
Headers = {
["Content-Type"] = "application/json",
["x-api-key"] = HttpService:GetSecret("APIKey"), -- Secret, not string
},
Body = HttpService:JSONEncode({ role = `groups/{groupId}/roles/{roleId}` }),
})
end)
if not ok then
warn("HTTP request failed:", err)
return false
end
if response.Success then
print("Updated:", response.StatusCode, response.StatusMessage)
return true
end
warn("Error:", response.StatusCode, response.StatusMessage)
return false
endBest practices: pcall everything; retry safe reads by default, but retry mutations only with endpoint-specific idempotency semantics. On 429, honor , then , before bounded exponential backoff. Always retain the last response/error and do not sleep after the final attempt. Aggregate into bulk endpoints where possible; rely on HTTP/2 (automatic, but send lowercase header names). The Observability Dashboard (Creator Hub → Monitoring) shows request count and response time for your calls.
retry-afterx-ratelimit-resetHttpService部分 Open Cloud 端点可以从在线游戏服务器内部通过 调用。你可以利用它在不离开体验环境的情况下,更新群组成员关系或根据外部触发条件移除用户。
HttpService要求:
- 在 Experience Settings 中启用 Allow HTTP Requests。
- API 密钥必须通过 Secrets Store 存储为 。使用
Secret获取它。切勿在脚本中硬编码密钥。HttpService:GetSecret("APIKey") - 只允许使用 和
x-api-key请求头。content-type - 的值必须是
x-api-key数据类型,不能是字符串。Secret - URL 路径参数中不允许出现 字符串,因此包含
..的数据存储或条目无法通过..访问。HttpService - 仅允许使用 HTTPS;除 80/443 外,不允许使用低于 1024 的端口;端口 1194 被阻止。
速率限制(每个游戏服务器):
- 每个服务器每分钟最多发出 2500 个 Open Cloud 请求。超出限制后,请求方法会停滞约 30 秒,且 可能因“Number of Open Cloud requests exceeded limit.”而失败。
pcall - Open Cloud 请求不计入单独的每分钟 500 个通用 HTTP 请求限制。
- 每个端点还会对密钥所有者实施独立限制,无论调用来自何处。
示例:从体验内更新群组成员关系。
lua
--!strict
local HttpService = game:GetService("HttpService")
local function updateGroupMembership(groupId: string, membershipId: string, roleId: string)
local response
local ok, err = pcall(function()
response = HttpService:RequestAsync({
Url = `https://apis.roblox.com/cloud/v2/groups/{groupId}/memberships/{membershipId}`,
Method = "PATCH",
Headers = {
["Content-Type"] = "application/json",
["x-api-key"] = HttpService:GetSecret("APIKey"), -- Secret, not string
},
Body = HttpService:JSONEncode({ role = `groups/{groupId}/roles/{roleId}` }),
})
end)
if not ok then
warn("HTTP request failed:", err)
return false
end
if response.Success then
print("Updated:", response.StatusCode, response.StatusMessage)
return true
end
warn("Error:", response.StatusCode, response.StatusMessage)
return false
end**最佳实践:**所有调用都使用 包裹;默认可以安全重试读取操作,但仅在端点具有特定幂等语义时重试修改操作。遇到 429 时,先遵循 ,再遵循 ,最后采用有上限的指数退避。始终保留最后一次响应或错误,并且最后一次尝试后不要继续休眠。尽可能将操作聚合到批量端点中;使用 HTTP/2(自动启用,但请发送小写形式的标头名称)。Observability Dashboard(Creator Hub → Monitoring)会显示 调用的请求数量和响应时间。
pcallretry-afterx-ratelimit-resetHttpServiceWebhooks
Webhook
Open Cloud emits webhooks for certain events, including subscription events (, , , ). Set up a webhook endpoint in your app, register it via the Cloud API, and Roblox will POST event payloads to it. This is the real-time path for subscription analytics without polling . See https://create.roblox.com/docs/en-us/cloud/webhooks/webhook-notifications.
cancelledpurchasedrefundedrenewedGetUserSubscriptionPaymentHistoryAsyncOpen Cloud 会为特定事件发送 Webhook,其中包括订阅事件(、、、)。在 app 中设置 Webhook 端点,并通过 Cloud API 注册它,随后 Roblox 会将事件负载 POST 到该端点。对于订阅分析而言,这是无需轮询 即可获取实时数据的路径。参见 https://create.roblox.com/docs/en-us/cloud/webhooks/webhook-notifications。
cancelledpurchasedrefundedrenewedGetUserSubscriptionPaymentHistoryAsyncDecision tree: in-engine vs Open Cloud
决策树:引擎内还是 Open Cloud
| Need | Use |
|---|---|
| Normal player data read/write during a live server | In-engine |
| External bulk migration, cleanup, RTBF deletion | Open Cloud Data Stores |
| Scheduled daily snapshot before a risky publish | Open Cloud |
| Restart all servers after a config change | Open Cloud |
| Publish a place from CI | Open Cloud |
| Upload many assets programmatically | Open Cloud Assets |
| Update a group role from in-experience | |
| Send a notification to a user outside the experience | Open Cloud |
| Real-time subscription event analytics | Open Cloud webhooks |
| Normal monetization prompts/grants in-experience | In-engine |
| Manage game pass/dev product config externally | Open Cloud game passes / developer products |
| 需求 | 使用方式 |
|---|---|
| 在线服务器运行期间读取或写入普通玩家数据 | 引擎内 |
| 外部批量迁移、清理和 RTBF 删除 | Open Cloud Data Stores |
| 在高风险发布前执行定时每日快照 | Open Cloud |
| 配置变更后重启所有服务器 | Open Cloud |
| 从 CI 发布 Place | Open Cloud |
| 以编程方式批量上传 Asset | Open Cloud Assets |
| 从体验内更新群组角色 | |
| 向体验外的用户发送通知 | Open Cloud |
| 实时分析订阅事件 | Open Cloud Webhook |
| 体验内的常规变现提示和发放 | 引擎内 |
| 从外部管理游戏通行证或开发者产品配置 | Open Cloud 游戏通行证/开发者产品 |
Security checklist
安全检查清单
- Keys stored in a secrets manager or Secrets Store, never in source/scripts.
- Minimum-permission scopes; experience-restricted where possible.
- IP restrictions for non-Roblox-server callers.
- Expiration dates on short-term keys; rotation process for long-term.
- Dedicated automation account for group resources (not your personal account).
- No in data store keys you need to reach from
...HttpService - pcall every call; retry reads safely and require explicit idempotency before mutation retries.
- passed as
x-api-keyfromSecret, not string.HttpService - Audit key usage via the introspect endpoint and the Observability Dashboard.
- Disable/delete unused keys (they auto-expire after 60 days anyway, but don't rely on that as your only cleanup).
- Treat as privileged: it runs Luau against your universe.
CreateLuauExecutionSessionTask
- 密钥存储在 secrets manager 或 Secrets Store 中,绝不存储在源代码或脚本中。
- 使用最低权限 scope;尽可能限制到特定体验。
- 对非 Roblox 服务器调用方使用 IP 限制。
- 为短期密钥设置过期日期;为长期密钥建立轮换流程。
- 为群组资源使用专用自动化账号,而不是个人账号。
- 需要通过 访问的数据存储键中不包含
HttpService。.. - 每次调用都使用 包裹;安全重试读取操作,并在重试修改操作前明确确认其幂等性。
pcall - 通过 将
HttpService作为x-api-key传递,而不是字符串。Secret - 通过 introspect 端点和 Observability Dashboard 审核密钥使用情况。
- 禁用或删除未使用的密钥(它们无论如何都会在 60 天后自动过期,但不要仅依赖此机制进行清理)。
- 将 视为高权限操作:它会针对你的 Universe 运行 Luau。
CreateLuauExecutionSessionTask
Common mistakes
常见错误
- Using legacy cookie-auth APIs for production (they break without notice).
- Storing API keys in scripts or source control.
- Using a personal account's key for group automation (compromises all your resources if the key leaks).
- Hitting the 2500-req/min Open Cloud limit by not batching.
HttpService - Running bulk Open Cloud v2 Data Store jobs without a client-side rate limiter (shared experience budget → live servers throttle).
- Expecting in data store keys to work from
..(it doesn't).HttpService - Forgetting the 60-day auto-expiry and having automation silently break.
- Using Open Cloud for things the in-engine API already does (unnecessary external dependency and latency).
- 在生产环境中使用旧版 Cookie 认证 API(它们可能在无通知的情况下失效)。
- 将 API 密钥存储在脚本或源代码管理中。
- 使用个人账号的密钥执行群组自动化(一旦密钥泄露,所有资源都会受到影响)。
- 未进行批处理,触发 每分钟 2500 个 Open Cloud 请求的限制。
HttpService - 运行批量 Open Cloud v2 Data Store 任务时未使用客户端速率限制器(共享体验预算会导致在线服务器被限流)。
- 期望包含 的数据存储键能够通过
..使用(实际上无法使用)。HttpService - 忘记 60 天自动过期机制,导致自动化悄无声息地中断。
- 对引擎内 API 已能完成的操作使用 Open Cloud(只会增加不必要的外部依赖和延迟)。
How to proceed
操作步骤
- Identify whether the task is in-engine or external. If external, Open Cloud.
- Create an API key with the minimum scopes for the task. If group-owned, use a dedicated account.
- Store the key in a Secrets Store if calling from ; otherwise in your secrets manager.
HttpService - Test with the introspect endpoint and a single GET.
- Build the workflow with pcall, header-aware rate limiting, and method/endpoint-aware retries. For bulk, prefer batch endpoints.
- Set up webhooks for events you want in real time (subscriptions).
- Monitor via the Observability Dashboard; rotate/replace keys before they auto-expire.
- 确定任务属于引擎内还是外部。如果在外部执行,则使用 Open Cloud。
- 创建具有任务所需最低 scope 的 API 密钥。如果资源属于群组,请使用专用账号。
- 如果从 调用,则将密钥存入 Secrets Store;否则存入你的 secrets manager。
HttpService - 使用 introspect 端点和单个 GET 请求进行测试。
- 构建工作流时加入 、感知标头的速率限制,以及感知方法和端点的重试逻辑。对于批量任务,优先使用批量端点。
pcall - 为需要实时获取的事件设置 Webhook,例如订阅事件。
- 通过 Observability Dashboard 进行监控;在密钥自动过期前完成轮换或替换。
Sources
来源
- https://create.roblox.com/docs/en-us/cloud
- https://create.roblox.com/docs/en-us/cloud/auth/api-keys
- https://create.roblox.com/docs/cloud/auth/oauth2-overview
- https://create.roblox.com/docs/en-us/cloud-services/http-service
- https://create.roblox.com/docs/en-us/cloud/reference/rate-limits
- https://create.roblox.com/docs/cloud-services/data-stores/error-codes-and-limits (Open Cloud v2 Data Store shared budgets)
- https://create.roblox.com/docs/cloud/guides/data-stores/throttling (legacy v1 Data Store limits)
- https://create.roblox.com/docs/en-us/cloud/webhooks/webhook-notifications
- https://create.roblox.com/docs/en-us/cloud-services/secrets
- https://create.roblox.com/docs/en-us/cloud
- https://create.roblox.com/docs/en-us/cloud/auth/api-keys
- https://create.roblox.com/docs/cloud/auth/oauth2-overview
- https://create.roblox.com/docs/en-us/cloud-services/http-service
- https://create.roblox.com/docs/en-us/cloud/reference/rate-limits
- https://create.roblox.com/docs/cloud-services/data-stores/error-codes-and-limits(Open Cloud v2 Data Store 共享预算)
- https://create.roblox.com/docs/cloud/guides/data-stores/throttling(旧版 v1 Data Store 限制)
- https://create.roblox.com/docs/en-us/cloud/webhooks/webhook-notifications
- https://create.roblox.com/docs/en-us/cloud-services/secrets
Reference index
引用索引
- auth-and-keys.md: Configure API keys, OAuth, scopes, or key rotation.
- calling-from-in-experience.md: Call supported Open Cloud endpoints through HttpService and handle retries.
- auth-and-keys.md:配置 API 密钥、OAuth、scope 或密钥轮换。
- calling-from-in-experience.md:通过 HttpService 调用受支持的 Open Cloud 端点并处理重试。