extract-openapi-from-code

Extract OpenAPI specifications from API codebases using the Speakeasy CLI.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET --skill extract-openapi-from-code-carloseguerrasilva
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extract-openapi-from-code
Source: https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET/tree/main/.agents/skills/extract-openapi-from-code
Command: npx skills add https://github.com/CarlosEGuerraSilva/OpenRouterSDK.NET --skill extract-openapi-from-code-carloseguerrasilva

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the process of generating an OpenAPI specification directly from your existing API codebase, eliminating the need for manual spec writing and ensuring consistency between your code and its documentation.

Core Features & Use Cases

  • Framework Support: Works with popular frameworks like FastAPI, Flask, Django, Spring Boot, NestJS, Hono, Rails, and Laravel.
  • Code-First Approach: Enables a "code-first" development workflow where the API code dictates the specification.
  • SDK Generation: Facilitates the subsequent generation of client SDKs based on the extracted OpenAPI spec.
  • Use Case: You've built a new REST API using FastAPI and need to generate an OpenAPI spec to share with your frontend team and to create a client library.

Quick Start

Use the extract-openapi-from-code skill to generate an OpenAPI spec from your FastAPI project located at '/path/to/my-fastapi-project'.

Frequently Asked Questions about extract-openapi-from-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an OpenAPI spec from existing FastAPI or Spring Boot code?

You can extract an OpenAPI specification directly from existing API codebases using a code-first approach. This automates spec generation for frameworks like FastAPI, Spring Boot, NestJS, and Laravel, ensuring your documentation matches your code without manual writing.

Can I extract OpenAPI specifications from Flask, Django, or Rails projects?

Yes, OpenAPI specifications can be extracted from Flask, Django, and Rails projects. This skill supports multiple frameworks including Hono and Laravel, allowing you to generate consistent API documentation across different programming languages and tech stacks.

What is the best way to start a code-first API development workflow for SDK generation?

The best way to start code-first SDK generation is to extract an OpenAPI spec from your existing API code. Once you have the generated specification file, you can use it to automate the creation of client libraries and share API contracts with frontend teams.

Do I need the Speakeasy CLI to extract OpenAPI specs from my API codebase?

Yes, the Speakeasy CLI is required to validate the extracted OpenAPI specifications and execute subsequent SDK generation workflows. You need this command-line tool installed to fully leverage the code-first specification extraction and client library creation process.

Why generate an OpenAPI spec from code instead of writing it manually?

Generating an OpenAPI spec from code eliminates the need for manual spec writing and ensures consistency between your API implementation and its documentation. This code-first approach prevents documentation drift and streamlines sharing API contracts with consumers.

What frameworks are supported for extracting OpenAPI specifications from code?

Supported frameworks for extracting OpenAPI specifications include FastAPI, Flask, Django, Spring Boot, NestJS, Hono, Rails, and Laravel. This broad framework support enables code-first development and subsequent SDK generation across multiple programming languages.