Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Enterprise
  4. Service Design Guidelines Part 1: OpenAPI and Kong
Enterprise
November 20, 2020
3 min read

Service Design Guidelines Part 1: OpenAPI and Kong

Vikas Vijendra
Topics
API DesignAIAPI Development
Share on Social

More on this topic

eBooks

Maturity Model for API Management

eBooks

Federated API Management: Accelerating Innovation with Autonomy and Oversight

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo

Introduction

We are in the midst of an explosion of APIs and microservices. For some, the first instinct of creating an API is to get down to building one. Some level of planning will help manage the quality of APIs when working within a team.

In this series of blogs, we will be sharing some guidelines on service design while working on API projects with Kong. Let us start by focusing on how to go about designing APIs that end up as entities that the Kong API Gateway runtime understands.

APIs or Services?

Kong is the world's most popular open source API Gateway. The world-wide millions-strong developer community and over 250 enterprise customers have been running API workloads since its inception on the back of Mashape's success. For the curious, have a look at this story on how Kong was founded. Along the way Kong evolved to not just be focused on APIs, or just do API Management. Kong manages any service, beyond RESTful. The service object, introduced more than two years ago in 0.13. is a dynamic entity capable of representing any endpoint we can imagine.

Fast forward to the current day and Kong allows Full Lifecycle Service Management for services that run on multiple protocols – HTTP, gRPC, GraphQL, TCP, etc. Hence, designing APIs or Services starts with one key entity in Kong – A Service.

What makes a Service/API in Kong?

Let us look at the Service object definition in the Kong documentation:

Service entities are abstractions of each of your own upstream services. Examples of Services would be a data transformation microservice, a billing API, etc.

If we want to bring in a real world example, let us load an existing API design spec – Account API – as per Open Banking OpenAPI Specification into Insomnia Designer:

Figure 1 – Insomnia Designer Preview Mode

In the above example, we could define Accounts and Balances as one or potentially two separate service objects. But, the leading question would be how do you represent the API methods?

You probably got a hint from the picture above, if you know the Kong basics, that they are configured as Routes. If we go back to documentation to ensure we understand the concepts well:

Route entities define rules to match client requests. Each Route is associated with a Service, and a Service may have multiple Routes associated with it. Every request matching a given Route will be proxied to its associated Service.

To summarize from an API Designer point of view:

Table 1 – API Consumer and API Provider views.

Rule of thumb

You create a new Kong Service to:

  • Define a backend application or a micro-service as a single string or by specifying its protocol, host, port and path individually
  • Provide access to a specific user or API provider team
  • Utilize a Domain Driven Design approach and hence create a separate service for every subdomain
  • Specify individual retry, timeout, certificate or tagging configurations as shown below

Figure 2 – Service Creation in Kong

You create a Kong Route:

  • For every API method or URI path
  • Specify the URI version in it (eg: /api/v1/account)
  • Follow API guidelines to ensure you maintain consistency
  • Utilize the power of regular expressions in the path as explained in the documentation here

Conclusion

In this first part of the blog, we looked at how you can design your APIs/Microservices in an API Designer, such as Insomnia Designer, and then configure the relevant entities such as Service and Routes. If you are in the mood to try out something fun, have a look at the declarative config plugin in Insomnia which automates the process of generating Service & Routes from Open API Spec. Check it out and let us know how you like it!

Topics
API DesignAIAPI Development
Share on Social
Vikas Vijendra

Recommended posts

You Might Be Doing API-First Wrong, New Analyst Research Suggests

Kong Logo
EnterpriseSeptember 3, 2025

Ever feel like you're fighting an uphill battle with your API strategy? You're building APIs faster than ever, but somehow everything feels harder. Wasn’t  API-first  supposed to make all this easier?  Well, you're not alone. And now industry analys

Heather Halenbeck

Announcing the Kong Agentic AI Hackathon

Kong Logo
NewsAugust 12, 2025

Kong-quer the Agentic AI Hackathon 🚀 Calling all builders, tinkerers, and API innovators. The Kong Hackathon is back for  API Summit 2025 ! This year, we’re challenging developers worldwide to create projects that don’t just react, they  think ,  a

Juhi Singh

How to Build a Single LLM AI Agent with Kong AI Gateway and LangGraph

Kong Logo
EngineeringJuly 24, 2025

In my previous post, we discussed how we can implement a basic AI Agent with Kong AI Gateway. In part two of this series, we're going to review LangGraph fundamentals, rewrite the AI Agent and explore how Kong AI Gateway can be used to protect an LLM

Claudio Acquaviva

How to Strengthen a ReAct AI Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 15, 2025

This is part one of a series exploring how Kong AI Gateway can be used in an AI Agent development with LangGraph. The series comprises three parts: Basic ReAct AI Agent with Kong AI Gateway Single LLM ReAct AI Agent with Kong AI Gateway and LangGr

Claudio Acquaviva

Build Your Own Internal RAG Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 9, 2025

What Is RAG, and Why Should You Use It? RAG (Retrieval-Augmented Generation) is not a new concept in AI, and unsurprisingly, when talking to companies, everyone seems to have their own interpretation of how to implement it. So, let’s start with a r

Antoine Jacquemin

Scalable Architectures with Vue Micro Frontends: A Developer-Centric Approach

Kong Logo
EngineeringJanuary 9, 2024

In this article, which is based on my talk at VueConf Toronto 2023, we'll explore how to harness the power of Vue.js and micro frontends to create scalable, modular architectures that prioritize the developer experience. We'll unveil practical strate

Adam DeHaven

72% Say Enterprise GenAI Spending Going Up in 2025, Study Finds

Kong Logo
EnterpriseJune 18, 2025

Survey Says: Google LLMs See Usage Surge, Most OK with DeepSeek in the Workplace Enterprise adoption of large language models (LLMs) is surging. According to Gartner , more than 80% of enterprises will have deployed generative AI (GenAI) applicatio

Eric Pulsifer

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

Platform
Kong KonnectKong GatewayKong AI GatewayKong InsomniaDeveloper PortalGateway ManagerCloud GatewayGet a Demo
Explore More
Open Banking API SolutionsAPI Governance SolutionsIstio API Gateway IntegrationKubernetes API ManagementAPI Gateway: Build vs BuyKong vs PostmanKong vs MuleSoftKong vs Apigee
Documentation
Kong Konnect DocsKong Gateway DocsKong Mesh DocsKong AI GatewayKong Insomnia DocsKong Plugin Hub
Open Source
Kong GatewayKumaInsomniaKong Community
Company
About KongCustomersCareersPressEventsContactPricing
  • Terms•
  • Privacy•
  • Trust and Compliance•
  • © Kong Inc. 2025