Seeking Guidance on API Gateway Options — Wary of “Action-Based” Pricing Models

Optimizing API Gateway Strategies: Balancing Endpoint Granularity and Cost Considerations

In the evolving landscape of API design, choosing the right approach to endpoint architecture is crucial—particularly when factoring in pricing models that charge based on specific metrics like “actions” or “endpoints.” I’m sharing some thoughts and seeking insights from the community, especially on how to navigate these considerations effectively.

As part of a project evaluating various API gateway solutions, one vendor highlighted a potential concern: their billing model is based on the number of “actions” or endpoints exposed. This raises important questions about how to structure our APIs for both efficiency and cost-effectiveness.

Currently, our backend architecture employs controllers—such as WidgetsController—with standard actions like CreateWidget, GetWidgets, UpdateWidget, and DeleteWidget. Additionally, we sometimes define specialized actions tailored to specific use cases, such as GetWidgetsForUseCase1 and GetWidgetsForUseCase2. These are designed to encapsulate distinct business logic pathways, providing clarity and separation of concerns within our codebase.

Our approach adheres to the DRY principle. Shared logic resides within service layers, avoiding duplication. The use-case-specific actions mainly serve to clarify intent at the controller level rather than to duplicate code.

The vendor recommends reducing the number of endpoints by consolidating similar actions—using flags or parameters to control behavior—while leveraging their tooling at the gateway layer to handle logic branching. While this seems convenient, it also appears to be a strategic push towards vendor lock-in and may not offer tangible architectural benefits.

Adding to the complexity, our team is contemplating expanding the API with new actions that return significantly different data structures based on request parameters. This further complicates the question: should we aim for fewer, more flexible endpoints, or maintain more focused, narrowly scoped ones for clarity and maintainability?

So, the core question is:
Is there a substantial architectural or performance advantage in merging multiple specific actions into a single, flexible endpoint? Or, is it generally better practice to keep endpoints straightforward and dedicated, even if it results in a greater number of them?

If you’ve encountered similar scenarios—especially where pricing considerations influence the API design—or have experience with large-scale, granular API architectures, I’d love to hear your insights. How have you balanced endpoint granularity with cost, complexity, and future scalability?


Leave a Reply

Your email address will not be published. Required fields are marked *


Cybersecurity and artificial intelligence technology company. For websites and social media.