-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add lago plugin #12196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add lago plugin #12196
Conversation
e17692e
to
636eaf3
Compare
Could @kayx23 please help check the docs, after that we can merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed the docs, it's great to add a diagram to explain the logics for both developers/users and Lago developers, but we can merge first.
docs/en/latest/plugins/lago.md
Outdated
|
||
This allows for API monetization or let APISIX to be an AI gateway for AI tokens billing scenarios. | ||
|
||
:::disclaimer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not seen a :::disclaimer
used anywhere - please confirm that the admonition will be rendered properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Co-authored-by: Traky Deng <[email protected]>
docs/en/latest/plugins/lago.md
Outdated
--> | ||
|
||
<head> | ||
<link rel="canonical" href="https://docs.api7.ai/hub/lago" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This plugin doc is not available at the api7 site yet. I think we could remove this canonical link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
docs/en/latest/plugins/lago.md
Outdated
|
||
This allows for API monetization or let APISIX to be an AI gateway for AI tokens billing scenarios. | ||
|
||
:::disclaimer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/en/latest/plugins/lago.md
Outdated
Of course, the fact that we make transaction ID, subscription ID as a configuration item and allow you to use APISIX and NGINX variables in it means that it's simple to integrate the plugin with any existing or your own authentication and internal services. | ||
|
||
- Use custom authentication: as long as the Lago subscription ID represented by the user ID is registered as an APISIX variable, it will be available from there, so custom authentication is completely possible! | ||
- Integration with internal services: sometimes you may not need the APISIX built-in `request-id` plugin, it doesn't matter, you can have your internal service (APISIX upstream) generate it and include it in the HTTP response header so that you can access it by way of an NGINX variable in the transaction ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally there are quite many run-on sentences, like this one and the one I commented above (and some I commented previously).
Suggest to run the paragraphs in GPT and fix in bulk if need be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proofread these sentences using DeepL write, which sometimes favors long, comma-separated sentences over shorter, independent sentences. It might just be a matter of personal preference for the tool. GPT is not quite as easy to integrate into my workflow.
Sometimes LLM-based tools modify the intended meaning of my inputs due to hallucinations, which can take extra time to check. 🤨
Anyway, I have again optimized the sentences you pointed out.
I'm not an expert in document writing. I lack the intuition to recognize that certain sentences aren't easy to read or are problematic. And I'll do my best.
You can send a suggestion via GitHub review then I will apply it, or we can merge it first and you can review and fix the language issues asynchronously. I worry that if I do a bulk rewrite of the paragraphs, I may introduce more new issues and make your previous efforts at document review useless (sunk costs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"long, comma-separated sentences" are run-on, which are, in fact, grammatical errors. It is not for style or preference that I wanted to mention this observation - just way too commonly spotted in your submitted content and it's not practical to suggest edition one by one (though for this one we've already done quite a bit). It's time consuming and a one-time effort to edit each doc - not a preventive measure. So I'm simply bringing this forward and perhaps you could adjust the tool a bit to avoid these issues in future content.
Other than grammars, I don't have any issue with the content and we can merge this. The doc writing can be improved in the future, to avoid a long cycle time of this PR.
Co-authored-by: Traky Deng <[email protected]>
Description
Add plugin for integration with Lago, this allows users to use APISIX as a monetization gateway to charge subscribers via API consumption. Empower your business.
The plugin sends API call logs to a Lago self-hosted or Lago cloud instance to charge a specified consumer via a specific billing metric and subscription.
Some typical use cases:
The plugin is flexible, you can configure multiple routes with different billing metric codes or properties to enhance pay-as-you-go scenarios, for example, setting different prices for different APIs. Check out the video here to understand it https://www.youtube.com/watch?v=ulLpAn8_P9o
Checklist