Skip to content

Browser extension that generates API specs for any app or website. Modified to provide natural language descriptions by:

License

Notifications You must be signed in to change notification settings

Superflows-AI/openapi-llm

 
 

Repository files navigation

MIT License


Generate a OpenAPI Specification in real time for any app or website, including descriptions of endpoints and parameters.


A browser extension that discovers API behaviour via your interactions with a product or website, and then uses an LLM to describe the API endpoints discovered.


The Superflows team extended the functionality of the original tool after building AI assistants using OpenAPI specifications. It's useful to have natural language descriptions in OpenAPI Specifications both for human understanding, and to increase the reliability of AI assistants using them to make API calls (also recommended by Anthropic).

About The Project

OpenAPI-LLM is built on top of the OpenAPI DevTools browser extension that generates OpenAPI specifications in real time from network requests. Once installed it adds a new tab to DevTools called `OpenAPI`. While the tool is running, it automatically converts network requests into a specification. You can then select endpoints you would like to have a natural language descriptions for, and generate descriptions of endpoints and parameters.

We customised this for the use case of feeding these OpenAPI Specifications to LLMs or AI agents. LLMs and AI typically require thorough descriptions of endpoints to use them well.

Features:

  • Instantly generate an OpenAPI 3.1 specification for any website or application just by using it
  • Automatically merges new request & response headers, bodies, and query parameters per endpoint
  • Click on a path parameter and the app will automatically merge existing and future matching requests
  • View the specification inside the tool using Redoc and download with a click
  • Describe endpoints of your choosing and their parameters using OpenAI's GPT4

This project is a fork of OpenAPI Devtools. Check out the original tool here.

(back to top)

Installation

This version of the browser extension is not currently available in the webstores. The original version is without the ability to add natural language descriptions is avaiable on webstores, you can find it here. If there is significant interest, we will add this version to webstores in future.

To install manually (Chrome):

To install manually (Firefox):

(back to top)

Usage

  • Once in the OpenAPI tool in developer tools, click start recording
  • Click on the product API you would like to document. You will see the OpenAPI spec populating.
  • Once you have populated the OpenAPI Spec, click the settings cog at the bottom of the OpenAPI window
  • Enter your OpenAI key. This is stored locally.
  • Select the endpoints you would like to add natural language descriptions to
  • Click 'Describe Endpoints' point, and wait for LLMs to work their magic
  • Return to the OpenAPI spec viewing page to see descriptions, and click download spec once you're happy

The specification automatically populates based on JSON requests that fire as you browse the web.

In the settings menu you can enter your OpenAI API key and select which endpoints you would like to describe. Once described, the descriptions will be placed into the OpenAPI Spec next to the relevant endpoint or parameter.

You can also filter hosts and parameterise paths in URLs. Once you do so all matching existing and future requests to that endpoint will be merged. This process is irreversible, but you can clear the specification and restart at any time.

When the same endpoint responds with different data, such as a value that is sometimes a string and sometimes null, the specification for that value will be either string or null. All information is accounted for in the final specification. If you see something missing from a request, trigger a request that contains the missing information.

The settings menu contains several options. Here you can enable real examples in the specification. You can also export the current state of the app as a string, share or store it, and import it later.

(back to top)

What is OpenAPI?

An OpenAPI specification is a description of what an API expects to receive and what it will respond with. It is governed by the OpenAPI Initiative and the Linux Foundation. OpenAPI specifications are the modern standard for RESTful APIs, and systems that have them are far easier to work with.

(back to top)

Contributing

To develop the project:

  • npm install
  • If developing in Chrome:
    • npm run dev
  • If developing in Firefox:
    • npm run build-firefox
    • npm run dev

(back to top)

About

Browser extension that generates API specs for any app or website. Modified to provide natural language descriptions by:

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.7%
  • Other 1.3%