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

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!

API DesignAIAPI Development

More on this topic

Videos

Keynote: Building for the New AI Era

Videos

Insomnia Overview: Collaborative API Development

See Kong in action

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

Get a Demo
Topics
API DesignAIAPI Development
Share on Social
Vikas Vijendra

Recommended posts

7 Modern Microservice Design Patterns

Kong Logo
EnterpriseJanuary 7, 2022

Microservices have an entirely new set of problems due to their distributed service-oriented architecture. As a result, microservice design patterns have surfaced. This post will consider the specific design patterns that can help us build reliable,

Viktor Gamov

Hiding SOAP Legacy Applications Using the Mullet Pattern

Kong Logo
EnterpriseNovember 15, 2021

In this episode of Kongcast , I had the pleasure of speaking with Aaron Weikle , the founder and CEO at MS3 , about supporting legacy-based applications as companies add the next generation of microservices. Check out the transcript and video fro

Kaitlyn Barnard

The AI Governance Wake-Up Call

Kong Logo
EnterpriseDecember 12, 2025

Companies are charging headfirst into AI, with research around agentic AI in the enterprise finding as many as 9 out of 10 organizations are actively working to adopt AI agents.  LLMs are being deployed, agentic workflows are getting created left

Taylor Hendricks

Kong AI Gateway and the EU AI Act: Compliance Without the Rewrites

Kong Logo
EnterpriseNovember 26, 2025

The Requirement : Article 10 of the EU AI Act mandates strict data governance for high-risk AI systems. This includes error detection, bias monitoring, and arguably most critically for enterprise use — ensuring that sensitive personal data (PII) is

Jordi Fernandez Moledo

Can You Trust What You’re Shipping? You Will with Insomnia v12

Kong Logo
Product ReleasesOctober 13, 2025

AI Assist: Clean commits, transparent teams Building trust starts with small things, like making sure every commit tells the right story. That’s where Insomnia’s v12 AI Commit capability comes in.  Developers want to write code. It’s what they’re go

Haley Giuliano

The Hidden AI Fragmentation Tax: AI Innovation Speed and Program Margins

Kong Logo
EnterpriseOctober 27, 2025

Everyone's telling you to innovate faster with AI. Move quicker. Ship more features. Deploy more agents. But before we sprint headlong into the AI revolution, we need to have a proper dollars-and-cents conversation that most companies are avoiding.

Alex Drag

6 Reasons Why Kong Insomnia Is Developers' Preferred API Client

Kong Logo
EngineeringAugust 8, 2025

So, what exactly is Kong Insomnia? Kong Insomnia is your all-in-one platform for designing, testing, debugging, and shipping APIs at speed. Built for developers who need power without bloat, Insomnia helps you move fast whether you’re working solo,

Juhi Singh

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 Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2025