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. Engineering
  4. Using ChatGPT to Reinvigorate APIs
Engineering
December 4, 2023
4 min read

Using ChatGPT to Reinvigorate APIs

Mark Sivill
Senior Solutions Engineer

In this post, we’ll see how ChatGPT can be used to reinvigorate APIs by creating an OpenAPI specification for an existing API that has existing documentation.

Introduction

ChatGPT, developed by OpenAI, has generated attention for its natural language processing capabilities. ChatGPT is based on machine learning techniques such as Generative Pre-trained Transformer (GPT) architecture which is part of Large Language Models (LLMs).

Application Programming Interfaces (APIs) underpins modern software development, enabling communication between different systems. Legacy APIs often lack standardized documentation, and versioning controls leading to outdated information, maintenance challenges, and slower API usage uptake.

Newer APIs often adopt standards such as OpenAPI specification which is defined by the OpenAPI Initiative to describe how the APIs work in machine-readable documentation. Using an OpenAPI specification to describe an API provides consistency across APIs, the ability to document the API, a contract on how to use the API, the ability to generate code stubs to consume and produce APIs, and API versioning. These features enable quicker API development, quicker uptake of API services, and a reduction in API maintenance.

Let’s see how ChatGPT might be used to reinvigorate APIs by creating an OpenAPI specification for an existing API with existing documentation. For our purposes, the API that will be used is “Where the ISS at?” which returns information about the International Space Station. The “Where the ISS at?” documentation can also be found on the Wayback Machine — just in case the main website disappears.

Full file details for ChatGPT questions and responses used in the article can be found in the GitHub Repository - ChatGPT OpenAPI specification. 

Generating an OpenAPI Specification with ChatGPT

Using ChatGPT version 3.5, we asked the following:

ChatGTP OpenAPI specification result

The results that ChatGPT produces are non-deterministic, which means the same question submitted at different times, will most probably produce different results. While creating this article, the above question was asked multiple times on ChatGPT which returned different but “similar” results for the questions. Repeating the above question will likely create different results from the ones below.

Due to this, ChatGPT isn’t something that could easily be used within an automated CI/CD pipeline as the results aren’t likely to be the same. This non-deterministic nature also means at times bits of the OpenAPI specification didn’t appear correctly in one result but did in another. Manually comparing the different results and combining them manually might be another approach to creating an initial OpenAPI specification.

Taking the generated OpenAPI specification from ChatGPT, the next step was to validate the results. The OpenAPI ecosystem has many tools that can validate an OpenAPI specification. One of those is Kong Insomnia. 

Insomnia includes a default linter that can check to see how well the OpenAPI specification is formatted compared to the specification. The Insomnia lint ruleset can also be custom-defined within Insomnia if a certain style needs to be adhered to.

ChatGPT OpenAPI specification in Kong Insomnia

The ChatGPT-generated OpenAPI specification has 2 errors and 11 warnings. The 2 errors are related to the parameters not being identified correctly, this can be fixed by changing /coordinates/{lat,lon}: to /coordinates/{lat},{lon}:

Re-generating an OpenAPI Specification with ChatGPT

To tackle the warnings from the previous ChatGPT results, let’s apply a custom naming style for operations and use a specific OpenAPI specification version. The ChatGPT question was rephased to:

ChatGPT’s second OpenAPI specification response in Kong Insomnia

This second ChatGPT-generated OpenAPI specification has 3 errors and 6 warnings. As before, 2 errors are related to the parameters not being identified correctly. This can be fixed by changing /coordinates/{lat,lon}: to /coordinates/{lat},{lon}:

Correctly indenting the contact information removes the other error and contact missing warning.

To fix the global tags missing, the following was added:

The second generated OpenAPI specification successfully linted in Kong Insomnia

Multiple OpenAPI Specification versions

An advantage of using an OpenAPI specification is that it can be versioned. In this article, several different OpenAPI specifications have been created which build on top of each other. ChatGPT could be used to create a rough and ready initial specification version that is shared with developers. Then over time, updated specification versions could be released. These different versions can be managed in a developer portal to enable quicker API development, quicker uptake of API services, and a reduction in API maintenance.

Different “Where the ISS at?” versions in the Kong Konnect Developer Portal

Summary

ChatGPT can generate an almost complete and working OpenAPI specification, but in both cases, “minor” issues needed to be addressed which were identified using an OpenAPI specification linter. While the fixed version of the OpenAPI specification is syntactically correct, the OpenAPI specification can be further refined for example updating the description fields, adding default values for parameters, validating parameters, etc. so it is more useful for developers.

The above work was based on one API that is well-documented in something other than an OpenAPI specification. Applying ChatGPT to an API with minimal documentation may have completely different results.

ChatGPT is an option to consider when an API has some existing documentation and a quick initial cut of an OpenAPI specification is required with minor changes. Expecting a fully complete generated OpenAPI specification with a repeatable output from ChatGPT using the above approach in 2023 is unrealistic. But in 5 or 10 years, who knows how far things will have progressed?

AIAI GatewayOpen Source

More on this topic

Videos

Context‑Aware LLM Traffic Management with RAG and AI Gateway

eBooks

The AI Connectivity Playbook: How to Build, Govern & Scale AI

See Kong in action

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

Get a Demo
Topics
AIAI GatewayOpen Source
Share on Social
Mark Sivill
Senior Solutions Engineer

Recommended posts

Insights from eBay: How API Ecosystems Are Ushering In the Agentic Era

Kong Logo
EngineeringDecember 15, 2025

APIs have quietly powered the global shift to an interconnected economy. They’ve served as the data exchange highways behind the seamless experiences we now take for granted — booking a ride, paying a vendor, sending a message, syncing financial rec

Amit Dey

Kong AI/MCP Gateway and Kong MCP Server Technical Breakdown

Kong Logo
EngineeringDecember 11, 2025

In the latest Kong Gateway 3.12 release , announced October 2025, specific MCP capabilities have been released: AI MCP Proxy plugin: it works as a protocol bridge, translating between MCP and HTTP so that MCP-compatible clients can either call exi

Jason Matis

AI Voice Agents with Kong AI Gateway and Cerebras

Kong Logo
EngineeringNovember 24, 2025

Kong Gateway is an API gateway and a core component of the Kong Konnect platform . Built on a plugin-based extensibility model, it centralizes essential functions such as proxying, routing, load balancing, and health checking, efficiently manag

Claudio Acquaviva

Move More Agentic Workloads to Production with AI Gateway 3.13

Kong Logo
Product ReleasesDecember 18, 2025

MCP ACLs, Claude Code Support, and New Guardrails New providers, smarter routing, stronger guardrails — because AI infrastructure should be as robust as APIs We know that successful AI connectivity programs often start with an intense focus on how

Greg Peranich

AI Guardrails: Ensure Safe, Responsible, Cost-Effective AI Integration

Kong Logo
EngineeringAugust 25, 2025

Why AI guardrails matter It's natural to consider the necessity of guardrails for your sophisticated AI implementations. The truth is, much like any powerful technology, AI requires a set of protective measures to ensure its reliability and integrit

Jason Matis

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

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. 2026