此外,为了保护设备电池,我们还在项目和命令 (devices.executeCommand) 中实现了设备实例级限制。这些限制同时适用于 QPM 和每小时查询次数 (QPH) 级别,但不适用于 get 和 list API 方法。
例如,假设项目 A 和项目 B 都有权访问同一设备(设备 A),可能是因为用户已授权两个不同的商业集成使用同一设备。如果项目 A 在 1 分钟内向设备 A 发送了 4 个命令,那么在达到设备实例级速率限制之前,项目 B 在同一分钟内只能向设备 A 发送 1 个命令。此时,来自两个项目到设备 A 的命令都会受到限制,直到以向设备 A 发出的第一个命令开始的分钟结束为止。
[null,null,["最后更新时间 (UTC):2025-07-29。"],[[["\u003cp\u003eDevice Access projects have usage limits based on the environment (Sandbox or Commercial) and the user's Commercial offering type.\u003c/p\u003e\n"],["\u003cp\u003eRate limits are implemented to ensure the Nest service remains available and prevent excessive API requests impacting performance.\u003c/p\u003e\n"],["\u003cp\u003eSandbox users have limits on the number of users, structures, and projects they can create for testing and evaluation.\u003c/p\u003e\n"],["\u003cp\u003eThe SDM API enforces rate limits at various levels including per API method, per command, and per device instance to manage resource usage and protect device battery life.\u003c/p\u003e\n"],["\u003cp\u003eExceeding rate limits will result in throttling and API errors, prompting developers to adjust their integration's request frequency.\u003c/p\u003e\n"]]],[],null,["# User and Rate Limits\n\nDevice Access projects are restricted by user, structure, and rate limits,\ndepending on the environment and type of Commercial offering.\n\nWe want developers to create compelling user experiences, but we also want the\nNest service and devices to always be available for the user. Integrations that\nmake a large number of requests in a given period of time can impact service and\ndevice availability, so the SDM API applies rate limits.\nRate limiting restricts the number of API calls for a given time period and\nprevents overutilization of resources.\n\nLimits by environment\n---------------------\n\nAll projects begin in the Sandbox environment. The Sandbox is\nintended for evaluation of the SDM API and personal use, and\nlimits are restricted accordingly. Environments with larger user bases, such as\nCommercial Development , have different limits.\n\nSandbox user limits\n-------------------\n\nA developer account in the Sandbox is limited to 25 users across 5\nstructures across all projects. There is a limit of 3 projects per account.\n\nStructures are limited to 5 users each, so the user limit will only be reached\nonce all 5 structures are maxed out with 5 users each. The developer account\n(which owns the project) does not count towards the 5 user limit for a\nstructure.\n\nConversely, if a project has 15 users over 5 structures, additional users can\nonly be added to the existing 5 structures, as the structure limit has\nalready been reached.\n\nSandbox rate limits\n-------------------\n\nThe Sandbox is rate limited at 3 different levels. Limits are set at\nqueries per minute (QPM) unless otherwise noted.\n\n### API level\n\nAPI calls are limited per project, per user. See the [API\nReference](/nest/device-access/reference/rest) for more information on individual\nmethods.\n\n| API Method | Rate Limit |\n|--------------------------|------------|\n| `devices.executeCommand` | 10 QPM |\n| `devices.get` | 10 QPM |\n| `devices.list` | 5 QPM |\n| `structures.get` | 5 QPM |\n| `structures.list` | 5 QPM |\n| `structures.rooms.get` | 5 QPM |\n| `structures.rooms.list` | 5 QPM |\n\n### Command level\n\nEach trait command (`devices.executeCommand`) is limited to 5 QPM per project,\nper user, per device.\n\nThat means if a project has 2 users with 2 devices each (4 total devices), the\nsame command can be called 5 times in a minute for each of those 4 devices.\n\nHowever, if a project has 2 users with 3 devices each for 6 total devices, the\nsame command could **not** be called 5 times in a minute for each of those 6\ndevices. This would result in 15 QPM for each user, when the\n`devices.executeCommand` API level rate limit for a project's user is 10 QPM.\n\n### Device instance level\n\nAdditionally, device instance level limits are implemented across projects and\ncommands (`devices.executeCommand`) for device battery protection. These limits\nare applied at both the QPM and queries per hour (QPH) levels and do not apply\nto the `get` and `list` API methods.\n\nFor example, suppose Project A and Project B both have access to the same\ndevice, Device A (perhaps the user has authorized two different commercial\nintegrations that use the same device). If Project A has sent 4 commands to\nDevice A within a minute, then Project B can only send 1 command to Device A in\nthat same minute before the device instance level rate limit is hit. At that\npoint, commands from both Projects to Device A are throttled until the end of\nthe minute that began with the first command to Device A.\n\nIf a device type is not listed below, it does not have device instance level\nrate limits.\n\n| Device Type | Device Instance Rate Limit |\n|-------------|----------------------------|\n| THERMOSTAT | 5 QPM or 100 QPH |\n| CAMERA | 30 QPM or 100 QPH |\n| DOORBELL | 30 QPM or 100 QPH |\n\n\nErrors\n------\n\nThe following error code(s) may be returned in relation to this guide:\n\n| Error Message | RPC | Troubleshooting |\n|---------------|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Rate limited. | `RESOURCE_EXHAUSTED` | Each developer has a quota limiting how many calls they can make. If you make more calls than your quota, you will receive the Rate limited message. To fix this, resubmit the call once the quota has expired. |\n\nSee the [API Error Code Reference](/nest/device-access/reference/errors/api) for\nthe full list of API error codes.\n\n\u003cbr /\u003e"]]