计量许可

计量许可

以下是使用 Metered 类的简单步骤。

  1. 创建 Metered 类的实例。
  2. 将公钥和私钥传递给 setMeteredKey 方法。
  3. 进行处理(执行任务)。
  4. 调用 Metered 类的 getConsumptionQuantity 方法。
  5. 它将返回您迄今为止消耗的 API 请求的数量。

以下是示例代码,演示如何设置计量公钥和私钥: