This is application renders the operations of an OpenAPI file and lets you generate sample code snippets using OpenAI or Claude.
- Node.js 16+ installed
- An API key for either:
- Anthropic's Claude API
- OpenAI's API
-
Clone the repository.
-
Navigate to the project directory:
cd openapi-llm-snippets
-
Install the dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:3000
to view the application. -
Add your API key in the input field and select the language you want to generate the code for.
-
Click on the "Generate" button to generate the code snippet.
The project is organized into several key directories and files:
src/
: Contains the main source code for the application.components/
: React components used throughout the application.OperationsList.js
: Component for displaying and managing API operations.
services/
: Contains service files for interacting with external APIs.openaiService.js
: Handles requests to the OpenAI API.claudeService.js
: Handles requests to the Anthropic Claude API.
This project is licensed under the MIT License. See the LICENSE file for details.