简体   繁体   English

使用提供的客户端/ UI为API调用计费

[英]Billing for api calls with a provided client/UI

I have a general question regarding the approach of metering/billing. 关于计量/计费方式,我有一个普遍的问题。

We have a service and want to meter via api calls as well as have an optional reusable javascript UI component which customers can use. 我们有一项服务,希望通过api调用进行计量,并有一个可供客户使用的可选可重用javascript UI组件。 This UI component is a reusable one and has to be used by the leading UI web application. 此UI组件是可重用的组件,必须由领先的UI Web应用程序使用。

This UI component internally makes call to the service using the same APIs. 此UI组件在内部使用相同的API调用服务。

For API integration api calls metering will be straight forward because the APIs will be used by the clients used/developed by the consumer. 对于API集成,API调用计量将很简单,因为API将由消费者使用/开发的客户端使用。

How should the metering happen for the UI component because the UI component is internally making API calls. UI组件的计量应该如何进行,因为UI组件在内部进行API调用。 Do we need to have a separate commercialisation model for the UI consumption ? 我们是否需要针对UI消费使用单独的商业化模型?

Best Regards, 最好的祝福,

Saurav 绍拉夫

This UI component internally makes call to the service using the same APIs. 此UI组件在内部使用相同的API调用服务。

You can't distinguish between the API calls your client made and therefore are not to be billed and the ones by any other user of the API endpoint. 无法区分之间的API调用您的客户端进行,因此不进行结算和那些通过API端点的任何其他用户。

The only way to I can think of you could achieve this is to embed some kind of secret into your client that can be presented to the server with the non billing requests. 我认为您可以实现此目标的唯一方法是在客户端嵌入某种秘密 ,该秘密可以与非计费请求一起呈现给服务器。 That is something that anyone with a rudimentary knowledge of how stuff works can find out . 任何对事物如何工作有基本了解的人都 可以找到

That is why I would recommend to find a billing metric other than calls (requests): 这就是为什么我建议找到除呼叫(请求)以外的计费指标的原因:

  • Time (monthly/annualy) 时间(每月/每年)
  • Users 用户数
  • Volume (requests per time) 数量(每次请求)

I know that there is always a business guy that thinks no one has enough criminal energy to circumvent the system like this 我知道,总是有一个商人认为没有人拥有足够的犯罪能量来规避这样的系统 ……

Do not compromise (you'll pay in the end...) 不要妥协 (您将最终支付...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM